comparison base/Preferences.h @ 145:82f529a08cf3

* Change preferences dialog to ok/apply/cancel model * Make preferences persist in a config file * Change instance() to getInstance() for all singleton types * Make pasting to time-value layer with no values in clipboard ask you how to generate the values * Fix bad behaviour caused by importing "data"-type (i.e. 3d dense) model from annotation file without a fixed window size available
author Chris Cannam
date Thu, 27 Jul 2006 16:06:32 +0000
parents a35098a9c814
children 059b0322009c
comparison
equal deleted inserted replaced
144:a9c3ba1777e1 145:82f529a08cf3
18 18
19 #include "PropertyContainer.h" 19 #include "PropertyContainer.h"
20 20
21 #include "Window.h" 21 #include "Window.h"
22 22
23 class ConfigFile;
24
23 class Preferences : public PropertyContainer 25 class Preferences : public PropertyContainer
24 { 26 {
25 Q_OBJECT 27 Q_OBJECT
26 28
27 public: 29 public:
37 39
38 bool getSmoothSpectrogram() const { return m_smoothSpectrogram; } 40 bool getSmoothSpectrogram() const { return m_smoothSpectrogram; }
39 float getTuningFrequency() const { return m_tuningFrequency; } 41 float getTuningFrequency() const { return m_tuningFrequency; }
40 WindowType getWindowType() const { return m_windowType; } 42 WindowType getWindowType() const { return m_windowType; }
41 43
44 ConfigFile *getConfigFile() { return m_configFile; }
45
42 //!!! harmonise with PaneStack 46 //!!! harmonise with PaneStack
43 enum PropertyBoxLayout { 47 enum PropertyBoxLayout {
44 VerticallyStacked, 48 VerticallyStacked,
45 Layered 49 Layered
46 }; 50 };
53 void setTuningFrequency(float freq); 57 void setTuningFrequency(float freq);
54 void setPropertyBoxLayout(PropertyBoxLayout layout); 58 void setPropertyBoxLayout(PropertyBoxLayout layout);
55 void setWindowType(WindowType type); 59 void setWindowType(WindowType type);
56 60
57 private: 61 private:
58 Preferences(); 62 Preferences(); // may throw DirectoryCreationFailed
59 virtual ~Preferences() { } 63 virtual ~Preferences();
60 64
61 static Preferences *m_instance; 65 static Preferences *m_instance;
62 66
63 bool m_smoothSpectrogram; 67 bool m_smoothSpectrogram;
64 float m_tuningFrequency; 68 float m_tuningFrequency;
65 PropertyBoxLayout m_propertyBoxLayout; 69 PropertyBoxLayout m_propertyBoxLayout;
66 WindowType m_windowType; 70 WindowType m_windowType;
71 ConfigFile *m_configFile;
67 }; 72 };
68 73
69 #endif 74 #endif