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