diff --git a/QtClient/JoplinQtClient/LoginPage.qml b/QtClient/JoplinQtClient/LoginPage.qml new file mode 100755 index 0000000000..ec8704c933 --- /dev/null +++ b/QtClient/JoplinQtClient/LoginPage.qml @@ -0,0 +1,4 @@ +import QtQuick 2.4 + +LoginPageForm { +} diff --git a/QtClient/JoplinQtClient/LoginPageForm.ui.qml b/QtClient/JoplinQtClient/LoginPageForm.ui.qml new file mode 100755 index 0000000000..cd01e52561 --- /dev/null +++ b/QtClient/JoplinQtClient/LoginPageForm.ui.qml @@ -0,0 +1,68 @@ +import QtQuick 2.4 +import QtQuick.Controls 2.0 +import QtQuick.Layouts 1.3 + +Item { + width: 400 + height: 400 + + GridLayout { + id: gridLayout1 + flow: GridLayout.LeftToRight + rows: 6 + columns: 2 + anchors.fill: parent + + Label { + id: label1 + text: qsTr("Domain") + } + + TextField { + id: textField1 + Layout.fillWidth: true + } + + Label { + id: label2 + text: qsTr("Email") + } + + TextField { + id: textField2 + Layout.fillWidth: true + } + + Label { + id: label3 + text: qsTr("Password") + } + + TextField { + id: textField3 + Layout.fillWidth: true + } + + Button { + id: button1 + text: qsTr("Login") + Layout.fillWidth: true + Layout.columnSpan: 2 + } + + Rectangle { + id: rectangle1 + width: 200 + height: 200 + color: "#ffffff" + Layout.columnSpan: 2 + Layout.rowSpan: 1 + Layout.fillHeight: true + Layout.fillWidth: true + } + + + + + } +} diff --git a/QtClient/JoplinQtClient/main.qml b/QtClient/JoplinQtClient/MainPage.qml similarity index 84% rename from QtClient/JoplinQtClient/main.qml rename to QtClient/JoplinQtClient/MainPage.qml index e69bdcc8c8..970a6119c8 100755 --- a/QtClient/JoplinQtClient/main.qml +++ b/QtClient/JoplinQtClient/MainPage.qml @@ -4,14 +4,8 @@ import QtQuick.Controls 1.4 import QtQuick.Layouts 1.0 Item { - id: root - width: 800 - height: 600 - signal currentFolderChanged() - signal currentNoteChanged() - signal addNoteButtonClicked() - signal addFolderButtonClicked() - signal syncButtonClicked() + + property Item appRoot property alias currentFolderIndex: folderList.currentIndex property alias currentNoteIndex: noteList.currentIndex @@ -31,7 +25,7 @@ Item { Layout.minimumHeight: 150 onCurrentItemChanged: { - root.currentFolderChanged() + appRoot.currentFolderChanged() } onEditingAccepted: function(index, text) { @@ -66,7 +60,7 @@ Item { Layout.preferredHeight: 100 onCurrentItemChanged: { - root.currentNoteChanged() + appRoot.currentNoteChanged() } } @@ -89,7 +83,7 @@ Item { folderList.model.showVirtualItem(); folderList.startEditing(folderList.model.rowCount() - 1); } - onAddNoteButtonClicked: root.addNoteButtonClicked() + onAddNoteButtonClicked: appRoot.addNoteButtonClicked() } Button { @@ -97,7 +91,7 @@ Item { text: "Sync" anchors.right: parent.right anchors.top: parent.top - onClicked: root.syncButtonClicked() + onClicked: appRoot.syncButtonClicked() } } diff --git a/QtClient/JoplinQtClient/app.qml b/QtClient/JoplinQtClient/app.qml new file mode 100755 index 0000000000..05abbc1cf5 --- /dev/null +++ b/QtClient/JoplinQtClient/app.qml @@ -0,0 +1,28 @@ +import QtQuick 2.7 +import QtQuick.Controls 2.0 +import QtQuick.Controls 1.4 +import QtQuick.Layouts 1.0 + +Item { + id: root + width: 800 + height: 600 + signal currentFolderChanged() + signal currentNoteChanged() + signal addNoteButtonClicked() + signal addFolderButtonClicked() + signal syncButtonClicked() + property alias currentFolderIndex: mainPage.currentFolderIndex + property alias currentNoteIndex: mainPage.currentNoteIndex + + MainPage { + id: mainPage + anchors.fill: parent + appRoot: root + } + + LoginPage { + + } + +} diff --git a/QtClient/JoplinQtClient/application.cpp b/QtClient/JoplinQtClient/application.cpp index a040000de0..6c29691936 100755 --- a/QtClient/JoplinQtClient/application.cpp +++ b/QtClient/JoplinQtClient/application.cpp @@ -17,7 +17,6 @@ Application::Application(int &argc, char **argv) : QGuiApplication(argc, argv), db_(jop::db()), api_(jop::API_BASE_URL), - //api_("https://joplin.cozic.net"), synchronizer_(api_.baseUrl(), db_), folderModel_(db_) @@ -45,7 +44,7 @@ Application::Application(int &argc, char **argv) : ctxt->setContextProperty("noteListModel", ¬eModel_); ctxt->setContextProperty("noteModel", &selectedQmlNote_); - view_.setSource(QUrl("qrc:/main.qml")); + view_.setSource(QUrl("qrc:/app.qml")); QObject* rootObject = (QObject*)view_.rootObject(); @@ -68,17 +67,17 @@ Application::Application(int &argc, char **argv) : connect(&api_, SIGNAL(requestDone(const QJsonObject&, const QString&)), this, SLOT(api_requestDone(const QJsonObject&, const QString&))); // Don't store password, store session ID - QString clientId = "B6E12222B6E12222"; - if (!settings.contains("user.email")) { - settings.setValue("user.email", "laurent@cozic.net"); - settings.setValue("user.password", "12345678"); - } +// QString clientId = "B6E12222B6E12222"; +// if (!settings.contains("user.email")) { +// settings.setValue("user.email", "laurent@cozic.net"); +// settings.setValue("user.password", "12345678"); +// } - QUrlQuery postData; - postData.addQueryItem("email", settings.value("user.email").toString()); - postData.addQueryItem("password", settings.value("user.password").toString()); - postData.addQueryItem("client_id", clientId); - api_.post("sessions", QUrlQuery(), postData, "getSession"); +// QUrlQuery postData; +// postData.addQueryItem("email", settings.value("user.email").toString()); +// postData.addQueryItem("password", settings.value("user.password").toString()); +// postData.addQueryItem("client_id", clientId); +// api_.post("sessions", QUrlQuery(), postData, "getSession"); } void Application::api_requestDone(const QJsonObject& response, const QString& tag) { diff --git a/QtClient/JoplinQtClient/qml.qrc b/QtClient/JoplinQtClient/qml.qrc index 9a4adf8c5b..8b1252035d 100755 --- a/QtClient/JoplinQtClient/qml.qrc +++ b/QtClient/JoplinQtClient/qml.qrc @@ -1,10 +1,13 @@ - main.qml + app.qml FolderList.qml NoteList.qml NoteEditor.qml AddButton.qml EditableListItem.qml + LoginPage.qml + LoginPageForm.ui.qml + MainPage.qml