author | zautrix <zautrix> | 2005-06-24 23:30:30 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-06-24 23:30:30 (UTC) |
commit | 184833db0d1bcb63e7d4bd5945ccdc0e6b92f7b8 (patch) (unidiff) | |
tree | 96074dff5dddd80afa2773f0bf573e0155f73293 /pwmanager | |
parent | 3dbc82b2711811450b77b85a5fd85744a61d0a2c (diff) | |
download | kdepimpi-184833db0d1bcb63e7d4bd5945ccdc0e6b92f7b8.zip kdepimpi-184833db0d1bcb63e7d4bd5945ccdc0e6b92f7b8.tar.gz kdepimpi-184833db0d1bcb63e7d4bd5945ccdc0e6b92f7b8.tar.bz2 |
sec fix
-rw-r--r-- | pwmanager/pwmanager/kcmconfigs/pwmconfigwidget.cpp | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/pwmanager/pwmanager/kcmconfigs/pwmconfigwidget.cpp b/pwmanager/pwmanager/kcmconfigs/pwmconfigwidget.cpp index c1ca536..2c5189c 100644 --- a/pwmanager/pwmanager/kcmconfigs/pwmconfigwidget.cpp +++ b/pwmanager/pwmanager/kcmconfigs/pwmconfigwidget.cpp | |||
@@ -65,294 +65,299 @@ PWMConfigWidget::PWMConfigWidget(PWMPrefs *prefs, QWidget *parent, const char *n | |||
65 | 65 | ||
66 | int i = 0; | 66 | int i = 0; |
67 | KPrefsWidRadios * windowStyle = addWidRadios(i18n("Window-style:") ,&(prefs->mMainViewStyle), windowStylePage); | 67 | KPrefsWidRadios * windowStyle = addWidRadios(i18n("Window-style:") ,&(prefs->mMainViewStyle), windowStylePage); |
68 | windowStyle->addRadio(i18n("Category on top")); | 68 | windowStyle->addRadio(i18n("Category on top")); |
69 | windowStyle->addRadio(i18n("Category-list left/top")); | 69 | windowStyle->addRadio(i18n("Category-list left/top")); |
70 | windowStyleLayout->addMultiCellWidget( (QWidget*)windowStyle->groupBox(),i,i,0,2); | 70 | windowStyleLayout->addMultiCellWidget( (QWidget*)windowStyle->groupBox(),i,i,0,2); |
71 | ++i; | 71 | ++i; |
72 | 72 | ||
73 | QLabel* lab = new QLabel(i18n("Font for Password entries:"), windowStylePage); | 73 | QLabel* lab = new QLabel(i18n("Font for Password entries:"), windowStylePage); |
74 | windowStyleLayout->addMultiCellWidget( lab,i,i,0,2); | 74 | windowStyleLayout->addMultiCellWidget( lab,i,i,0,2); |
75 | ++i; | 75 | ++i; |
76 | KPrefsWidFont *selEntrFont = | 76 | KPrefsWidFont *selEntrFont = |
77 | addWidFont(i18n("Password"),i18n("Font:"), | 77 | addWidFont(i18n("Password"),i18n("Font:"), |
78 | &(prefs->mEntryFont),windowStylePage); | 78 | &(prefs->mEntryFont),windowStylePage); |
79 | windowStyleLayout->addWidget(selEntrFont->label(),i,0); | 79 | windowStyleLayout->addWidget(selEntrFont->label(),i,0); |
80 | windowStyleLayout->addWidget(selEntrFont->preview(),i,1); | 80 | windowStyleLayout->addWidget(selEntrFont->preview(),i,1); |
81 | windowStyleLayout->addWidget(selEntrFont->button(),i,2); | 81 | windowStyleLayout->addWidget(selEntrFont->button(),i,2); |
82 | ++i; | 82 | ++i; |
83 | 83 | ||
84 | lab = new QLabel(i18n("Font for Password summary:"), windowStylePage); | 84 | lab = new QLabel(i18n("Font for Password summary:"), windowStylePage); |
85 | windowStyleLayout->addMultiCellWidget( lab,i,i,0,2); | 85 | windowStyleLayout->addMultiCellWidget( lab,i,i,0,2); |
86 | ++i; | 86 | ++i; |
87 | selEntrFont = | 87 | selEntrFont = |
88 | addWidFont(i18n("Summary"),i18n("Font:"), | 88 | addWidFont(i18n("Summary"),i18n("Font:"), |
89 | &(prefs->mViewFont),windowStylePage); | 89 | &(prefs->mViewFont),windowStylePage); |
90 | windowStyleLayout->addWidget(selEntrFont->label(),i,0); | 90 | windowStyleLayout->addWidget(selEntrFont->label(),i,0); |
91 | windowStyleLayout->addWidget(selEntrFont->preview(),i,1); | 91 | windowStyleLayout->addWidget(selEntrFont->preview(),i,1); |
92 | windowStyleLayout->addWidget(selEntrFont->button(),i,2); | 92 | windowStyleLayout->addWidget(selEntrFont->button(),i,2); |
93 | ++i; | 93 | ++i; |
94 | 94 | ||
95 | lab = new QLabel(i18n(""), windowStylePage); | 95 | lab = new QLabel(i18n(""), windowStylePage); |
96 | windowStyleLayout->addMultiCellWidget( lab,i,i,0,2); | 96 | windowStyleLayout->addMultiCellWidget( lab,i,i,0,2); |
97 | 97 | ||
98 | // File page | 98 | // File page |
99 | ////////////////////////////////////////////////////// | 99 | ////////////////////////////////////////////////////// |
100 | QWidget *filePage = new QWidget( this ); | 100 | QWidget *filePage = new QWidget( this ); |
101 | QGridLayout *fileLayout = new QGridLayout( filePage, 3, 2); | 101 | QGridLayout *fileLayout = new QGridLayout( filePage, 3, 2); |
102 | 102 | ||
103 | i = 0; | 103 | i = 0; |
104 | QLabel* kcfg_compression_label = new QLabel(i18n("Compression:"), filePage); | 104 | QLabel* kcfg_compression_label = new QLabel(i18n("Compression:"), filePage); |
105 | fileLayout->addWidget(kcfg_compression_label,i,0); | 105 | fileLayout->addWidget(kcfg_compression_label,i,0); |
106 | kcfg_compression = new QComboBox(filePage, "kcfg_compression"); | 106 | kcfg_compression = new QComboBox(filePage, "kcfg_compression"); |
107 | kcfg_compression->insertItem(i18n("None")); | 107 | kcfg_compression->insertItem(i18n("None")); |
108 | kcfg_compression->insertItem(i18n("gzip")); | 108 | kcfg_compression->insertItem(i18n("gzip")); |
109 | //US not yet supported: kcfg_compression->insertItem(i18n("bzip2")); | 109 | //US not yet supported: kcfg_compression->insertItem(i18n("bzip2")); |
110 | fileLayout->addWidget( kcfg_compression,i,1); | 110 | fileLayout->addWidget( kcfg_compression,i,1); |
111 | ++i; | 111 | ++i; |
112 | 112 | ||
113 | QLabel* kcfg_crypt_label = new QLabel(i18n("Encryption:"), filePage); | 113 | QLabel* kcfg_crypt_label = new QLabel(i18n("Encryption:"), filePage); |
114 | fileLayout->addWidget(kcfg_crypt_label,i,0); | 114 | fileLayout->addWidget(kcfg_crypt_label,i,0); |
115 | kcfg_cryptAlgo = new QComboBox(filePage, "kcfg_cryptAlgo"); | 115 | kcfg_cryptAlgo = new QComboBox(filePage, "kcfg_cryptAlgo"); |
116 | kcfg_cryptAlgo->insertItem(i18n("Blowfish (128 bit)")); | 116 | kcfg_cryptAlgo->insertItem(i18n("Blowfish (128 bit)")); |
117 | #ifdef CONFIG_PWMANAGER_GCRY | 117 | #ifdef CONFIG_PWMANAGER_GCRY |
118 | kcfg_cryptAlgo->insertItem(i18n("AES-128, Rijndael (128 bit)")); | 118 | kcfg_cryptAlgo->insertItem(i18n("AES-128, Rijndael (128 bit)")); |
119 | kcfg_cryptAlgo->insertItem(i18n("AES-192, Rijndael (192 bit)")); | 119 | kcfg_cryptAlgo->insertItem(i18n("AES-192, Rijndael (192 bit)")); |
120 | kcfg_cryptAlgo->insertItem(i18n("AES-256, Rijndael (256 bit)")); | 120 | kcfg_cryptAlgo->insertItem(i18n("AES-256, Rijndael (256 bit)")); |
121 | kcfg_cryptAlgo->insertItem(i18n("Triple-DES (168 bit)")); | 121 | kcfg_cryptAlgo->insertItem(i18n("Triple-DES (168 bit)")); |
122 | kcfg_cryptAlgo->insertItem(i18n("Twofish (256 bit)")); | 122 | kcfg_cryptAlgo->insertItem(i18n("Twofish (256 bit)")); |
123 | kcfg_cryptAlgo->insertItem(i18n("Twofish-128 (128 bit)")); | 123 | kcfg_cryptAlgo->insertItem(i18n("Twofish-128 (128 bit)")); |
124 | #endif // CONFIG_PWMANAGER_GCRY | 124 | #endif // CONFIG_PWMANAGER_GCRY |
125 | fileLayout->addWidget( kcfg_cryptAlgo,i,1); | 125 | fileLayout->addWidget( kcfg_cryptAlgo,i,1); |
126 | ++i; | 126 | ++i; |
127 | 127 | ||
128 | QLabel* kcfg_hash_label = new QLabel(i18n("Hashing:"), filePage); | 128 | QLabel* kcfg_hash_label = new QLabel(i18n("Hashing:"), filePage); |
129 | fileLayout->addWidget(kcfg_hash_label,i,0); | 129 | fileLayout->addWidget(kcfg_hash_label,i,0); |
130 | kcfg_hashAlgo = new QComboBox(filePage, "kcfg_hashAlgo"); | 130 | kcfg_hashAlgo = new QComboBox(filePage, "kcfg_hashAlgo"); |
131 | kcfg_hashAlgo->insertItem(i18n("SHA-160, SHA1 (160 bit)")); | 131 | kcfg_hashAlgo->insertItem(i18n("SHA-160, SHA1 (160 bit)")); |
132 | #ifdef CONFIG_PWMANAGER_GCRY | 132 | #ifdef CONFIG_PWMANAGER_GCRY |
133 | kcfg_hashAlgo->insertItem(i18n("SHA-256 (256 bit)")); | 133 | kcfg_hashAlgo->insertItem(i18n("SHA-256 (256 bit)")); |
134 | kcfg_hashAlgo->insertItem(i18n("SHA-384 (384 bit)")); | 134 | kcfg_hashAlgo->insertItem(i18n("SHA-384 (384 bit)")); |
135 | kcfg_hashAlgo->insertItem(i18n("SHA-512 (512 bit)")); | 135 | kcfg_hashAlgo->insertItem(i18n("SHA-512 (512 bit)")); |
136 | kcfg_hashAlgo->insertItem(i18n("MD5 (128 bit)")); | 136 | kcfg_hashAlgo->insertItem(i18n("MD5 (128 bit)")); |
137 | kcfg_hashAlgo->insertItem(i18n("RIPE-MD-160 (160 bit)")); | 137 | kcfg_hashAlgo->insertItem(i18n("RIPE-MD-160 (160 bit)")); |
138 | kcfg_hashAlgo->insertItem(i18n("Tiger (192 bit)")); | 138 | kcfg_hashAlgo->insertItem(i18n("Tiger (192 bit)")); |
139 | #endif // CONFIG_PWMANAGER_GCRY | 139 | #endif // CONFIG_PWMANAGER_GCRY |
140 | fileLayout->addWidget( kcfg_hashAlgo,i,1); | 140 | fileLayout->addWidget( kcfg_hashAlgo,i,1); |
141 | ++i; | 141 | ++i; |
142 | 142 | ||
143 | permissionLineEdit = new QLineEdit(filePage); | 143 | permissionLineEdit = new QLineEdit(filePage); |
144 | QLabel* permissionLineLabel = new QLabel(permissionLineEdit, i18n("Permissions:"), filePage); | 144 | QLabel* permissionLineLabel = new QLabel(permissionLineEdit, i18n("Permissions:"), filePage); |
145 | fileLayout->addWidget(permissionLineLabel,i,0); | 145 | fileLayout->addWidget(permissionLineLabel,i,0); |
146 | fileLayout->addWidget(permissionLineEdit,i,1); | 146 | fileLayout->addWidget(permissionLineEdit,i,1); |
147 | ++i; | 147 | ++i; |
148 | 148 | ||
149 | KPrefsWidBool *sb = addWidBool(i18n("Make backup before saving"), | 149 | KPrefsWidBool *sb = addWidBool(i18n("Make backup before saving"), |
150 | &(prefs->mMakeFileBackup),filePage); | 150 | &(prefs->mMakeFileBackup),filePage); |
151 | fileLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); | 151 | fileLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); |
152 | ++i; | 152 | ++i; |
153 | 153 | ||
154 | // Timeout page | 154 | // Timeout page |
155 | ////////////////////////////////////////////////////// | 155 | ////////////////////////////////////////////////////// |
156 | QWidget *timeoutPage = new QWidget( this ); | 156 | QWidget *timeoutPage = new QWidget( this ); |
157 | QGridLayout *timeoutLayout = new QGridLayout( timeoutPage, 3, 2); | 157 | QGridLayout *timeoutLayout = new QGridLayout( timeoutPage, 3, 2); |
158 | 158 | ||
159 | i = 0; | 159 | i = 0; |
160 | pwTimeoutSpinBox = new QSpinBox( 0,600,10,timeoutPage, "pwTimeoutSpinBox" ); | 160 | pwTimeoutSpinBox = new QSpinBox( 0,600,10,timeoutPage, "pwTimeoutSpinBox" ); |
161 | QLabel* timeoutLabel = new QLabel(pwTimeoutSpinBox, i18n("Password timeout\n(timeout to hold password in\nmemory,so you don't have to\nre-enter it,if you\nalready have entered it)\n[set to 0 to disable]:"), timeoutPage); | 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); |
162 | timeoutLayout->addMultiCellWidget(timeoutLabel,i, i, 0 ,0); | 162 | timeoutLayout->addMultiCellWidget(timeoutLabel, i, i, 0 ,1); |
163 | timeoutLayout->addWidget(pwTimeoutSpinBox,i,1); | ||
164 | ++i; | 163 | ++i; |
165 | 164 | timeoutLayout->addMultiCellWidget(pwTimeoutSpinBox,i,i,0,1); | |
165 | ++i; | ||
166 | pwTimeoutSpinBox->setSuffix ( i18n(" sec") ); | ||
166 | lockTimeoutSpinBox = new QSpinBox( 0,600,10,timeoutPage, "lockTimeoutSpinBox" ); | 167 | lockTimeoutSpinBox = new QSpinBox( 0,600,10,timeoutPage, "lockTimeoutSpinBox" ); |
167 | QLabel* lockTimeoutLabel = new QLabel(lockTimeoutSpinBox, i18n("Auto-lock timeout\n(auto lock document after this\namount of seconds)\n[set to 0 to disable]:"), timeoutPage); | 168 | QLabel* lockTimeoutLabel = new QLabel(lockTimeoutSpinBox, i18n("<b>Auto-lock timeout</b> (auto lock document after this\namount of seconds) [set to 0 to disable]:"), timeoutPage); |
168 | timeoutLayout->addMultiCellWidget(lockTimeoutLabel,i, i, 0 ,0); | 169 | timeoutLayout->addMultiCellWidget(lockTimeoutLabel,i, i, 0 ,1); |
169 | timeoutLayout->addWidget(lockTimeoutSpinBox,i,1); | 170 | ++i; |
171 | timeoutLayout->addMultiCellWidget(lockTimeoutSpinBox,i,i,0,1); | ||
172 | lockTimeoutSpinBox->setSuffix ( i18n(" sec") ); | ||
170 | ++i; | 173 | ++i; |
171 | 174 | ||
172 | sb = addWidBool(i18n("deep-lock on autolock"), | 175 | sb = addWidBool(i18n("deep-lock on autolock"), |
173 | &(prefs->mAutoDeeplock),timeoutPage); | 176 | &(prefs->mAutoDeeplock),timeoutPage); |
174 | timeoutLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); | 177 | timeoutLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); |
175 | ++i; | 178 | ++i; |
176 | 179 | sb = addWidBool(i18n("Open document with passwords unlocked"),&(prefs->mUnlockOnOpen),timeoutPage); | |
180 | timeoutLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); | ||
181 | ++i; | ||
177 | 182 | ||
178 | // Autostart page | 183 | // Autostart page |
179 | ////////////////////////////////////////////////////// | 184 | ////////////////////////////////////////////////////// |
180 | QWidget *autostartPage = new QWidget( this ); | 185 | QWidget *autostartPage = new QWidget( this ); |
181 | QGridLayout *autostartLayout = new QGridLayout( autostartPage, 3, 2); | 186 | QGridLayout *autostartLayout = new QGridLayout( autostartPage, 3, 2); |
182 | 187 | ||
183 | i = 0; | 188 | i = 0; |
184 | 189 | ||
185 | autostartLineEdit = new KURLRequester(autostartPage, "autoStartLineEdit"); | 190 | autostartLineEdit = new KURLRequester(autostartPage, "autoStartLineEdit"); |
186 | QLabel* autostartLineLabel = new QLabel(autostartLineEdit, "Open this file automatically on startup:",autostartPage); | 191 | QLabel* autostartLineLabel = new QLabel(autostartLineEdit, "Open this file automatically on startup:",autostartPage); |
187 | autostartLayout->addMultiCellWidget(autostartLineLabel,i,i,0,1); | 192 | autostartLayout->addMultiCellWidget(autostartLineLabel,i,i,0,1); |
188 | ++i; | 193 | ++i; |
189 | autostartLayout->addMultiCellWidget(autostartLineEdit,i,i,0,1); | 194 | autostartLayout->addMultiCellWidget(autostartLineEdit,i,i,0,1); |
190 | ++i; | 195 | ++i; |
191 | 196 | ||
192 | sb = addWidBool(i18n("open deeplocked"), | 197 | sb = addWidBool(i18n("open deeplocked"), |
193 | &(prefs->mAutostartDeeplocked),autostartPage); | 198 | &(prefs->mAutostartDeeplocked),autostartPage); |
194 | autostartLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); | 199 | autostartLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); |
195 | ++i; | 200 | ++i; |
196 | 201 | ||
197 | 202 | ||
198 | // external app page | 203 | // external app page |
199 | ////////////////////////////////////////////////////// | 204 | ////////////////////////////////////////////////////// |
200 | QWidget *externalappPage = new QWidget( this ); | 205 | QWidget *externalappPage = new QWidget( this ); |
201 | QGridLayout *externalappLayout = new QGridLayout( externalappPage, 3, 2); | 206 | QGridLayout *externalappLayout = new QGridLayout( externalappPage, 3, 2); |
202 | 207 | ||
203 | i = 0; | 208 | i = 0; |
204 | 209 | ||
205 | browserLineEdit = new QLineEdit(externalappPage); | 210 | browserLineEdit = new QLineEdit(externalappPage); |
206 | QLabel* browserLineLabel = new QLabel(browserLineEdit, i18n("Favourite browser:"), externalappPage); | 211 | QLabel* browserLineLabel = new QLabel(browserLineEdit, i18n("Favourite browser:"), externalappPage); |
207 | externalappLayout->addWidget(browserLineLabel,i,0); | 212 | externalappLayout->addWidget(browserLineLabel,i,0); |
208 | externalappLayout->addWidget(browserLineEdit,i,1); | 213 | externalappLayout->addWidget(browserLineEdit,i,1); |
209 | ++i; | 214 | ++i; |
210 | 215 | ||
211 | xtermLineEdit = new QLineEdit(externalappPage); | 216 | xtermLineEdit = new QLineEdit(externalappPage); |
212 | QLabel* xtermLineLabel = new QLabel(xtermLineEdit, i18n("Favourite x-terminal:"), externalappPage); | 217 | QLabel* xtermLineLabel = new QLabel(xtermLineEdit, i18n("Favourite x-terminal:"), externalappPage); |
213 | externalappLayout->addWidget(xtermLineLabel,i,0); | 218 | externalappLayout->addWidget(xtermLineLabel,i,0); |
214 | externalappLayout->addWidget(xtermLineEdit,i,1); | 219 | externalappLayout->addWidget(xtermLineEdit,i,1); |
215 | ++i; | 220 | ++i; |
216 | 221 | ||
217 | 222 | #if 0 | |
218 | // miscelaneous page | 223 | // miscelaneous page |
219 | ////////////////////////////////////////////////////// | 224 | ////////////////////////////////////////////////////// |
220 | QWidget *miscPage = new QWidget( this ); | 225 | QWidget *miscPage = new QWidget( this ); |
221 | QGridLayout *miscLayout = new QGridLayout( miscPage, 3, 2); | 226 | QGridLayout *miscLayout = new QGridLayout( miscPage, 3, 2); |
222 | 227 | ||
223 | i = 0; | 228 | i = 0; |
224 | 229 | ||
225 | /*US ENH: PWM/Pi has no tray and con be minimized | 230 | /*US ENH: PWM/Pi has no tray and con be minimized |
226 | sb = addWidBool(i18n("Show icon in system-tray"),&(prefs->mTray),miscPage); | 231 | sb = addWidBool(i18n("Show icon in system-tray"),&(prefs->mTray),miscPage); |
227 | miscLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); | 232 | miscLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); |
228 | ++i; | 233 | ++i; |
229 | */ | 234 | */ |
230 | 235 | ||
231 | sb = addWidBool(i18n("Open document with passwords unlocked"),&(prefs->mUnlockOnOpen),miscPage); | 236 | sb = addWidBool(i18n("Open document with passwords unlocked"),&(prefs->mUnlockOnOpen),miscPage); |
232 | miscLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); | 237 | miscLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); |
233 | ++i; | 238 | ++i; |
234 | 239 | ||
235 | /*US ENH: PWM/Pi has no tray and con be minimized | 240 | /*US ENH: PWM/Pi has no tray and con be minimized |
236 | sb = addWidBool(i18n("auto-minimize to tray on startup"),&(prefs->mAutoMinimizeOnStart),miscPage); | 241 | sb = addWidBool(i18n("auto-minimize to tray on startup"),&(prefs->mAutoMinimizeOnStart),miscPage); |
237 | miscLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); | 242 | miscLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); |
238 | ++i; | 243 | ++i; |
239 | 244 | ||
240 | KPrefsWidRadios * minimizeRadio = addWidRadios(i18n("auto-lock on minimize:") ,&(prefs->mMinimizeLock), miscPage); | 245 | KPrefsWidRadios * minimizeRadio = addWidRadios(i18n("auto-lock on minimize:") ,&(prefs->mMinimizeLock), miscPage); |
241 | minimizeRadio->addRadio(i18n("don't lock")); | 246 | minimizeRadio->addRadio(i18n("don't lock")); |
242 | minimizeRadio->addRadio(i18n("normal lock")); | 247 | minimizeRadio->addRadio(i18n("normal lock")); |
243 | minimizeRadio->addRadio(i18n("deep-lock")); | 248 | minimizeRadio->addRadio(i18n("deep-lock")); |
244 | miscLayout->addMultiCellWidget( (QWidget*)minimizeRadio->groupBox(),i,i,0,2); | 249 | miscLayout->addMultiCellWidget( (QWidget*)minimizeRadio->groupBox(),i,i,0,2); |
245 | ++i; | 250 | ++i; |
246 | 251 | ||
247 | sb = addWidBool(i18n("KWallet emulation"),&(prefs->mKWalletEmu),miscPage); | 252 | sb = addWidBool(i18n("KWallet emulation"),&(prefs->mKWalletEmu),miscPage); |
248 | miscLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); | 253 | miscLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); |
249 | ++i; | 254 | ++i; |
250 | 255 | ||
251 | sb = addWidBool(i18n("Close instead Minimize into tray"),&(prefs->mClose),miscPage); | 256 | sb = addWidBool(i18n("Close instead Minimize into tray"),&(prefs->mClose),miscPage); |
252 | miscLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); | 257 | miscLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); |
253 | ++i; | 258 | ++i; |
254 | */ | 259 | */ |
255 | 260 | #endif | |
256 | 261 | ||
257 | tabWidget->addTab( windowStylePage, i18n( "Look && feel" ) ); | 262 | tabWidget->addTab( windowStylePage, i18n( "Look && feel" ) ); |
258 | tabWidget->addTab( filePage, i18n( "File" ) ); | 263 | tabWidget->addTab( filePage, i18n( "File" ) ); |
259 | tabWidget->addTab( timeoutPage, i18n( "Timeout" ) ); | 264 | tabWidget->addTab( timeoutPage, i18n( "Timeout" ) ); |
260 | tabWidget->addTab( autostartPage, i18n( "Autostart" ) ); | 265 | tabWidget->addTab( autostartPage, i18n( "Autostart" ) ); |
261 | tabWidget->addTab( externalappPage, i18n( "External apps" ) ); | 266 | tabWidget->addTab( externalappPage, i18n( "External apps" ) ); |
262 | tabWidget->addTab( miscPage, i18n( "Miscellaneous" ) ); | 267 | //tabWidget->addTab( miscPage, i18n( "Miscellaneous" ) ); |
263 | 268 | ||
264 | 269 | ||
265 | connect( permissionLineEdit, SIGNAL( textChanged(const QString&) ), this, SLOT( modified() ) ); | 270 | connect( permissionLineEdit, SIGNAL( textChanged(const QString&) ), this, SLOT( modified() ) ); |
266 | connect( pwTimeoutSpinBox, SIGNAL( valueChanged(int) ), this, SLOT( modified() ) ); | 271 | connect( pwTimeoutSpinBox, SIGNAL( valueChanged(int) ), this, SLOT( modified() ) ); |
267 | connect( lockTimeoutSpinBox, SIGNAL( valueChanged(int) ), this, SLOT( modified() ) ); | 272 | connect( lockTimeoutSpinBox, SIGNAL( valueChanged(int) ), this, SLOT( modified() ) ); |
268 | connect( autostartLineEdit, SIGNAL( textChanged(const QString&) ), this, SLOT( modified() ) ); | 273 | connect( autostartLineEdit, SIGNAL( textChanged(const QString&) ), this, SLOT( modified() ) ); |
269 | connect( browserLineEdit, SIGNAL( textChanged(const QString&) ), this, SLOT( modified() ) ); | 274 | connect( browserLineEdit, SIGNAL( textChanged(const QString&) ), this, SLOT( modified() ) ); |
270 | connect( xtermLineEdit, SIGNAL( textChanged(const QString&) ), this, SLOT( modified() ) ); | 275 | connect( xtermLineEdit, SIGNAL( textChanged(const QString&) ), this, SLOT( modified() ) ); |
271 | 276 | ||
272 | } | 277 | } |
273 | 278 | ||
274 | 279 | ||
275 | void PWMConfigWidget::usrReadConfig() | 280 | void PWMConfigWidget::usrReadConfig() |
276 | { | 281 | { |
277 | PWMPrefs* prefs = PWMPrefs::instance(); | 282 | PWMPrefs* prefs = PWMPrefs::instance(); |
278 | 283 | ||
279 | 284 | ||
280 | setFilePermissions(prefs->mFilePermissions); | 285 | setFilePermissions(prefs->mFilePermissions); |
281 | 286 | ||
282 | pwTimeoutSpinBox->setValue(prefs->mPwTimeout); | 287 | pwTimeoutSpinBox->setValue(prefs->mPwTimeout); |
283 | lockTimeoutSpinBox->setValue(prefs->mLockTimeout); | 288 | lockTimeoutSpinBox->setValue(prefs->mLockTimeout); |
284 | autostartLineEdit->setURL(prefs->mAutoStart); | 289 | autostartLineEdit->setURL(prefs->mAutoStart); |
285 | browserLineEdit->setText(prefs->mBrowserCommand); | 290 | browserLineEdit->setText(prefs->mBrowserCommand); |
286 | xtermLineEdit->setText(prefs->mXTermCommand); | 291 | xtermLineEdit->setText(prefs->mXTermCommand); |
287 | 292 | ||
288 | kcfg_compression->setCurrentItem(prefs->mCompression); | 293 | kcfg_compression->setCurrentItem(prefs->mCompression); |
289 | kcfg_cryptAlgo->setCurrentItem(prefs->mCryptAlgo); | 294 | kcfg_cryptAlgo->setCurrentItem(prefs->mCryptAlgo); |
290 | kcfg_hashAlgo->setCurrentItem(prefs->mHashAlgo); | 295 | kcfg_hashAlgo->setCurrentItem(prefs->mHashAlgo); |
291 | } | 296 | } |
292 | 297 | ||
293 | void PWMConfigWidget::usrWriteConfig() | 298 | void PWMConfigWidget::usrWriteConfig() |
294 | { | 299 | { |
295 | PWMPrefs* prefs = PWMPrefs::instance(); | 300 | PWMPrefs* prefs = PWMPrefs::instance(); |
296 | 301 | ||
297 | prefs->mFilePermissions = getFilePermissions(); | 302 | prefs->mFilePermissions = getFilePermissions(); |
298 | 303 | ||
299 | prefs->mPwTimeout = pwTimeoutSpinBox->value(); | 304 | prefs->mPwTimeout = pwTimeoutSpinBox->value(); |
300 | prefs->mLockTimeout = lockTimeoutSpinBox->value(); | 305 | prefs->mLockTimeout = lockTimeoutSpinBox->value(); |
301 | prefs->mAutoStart = autostartLineEdit->url(); | 306 | prefs->mAutoStart = autostartLineEdit->url(); |
302 | 307 | ||
303 | prefs->mBrowserCommand = browserLineEdit->text(); | 308 | prefs->mBrowserCommand = browserLineEdit->text(); |
304 | prefs->mXTermCommand = xtermLineEdit->text(); | 309 | prefs->mXTermCommand = xtermLineEdit->text(); |
305 | 310 | ||
306 | prefs->mCompression = kcfg_compression->currentItem(); | 311 | prefs->mCompression = kcfg_compression->currentItem(); |
307 | prefs->mCryptAlgo = kcfg_cryptAlgo->currentItem(); | 312 | prefs->mCryptAlgo = kcfg_cryptAlgo->currentItem(); |
308 | prefs->mHashAlgo = kcfg_hashAlgo->currentItem(); | 313 | prefs->mHashAlgo = kcfg_hashAlgo->currentItem(); |
309 | 314 | ||
310 | } | 315 | } |
311 | 316 | ||
312 | int PWMConfigWidget::getFilePermissions() | 317 | int PWMConfigWidget::getFilePermissions() |
313 | { | 318 | { |
314 | char octalDigits[] = "01234567"; | 319 | char octalDigits[] = "01234567"; |
315 | bool isOctal; | 320 | bool isOctal; |
316 | QString permString(permissionLineEdit->text()); | 321 | QString permString(permissionLineEdit->text()); |
317 | int i, j, length = permString.length(); | 322 | int i, j, length = permString.length(); |
318 | if (length != 3) { | 323 | if (length != 3) { |
319 | printWarn("Wrong permission string length! Please enter " | 324 | printWarn("Wrong permission string length! Please enter " |
320 | "the string like the following example: 600"); | 325 | "the string like the following example: 600"); |
321 | return CONF_DEFAULT_FILEPERMISSIONS; | 326 | return CONF_DEFAULT_FILEPERMISSIONS; |
322 | } | 327 | } |
323 | for (i = 0; i < length; ++i) { | 328 | for (i = 0; i < length; ++i) { |
324 | isOctal = false; | 329 | isOctal = false; |
325 | for (j = 0; j < 8; ++j) { | 330 | for (j = 0; j < 8; ++j) { |
326 | if (permString.at(i) == octalDigits[j]) { | 331 | if (permString.at(i) == octalDigits[j]) { |
327 | isOctal = true; | 332 | isOctal = true; |
328 | break; | 333 | break; |
329 | } | 334 | } |
330 | } | 335 | } |
331 | if (!isOctal) { | 336 | if (!isOctal) { |
332 | printWarn("CONFIG: File-permissions: This is " | 337 | printWarn("CONFIG: File-permissions: This is " |
333 | "not an octal number "); | 338 | "not an octal number "); |
334 | return CONF_DEFAULT_FILEPERMISSIONS; | 339 | return CONF_DEFAULT_FILEPERMISSIONS; |
335 | } | 340 | } |
336 | } | 341 | } |
337 | 342 | ||
338 | int ret = strtol(permString.latin1(), 0, 8); | 343 | int ret = strtol(permString.latin1(), 0, 8); |
339 | if (ret == 0) { | 344 | if (ret == 0) { |
340 | /* either an error occured, or the user did really type 000 */ | 345 | /* either an error occured, or the user did really type 000 */ |
341 | printWarn("CONFIG: File-permissions: Hm, either conversion error, " | 346 | printWarn("CONFIG: File-permissions: Hm, either conversion error, " |
342 | "or you really typed 000. 8-)"); | 347 | "or you really typed 000. 8-)"); |
343 | return CONF_DEFAULT_FILEPERMISSIONS; | 348 | return CONF_DEFAULT_FILEPERMISSIONS; |
344 | } | 349 | } |
345 | return ret; | 350 | return ret; |
346 | } | 351 | } |
347 | 352 | ||
348 | void PWMConfigWidget::setFilePermissions(int perm) | 353 | void PWMConfigWidget::setFilePermissions(int perm) |
349 | { | 354 | { |
350 | char tmpBuf[30]; | 355 | char tmpBuf[30]; |
351 | sprintf(tmpBuf, "%o", perm); | 356 | sprintf(tmpBuf, "%o", perm); |
352 | permissionLineEdit->setText(tmpBuf); | 357 | permissionLineEdit->setText(tmpBuf); |
353 | } | 358 | } |
354 | 359 | ||
355 | 360 | ||
356 | 361 | ||
357 | #ifndef PWM_EMBEDDED | 362 | #ifndef PWM_EMBEDDED |
358 | #include "pwmconfigwidget.moc" | 363 | #include "pwmconfigwidget.moc" |