summaryrefslogtreecommitdiffabout
path: root/pwmanager
Unidiff
Diffstat (limited to 'pwmanager') (more/less context) (ignore whitespace changes)
-rw-r--r--pwmanager/pwmanager/kcmconfigs/pwmconfigwidget.cpp27
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
@@ -113,198 +113,203 @@ PWMConfigWidget::PWMConfigWidget(PWMPrefs *prefs, QWidget *parent, const char *n
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
275void PWMConfigWidget::usrReadConfig() 280void 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
293void PWMConfigWidget::usrWriteConfig() 298void 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}