X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fglobalsettings.hpp;h=9581e294ba658518e393f7e5966324e9a92f3433;hp=b7457963da88e462cdaa1a2e8202f5ae2a919fb0;hb=326cf6feb8598aa03a35fd6f678e4f536f168149;hpb=bf9f12687c8d43422455cbdc27ec1cc5d4305149 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