]> sigrok.org Git - pulseview.git/blobdiff - pv/globalsettings.hpp
Trace: Removed coloured_bg state
[pulseview.git] / pv / globalsettings.hpp
index b7457963da88e462cdaa1a2e8202f5ae2a919fb0..1c07c308d71a5170e9c227a251fa14238aafde01 100644 (file)
 #include <QString>
 #include <QVariant>
 
 #include <QString>
 #include <QVariant>
 
+using std::function;
+using std::map;
+using std::multimap;
+
 namespace pv {
 
 class GlobalSettings : public QSettings
 namespace pv {
 
 class GlobalSettings : public QSettings
@@ -36,17 +40,41 @@ class GlobalSettings : public QSettings
 public:
        static const QString Key_View_AlwaysZoomToFit;
        static const QString Key_View_ColouredBG;
 public:
        static const QString Key_View_AlwaysZoomToFit;
        static const QString Key_View_ColouredBG;
+       static const QString Key_View_StickyScrolling;
+       static const QString Key_View_ShowSamplingPoints;
+       static const QString Key_View_ShowAnalogMinorGrid;
 
 public:
        GlobalSettings();
 
        static void register_change_handler(const QString key,
 
 public:
        GlobalSettings();
 
        static void register_change_handler(const QString key,
-               std::function<void(QVariant)> cb);
+               function<void(QVariant)> cb);
 
        void setValue(const QString& key, const QVariant& value);
 
 
        void setValue(const QString& key, const QVariant& value);
 
+       /**
+        * Begins the tracking of changes. All changes will
+        * be recorded until stop_tracking() is called.
+        * The change tracking is global and doesn't support nesting.
+        */
+       void start_tracking();
+
+       /**
+        * Ends the tracking of changes without any changes to the settings.
+        */
+       void stop_tracking();
+
+       /**
+        * Ends the tracking of changes, undoing the changes since the
+        * change tracking began.
+        */
+       void undo_tracked_changes();
+
 private:
 private:
-       static std::multimap< QString, std::function<void(QVariant)> > callbacks_;
+       static multimap< QString, function<void(QVariant)> > callbacks_;
+
+       static bool tracking_;
+       static map<QString, QVariant> tracked_changes_;
 };
 
 } // namespace pv
 };
 
 } // namespace pv