diff options
-rw-r--r-- | Home.qml | 14 | ||||
-rw-r--r-- | TaskDetails.qml | 42 | ||||
-rw-r--r-- | TicketDetails.qml | 35 | ||||
-rw-r--r-- | TicketList.qml (renamed from TaskList.qml) | 5 | ||||
-rw-r--r-- | controller.cxx | 16 | ||||
-rw-r--r-- | controller.hxx | 2 | ||||
-rw-r--r-- | kelakon.qrc | 4 | ||||
m--------- | larva | 0 |
8 files changed, 55 insertions, 63 deletions
@@ -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/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/TaskList.qml b/TicketList.qml index 55a59ae..ba874b9 100644 --- a/TaskList.qml +++ b/TicketList.qml @@ -3,15 +3,14 @@ import "larva/features" TaskListForm { listView { - objectName: "taskList" - model: taskList + model: ticketList delegate: TaskForm { width: parent.width height: task.height taskTitle.text: subject itemDelegate.onClicked: { window.ticketHistory(id) - pageView.push("TaskDetails.qml" + 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<User>("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<User*>(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<QObject*>("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 @@ <file>Login.qml</file> <file>LoginPassword.qml</file> <file>Home.qml</file> - <file>TaskList.qml</file> - <file>TaskDetails.qml</file> + <file>TicketList.qml</file> + <file>TicketDetails.qml</file> <file>Profile.qml</file> <file>Email.qml</file> <file>Password.qml</file> diff --git a/larva b/larva -Subproject 04df88e0e5db34066a626a02dbe9960b55267e6 +Subproject a78618b78bc41e2bf0789a96187a37d8cc24085 |