summaryrefslogtreecommitdiffstats
path: root/karm/preferences.h
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit460c52653ab0dcca6f19a4f492ed2c5e4e963ab0 (patch)
tree67208f7c145782a7e90b123b982ca78d88cc2c87 /karm/preferences.h
downloadtdepim-460c52653ab0dcca6f19a4f492ed2c5e4e963ab0.tar.gz
tdepim-460c52653ab0dcca6f19a4f492ed2c5e4e963ab0.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'karm/preferences.h')
-rw-r--r--karm/preferences.h90
1 files changed, 90 insertions, 0 deletions
diff --git a/karm/preferences.h b/karm/preferences.h
new file mode 100644
index 000000000..e917d70bb
--- /dev/null
+++ b/karm/preferences.h
@@ -0,0 +1,90 @@
+#ifndef KARM_PREFERENCES_H
+#define KARM_PREFERENCES_H
+
+#include <kdialogbase.h>
+
+class QCheckBox;
+class QLabel;
+class QSpinBox;
+class QString;
+class KURLRequester;
+
+/**
+ * Provide an interface to the configuration options for the program.
+ */
+
+class Preferences :public KDialogBase
+{
+ Q_OBJECT
+
+ public:
+ static Preferences *instance( const QString& icsfile = "" );
+ void disableIdleDetection();
+
+ // Retrive information about settings
+ bool detectIdleness() const;
+ int idlenessTimeout() const;
+ QString iCalFile() const;
+ QString activeCalendarFile() const;
+ bool autoSave() const;
+ bool logging() const;
+ int autoSavePeriod() const;
+ bool promptDelete() const;
+ QString setPromptDelete( bool prompt );
+ bool displayColumn(int n) const;
+ QString userRealName() const;
+
+ void emitSignals();
+ bool readBoolEntry( const QString& uid );
+ void writeEntry( const QString &key, bool value );
+ void deleteEntry( const QString &key );
+
+ public slots:
+ void showDialog();
+ void load();
+ void save();
+
+ signals:
+ void detectIdleness(bool on);
+ void idlenessTimeout(int minutes);
+ void iCalFile(QString);
+ void autoSave(bool on);
+ void autoSavePeriod(int minutes);
+ void setupChanged();
+
+ protected slots:
+ virtual void slotOk();
+ virtual void slotCancel();
+ void idleDetectCheckBoxChanged();
+ void autoSaveCheckBoxChanged();
+
+ private:
+ void makeDisplayPage();
+ void makeBehaviorPage();
+ void makeStoragePage();
+
+ Preferences( const QString& icsfile = "" );
+ static Preferences *_instance;
+ bool _unsavedChanges;
+
+ // Widgets
+ QCheckBox *_doIdleDetectionW, *_doAutoSaveW, *_promptDeleteW;
+ QCheckBox *_displayTimeW, *_displaySessionW,
+ *_displayTotalTimeW, *_displayTotalSessionW;
+ QCheckBox *_loggingW;
+ QLabel *_idleDetectLabelW, *_displayColumnsLabelW;
+ QSpinBox *_idleDetectValueW, *_autoSaveValueW;
+ KURLRequester *_iCalFileW ;
+
+ // Values
+ bool _doIdleDetectionV, _doAutoSaveV, _promptDeleteV, _loggingV;
+ bool _displayColumnV[4];
+ int _idleDetectValueV, _autoSaveValueV;
+ QString _iCalFileV;
+
+ /** real name of the user, used during ICAL saving */
+ QString _userRealName;
+};
+
+#endif // KARM_PREFERENCES_H
+