From b5ca997b2d2a64f955b78208d0362cba0278f8d3 Mon Sep 17 00:00:00 2001 From: Samuel Fadel Date: Thu, 11 Feb 2016 12:03:59 -0200 Subject: Modified the way the history interacts with other components. * Main class is now responsible for updating map components whenever the current map changes (even rewinding): this simplifies other objects because they don't have to know anything about how the data is being displayed later (no CP/RP juggling everywhere) * Added undo/reset actions to main view, including menu items * ProjectionHistory now has specific signals for each change happening to the history --- main_view.qml | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) (limited to 'main_view.qml') diff --git a/main_view.qml b/main_view.qml index cfbea4f..b0cee3c 100644 --- a/main_view.qml +++ b/main_view.qml @@ -27,6 +27,12 @@ ApplicationWindow { MenuItem { action: quitAction } } + Menu { + title: "Edit" + MenuItem { action: undoManipulationAction } + MenuItem { action: resetManipulationAction } + } + Menu { title: "Select" MenuItem { action: selectRPsAction } @@ -79,6 +85,7 @@ ApplicationWindow { y: parent.y z: 1 anchors.fill: parent + glyphSize: 3.0 } Scatterplot { @@ -258,10 +265,10 @@ ApplicationWindow { id: cpGlyphSizeSpinBox maximumValue: 100 minimumValue: 6 - value: cpPlot.glyphSize() decimals: 1 stepSize: 1 - onValueChanged: cpPlot.setGlyphSize(this.value) + value: cpPlot.glyphSize + onValueChanged: cpPlot.glyphSize = this.value } Label { text: "Opacity:" } @@ -364,10 +371,10 @@ ApplicationWindow { id: rpGlyphSizeSpinBox maximumValue: 100 minimumValue: 2 - value: rpPlot.glyphSize() decimals: 1 stepSize: 1 - onValueChanged: rpPlot.setGlyphSize(this.value) + value: rpPlot.glyphSize + onValueChanged: rpPlot.glyphSize = this.value } Label { text: "Opacity:" } @@ -459,6 +466,20 @@ ApplicationWindow { onTriggered: Qt.quit() } + Action { + id: undoManipulationAction + text: "&Undo manipulation" + shortcut: "Ctrl+Z" + onTriggered: Main.undoManipulation() + } + + Action { + id: resetManipulationAction + text: "&Reset manipulation" + shortcut: "Ctrl+R" + onTriggered: Main.resetManipulation() + } + Action { id: selectRPsAction text: "&Regular points" -- cgit v1.2.3