Diffstat (limited to 'pwmanager/pwmanager/kcmconfigs/pwmconfigwidget.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | pwmanager/pwmanager/kcmconfigs/pwmconfigwidget.cpp | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/pwmanager/pwmanager/kcmconfigs/pwmconfigwidget.cpp b/pwmanager/pwmanager/kcmconfigs/pwmconfigwidget.cpp index 2c5189c..04771b3 100644 --- a/pwmanager/pwmanager/kcmconfigs/pwmconfigwidget.cpp +++ b/pwmanager/pwmanager/kcmconfigs/pwmconfigwidget.cpp | |||
@@ -17,27 +17,30 @@ | |||
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | 18 | ||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <qcheckbox.h> | 24 | #include <qcheckbox.h> |
25 | #include <qframe.h> | 25 | #include <q3frame.h> |
26 | #include <qgroupbox.h> | 26 | #include <q3groupbox.h> |
27 | #include <qlayout.h> | 27 | #include <qlayout.h> |
28 | #include <qpushbutton.h> | 28 | #include <qpushbutton.h> |
29 | #include <qtabwidget.h> | 29 | #include <qtabwidget.h> |
30 | #include <qcombobox.h> | 30 | #include <qcombobox.h> |
31 | #include <qlineedit.h> | 31 | #include <qlineedit.h> |
32 | #include <qspinbox.h> | 32 | #include <qspinbox.h> |
33 | #include <qlabel.h> | 33 | #include <qlabel.h> |
34 | #include <qfile.h> | 34 | #include <qfile.h> |
35 | #include <qvbox.h> | 35 | #include <q3vbox.h> |
36 | //Added by qt3to4: | ||
37 | #include <Q3GridLayout> | ||
38 | #include <Q3VBoxLayout> | ||
36 | 39 | ||
37 | #include <kconfig.h> | 40 | #include <kconfig.h> |
38 | #include <kdebug.h> | 41 | #include <kdebug.h> |
39 | #include <kdialog.h> | 42 | #include <kdialog.h> |
40 | #include <klistview.h> | 43 | #include <klistview.h> |
41 | #include <klocale.h> | 44 | #include <klocale.h> |
42 | #include <kglobal.h> | 45 | #include <kglobal.h> |
43 | #include <kmessagebox.h> | 46 | #include <kmessagebox.h> |
@@ -47,26 +50,26 @@ | |||
47 | #include "pwmprefs.h" | 50 | #include "pwmprefs.h" |
48 | 51 | ||
49 | #include "pwmconfigwidget.h" | 52 | #include "pwmconfigwidget.h" |
50 | #include "pwmexception.h" | 53 | #include "pwmexception.h" |
51 | 54 | ||
52 | PWMConfigWidget::PWMConfigWidget(PWMPrefs *prefs, QWidget *parent, const char *name ) | 55 | PWMConfigWidget::PWMConfigWidget(PWMPrefs *prefs, QWidget *parent, const char *name ) |
53 | : KPrefsWidget(prefs, parent, name ) | 56 | : KPrefsWidget(prefs, parent, name ) |
54 | { | 57 | { |
55 | QVBoxLayout *topLayout = new QVBoxLayout( this, 0, | 58 | Q3VBoxLayout *topLayout = new Q3VBoxLayout( this, 0, |
56 | KDialog::spacingHint() ); | 59 | KDialog::spacingHint() ); |
57 | 60 | ||
58 | QTabWidget *tabWidget = new QTabWidget( this ); | 61 | QTabWidget *tabWidget = new QTabWidget( this ); |
59 | topLayout->addWidget( tabWidget ); | 62 | topLayout->addWidget( tabWidget ); |
60 | 63 | ||
61 | // windowsStyle page | 64 | // windowsStyle page |
62 | ////////////////////////////////////////////////////// | 65 | ////////////////////////////////////////////////////// |
63 | QWidget *windowStylePage = new QWidget( this ); | 66 | QWidget *windowStylePage = new QWidget( this ); |
64 | QGridLayout *windowStyleLayout = new QGridLayout( windowStylePage, 3, 3); | 67 | Q3GridLayout *windowStyleLayout = new Q3GridLayout( windowStylePage, 3, 3); |
65 | 68 | ||
66 | int i = 0; | 69 | int i = 0; |
67 | KPrefsWidRadios * windowStyle = addWidRadios(i18n("Window-style:") ,&(prefs->mMainViewStyle), windowStylePage); | 70 | KPrefsWidRadios * windowStyle = addWidRadios(i18n("Window-style:") ,&(prefs->mMainViewStyle), windowStylePage); |
68 | windowStyle->addRadio(i18n("Category on top")); | 71 | windowStyle->addRadio(i18n("Category on top")); |
69 | windowStyle->addRadio(i18n("Category-list left/top")); | 72 | windowStyle->addRadio(i18n("Category-list left/top")); |
70 | windowStyleLayout->addMultiCellWidget( (QWidget*)windowStyle->groupBox(),i,i,0,2); | 73 | windowStyleLayout->addMultiCellWidget( (QWidget*)windowStyle->groupBox(),i,i,0,2); |
71 | ++i; | 74 | ++i; |
72 | 75 | ||
@@ -93,17 +96,17 @@ PWMConfigWidget::PWMConfigWidget(PWMPrefs *prefs, QWidget *parent, const char *n | |||
93 | ++i; | 96 | ++i; |
94 | 97 | ||
95 | lab = new QLabel(i18n(""), windowStylePage); | 98 | lab = new QLabel(i18n(""), windowStylePage); |
96 | windowStyleLayout->addMultiCellWidget( lab,i,i,0,2); | 99 | windowStyleLayout->addMultiCellWidget( lab,i,i,0,2); |
97 | 100 | ||
98 | // File page | 101 | // File page |
99 | ////////////////////////////////////////////////////// | 102 | ////////////////////////////////////////////////////// |
100 | QWidget *filePage = new QWidget( this ); | 103 | QWidget *filePage = new QWidget( this ); |
101 | QGridLayout *fileLayout = new QGridLayout( filePage, 3, 2); | 104 | Q3GridLayout *fileLayout = new Q3GridLayout( filePage, 3, 2); |
102 | 105 | ||
103 | i = 0; | 106 | i = 0; |
104 | QLabel* kcfg_compression_label = new QLabel(i18n("Compression:"), filePage); | 107 | QLabel* kcfg_compression_label = new QLabel(i18n("Compression:"), filePage); |
105 | fileLayout->addWidget(kcfg_compression_label,i,0); | 108 | fileLayout->addWidget(kcfg_compression_label,i,0); |
106 | kcfg_compression = new QComboBox(filePage, "kcfg_compression"); | 109 | kcfg_compression = new QComboBox(filePage, "kcfg_compression"); |
107 | kcfg_compression->insertItem(i18n("None")); | 110 | kcfg_compression->insertItem(i18n("None")); |
108 | kcfg_compression->insertItem(i18n("gzip")); | 111 | kcfg_compression->insertItem(i18n("gzip")); |
109 | //US not yet supported: kcfg_compression->insertItem(i18n("bzip2")); | 112 | //US not yet supported: kcfg_compression->insertItem(i18n("bzip2")); |
@@ -149,17 +152,17 @@ PWMConfigWidget::PWMConfigWidget(PWMPrefs *prefs, QWidget *parent, const char *n | |||
149 | KPrefsWidBool *sb = addWidBool(i18n("Make backup before saving"), | 152 | KPrefsWidBool *sb = addWidBool(i18n("Make backup before saving"), |
150 | &(prefs->mMakeFileBackup),filePage); | 153 | &(prefs->mMakeFileBackup),filePage); |
151 | fileLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); | 154 | fileLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); |
152 | ++i; | 155 | ++i; |
153 | 156 | ||
154 | // Timeout page | 157 | // Timeout page |
155 | ////////////////////////////////////////////////////// | 158 | ////////////////////////////////////////////////////// |
156 | QWidget *timeoutPage = new QWidget( this ); | 159 | QWidget *timeoutPage = new QWidget( this ); |
157 | QGridLayout *timeoutLayout = new QGridLayout( timeoutPage, 3, 2); | 160 | Q3GridLayout *timeoutLayout = new Q3GridLayout( timeoutPage, 3, 2); |
158 | 161 | ||
159 | i = 0; | 162 | i = 0; |
160 | pwTimeoutSpinBox = new QSpinBox( 0,600,10,timeoutPage, "pwTimeoutSpinBox" ); | 163 | pwTimeoutSpinBox = new QSpinBox( 0,600,10,timeoutPage, "pwTimeoutSpinBox" ); |
161 | QLabel* timeoutLabel = new QLabel(pwTimeoutSpinBox, i18n("<b>Password timeout</b> (timeout to hold password in memory,so you don't have to re-enter it,if you already have entered it) [set to 0 to disable]:"), timeoutPage); | 164 | QLabel* timeoutLabel = new QLabel(pwTimeoutSpinBox, i18n("<b>Password timeout</b> (timeout to hold password in memory,so you don't have to re-enter it,if you already have entered it) [set to 0 to disable]:"), timeoutPage); |
162 | timeoutLayout->addMultiCellWidget(timeoutLabel, i, i, 0 ,1); | 165 | timeoutLayout->addMultiCellWidget(timeoutLabel, i, i, 0 ,1); |
163 | ++i; | 166 | ++i; |
164 | timeoutLayout->addMultiCellWidget(pwTimeoutSpinBox,i,i,0,1); | 167 | timeoutLayout->addMultiCellWidget(pwTimeoutSpinBox,i,i,0,1); |
165 | ++i; | 168 | ++i; |
@@ -178,17 +181,17 @@ PWMConfigWidget::PWMConfigWidget(PWMPrefs *prefs, QWidget *parent, const char *n | |||
178 | ++i; | 181 | ++i; |
179 | sb = addWidBool(i18n("Open document with passwords unlocked"),&(prefs->mUnlockOnOpen),timeoutPage); | 182 | sb = addWidBool(i18n("Open document with passwords unlocked"),&(prefs->mUnlockOnOpen),timeoutPage); |
180 | timeoutLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); | 183 | timeoutLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); |
181 | ++i; | 184 | ++i; |
182 | 185 | ||
183 | // Autostart page | 186 | // Autostart page |
184 | ////////////////////////////////////////////////////// | 187 | ////////////////////////////////////////////////////// |
185 | QWidget *autostartPage = new QWidget( this ); | 188 | QWidget *autostartPage = new QWidget( this ); |
186 | QGridLayout *autostartLayout = new QGridLayout( autostartPage, 3, 2); | 189 | Q3GridLayout *autostartLayout = new Q3GridLayout( autostartPage, 3, 2); |
187 | 190 | ||
188 | i = 0; | 191 | i = 0; |
189 | 192 | ||
190 | autostartLineEdit = new KURLRequester(autostartPage, "autoStartLineEdit"); | 193 | autostartLineEdit = new KURLRequester(autostartPage, "autoStartLineEdit"); |
191 | QLabel* autostartLineLabel = new QLabel(autostartLineEdit, "Open this file automatically on startup:",autostartPage); | 194 | QLabel* autostartLineLabel = new QLabel(autostartLineEdit, "Open this file automatically on startup:",autostartPage); |
192 | autostartLayout->addMultiCellWidget(autostartLineLabel,i,i,0,1); | 195 | autostartLayout->addMultiCellWidget(autostartLineLabel,i,i,0,1); |
193 | ++i; | 196 | ++i; |
194 | autostartLayout->addMultiCellWidget(autostartLineEdit,i,i,0,1); | 197 | autostartLayout->addMultiCellWidget(autostartLineEdit,i,i,0,1); |
@@ -198,17 +201,17 @@ PWMConfigWidget::PWMConfigWidget(PWMPrefs *prefs, QWidget *parent, const char *n | |||
198 | &(prefs->mAutostartDeeplocked),autostartPage); | 201 | &(prefs->mAutostartDeeplocked),autostartPage); |
199 | autostartLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); | 202 | autostartLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); |
200 | ++i; | 203 | ++i; |
201 | 204 | ||
202 | 205 | ||
203 | // external app page | 206 | // external app page |
204 | ////////////////////////////////////////////////////// | 207 | ////////////////////////////////////////////////////// |
205 | QWidget *externalappPage = new QWidget( this ); | 208 | QWidget *externalappPage = new QWidget( this ); |
206 | QGridLayout *externalappLayout = new QGridLayout( externalappPage, 3, 2); | 209 | Q3GridLayout *externalappLayout = new Q3GridLayout( externalappPage, 3, 2); |
207 | 210 | ||
208 | i = 0; | 211 | i = 0; |
209 | 212 | ||
210 | browserLineEdit = new QLineEdit(externalappPage); | 213 | browserLineEdit = new QLineEdit(externalappPage); |
211 | QLabel* browserLineLabel = new QLabel(browserLineEdit, i18n("Favourite browser:"), externalappPage); | 214 | QLabel* browserLineLabel = new QLabel(browserLineEdit, i18n("Favourite browser:"), externalappPage); |
212 | externalappLayout->addWidget(browserLineLabel,i,0); | 215 | externalappLayout->addWidget(browserLineLabel,i,0); |
213 | externalappLayout->addWidget(browserLineEdit,i,1); | 216 | externalappLayout->addWidget(browserLineEdit,i,1); |
214 | ++i; | 217 | ++i; |
@@ -218,17 +221,17 @@ PWMConfigWidget::PWMConfigWidget(PWMPrefs *prefs, QWidget *parent, const char *n | |||
218 | externalappLayout->addWidget(xtermLineLabel,i,0); | 221 | externalappLayout->addWidget(xtermLineLabel,i,0); |
219 | externalappLayout->addWidget(xtermLineEdit,i,1); | 222 | externalappLayout->addWidget(xtermLineEdit,i,1); |
220 | ++i; | 223 | ++i; |
221 | 224 | ||
222 | #if 0 | 225 | #if 0 |
223 | // miscelaneous page | 226 | // miscelaneous page |
224 | ////////////////////////////////////////////////////// | 227 | ////////////////////////////////////////////////////// |
225 | QWidget *miscPage = new QWidget( this ); | 228 | QWidget *miscPage = new QWidget( this ); |
226 | QGridLayout *miscLayout = new QGridLayout( miscPage, 3, 2); | 229 | Q3GridLayout *miscLayout = new Q3GridLayout( miscPage, 3, 2); |
227 | 230 | ||
228 | i = 0; | 231 | i = 0; |
229 | 232 | ||
230 | /*US ENH: PWM/Pi has no tray and con be minimized | 233 | /*US ENH: PWM/Pi has no tray and con be minimized |
231 | sb = addWidBool(i18n("Show icon in system-tray"),&(prefs->mTray),miscPage); | 234 | sb = addWidBool(i18n("Show icon in system-tray"),&(prefs->mTray),miscPage); |
232 | miscLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); | 235 | miscLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); |
233 | ++i; | 236 | ++i; |
234 | */ | 237 | */ |
@@ -354,12 +357,12 @@ void PWMConfigWidget::setFilePermissions(int perm) | |||
354 | { | 357 | { |
355 | char tmpBuf[30]; | 358 | char tmpBuf[30]; |
356 | sprintf(tmpBuf, "%o", perm); | 359 | sprintf(tmpBuf, "%o", perm); |
357 | permissionLineEdit->setText(tmpBuf); | 360 | permissionLineEdit->setText(tmpBuf); |
358 | } | 361 | } |
359 | 362 | ||
360 | 363 | ||
361 | 364 | ||
362 | #ifndef PWM_EMBEDDED | 365 | #ifndef PWM_EMBEDDED_ |
363 | #include "pwmconfigwidget.moc" | 366 | #include "moc_pwmconfigwidget.cpp" |
364 | #endif //PWM_EMBEDDED | 367 | #endif //PWM_EMBEDDED |
365 | 368 | ||