Commit 833f8d45 authored by Andreas Cord-Landwehr's avatar Andreas Cord-Landwehr
Browse files

Add menu entry to edit learner profile.

parent 526ad4c2
......@@ -86,7 +86,7 @@ MainWindow::MainWindow()
// set view
rootContext()->setContextProperty("g_resourceManager", m_resourceManager);
rootContext()->setContextProperty("g_trainingSession", m_trainingSession);
rootContext()->setContextProperty("profileManager", m_profileManager);
rootContext()->setContextProperty("g_profileManager", m_profileManager);
rootContext()->setContextProperty("kcfg_UseContributorResources", Settings::useCourseRepository());
rootContext()->setContextProperty("kcfg_ShowMenuBar", Settings::showMenuBar());
......
/*
* Copyright 2013-2015 Andreas Cord-Landwehr <cordlandwehr@kde.org>
* Copyright 2013-2016 Andreas Cord-Landwehr <cordlandwehr@kde.org>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
......@@ -32,10 +32,15 @@ ApplicationWindow {
minimumHeight: 600
signal triggerDownloadCourses();
signal triggerEditProfile();
signal triggerSettingsDialog();
signal triggerAction(string actionName);
signal switchMenuBarVisibility();
onTriggerEditProfile: {
editProfileDialog.open()
}
Item {
id: theme
property string backgroundColor: "#ffffff"
......@@ -46,7 +51,7 @@ ApplicationWindow {
property int spacing: 15
}
property Learner learner: profileManager.activeProfile
property Learner learner: g_profileManager.activeProfile
property ResourceManager resourceManager: g_resourceManager
CourseModel {
......@@ -163,22 +168,20 @@ ApplicationWindow {
}
}
//FIXME setup dialog deactivated for refactoring
// SheetDialog {
// id: profileSelectorSheet
// anchors {
// top: root.top
// topMargin: header.height
// left: root.left
// bottom: root.bottom
// right: root.right
// }
//TODO change to loader for arbitrary dialogs
//TODO add margin for main menu
SheetDialog {
id: editProfileDialog
anchors {
fill: main
}
content: Item {}
// content: ProfileSelector {
// anchors.fill: parent
// onProfileChosen: {
// profileSelectorSheet.close()
// }
// }
// }
}
}
/*
* Copyright 2015 Andreas Cord-Landwehr <cordlandwehr@kde.org>
* Copyright 2015-2016 Andreas Cord-Landwehr <cordlandwehr@kde.org>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
......@@ -25,6 +25,12 @@ MenuBar {
id: root
Menu {
title: i18n("File")
MenuItem {
text: i18n("Edit User")
iconName: "user-properties"
onTriggered: triggerEditProfile()
}
MenuSeparator { }
MenuItem {
text: i18n("Quit")
iconName: "application-exit"
......
......@@ -102,6 +102,12 @@ ToolBar{
onTriggered: triggerDownloadCourses()
}
MenuSeparator { }
MenuItem {
text: i18n("Edit User")
iconName: "user-properties"
onTriggered: triggerEditProfile()
}
MenuSeparator { }
// TODO requires proper support of KKeySequenceWidget's settings
// MenuItem {
// text: i18n("Configure Shortcuts...")
......
/*
* Copyright 2012 Sebastian Gottfried <sebastiangottfried@web.de>
* Copyright 2016 Andreas Cord-Landwehr <cordlandwehr@kde.org>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
......@@ -19,6 +20,7 @@
*/
import QtQuick 2.1
import QtQuick.Layouts 1.2
Item {
id: root
......@@ -64,8 +66,7 @@ Item {
}
}
Item {
id: contentArea
ColumnLayout {
anchors {
fill: parent
topMargin: 10
......@@ -73,6 +74,27 @@ Item {
bottomMargin: 10
leftMargin: 10
}
Item {
id: contentArea
Layout.fillWidth: true
Layout.fillHeight: true
// the content
}
RowLayout {
Item {
Layout.fillWidth: true
}
FlatButton {
id: closeButton
text: i18n("Close")
iconName: "dialog-close"
iconSize: 22
fontSize: 14
onClicked: {
close()
}
}
}
}
state: "closed"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment