X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fglobalsettings.hpp;h=f6239a6b3d089f726cea54afd1bffaf3f211b14a;hp=6f32bf01ebbb8d959ce531a17ef1e55b0a16bba8;hb=HEAD;hpb=a42d2514a57051f971e7b239bc3765ebf93669ae diff --git a/pv/globalsettings.hpp b/pv/globalsettings.hpp index 6f32bf01..f6239a6b 100644 --- a/pv/globalsettings.hpp +++ b/pv/globalsettings.hpp @@ -17,8 +17,8 @@ * along with this program; if not, see . */ -#ifndef PULSEVIEW_GLOBALSETTINGS_HPP -#define PULSEVIEW_GLOBALSETTINGS_HPP +#ifndef PULSEVIEW_PV_GLOBALSETTINGS_HPP +#define PULSEVIEW_PV_GLOBALSETTINGS_HPP #include @@ -30,6 +30,8 @@ #include #include +#include "util.hpp" + using std::map; using std::pair; using std::vector; @@ -51,13 +53,17 @@ class GlobalSettings : public QSettings Q_OBJECT public: + static const QString Key_General_Language; static const QString Key_General_Theme; static const QString Key_General_Style; + static const QString Key_General_SaveWithSetup; + static const QString Key_General_StartAllSessions; static const QString Key_View_ZoomToFitDuringAcq; static const QString Key_View_ZoomToFitAfterAcq; static const QString Key_View_TriggerIsZeroTime; static const QString Key_View_ColoredBG; static const QString Key_View_StickyScrolling; + static const QString Key_View_AllowVerticalDragging; static const QString Key_View_ShowSamplingPoints; static const QString Key_View_FillSignalHighAreas; static const QString Key_View_FillSignalHighAreaColor; @@ -66,9 +72,15 @@ public: static const QString Key_View_DefaultDivHeight; static const QString Key_View_DefaultLogicHeight; static const QString Key_View_ShowHoverMarker; + static const QString Key_View_KeepRulerItemSelected; static const QString Key_View_SnapDistance; + static const QString Key_View_CursorFillColor; + static const QString Key_View_CursorShowInterval; + static const QString Key_View_CursorShowFrequency; + static const QString Key_View_CursorShowSamples; static const QString Key_Dec_InitialStateConfigurable; static const QString Key_Dec_ExportFormat; + static const QString Key_Dec_AlwaysShowAllRows; static const QString Key_Log_BufferSize; static const QString Key_Log_NotifyOfStacktrace; @@ -86,9 +98,11 @@ public: void set_bright_theme_default_colors(); void set_dark_theme_default_colors(); - bool current_theme_is_dark(); + static bool current_theme_is_dark(); void apply_theme(); + void apply_language(); + static void add_change_handler(GlobalSettingsInterface *cb); static void remove_change_handler(GlobalSettingsInterface *cb); @@ -113,13 +127,14 @@ public: void undo_tracked_changes(); static void store_gvariant(QSettings &settings, GVariant *v); - static GVariant* restore_gvariant(QSettings &settings); static void store_variantbase(QSettings &settings, Glib::VariantBase v); - static Glib::VariantBase restore_variantbase(QSettings &settings); + static void store_timestamp(QSettings &settings, const char *name, const pv::util::Timestamp &ts); + static pv::util::Timestamp restore_timestamp(QSettings &settings, const char *name); + private: static vector callbacks_; @@ -129,9 +144,9 @@ private: static QString default_style_; static QPalette default_palette_; - bool is_dark_theme_; + static bool is_dark_theme_; }; } // namespace pv -#endif // PULSEVIEW_GLOBALSETTINGS_HPP +#endif // PULSEVIEW_PV_GLOBALSETTINGS_HPP