File: preferences.h

package info (click to toggle)
kdeutils 4%3A2.2.2-9.2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 8,892 kB
  • ctags: 10,879
  • sloc: cpp: 82,942; sh: 11,754; ansic: 4,638; perl: 1,852; makefile: 706; python: 258
file content (70 lines) | stat: -rw-r--r-- 1,436 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#ifndef __preferences_h
#define __preferences_h

#include <kdialogbase.h>

class QCheckBox;
class QLabel;
class QSpinBox;
class QLineEdit;


class Preferences :public KDialogBase 
{
Q_OBJECT

public:
  static Preferences *instance();
  void disableIdleDetection();
  
   // Retrive information about settings
  bool detectIdleness();
  int idlenessTimeout();
  QString saveFile();
  bool autoSave();
  int autoSavePeriod();

public slots:
  void showDialog();
  void load();
  void save();
  

signals:  
  void detectIdleness(bool on);
  void idlenessTimeout(int minutes);
  void saveFile(QString);
  void autoSave(bool on);
  void autoSavePeriod(int minutes);
  void setupChanged();
  
protected slots:
  virtual void slotOk();
  virtual void slotCancel();
  void idleDetectCheckBoxChanged();
  void autoSaveCheckBoxChanged();
  
protected:
  void emitSignals();

private:
  Preferences();
  static Preferences *_instance;
  bool _unsavedChanges;

  // Widgets in the dialog (All variables ends in W to indicate that they are Widgets)
  QCheckBox *_doIdleDetectionW, *_doAutoSaveW;
  QLabel    *_idleDetectLabelW, *_autoSaveLabelW;
  QSpinBox  *_idleDetectValueW, *_autoSaveValueW;
  QLineEdit *_saveFileW;
  QVBox *idleMenu;
  
  // Values for the preferences. (All variables in in V to indicate they are Values)
  bool _doIdleDetectionV, _doAutoSaveV;
  int  _idleDetectValueV, _autoSaveValueV;
  QString _saveFileV;
  
};

#endif