aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Fadel <samuelfadel@gmail.com>2016-02-29 23:45:38 -0300
committerSamuel Fadel <samuelfadel@gmail.com>2016-02-29 23:45:38 -0300
commit00efaedf4e328604598975a07a497d1ce769bb19 (patch)
tree74f2a37bf020abfce70785aa3bda1cb8c7c88f77
parentbf9362935c77bb5cb739c39e3f9b0abcbdcb6aa5 (diff)
Added dialog for saving screenshots with a prefix.
-rw-r--r--main_view.qml43
1 files changed, 32 insertions, 11 deletions
diff --git a/main_view.qml b/main_view.qml
index 66fdf44..6cd54ae 100644
--- a/main_view.qml
+++ b/main_view.qml
@@ -464,22 +464,45 @@ ApplicationWindow {
}
}
- Action {
- id: screenshotAction
- text: "Save screenshot"
- shortcut: "Ctrl+Shift+S"
- onTriggered: {
+ Dialog {
+ id: prefixDialog
+ title: "Save screenshot"
+ standardButtons: StandardButton.Save | StandardButton.Cancel
+
+ TextField {
+ id: prefixTextField
+ placeholderText: "Enter prefix"
+ }
+
+ onAccepted: {
+ var prefix = prefixTextField.text;
+ if (prefix.length == 0) {
+ prefix = "screenshot";
+ }
+
mainView.grabToImage(function(result) {
- result.saveToFile("screenshot-main.png");
+ result.saveToFile(prefix + "-main.png");
});
bottomViewCP.grabToImage(function(result) {
- result.saveToFile("screenshot-bottom-cp.png");
+ result.saveToFile(prefix + "-bottom-cp.png");
});
bottomViewRP.grabToImage(function(result) {
- result.saveToFile("screenshot-bottom-rp.png");
+ result.saveToFile(prefix + "-bottom-rp.png");
});
+
+ prefixTextField.text = "";
+ }
+ }
+
+ Action {
+ id: screenshotAction
+ text: "Save screenshot"
+ shortcut: "Ctrl+Shift+S"
+ onTriggered: {
+ prefixDialog.open();
+ prefixTextField.forceActiveFocus();
}
}
@@ -487,9 +510,7 @@ ApplicationWindow {
id: savePlotAction
text: "&Save data"
shortcut: "Ctrl+S"
- onTriggered: {
- Main.saveData()
- }
+ onTriggered: Main.saveData()
}
Action {