diff --git a/assets/buho72.png b/assets/buho72.png new file mode 100644 index 0000000..da7fdae Binary files /dev/null and b/assets/buho72.png differ diff --git a/assets/buho96.png b/assets/buho96.png new file mode 100644 index 0000000..774b9df Binary files /dev/null and b/assets/buho96.png differ diff --git a/buho.pro b/buho.pro index 38749b4..36a2b9e 100644 --- a/buho.pro +++ b/buho.pro @@ -1,80 +1,81 @@ QT += qml QT += quick QT += sql QT += widgets QT += quickcontrols2 CONFIG += c++11 CONFIG += ordered TARGET = buho TEMPLATE = app DESTDIR = $$OUT_PWD/ linux:unix:!android { message(Building for Linux KDE) QT += webengine } else:android { message(Building helpers for Android) - include($$PWD/3rdparty/kirigami/kirigami.pri) include($$PWD/android/android.pri) include($$PWD/android/openssl/openssl.pri) + include($$PWD/3rdparty/kirigami/kirigami.pri) + DEFINES += STATIC_KIRIGAMI } else { message("Unknown configuration") } include($$PWD/mauikit/mauikit.pri) include($$PWD/QGumboParser/QGumboParser.pri) DEFINES += QT_DEPRECATED_WARNINGS SOURCES += \ main.cpp \ src/db/db.cpp \ src/db/dbactions.cpp \ src/buho.cpp \ src/documenthandler.cpp \ src/linker.cpp \ src/utils/htmlparser.cpp RESOURCES += \ qml.qrc \ assets/assets.qrc # Additional import path used to resolve QML modules in Qt Creator's code model QML_IMPORT_PATH = # Additional import path used to resolve QML modules just for Qt Quick Designer QML_DESIGNER_IMPORT_PATH = # Default rules for deployment. qnx: target.path = /tmp/$${TARGET}/bin else: unix:!android: target.path = /opt/$${TARGET}/bin !isEmpty(target.path): INSTALLS += target DISTFILES += \ src/db/script.sql \ src/utils/owl.js \ HEADERS += \ src/db/db.h \ src/db/dbactions.h \ src/buho.h \ src/utils/owl.h \ src/documenthandler.h \ src/linker.h \ src/utils/htmlparser.h INCLUDEPATH += \ src/utils/ \ src/ include($$PWD/install.pri) diff --git a/buho.pro.user b/buho.pro.user new file mode 100644 index 0000000..b68d500 --- /dev/null +++ b/buho.pro.user @@ -0,0 +1,652 @@ + + + + + + EnvironmentId + {9ec4bc40-4fd2-41e4-80ae-fee04b535e4b} + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 4 + false + 80 + true + true + 1 + true + false + 0 + true + true + 0 + 8 + true + 1 + true + true + true + false + + + + ProjectExplorer.Project.PluginSettings + + + + ProjectExplorer.Project.Target.0 + + Desktop + Desktop + {5dd75fee-8342-4bc4-90e6-c05cd752ae29} + 0 + 0 + 0 + + /home/camilo/Coding/build-buho-Desktop-Debug + + + true + qmake + + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + false + + + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + true + clean + + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + true + + + /home/camilo/Coding/build-buho-Desktop-Release + + + true + qmake + + QtProjectManager.QMakeBuildStep + false + + false + false + true + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + false + + + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + true + clean + + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + true + + + /home/camilo/Coding/build-buho-Desktop-Profile + + + true + qmake + + QtProjectManager.QMakeBuildStep + true + + false + true + true + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + false + + + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + true + clean + + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + true + + 3 + + + 0 + Deploy + + ProjectExplorer.BuildSteps.Deploy + + 1 + Deploy Configuration + + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + buho + + Qt4ProjectManager.Qt4RunConfiguration:/home/camilo/Coding/buho/buho.pro + true + + buho.pro + false + + /home/camilo/Coding/build-buho-Desktop-Debug/ + 3768 + false + true + false + false + true + + 1 + + + + ProjectExplorer.Project.Target.1 + + Android for armeabi-v7a (GCC 4.9, Qt 5.11.1 (android_armv7)) + Android for armeabi-v7a (GCC 4.9, Qt 5.11.1 (android_armv7)) + {625144e9-66e3-4076-9494-b4ecaff4f4d7} + 0 + 0 + 0 + + /home/camilo/Coding/build-buho-Android_for_armeabi_v7a_GCC_4_9_Qt_5_11_1_android_armv7-Debug + + + true + qmake + + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + false + + + + + true + Copy application data + + Qt4ProjectManager.AndroidPackageInstallationStep + + + android-27 + + true + Build Android APK + + QmakeProjectManager.AndroidBuildApkStep + false + false + + 4 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + true + clean + + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + true + + + /home/camilo/Coding/build-buho-Android_for_armeabi_v7a_GCC_4_9_Qt_5_11_1_android_armv7-Release + + + true + qmake + + QtProjectManager.QMakeBuildStep + false + + false + false + true + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + false + + + + + true + Copy application data + + Qt4ProjectManager.AndroidPackageInstallationStep + + + android-27 + + true + Build Android APK + + QmakeProjectManager.AndroidBuildApkStep + false + false + + 4 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + true + clean + + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + true + + + /home/camilo/Coding/build-buho-Android_for_armeabi_v7a_GCC_4_9_Qt_5_11_1_android_armv7-Profile + + + true + qmake + + QtProjectManager.QMakeBuildStep + true + + false + true + true + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + false + + + + + true + Copy application data + + Qt4ProjectManager.AndroidPackageInstallationStep + + + android-27 + + true + Build Android APK + + QmakeProjectManager.AndroidBuildApkStep + false + false + + 4 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + true + clean + + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + true + + 3 + + + + true + Deploy to Android device + + Qt4ProjectManager.AndroidDeployQtStep + false + + 1 + Deploy + + ProjectExplorer.BuildSteps.Deploy + + 1 + Deploy to Android device + + Qt4ProjectManager.AndroidDeployConfiguration2 + + 1 + + + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + + + + buho + buho + Qt4ProjectManager.AndroidRunConfiguration:/home/camilo/Coding/buho/buho.pro + buho.pro + 3768 + false + true + false + false + true + + 1 + + + + ProjectExplorer.Project.TargetCount + 2 + + + ProjectExplorer.Project.Updater.FileVersion + 18 + + + Version + 18 + + diff --git a/main.qml b/main.qml index 29f8fbd..c8dd298 100644 --- a/main.qml +++ b/main.qml @@ -1,190 +1,192 @@ import QtQuick 2.9 import QtQuick.Controls 2.2 import org.kde.kirigami 2.0 as Kirigami import org.kde.maui 1.0 as Maui import "src/widgets" import "src/views/notes" import "src/views/links" import "src/views/books" Maui.ApplicationWindow { id: root title: qsTr("Buho") /***** PROPS *****/ + altToolBars: true floatingBar: true footBarOverlap: true allowRiseContent: false accentColor : "#8981d8" menuDrawer.bannerImageSource: "qrc:/Faq.png" property int currentView : views.notes property var views : ({ notes: 0, links: 1, books: 2, tags: 3, search: 4 }) headBar.middleContent: [ Maui.ToolButton { display: root.isWide ? ToolButton.TextBesideIcon : ToolButton.IconOnly onClicked: currentView = views.notes iconColor: currentView === views.notes? highlightColor : textColor iconName: "draw-text" text: qsTr("Notes") }, Maui.ToolButton { display: root.isWide ? ToolButton.TextBesideIcon : ToolButton.IconOnly onClicked: currentView = views.links iconColor: currentView === views.links? highlightColor : textColor iconName: "link" text: qsTr("Links") }, Maui.ToolButton { display: root.isWide ? ToolButton.TextBesideIcon : ToolButton.IconOnly iconColor: currentView === views.books? highlightColor : textColor iconName: "document-new" text: qsTr("Books") }, Maui.ToolButton { display: root.isWide ? ToolButton.TextBesideIcon : ToolButton.IconOnly iconColor: currentView === views.tags? highlightColor : textColor iconName: "tag" text: qsTr("Tags") } ] footBarMargins: space.huge footBarAligment: Qt.AlignRight footBar.middleContent: [ Maui.PieButton { id: addButton iconName: "list-add" iconColor: "white" model: ListModel { ListElement {iconName: "document-new"; mid: "page"} ListElement {iconName: "link"; mid: "link"} ListElement {iconName: "draw-text"; mid: "note"} } onItemClicked: { if(item.mid === "note") newNote() else if(item.mid === "link") newLink() } } ] /***** COMPONENTS *****/ Connections { target: owl onNoteInserted: notesView.append(note) onLinkInserted: linksView.append(link) } NewNoteDialog { id: newNoteDialog onNoteSaved: owl.insertNote(note) } NewNoteDialog { id: editNote onNoteSaved: { if(owl.updateNote(note)) notesView.cardsView.currentItem.update(note) } } NewLinkDialog { id: newLinkDialog onLinkSaved: owl.insertLink(link) } /***** VIEWS *****/ - SwipeView + SwipeView { id: swipeView anchors.fill: parent currentIndex: currentView onCurrentIndexChanged: currentView = currentIndex interactive: isMobile + NotesView { id: notesView onNoteClicked: setNote(note) } LinksView { id: linksView onLinkClicked: previewLink(link) } BooksView { id: booksView } } Component.onCompleted: { notesView.populate() linksView.populate() } function newNote() { currentView = views.notes newNoteDialog.open() } function newLink() { currentView = views.links newLinkDialog.open() } function setNote(note) { var tags = owl.getNoteTags(note.id) note.tags = tags notesView.currentNote = note editNote.fill(note) } function previewLink(link) { var tags = owl.getLinkTags(link.link) link.tags = tags linksView.previewer.show(link) } } diff --git a/mauikit b/mauikit deleted file mode 120000 index 4ea8073..0000000 --- a/mauikit +++ /dev/null @@ -1 +0,0 @@ -/home/camilo/Coding/qml/mauikit \ No newline at end of file diff --git a/mauikit b/mauikit new file mode 160000 index 0000000..49aeaa2 --- /dev/null +++ b/mauikit @@ -0,0 +1 @@ +Subproject commit 49aeaa274206bea6b8438f75ae5efa2b14d88fa7 diff --git a/src/views/notes/NotesView.qml b/src/views/notes/NotesView.qml index 6f15364..8a0fcc0 100644 --- a/src/views/notes/NotesView.qml +++ b/src/views/notes/NotesView.qml @@ -1,132 +1,132 @@ import QtQuick 2.9 import QtQuick.Layouts 1.3 import "../../widgets" import org.kde.maui 1.0 as Maui import org.kde.kirigami 2.2 as Kirigami import "../../utils/owl.js" as O Maui.Page { property alias cardsView : cardsView property var currentNote : ({}) signal noteClicked(var note) margins: 0 headBarExit : false headBarVisible: !cardsView.holder.visible headBarTitle : cardsView.count + " notes" headBar.leftContent: [ Maui.ToolButton { iconName: cardsView.gridView ? "view-list-icons" : "view-list-details" onClicked: { cardsView.gridView = !cardsView.gridView cardsView.refresh() } }, Maui.ToolButton { iconName: "view-sort-ascending" }, Maui.ToolButton { iconName: "view-sort-descending" } ] headBar.rightContent: [ Maui.ToolButton { iconName: "tag-recents" }, Maui.ToolButton { id: pinButton iconName: "window-pin" checkable: true iconColor: checked ? highlightColor : textColor }, Maui.ToolButton { iconName: "view-calendar-day" } ] ColumnLayout { anchors.fill: parent spacing: 0 CardsList { id: pinnedList visible: pinButton.checked Layout.margins: isMobile ? space.big : space.enormous Layout.alignment: Qt.AlignVCenter Layout.fillWidth: true height: cardsView.itemHeight itemHeight: cardsView.itemHeight * 0.9 itemWidth: itemHeight onItemClicked: noteClicked(cardsView.model.get(index)) } Kirigami.Separator { visible: pinnedList.visible Layout.fillWidth: true height: unit } CardsView { id: cardsView Layout.fillHeight: true Layout.fillWidth: true width: parent.width Layout.margins: isMobile ? space.big : space.enormous onItemClicked: noteClicked(cardsView.model.get(index)) holder.emoji: "qrc:/Type.png" - holder.emojiSize: iconSizes.huge + holder.emojiSize: 500 holder.isMask: false holder.title : "No notes!" holder.body: "Click here to create a new note" Connections { target: cardsView.holder onActionTriggered: newNote() } Connections { target: cardsView.menu onDeleteClicked: if(O.removeNote(cardsView.model.get(cardsView.currentIndex))) cardsView.model.remove(cardsView.currentIndex) } } } function populate() { var data = owl.getNotes() for(var i in data) append(data[i]) } function append(note) { cardsView.model.append(note) } } diff --git a/src/widgets/CardsView.qml b/src/widgets/CardsView.qml index 16ce65b..f53183e 100644 --- a/src/widgets/CardsView.qml +++ b/src/widgets/CardsView.qml @@ -1,82 +1,84 @@ import QtQuick 2.9 import QtQuick.Controls 2.2 import org.kde.kirigami 2.2 as Kirigami import org.kde.maui 1.0 as Maui GridView { property bool gridView : true property alias holder : holder property alias menu : cardMenu readonly property int defaultSize : unit * 200 property int itemWidth : !gridView ? width : isMobile? (width-itemSpacing) * 0.42 : unit * 200 property int itemHeight: unit * 120 property int itemSpacing: space.huge signal itemClicked(int index) boundsBehavior: !isMobile? Flickable.StopAtBounds : Flickable.DragAndOvershootBounds cellWidth: itemWidth + itemSpacing cellHeight: itemHeight + itemSpacing clip : true Maui.Holder { id: holder visible: count < 1 + z: 999 } + CardMenu { id: cardMenu } model: ListModel { id: cardsModel} delegate: CardDelegate { id: delegate cardWidth: itemWidth cardHeight: itemHeight onClicked: { currentIndex = index itemClicked(index) } onRightClicked: { currentIndex = index cardMenu.popup() } onPressAndHold: { currentIndex = index cardMenu.popup() } } // onWidthChanged: if(!isMobile && gridView) adaptGrid() function adaptGrid() { var amount = parseInt(width/(itemWidth + itemSpacing),10) var leftSpace = parseInt(width-(amount*(itemWidth + itemSpacing)), 10) var size = parseInt((itemWidth + itemSpacing)+(parseInt(leftSpace/amount, 10)), 10) size = size > itemWidth + itemSpacing ? size : itemWidth + itemSpacing cellWidth = size } function refresh() { model = cardsModel } }