Mercurial > hg > svgui
diff view/ViewManager.h @ 1468:de41a11cabc2
Add opportunistic-editing toggle
author | Chris Cannam |
---|---|
date | Thu, 13 Jun 2019 15:35:01 +0100 |
parents | a18e78b9c78b |
children | 9bf8aa2916e9 |
line wrap: on
line diff
--- a/view/ViewManager.h Thu Jun 13 15:05:25 2019 +0100 +++ b/view/ViewManager.h Thu Jun 13 15:35:01 2019 +0100 @@ -245,6 +245,24 @@ void setZoomWheelsEnabled(bool enable); bool getZoomWheelsEnabled() const { return m_zoomWheelsEnabled; } + /** + * Enable or disable opportunistic editing. This allows certain + * edits while not in edit modes - e.g. double-click on an item + * while in navigate mode to open an edit dialog. It is enabled by + * default, but it may be undesirable if the application is + * intended to be "read-only". + * + * This setting makes no difference to behaviour when actually in + * editing modes. + * + * Unlike some other options, this is considered to be + * application-build-specific and is not restored from settings. + */ + void setOpportunisticEditingEnabled(bool enable); + bool getOpportunisticEditingEnabled() const { + return m_opportunisticEditingEnabled; + } + void setGlobalDarkBackground(bool dark); bool getGlobalDarkBackground() const; @@ -303,6 +321,9 @@ /** Emitted when the zoom wheels have been toggled. */ void zoomWheelsEnabledChanged(); + /** Emitted when editing-enabled has been toggled. */ + void opportunisticEditingEnabledChanged(); + /** Emitted when any loggable activity has occurred. */ void activity(QString); @@ -366,6 +387,7 @@ OverlayMode m_overlayMode; bool m_zoomWheelsEnabled; + bool m_opportunisticEditingEnabled; bool m_showCentreLine; bool m_illuminateLocalFeatures; bool m_showWorkTitle;