karm
preferences.h00001 #ifndef KARM_PREFERENCES_H
00002 #define KARM_PREFERENCES_H
00003
00004 #include <kdialogbase.h>
00005
00006 class TQCheckBox;
00007 class TQLabel;
00008 class TQSpinBox;
00009 class TQString;
00010 class KURLRequester;
00011
00016 class Preferences :public KDialogBase
00017 {
00018 Q_OBJECT
00019
00020 public:
00021 static Preferences *instance( const TQString& icsfile = "" );
00022 void disableIdleDetection();
00023
00024
00025 bool detectIdleness() const;
00026 int idlenessTimeout() const;
00027 TQString iCalFile() const;
00028 TQString activeCalendarFile() const;
00029 bool autoSave() const;
00030 bool logging() const;
00031 int autoSavePeriod() const;
00032 bool promptDelete() const;
00033 TQString setPromptDelete( bool prompt );
00034 bool displayColumn(int n) const;
00035 TQString userRealName() const;
00036
00037 void emitSignals();
00038 bool readBoolEntry( const TQString& uid );
00039 void writeEntry( const TQString &key, bool value );
00040 void deleteEntry( const TQString &key );
00041
00042 public slots:
00043 void showDialog();
00044 void load();
00045 void save();
00046
00047 signals:
00048 void detectIdleness(bool on);
00049 void idlenessTimeout(int minutes);
00050 void iCalFile(TQString);
00051 void autoSave(bool on);
00052 void autoSavePeriod(int minutes);
00053 void setupChanged();
00054
00055 protected slots:
00056 virtual void slotOk();
00057 virtual void slotCancel();
00058 void idleDetectCheckBoxChanged();
00059 void autoSaveCheckBoxChanged();
00060
00061 private:
00062 void makeDisplayPage();
00063 void makeBehaviorPage();
00064 void makeStoragePage();
00065
00066 Preferences( const TQString& icsfile = "" );
00067 static Preferences *_instance;
00068 bool _unsavedChanges;
00069
00070
00071 TQCheckBox *_doIdleDetectionW, *_doAutoSaveW, *_promptDeleteW;
00072 TQCheckBox *_displayTimeW, *_displaySessionW,
00073 *_displayTotalTimeW, *_displayTotalSessionW;
00074 TQCheckBox *_loggingW;
00075 TQLabel *_idleDetectLabelW, *_displayColumnsLabelW;
00076 TQSpinBox *_idleDetectValueW, *_autoSaveValueW;
00077 KURLRequester *_iCalFileW ;
00078
00079
00080 bool _doIdleDetectionV, _doAutoSaveV, _promptDeleteV, _loggingV;
00081 bool _displayColumnV[4];
00082 int _idleDetectValueV, _autoSaveValueV;
00083 TQString _iCalFileV;
00084
00086 TQString _userRealName;
00087 };
00088
00089 #endif // KARM_PREFERENCES_H
00090
|