Skip to content

Commit

Permalink
New note action added.
Browse files Browse the repository at this point in the history
  • Loading branch information
vvb16 committed Oct 19, 2015
1 parent 8e8286f commit a822d44
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 3 deletions.
Binary file added filenew.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 29 additions & 3 deletions main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ ApplicationWindow {
menuBar: MenuBar {
Menu {
title: qsTr("Файл")
MenuItem {
action: noteNewAction
}
MenuItem {
action: noteOpenAction
}
Expand All @@ -39,19 +42,38 @@ ApplicationWindow {
}
}

Action {
id: noteNewAction
text: qsTr("Новая заявка")
shortcut: StandardKey.New
iconSource: "filenew.png"
enabled: true
onTriggered: {
noteSaveAction.enabled = true;
goNextAction.enabled = true;
console.log("New action triggered");
}
}

Action {
id: noteOpenAction
text: qsTr("Открыть")
text: qsTr("Открыть заявку")
shortcut: StandardKey.Open
iconSource: "fileopen.png"
onTriggered: console.log("Open action triggered");
enabled: true
onTriggered: {
noteSaveAction.enabled = true;
goNextAction.enabled = true;
console.log("Open action triggered");
}
}

Action {
id: noteSaveAction
text: qsTr("Сохранить")
text: qsTr("Сохранить заявку")
shortcut: StandardKey.Save
iconSource: "filesave.png"
enabled: false
onTriggered: console.log("Save action triggered");
}

Expand All @@ -60,6 +82,7 @@ ApplicationWindow {
text: qsTr("Далее")
shortcut: StandardKey.Forward
iconSource: "actionnext.png"
enabled: false
property var srcs: ["StartView.qml", "InitializationView.qml", "ToolstringEditor.qml"]
property int current_src_idx: 0
onTriggered: {
Expand Down Expand Up @@ -88,6 +111,9 @@ ApplicationWindow {
toolBar: ToolBar {
RowLayout {
anchors.fill: parent
ToolButton {
action: noteNewAction
}
ToolButton {
action: noteOpenAction
}
Expand Down
1 change: 1 addition & 0 deletions qml.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
<file>ToolstringEditor.qml</file>
<file>InitializationView.qml</file>
<file>StartView.qml</file>
<file>filenew.png</file>
</qresource>
</RCC>

0 comments on commit a822d44

Please sign in to comment.