From 583323be56520c697bbc9d08e6abf8ec4b5c42c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=20=EA=A6=AB=EA=A6=B6=20=EA=A6=8F=EA=A7=80?= =?UTF-8?q?=EA=A6=A6=EA=A6=BF=20=EA=A6=A7=20=EA=A6=AE=20=EA=A6=91=20?= =?UTF-8?q?=EA=A6=A9=20=EA=A6=AD=EA=A7=80?= Date: Mon, 30 Sep 2019 10:36:16 +0800 Subject: Rename task to ticket --- Home.qml | 14 +++++++------- TaskDetails.qml | 42 ------------------------------------------ TaskList.qml | 19 ------------------- TicketDetails.qml | 35 +++++++++++++++++++++++++++++++++++ TicketList.qml | 18 ++++++++++++++++++ controller.cxx | 16 ++++++++-------- controller.hxx | 2 +- kelakon.qrc | 4 ++-- larva | 2 +- 9 files changed, 72 insertions(+), 80 deletions(-) delete mode 100644 TaskDetails.qml delete mode 100644 TaskList.qml create mode 100644 TicketDetails.qml create mode 100644 TicketList.qml diff --git a/Home.qml b/Home.qml index 3c670cc..2a8d1a3 100644 --- a/Home.qml +++ b/Home.qml @@ -16,9 +16,9 @@ HomeForm { todayItemDelegate { text: qsTr("Today") onClicked: { - contentView.push("TaskList.qml") - var taskList = contentView.currentItem - taskList.title = qsTr("Today") + contentView.push("TicketList.qml") + var ticketList = contentView.currentItem + ticketList.title = qsTr("Today") drawer.close() } } @@ -26,16 +26,16 @@ HomeForm { futureItemDelegate { text:qsTr("Future") onClicked: { - contentView.push("TaskList.qml") - var taskList = contentView.currentItem - taskList.title = qsTr("Future task") + contentView.push("TicketList.qml") + var ticketList = contentView.currentItem + ticketList.title = qsTr("Future ticket") drawer.close() } } } } - contentView.initialItem: TaskList { + contentView.initialItem: TicketList { title: qsTr("Today") } } diff --git a/TaskDetails.qml b/TaskDetails.qml deleted file mode 100644 index 6470b50..0000000 --- a/TaskDetails.qml +++ /dev/null @@ -1,42 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.Material 2.12 -import QtQuick.Layouts 1.12 -import "larva/features" - -TaskDetailForm { - property string subject - backButton.onClicked: pageView.pop() - - StackView { - id: contentView - anchors.fill: parent - - TaskBriefForm { - id: taskBriefForm - anchors.top: parent.top - anchors.topMargin: 0 - anchors.right: parent.right - anchors.rightMargin: 0 - anchors.left: parent.left - anchors.leftMargin: 0 - ticketSubject.text: subject - } - - TaskHistoryForm { - id: taskHistoryForm - anchors.right: parent.right - anchors.rightMargin: 0 - anchors.left: parent.left - anchors.leftMargin: 0 - anchors.top: taskBriefForm.bottom - anchors.topMargin: 0 - } - } -} - -/*##^## -Designer { - D{i:0;autoSize:true;height:480;width:640} -} -##^##*/ diff --git a/TaskList.qml b/TaskList.qml deleted file mode 100644 index 55a59ae..0000000 --- a/TaskList.qml +++ /dev/null @@ -1,19 +0,0 @@ -import QtQuick 2.12 -import "larva/features" - -TaskListForm { - listView { - objectName: "taskList" - model: taskList - delegate: TaskForm { - width: parent.width - height: task.height - taskTitle.text: subject - itemDelegate.onClicked: { - window.ticketHistory(id) - pageView.push("TaskDetails.qml" - , {"subject": subject}) - } - } - } -} diff --git a/TicketDetails.qml b/TicketDetails.qml new file mode 100644 index 0000000..add934f --- /dev/null +++ b/TicketDetails.qml @@ -0,0 +1,35 @@ +import QtQuick 2.12 +import QtQuick.Controls 2.12 +import QtQuick.Controls.Material 2.12 +import QtQuick.Layouts 1.12 +import "larva/features" + +TaskDetailForm { + property string subject + backButton.onClicked: pageView.pop() + + StackView { + id: contentView + anchors.fill: parent + + TaskBriefForm { + id: ticketBriefForm + anchors.top: parent.top + anchors.topMargin: 0 + anchors.right: parent.right + anchors.rightMargin: 0 + anchors.left: parent.left + anchors.leftMargin: 0 + ticketSubject.text: subject + } + + TaskHistoryForm { + anchors.right: parent.right + anchors.rightMargin: 0 + anchors.left: parent.left + anchors.leftMargin: 0 + anchors.top: ticketBriefForm.bottom + anchors.topMargin: 0 + } + } +} diff --git a/TicketList.qml b/TicketList.qml new file mode 100644 index 0000000..ba874b9 --- /dev/null +++ b/TicketList.qml @@ -0,0 +1,18 @@ +import QtQuick 2.12 +import "larva/features" + +TaskListForm { + listView { + model: ticketList + delegate: TaskForm { + width: parent.width + height: task.height + taskTitle.text: subject + itemDelegate.onClicked: { + window.ticketHistory(id) + pageView.push("TicketDetails.qml" + , {"subject": subject}) + } + } + } +} diff --git a/controller.cxx b/controller.cxx index 1b0e9f3..a229495 100644 --- a/controller.cxx +++ b/controller.cxx @@ -33,15 +33,15 @@ Controller::Controller(QObject* parent) : QObject{parent} auto typeId = qmlRegisterSingletonType("KelakonUser", 0, 1, "User" , [](QQmlEngine *engine , QJSEngine *scriptEngine) -> QObject* { - Q_UNUSED(engine) - Q_UNUSED(scriptEngine) - return new User; + Q_UNUSED(engine) + Q_UNUSED(scriptEngine) + return new User; }); auto qUser = engine->singletonInstance(typeId); using RTClient::TicketList; - taskList = new TicketList; - engine->rootContext()->setContextProperty("taskList", taskList); + ticketList = new TicketList; + engine->rootContext()->setContextProperty("ticketList", ticketList); connect(appWindow, SIGNAL(logIn(QString, QString)) , client, SLOT(logIn(QString, QString))); @@ -61,11 +61,11 @@ Controller::Controller(QObject* parent) : QObject{parent} (&Controller::checked) , client, &Client::ticketSearch); - connect(client, &Client::ticketSearched, taskList, &TicketList::update); + connect(client, &Client::ticketSearched, ticketList, &TicketList::update); connect(client, &Client::loggedIn, [appWindow,this]() { auto loginView = appWindow->findChild("login"); - connect(taskList, &TicketList::updated, [loginView]() { + connect(ticketList, &TicketList::updated, [loginView]() { QMetaObject::invokeMethod(loginView , "pushHome"); }); @@ -84,5 +84,5 @@ Controller::~Controller() { thread.quit(); thread.wait(); - delete taskList; + delete ticketList; } diff --git a/controller.hxx b/controller.hxx index 66a3cd4..04db899 100644 --- a/controller.hxx +++ b/controller.hxx @@ -19,7 +19,7 @@ class Controller : public QObject private: QThread thread; - RTClient::TicketList* taskList; + RTClient::TicketList* ticketList; }; #endif // CONTROLLER_HXX diff --git a/kelakon.qrc b/kelakon.qrc index 1342d52..670ff28 100644 --- a/kelakon.qrc +++ b/kelakon.qrc @@ -4,8 +4,8 @@ Login.qml LoginPassword.qml Home.qml - TaskList.qml - TaskDetails.qml + TicketList.qml + TicketDetails.qml Profile.qml Email.qml Password.qml diff --git a/larva b/larva index 04df88e..a78618b 160000 --- a/larva +++ b/larva @@ -1 +1 @@ -Subproject commit 04df88e0e5db34066a626a02dbe9960b55267e6b +Subproject commit a78618b78bc41e2bf0789a96187a37d8cc240853 -- cgit v1.2.3