X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fglobalsettings.hpp;h=9581e294ba658518e393f7e5966324e9a92f3433;hp=b7457963da88e462cdaa1a2e8202f5ae2a919fb0;hb=2cca9ebfdc367aa8e4651cf063f0cdea8fccb798;hpb=3906e758503d37794b12e92aee68757e54a89a38 diff --git a/pv/globalsettings.hpp b/pv/globalsettings.hpp index b7457963..9581e294 100644 --- a/pv/globalsettings.hpp +++ b/pv/globalsettings.hpp @@ -45,8 +45,29 @@ public: 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: static std::multimap< QString, std::function > callbacks_; + + static bool tracking_; + static std::map tracked_changes_; }; } // namespace pv