diff --git a/src/qml/ArtikulateDrawer.qml b/src/qml/ArtikulateDrawer.qml index 2815529..ba66db8 100644 --- a/src/qml/ArtikulateDrawer.qml +++ b/src/qml/ArtikulateDrawer.qml @@ -1,143 +1,130 @@ /* * Copyright 2018 Andreas Cord-Landwehr * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License or (at your option) version 3 or any later version * accepted by the membership of KDE e.V. (or its successor approved * by the membership of KDE e.V.), which shall act as a proxy * defined in Section 14 of version 3 of the license. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ import QtQuick 2.5 import QtQuick.Layouts 1.3 import QtQuick.Controls 2.0 as QQC2 import org.kde.kirigami 2.0 as Kirigami Kirigami.GlobalDrawer { id: root title: "Artikulate" titleIcon: "artikulate" resetMenuOnTriggered: false bottomPadding: 0 property QtObject pageStack // enforce drawer always to be open modal: false handleVisible: false actions: [ Kirigami.Action { text: i18n("Welcome") iconName: "artikulate" onTriggered: { root.pageStack.clear(); root.pageStack.push(welcomePageComponent); } }, Kirigami.Action { text: i18n("Training") iconName: "document-open" onTriggered: { root.pageStack.clear(); root.pageStack.push(trainingItemsPageComponent); root.pageStack.push(trainingPageComponent); } }, - Kirigami.Action { - text: i18n("User Profile") - iconName: "user-properties" - onTriggered: { - root.pageStack.clear(); - root.pageStack.push(profileSettingsPageComponent); - } - Kirigami.Action { - text: i18n("Configure Profile") - iconName: "user-properties" - onTriggered: { - root.pageStack.pop(); - root.pageStack.push(profileSettingsPageComponent); - } - } - Kirigami.Action { - text: i18n("Training Languages"); - onTriggered: { - root.pageStack.pop(); - root.pageStack.push(languageSettingsPageComponent); - } - } - }, Kirigami.Action { text: i18n("Help") iconName: "help-about" Kirigami.Action { text: i18n("Artikulate Handbook") iconName: "help-contents" onTriggered: { triggerAction("help_contents"); globalDrawer.resetMenu(); } } Kirigami.Action { text: i18n("Report Bug") iconName: "tools-report-bug" onTriggered: { triggerAction("help_report_bug"); globalDrawer.resetMenu(); } } Kirigami.Action { text: i18n("About Artikulate") iconName: "artikulate" onTriggered: { triggerAction("help_about_app") globalDrawer.resetMenu(); } } Kirigami.Action { text: i18n("About KDE") iconName: "help-about" onTriggered: { triggerAction("help_about_kde") globalDrawer.resetMenu(); } } } ] ColumnLayout { spacing: 0 Layout.fillWidth: true Layout.leftMargin: -root.leftPadding Layout.rightMargin: -root.rightPadding Kirigami.Separator { Layout.fillWidth: true } + ActionListItem { + action: Kirigami.Action { + text: i18n("Statistics") + iconName: "user-properties" + onTriggered: { + root.pageStack.pop(); + root.pageStack.push(profileSettingsPageComponent); + } + } + } ActionListItem { action: Kirigami.Action { text: i18n("Settings") iconName: "settings-configure" onTriggered: triggerSettingsDialog() } } ActionListItem { action: Kirigami.Action { text: i18n("Download Training") iconName: "get-hot-new-stuff" onTriggered: triggerDownloadCourses() } } } } diff --git a/src/qml/LanguageSettingsPage.qml b/src/qml/LanguageSettingsPage.qml deleted file mode 100644 index 834cad5..0000000 --- a/src/qml/LanguageSettingsPage.qml +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2012 Sebastian Gottfried - * Copyright 2013-2017 Andreas Cord-Landwehr - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License or (at your option) version 3 or any later version - * accepted by the membership of KDE e.V. (or its successor approved - * by the membership of KDE e.V.), which shall act as a proxy - * defined in Section 14 of version 3 of the license. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -import QtQuick 2.1 -import QtQuick.Layouts 1.2 -import QtQuick.Controls 2.0 as QQC2 -import org.kde.kirigami 2.0 as Kirigami2 -import artikulate 1.0 - -Kirigami2.ScrollablePage { - id: root - - title: i18n("Training Languages") - - Layout.fillWidth: true - - ListView { - id: goalList - width: root.width - Layout.fillHeight: true - - model: LearningGoalModel { - profileManager: g_profileManager - learner: g_profileManager.activeProfile - } - delegate: ListItem { - id: goalSelector - property LearningGoal goal: model.dataRole - width: goalList.width - 10 - title: model.title - iconName: "favorites" - onSelected: goalList.currentIndex = index - } - } -} diff --git a/src/qml/Main.qml b/src/qml/Main.qml index 8a054d0..00dc5f7 100644 --- a/src/qml/Main.qml +++ b/src/qml/Main.qml @@ -1,87 +1,83 @@ /* * Copyright 2013-2017 Andreas Cord-Landwehr * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License or (at your option) version 3 or any later version * accepted by the membership of KDE e.V. (or its successor approved * by the membership of KDE e.V.), which shall act as a proxy * defined in Section 14 of version 3 of the license. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ import QtQuick 2.5 import QtQuick.Controls 2.0 as QQC2 import org.kde.kirigami 2.0 as Kirigami2 import artikulate 1.0 Kirigami2.ApplicationWindow { id: root function changePage(pageItem) { root.pageStack.clear(); root.pageStack.push(pageItem); root.pageStack.push(pageItem); } // header: Text { // font.pointSize: Kirigami2.Units.gridUnit * 1 // text: pageStack.currentItem.title // } header: Kirigami2.ApplicationHeader { } globalDrawer: ArtikulateDrawer { pageStack: root.pageStack } contextDrawer: Kirigami2.ContextDrawer { id: contextDrawer } signal triggerDownloadCourses(); signal triggerSettingsDialog(); signal triggerAction(string actionName); signal switchMenuBarVisibility(); property Learner learner: g_profileManager.activeProfile property ResourceManager resourceManager: g_resourceManager CourseModel { id: availableCourseModel resourceManager: g_resourceManager } pageStack.initialPage: welcomePageComponent // pages Component { id: welcomePageComponent WelcomePage { } } Component { id: trainingPageComponent TrainingPage { } } Component { id: trainingItemsPageComponent TrainingItemsPage { } } Component { id: profileSettingsPageComponent ProfileSettingsPage { } } - Component { - id: languageSettingsPageComponent - LanguageSettingsPage { } - } } diff --git a/src/qml/qml.qrc b/src/qml/qml.qrc index d3d1fd1..681ab65 100644 --- a/src/qml/qml.qrc +++ b/src/qml/qml.qrc @@ -1,28 +1,27 @@ ActionListItem.qml ArtikulateDrawer.qml CheckListItem.qml CourseSwitcher.qml Editor.qml - LanguageSettingsPage.qml LanguageSwitcher.qml ListItem.qml Main.qml PhonemeUnitSelector.qml PhraseEditor.qml PhraseEditorEditStateComponent.qml PhraseEditorSoundComponent.qml PhraseEditorTypeComponent.qml ProfileSelector.qml ProfileSettingsPage.qml ProfileUserImageItem.qml SoundPlayer.qml SoundRecorder.qml TrainerCourseStatistics.qml TrainingItemsPage.qml TrainingPage.qml UnitEditor.qml WelcomePage.qml