-rw-r--r-- | libkdepim/kcmconfigs/kdepimconfigwidget.cpp | 41 | ||||
-rw-r--r-- | libkdepim/kcmconfigs/kdepimconfigwidget.h | 4 | ||||
-rw-r--r-- | libkdepim/kpimglobalprefs.cpp | 7 | ||||
-rw-r--r-- | libkdepim/kpimglobalprefs.h | 6 | ||||
-rw-r--r-- | libkdepim/kprefsdialog.cpp | 2 | ||||
-rw-r--r-- | libkdepim/kprefsdialog.h | 7 |
6 files changed, 60 insertions, 7 deletions
diff --git a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp index 753d90a..fbfbc45 100644 --- a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp +++ b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp | |||
@@ -22,40 +22,43 @@ | |||
22 | */ | 22 | */ |
23 | 23 | ||
24 | /* | 24 | /* |
25 | Enhanced Version of the file for platform independent KDE tools. | 25 | Enhanced Version of the file for platform independent KDE tools. |
26 | Copyright (c) 2004 Ulf Schenk | 26 | Copyright (c) 2004 Ulf Schenk |
27 | 27 | ||
28 | $Id$ | 28 | $Id$ |
29 | */ | 29 | */ |
30 | 30 | ||
31 | #include <qlayout.h> | 31 | #include <qlayout.h> |
32 | #include <qtabwidget.h> | 32 | #include <qtabwidget.h> |
33 | #include <qcombobox.h> | 33 | #include <qcombobox.h> |
34 | #include <qgroupbox.h> | 34 | #include <qgroupbox.h> |
35 | #include <qlabel.h> | 35 | #include <qlabel.h> |
36 | #include <qlineedit.h> | 36 | #include <qlineedit.h> |
37 | #include <qbuttongroup.h> | 37 | #include <qbuttongroup.h> |
38 | #include <qcheckbox.h> | ||
38 | #include <qfile.h> | 39 | #include <qfile.h> |
39 | #include <qvbox.h> | 40 | #include <qvbox.h> |
40 | #include <qdir.h> | 41 | #include <qdir.h> |
41 | #include <qregexp.h> | 42 | #include <qregexp.h> |
43 | #include <qspinbox.h> | ||
42 | 44 | ||
43 | #include <kdialog.h> | 45 | #include <kdialog.h> |
44 | #include <kprefsdialog.h> | 46 | #include <kprefsdialog.h> |
45 | #include <klocale.h> | 47 | #include <klocale.h> |
48 | #include <kglobalsettings.h> | ||
46 | #include <kdateedit.h> | 49 | #include <kdateedit.h> |
47 | #include <kglobal.h> | 50 | #include <kglobal.h> |
48 | #include <stdlib.h> | 51 | #include <stdlib.h> |
49 | 52 | ||
50 | /*US | 53 | /*US |
51 | #include <qcheckbox.h> | 54 | #include <qcheckbox.h> |
52 | #include <qframe.h> | 55 | #include <qframe.h> |
53 | #include <qpushbutton.h> | 56 | #include <qpushbutton.h> |
54 | #include <qcombobox.h> | 57 | #include <qcombobox.h> |
55 | #include <qlineedit.h> | 58 | #include <qlineedit.h> |
56 | #include <qlabel.h> | 59 | #include <qlabel.h> |
57 | #include <qfile.h> | 60 | #include <qfile.h> |
58 | 61 | ||
59 | #include <kconfig.h> | 62 | #include <kconfig.h> |
60 | #include <kdebug.h> | 63 | #include <kdebug.h> |
61 | #include <kdialog.h> | 64 | #include <kdialog.h> |
@@ -96,38 +99,74 @@ KDEPIMConfigWidget::KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent, | |||
96 | mExternalAppsMap.insert(ExternalAppHandler::PAGER, i18n("Pager")); | 99 | mExternalAppsMap.insert(ExternalAppHandler::PAGER, i18n("Pager")); |
97 | mExternalAppsMap.insert(ExternalAppHandler::SIP, i18n("SIP")); | 100 | mExternalAppsMap.insert(ExternalAppHandler::SIP, i18n("SIP")); |
98 | 101 | ||
99 | 102 | ||
100 | QVBoxLayout *topLayout = new QVBoxLayout( this, 0, | 103 | QVBoxLayout *topLayout = new QVBoxLayout( this, 0, |
101 | KDialog::spacingHint() ); | 104 | KDialog::spacingHint() ); |
102 | 105 | ||
103 | tabWidget = new QTabWidget( this ); | 106 | tabWidget = new QTabWidget( this ); |
104 | topLayout->addWidget( tabWidget ); | 107 | topLayout->addWidget( tabWidget ); |
105 | 108 | ||
106 | 109 | ||
107 | setupLocaleTab(); | 110 | setupLocaleTab(); |
108 | setupLocaleDateTab(); | 111 | setupLocaleDateTab(); |
109 | setupTimeZoneTab(); | 112 | setupTimeZoneTab(); |
110 | setupExternalAppTab(); | 113 | setupExternalAppTab(); |
111 | setupStoreTab(); | 114 | setupStoreTab(); |
112 | 115 | setupBackupTab(); | |
113 | } | 116 | } |
114 | void KDEPIMConfigWidget::showTimeZoneTab() | 117 | void KDEPIMConfigWidget::showTimeZoneTab() |
115 | { | 118 | { |
116 | tabWidget->setCurrentPage ( 3 ) ; | 119 | tabWidget->setCurrentPage ( 3 ) ; |
117 | } | 120 | } |
121 | void KDEPIMConfigWidget::setupBackupTab() | ||
122 | { | ||
123 | QVBox *colorPage = new QVBox( this ); | ||
124 | tabWidget->addTab( colorPage, i18n( "Backup" ) ); | ||
125 | QWidget* topFrame = new QWidget( colorPage ); | ||
126 | QVBoxLayout *topLayout = new QVBoxLayout(topFrame); | ||
127 | KPrefsWidBool *sb = addWidBool(i18n("Backup enabled"), | ||
128 | &(KPimGlobalPrefs::instance()->mBackupEnabled),topFrame); | ||
129 | topLayout->addWidget((QWidget*)sb->checkBox()); | ||
130 | QWidget* bupFrame = new QWidget( topFrame ); | ||
131 | topLayout->addWidget((bupFrame)); | ||
132 | QObject::connect ( sb->checkBox(), SIGNAL (toggled ( bool ) ), bupFrame, SLOT ( setEnabled( bool ) ) ); | ||
133 | QVBoxLayout *bupLayout = new QVBoxLayout(bupFrame); | ||
134 | sb = addWidBool(i18n("Use standard backup dir"), | ||
135 | &(KPimGlobalPrefs::instance()->mBackupEnabled),bupFrame); | ||
136 | bupLayout->addWidget((QWidget*)sb->checkBox()); | ||
137 | mBackupUrl = new KURLRequester( bupFrame ); | ||
138 | mBackupUrl->setURL( KGlobalSettings::backupDataDir() ); | ||
139 | QObject::connect ( sb->checkBox(), SIGNAL (toggled ( bool ) ), mBackupUrl ,SLOT ( setDisabled( bool ) ) ); | ||
140 | bupLayout->addWidget( mBackupUrl ); | ||
141 | |||
142 | |||
143 | QHBox *dummy = new QHBox(bupFrame); | ||
144 | new QLabel(i18n("Number of Backups:"),dummy); | ||
145 | mBackupNumbersSpin = new QSpinBox(1,21,1,dummy); | ||
146 | new QLabel(i18n(" "),dummy); | ||
147 | bupLayout->addWidget( dummy ); | ||
148 | |||
149 | dummy = new QHBox(bupFrame); | ||
150 | new QLabel(i18n("Make backup every "),dummy); | ||
151 | mBackupDayCountSpin = new QSpinBox(1,28,1,dummy); | ||
152 | new QLabel(i18n(" days"),dummy); | ||
153 | new QLabel(i18n(" "),dummy); | ||
154 | bupLayout->addWidget( dummy ); | ||
155 | |||
156 | } | ||
118 | void KDEPIMConfigWidget::setupStoreTab() | 157 | void KDEPIMConfigWidget::setupStoreTab() |
119 | { | 158 | { |
120 | QVBox *colorPage = new QVBox( this ); | 159 | QVBox *colorPage = new QVBox( this ); |
121 | tabWidget->addTab( colorPage, i18n( "Colors" ) ); | 160 | tabWidget->addTab( colorPage, i18n( "Colors" ) ); |
122 | QWidget* cw = new QWidget( colorPage ); | 161 | QWidget* cw = new QWidget( colorPage ); |
123 | KPrefsWidColor *holidayColor = | 162 | KPrefsWidColor *holidayColor = |
124 | addWidColor(i18n("Alternating background of list views"), | 163 | addWidColor(i18n("Alternating background of list views"), |
125 | &(KPimGlobalPrefs::instance()->mAlternateColor),cw); | 164 | &(KPimGlobalPrefs::instance()->mAlternateColor),cw); |
126 | QHBoxLayout *topLayout = new QHBoxLayout(cw); | 165 | QHBoxLayout *topLayout = new QHBoxLayout(cw); |
127 | topLayout->addWidget(holidayColor->label()); | 166 | topLayout->addWidget(holidayColor->label()); |
128 | topLayout->addWidget( (QWidget* )holidayColor->button()); | 167 | topLayout->addWidget( (QWidget* )holidayColor->button()); |
129 | 168 | ||
130 | 169 | ||
131 | QVBox *storePage = new QVBox( this ); | 170 | QVBox *storePage = new QVBox( this ); |
132 | new QLabel( i18n("Your current storage dir is:\n%1\nYour mail is stored in:\n(storagedir)/apps/kopiemail/localmail").arg(KGlobal::dirs()->localkdedir()), storePage ); | 171 | new QLabel( i18n("Your current storage dir is:\n%1\nYour mail is stored in:\n(storagedir)/apps/kopiemail/localmail").arg(KGlobal::dirs()->localkdedir()), storePage ); |
133 | new QLabel( i18n("<b>New data storage dir:</b>"), storePage ); | 172 | new QLabel( i18n("<b>New data storage dir:</b>"), storePage ); |
diff --git a/libkdepim/kcmconfigs/kdepimconfigwidget.h b/libkdepim/kcmconfigs/kdepimconfigwidget.h index 984e4e0..c0b92a9 100644 --- a/libkdepim/kcmconfigs/kdepimconfigwidget.h +++ b/libkdepim/kcmconfigs/kdepimconfigwidget.h | |||
@@ -66,32 +66,33 @@ class KDEPIMConfigWidget : public KPrefsWidget | |||
66 | private slots: | 66 | private slots: |
67 | // void configureExtension(); | 67 | // void configureExtension(); |
68 | // void selectionChanged( QListViewItem* ); | 68 | // void selectionChanged( QListViewItem* ); |
69 | // void itemClicked( QListViewItem* ); | 69 | // void itemClicked( QListViewItem* ); |
70 | void client_changed( int newClient ); | 70 | void client_changed( int newClient ); |
71 | void externalapp_changed( int newApp ); | 71 | void externalapp_changed( int newApp ); |
72 | void saveStoreSettings(); | 72 | void saveStoreSettings(); |
73 | void setStandardStore(); | 73 | void setStandardStore(); |
74 | void setLocalStore(); | 74 | void setLocalStore(); |
75 | 75 | ||
76 | private: | 76 | private: |
77 | void setupExternalAppTab(); | 77 | void setupExternalAppTab(); |
78 | void setupLocaleDateTab(); | 78 | void setupLocaleDateTab(); |
79 | void setupLocaleTab(); | 79 | void setupLocaleTab(); |
80 | void setupTimeZoneTab(); | 80 | void setupTimeZoneTab(); |
81 | void setupStoreTab(); | 81 | void setupStoreTab(); |
82 | void setupBackupTab(); | ||
82 | KURLRequester* mStoreUrl; | 83 | KURLRequester* mStoreUrl; |
83 | 84 | ||
84 | void setCombo(QComboBox *combo,const QString & text, const QStringList *tags = 0); | 85 | void setCombo(QComboBox *combo,const QString & text, const QStringList *tags = 0); |
85 | 86 | ||
86 | 87 | ||
87 | void saveEditFieldSettings(); | 88 | void saveEditFieldSettings(); |
88 | void updateClientWidgets(); | 89 | void updateClientWidgets(); |
89 | 90 | ||
90 | QTabWidget *tabWidget; | 91 | QTabWidget *tabWidget; |
91 | 92 | ||
92 | 93 | ||
93 | QLineEdit* mUserDateFormatShort; | 94 | QLineEdit* mUserDateFormatShort; |
94 | QLineEdit* mUserDateFormatLong; | 95 | QLineEdit* mUserDateFormatLong; |
95 | QComboBox* mTimeZoneCombo; | 96 | QComboBox* mTimeZoneCombo; |
96 | KDateEdit* mStartDateSavingEdit; | 97 | KDateEdit* mStartDateSavingEdit; |
97 | KDateEdit* mEndDateSavingEdit; | 98 | KDateEdit* mEndDateSavingEdit; |
@@ -139,23 +140,24 @@ class KDEPIMConfigWidget : public KPrefsWidget | |||
139 | int mSMSClient; | 140 | int mSMSClient; |
140 | QString mSMSOtherChannel; | 141 | QString mSMSOtherChannel; |
141 | QString mSMSOtherMessage; | 142 | QString mSMSOtherMessage; |
142 | QString mSMSOtherMessageParameters; | 143 | QString mSMSOtherMessageParameters; |
143 | 144 | ||
144 | int mPagerClient; | 145 | int mPagerClient; |
145 | QString mPagerOtherChannel; | 146 | QString mPagerOtherChannel; |
146 | QString mPagerOtherMessage; | 147 | QString mPagerOtherMessage; |
147 | QString mPagerOtherMessageParameters; | 148 | QString mPagerOtherMessageParameters; |
148 | 149 | ||
149 | int mSipClient; | 150 | int mSipClient; |
150 | QString mSipOtherChannel; | 151 | QString mSipOtherChannel; |
151 | QString mSipOtherMessage; | 152 | QString mSipOtherMessage; |
152 | QString mSipOtherMessageParameters; | 153 | QString mSipOtherMessageParameters; |
153 | 154 | ||
154 | 155 | ||
155 | 156 | KURLRequester* mBackupUrl; | |
157 | QSpinBox* mBackupDayCountSpin, *mBackupNumbersSpin ; | ||
156 | QMap<ExternalAppHandler::Types, QString> mExternalAppsMap; | 158 | QMap<ExternalAppHandler::Types, QString> mExternalAppsMap; |
157 | 159 | ||
158 | // AddresseeWidget *mAddresseeWidget; | 160 | // AddresseeWidget *mAddresseeWidget; |
159 | }; | 161 | }; |
160 | 162 | ||
161 | #endif | 163 | #endif |
diff --git a/libkdepim/kpimglobalprefs.cpp b/libkdepim/kpimglobalprefs.cpp index 873f0eb..90321b2 100644 --- a/libkdepim/kpimglobalprefs.cpp +++ b/libkdepim/kpimglobalprefs.cpp | |||
@@ -98,32 +98,39 @@ KPimGlobalPrefs::KPimGlobalPrefs( const QString &name ) | |||
98 | 98 | ||
99 | addItemInt( "PagerChannelType", &mPagerClient, NONE_PAC ); | 99 | addItemInt( "PagerChannelType", &mPagerClient, NONE_PAC ); |
100 | addItemString( "PagerChannel", &mPagerOtherChannel, "" ); | 100 | addItemString( "PagerChannel", &mPagerOtherChannel, "" ); |
101 | addItemString( "PagerChannelMessage", &mPagerOtherMessage, "" ); | 101 | addItemString( "PagerChannelMessage", &mPagerOtherMessage, "" ); |
102 | addItemString( "PagerChannelParameters", &mPagerOtherMessageParameters, "" ); | 102 | addItemString( "PagerChannelParameters", &mPagerOtherMessageParameters, "" ); |
103 | 103 | ||
104 | addItemInt( "SIPChannelType", &mSipClient, KPPI_SIC ); | 104 | addItemInt( "SIPChannelType", &mSipClient, KPPI_SIC ); |
105 | addItemString( "SIPChannel", &mSipOtherChannel, "" ); | 105 | addItemString( "SIPChannel", &mSipOtherChannel, "" ); |
106 | addItemString( "SIPChannelMessage", &mSipOtherMessage, "" ); | 106 | addItemString( "SIPChannelMessage", &mSipOtherMessage, "" ); |
107 | addItemString( "SIPChannelParameters", &mSipOtherMessageParameters, "" ); | 107 | addItemString( "SIPChannelParameters", &mSipOtherMessageParameters, "" ); |
108 | 108 | ||
109 | KPrefs::setCurrentGroup( "PhoneAccess" ); | 109 | KPrefs::setCurrentGroup( "PhoneAccess" ); |
110 | addItemString("Ex2PhoneDevice",&mEx2PhoneDevice,"/dev/ircomm"); | 110 | addItemString("Ex2PhoneDevice",&mEx2PhoneDevice,"/dev/ircomm"); |
111 | addItemString("Ex2PhoneConnection",&mEx2PhoneConnection,"irda"); | 111 | addItemString("Ex2PhoneConnection",&mEx2PhoneConnection,"irda"); |
112 | addItemString("Ex2PhoneModel",&mEx2PhoneModel,"6310i"); | 112 | addItemString("Ex2PhoneModel",&mEx2PhoneModel,"6310i"); |
113 | 113 | ||
114 | KPrefs::setCurrentGroup( "BackupSettings" ); | ||
115 | addItemString("BackupDatadir",&mBackupDatadir,KGlobalSettings::backupDataDir()); | ||
116 | addItemInt( "BackupNumbers", &mBackupNumbers, 3 ); | ||
117 | addItemInt( "BackupDayCount", &mBackupDayCount, 2 ); | ||
118 | addItemBool( "BackupUseDefaultDir",&mBackupUseDefaultDir, true ); | ||
119 | addItemBool( "BackupEnabled",&mBackupEnabled, false ); | ||
120 | |||
114 | } | 121 | } |
115 | 122 | ||
116 | void KPimGlobalPrefs::setGlobalConfig() | 123 | void KPimGlobalPrefs::setGlobalConfig() |
117 | { | 124 | { |
118 | if ( mLocaleDict == 0 ) { | 125 | if ( mLocaleDict == 0 ) { |
119 | QString fileName ; | 126 | QString fileName ; |
120 | QString name = KGlobal::getAppName() +"/"; | 127 | QString name = KGlobal::getAppName() +"/"; |
121 | #ifndef DESKTOP_VERSION | 128 | #ifndef DESKTOP_VERSION |
122 | fileName= QString(getenv("QPEDIR"))+"/pics/kdepim/"+name; | 129 | fileName= QString(getenv("QPEDIR"))+"/pics/kdepim/"+name; |
123 | #else | 130 | #else |
124 | fileName = qApp->applicationDirPath () + "/kdepim/"+ name; | 131 | fileName = qApp->applicationDirPath () + "/kdepim/"+ name; |
125 | #endif | 132 | #endif |
126 | mLocaleDict = 0; | 133 | mLocaleDict = 0; |
127 | if ( mPreferredLanguage > 0 && mPreferredLanguage < 5 ) { | 134 | if ( mPreferredLanguage > 0 && mPreferredLanguage < 5 ) { |
128 | 135 | ||
129 | if ( mPreferredLanguage == 1 ) | 136 | if ( mPreferredLanguage == 1 ) |
diff --git a/libkdepim/kpimglobalprefs.h b/libkdepim/kpimglobalprefs.h index 36cc25a..94ac8ae 100644 --- a/libkdepim/kpimglobalprefs.h +++ b/libkdepim/kpimglobalprefs.h | |||
@@ -127,19 +127,25 @@ class KPimGlobalPrefs : public KPrefs | |||
127 | QString mSMSOtherMessageParameters; | 127 | QString mSMSOtherMessageParameters; |
128 | 128 | ||
129 | int mPagerClient; | 129 | int mPagerClient; |
130 | QString mPagerOtherChannel; | 130 | QString mPagerOtherChannel; |
131 | QString mPagerOtherMessage; | 131 | QString mPagerOtherMessage; |
132 | QString mPagerOtherMessageParameters; | 132 | QString mPagerOtherMessageParameters; |
133 | 133 | ||
134 | int mSipClient; | 134 | int mSipClient; |
135 | QString mSipOtherChannel; | 135 | QString mSipOtherChannel; |
136 | QString mSipOtherMessage; | 136 | QString mSipOtherMessage; |
137 | QString mSipOtherMessageParameters; | 137 | QString mSipOtherMessageParameters; |
138 | 138 | ||
139 | QString mEx2PhoneDevice; | 139 | QString mEx2PhoneDevice; |
140 | QString mEx2PhoneConnection; | 140 | QString mEx2PhoneConnection; |
141 | QString mEx2PhoneModel; | 141 | QString mEx2PhoneModel; |
142 | 142 | ||
143 | |||
144 | bool mBackupEnabled; | ||
145 | QString mBackupDatadir; | ||
146 | bool mBackupUseDefaultDir; | ||
147 | int mBackupNumbers; | ||
148 | int mBackupDayCount; | ||
143 | }; | 149 | }; |
144 | 150 | ||
145 | #endif | 151 | #endif |
diff --git a/libkdepim/kprefsdialog.cpp b/libkdepim/kprefsdialog.cpp index dd9a602..b6ae775 100644 --- a/libkdepim/kprefsdialog.cpp +++ b/libkdepim/kprefsdialog.cpp | |||
@@ -267,33 +267,33 @@ QLabel *KPrefsDialogWidString::label() | |||
267 | return mLabel; | 267 | return mLabel; |
268 | } | 268 | } |
269 | 269 | ||
270 | QLineEdit *KPrefsDialogWidString::lineEdit() | 270 | QLineEdit *KPrefsDialogWidString::lineEdit() |
271 | { | 271 | { |
272 | return mEdit; | 272 | return mEdit; |
273 | } | 273 | } |
274 | 274 | ||
275 | 275 | ||
276 | KPrefsDialog::KPrefsDialog(KPrefs *prefs,QWidget *parent,char *name,bool modal) : | 276 | KPrefsDialog::KPrefsDialog(KPrefs *prefs,QWidget *parent,char *name,bool modal) : |
277 | KDialogBase(IconList,i18n("Preferences"),Ok|Cancel|Default,Ok,parent, | 277 | KDialogBase(IconList,i18n("Preferences"),Ok|Cancel|Default,Ok,parent, |
278 | name,modal,true) | 278 | name,modal,true) |
279 | { | 279 | { |
280 | mPrefs = prefs; | 280 | mPrefs = prefs; |
281 | 281 | ||
282 | // This seems to cause a crash on exit. Investigate later. | 282 | // This seems to cause a crash on exit. Investigate later. |
283 | // mPrefsWids.setAutoDelete(true); | 283 | mPrefsWids.setAutoDelete(true); |
284 | 284 | ||
285 | connect(this,SIGNAL(defaultClicked()),SLOT(slotDefault())); | 285 | connect(this,SIGNAL(defaultClicked()),SLOT(slotDefault())); |
286 | //connect(this,SIGNAL(cancelClicked()),SLOT(slotDefault())); | 286 | //connect(this,SIGNAL(cancelClicked()),SLOT(slotDefault())); |
287 | //connect(this,SIGNAL(cancelClicked()),SLOT(reject())); | 287 | //connect(this,SIGNAL(cancelClicked()),SLOT(reject())); |
288 | } | 288 | } |
289 | 289 | ||
290 | KPrefsDialog::~KPrefsDialog() | 290 | KPrefsDialog::~KPrefsDialog() |
291 | { | 291 | { |
292 | } | 292 | } |
293 | 293 | ||
294 | void KPrefsDialog::addWid(KPrefsDialogWid *wid) | 294 | void KPrefsDialog::addWid(KPrefsDialogWid *wid) |
295 | { | 295 | { |
296 | mPrefsWids.append(wid); | 296 | mPrefsWids.append(wid); |
297 | } | 297 | } |
298 | 298 | ||
299 | KPrefsDialogWidBool *KPrefsDialog::addWidBool(const QString &text,bool *reference,QWidget *parent) | 299 | KPrefsDialogWidBool *KPrefsDialog::addWidBool(const QString &text,bool *reference,QWidget *parent) |
diff --git a/libkdepim/kprefsdialog.h b/libkdepim/kprefsdialog.h index ad13b78..efcb86a 100644 --- a/libkdepim/kprefsdialog.h +++ b/libkdepim/kprefsdialog.h | |||
@@ -33,33 +33,33 @@ class KPrefs; | |||
33 | class KPrefsDialog; | 33 | class KPrefsDialog; |
34 | 34 | ||
35 | class KColorButton; | 35 | class KColorButton; |
36 | class QCheckBox; | 36 | class QCheckBox; |
37 | class QLabel; | 37 | class QLabel; |
38 | class QSpinBox; | 38 | class QSpinBox; |
39 | class QButtonGroup; | 39 | class QButtonGroup; |
40 | 40 | ||
41 | /** | 41 | /** |
42 | @short Base class for widgets used by @ref KPrefsDialog. | 42 | @short Base class for widgets used by @ref KPrefsDialog. |
43 | @author Cornelius Schumacher | 43 | @author Cornelius Schumacher |
44 | @see KPrefsDialog | 44 | @see KPrefsDialog |
45 | 45 | ||
46 | This class provides the interface for the preferences widgets used by | 46 | This class provides the interface for the preferences widgets used by |
47 | KPrefsDialog. | 47 | KPrefsDialog. |
48 | */ | 48 | */ |
49 | class KPrefsDialogWid | 49 | class KPrefsDialogWid : public QObject |
50 | { | 50 | { |
51 | public: | 51 | public: |
52 | /** | 52 | /** |
53 | This function is called to read value of the setting from the | 53 | This function is called to read value of the setting from the |
54 | stored configuration and display it in the widget. | 54 | stored configuration and display it in the widget. |
55 | */ | 55 | */ |
56 | virtual void readConfig() = 0; | 56 | virtual void readConfig() = 0; |
57 | /** | 57 | /** |
58 | This function is called to write the current setting of the widget to the | 58 | This function is called to write the current setting of the widget to the |
59 | stored configuration. | 59 | stored configuration. |
60 | */ | 60 | */ |
61 | virtual void writeConfig() = 0; | 61 | virtual void writeConfig() = 0; |
62 | }; | 62 | }; |
63 | 63 | ||
64 | /** | 64 | /** |
65 | @short Widget for bool settings in @ref KPrefsDialog. | 65 | @short Widget for bool settings in @ref KPrefsDialog. |
@@ -123,35 +123,34 @@ class KPrefsDialogWidTime : public KPrefsDialogWid | |||
123 | void readConfig(); | 123 | void readConfig(); |
124 | void writeConfig(); | 124 | void writeConfig(); |
125 | 125 | ||
126 | private: | 126 | private: |
127 | int *mReference; | 127 | int *mReference; |
128 | 128 | ||
129 | QLabel *mLabel; | 129 | QLabel *mLabel; |
130 | QSpinBox *mSpin; | 130 | QSpinBox *mSpin; |
131 | }; | 131 | }; |
132 | 132 | ||
133 | /** | 133 | /** |
134 | @short Widget for color settings in @ref KPrefsDialog. | 134 | @short Widget for color settings in @ref KPrefsDialog. |
135 | 135 | ||
136 | This class provides a widget for configuring color values. It is meant to be | 136 | This class provides a widget for configuring color values. It is meant to be |
137 | used by KPrefsDialog. The user is responsible for the layout management. | 137 | used by KPrefsDialog. The user is responsible for the layout management. |
138 | */ | 138 | */ |
139 | class KPrefsDialogWidColor : public QObject, public KPrefsDialogWid | 139 | class KPrefsDialogWidColor : public KPrefsDialogWid |
140 | { | 140 | { |
141 | Q_OBJECT | ||
142 | public: | 141 | public: |
143 | /** | 142 | /** |
144 | Create a color widget consisting of a test field and a button for opening | 143 | Create a color widget consisting of a test field and a button for opening |
145 | a color dialog. | 144 | a color dialog. |
146 | 145 | ||
147 | @param text Text of button. | 146 | @param text Text of button. |
148 | @param reference Pointer to variable read and written by this widget. | 147 | @param reference Pointer to variable read and written by this widget. |
149 | @param parent Parent widget. | 148 | @param parent Parent widget. |
150 | */ | 149 | */ |
151 | KPrefsDialogWidColor(const QString &text,QColor *reference,QWidget *parent); | 150 | KPrefsDialogWidColor(const QString &text,QColor *reference,QWidget *parent); |
152 | /** | 151 | /** |
153 | Destruct color setting widget. | 152 | Destruct color setting widget. |
154 | */ | 153 | */ |
155 | ~KPrefsDialogWidColor(); | 154 | ~KPrefsDialogWidColor(); |
156 | 155 | ||
157 | /** | 156 | /** |
@@ -166,33 +165,33 @@ class KPrefsDialogWidColor : public QObject, public KPrefsDialogWid | |||
166 | void readConfig(); | 165 | void readConfig(); |
167 | void writeConfig(); | 166 | void writeConfig(); |
168 | 167 | ||
169 | private: | 168 | private: |
170 | QColor *mReference; | 169 | QColor *mReference; |
171 | 170 | ||
172 | QLabel *mLabel; | 171 | QLabel *mLabel; |
173 | KColorButton *mButton; | 172 | KColorButton *mButton; |
174 | }; | 173 | }; |
175 | 174 | ||
176 | /** | 175 | /** |
177 | @short Widget for font settings in @ref KPrefsDialog. | 176 | @short Widget for font settings in @ref KPrefsDialog. |
178 | 177 | ||
179 | This class provides a widget for configuring font values. It is meant to be | 178 | This class provides a widget for configuring font values. It is meant to be |
180 | used by KPrefsDialog. The user is responsible for the layout management. | 179 | used by KPrefsDialog. The user is responsible for the layout management. |
181 | */ | 180 | */ |
182 | class KPrefsDialogWidFont : public QObject, public KPrefsDialogWid | 181 | class KPrefsDialogWidFont : public KPrefsDialogWid |
183 | { | 182 | { |
184 | Q_OBJECT | 183 | Q_OBJECT |
185 | public: | 184 | public: |
186 | /** | 185 | /** |
187 | Create a font widget consisting of a test field and a button for opening | 186 | Create a font widget consisting of a test field and a button for opening |
188 | a font dialog. | 187 | a font dialog. |
189 | 188 | ||
190 | @param label Text of label. | 189 | @param label Text of label. |
191 | @param reference Pointer to variable read and written by this widget. | 190 | @param reference Pointer to variable read and written by this widget. |
192 | @param parent Parent widget. | 191 | @param parent Parent widget. |
193 | */ | 192 | */ |
194 | KPrefsDialogWidFont(const QString &sampleText,const QString &labelText, | 193 | KPrefsDialogWidFont(const QString &sampleText,const QString &labelText, |
195 | QFont *reference,QWidget *parent); | 194 | QFont *reference,QWidget *parent); |
196 | /** | 195 | /** |
197 | Destruct font setting widget. | 196 | Destruct font setting widget. |
198 | */ | 197 | */ |