summaryrefslogtreecommitdiffabout
authorulf69 <ulf69>2004-10-16 01:02:53 (UTC)
committer ulf69 <ulf69>2004-10-16 01:02:53 (UTC)
commit9c82c0ed220d9efe16ea383e65f760f01492787d (patch) (side-by-side diff)
tree2aedddfad3e72de7c2c92ff216d7df2cc83fe258
parent1821dcc08c8f6f2bc0fdb991c335ed03262d1443 (diff)
downloadkdepimpi-9c82c0ed220d9efe16ea383e65f760f01492787d.zip
kdepimpi-9c82c0ed220d9efe16ea383e65f760f01492787d.tar.gz
kdepimpi-9c82c0ed220d9efe16ea383e65f760f01492787d.tar.bz2
added configsettings for crypt ans hash algo
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--pwmanager/pwmanager/kcmconfigs/pwmconfigwidget.cpp51
-rw-r--r--pwmanager/pwmanager/kcmconfigs/pwmconfigwidget.h8
2 files changed, 53 insertions, 6 deletions
diff --git a/pwmanager/pwmanager/kcmconfigs/pwmconfigwidget.cpp b/pwmanager/pwmanager/kcmconfigs/pwmconfigwidget.cpp
index 8afea76..525bdaa 100644
--- a/pwmanager/pwmanager/kcmconfigs/pwmconfigwidget.cpp
+++ b/pwmanager/pwmanager/kcmconfigs/pwmconfigwidget.cpp
@@ -72,37 +72,69 @@ PWMConfigWidget::PWMConfigWidget(PWMPrefs *prefs, QWidget *parent, const char *n
KPrefsWidFont *selEntrFont =
addWidFont(i18n("Password"),i18n("Font for Pw entries:"),
&(prefs->mEntryFont),windowStylePage);
windowStyleLayout->addWidget(selEntrFont->label(),i,0);
windowStyleLayout->addWidget(selEntrFont->preview(),i,1);
windowStyleLayout->addWidget(selEntrFont->button(),i,2);
++i;
// File page
//////////////////////////////////////////////////////
QWidget *filePage = new QWidget( this );
QGridLayout *fileLayout = new QGridLayout( filePage, 3, 2);
i = 0;
- KPrefsWidRadios * compr = addWidRadios(i18n("Compression:") ,&(prefs->mCompression), filePage);
- compr->addRadio(i18n("none"));
- compr->addRadio(i18n("gzip"));
- compr->addRadio(i18n("bzip2"));
- fileLayout->addMultiCellWidget( (QWidget*)compr->groupBox(),i,i,0,1);
+ QLabel* kcfg_compression_label = new QLabel(i18n("Compression:"), filePage);
+ fileLayout->addWidget(kcfg_compression_label,i,0);
+ kcfg_compression = new QComboBox(filePage, "kcfg_compression");
+ kcfg_compression->insertItem(i18n("None"));
+ kcfg_compression->insertItem(i18n("gzip"));
+ //US not yet supported: kcfg_compression->insertItem(i18n("bzip2"));
+ fileLayout->addWidget( kcfg_compression,i,1);
+ ++i;
+
+ QLabel* kcfg_crypt_label = new QLabel(i18n("Encryption:"), filePage);
+ fileLayout->addWidget(kcfg_crypt_label,i,0);
+ kcfg_cryptAlgo = new QComboBox(filePage, "kcfg_cryptAlgo");
+ kcfg_cryptAlgo->insertItem(i18n("Blowfish (128 bit)"));
+#ifdef CONFIG_PWMANAGER_GCRY
+ kcfg_cryptAlgo->insertItem(i18n("AES-128, Rijndael (128 bit)"));
+ kcfg_cryptAlgo->insertItem(i18n("AES-192, Rijndael (192 bit)"));
+ kcfg_cryptAlgo->insertItem(i18n("AES-256, Rijndael (256 bit)"));
+ kcfg_cryptAlgo->insertItem(i18n("Triple-DES (168 bit)"));
+ kcfg_cryptAlgo->insertItem(i18n("Twofish (256 bit)"));
+ kcfg_cryptAlgo->insertItem(i18n("Twofish-128 (128 bit)"));
+#endif // CONFIG_PWMANAGER_GCRY
+ fileLayout->addWidget( kcfg_cryptAlgo,i,1);
+ ++i;
+
+ QLabel* kcfg_hash_label = new QLabel(i18n("Hashing:"), filePage);
+ fileLayout->addWidget(kcfg_hash_label,i,0);
+ kcfg_hashAlgo = new QComboBox(filePage, "kcfg_hashAlgo");
+ kcfg_hashAlgo->insertItem(i18n("SHA-160, SHA1 (160 bit)"));
+#ifdef CONFIG_PWMANAGER_GCRY
+ kcfg_hashAlgo->insertItem(i18n("SHA-256 (256 bit)"));
+ kcfg_hashAlgo->insertItem(i18n("SHA-384 (384 bit)"));
+ kcfg_hashAlgo->insertItem(i18n("SHA-512 (512 bit)"));
+ kcfg_hashAlgo->insertItem(i18n("MD5 (128 bit)"));
+ kcfg_hashAlgo->insertItem(i18n("RIPE-MD-160 (160 bit)"));
+ kcfg_hashAlgo->insertItem(i18n("Tiger (192 bit)"));
+#endif // CONFIG_PWMANAGER_GCRY
+ fileLayout->addWidget( kcfg_hashAlgo,i,1);
++i;
permissionLineEdit = new QLineEdit(filePage);
QLabel* permissionLineLabel = new QLabel(permissionLineEdit, i18n("Permissions:"), filePage);
fileLayout->addWidget(permissionLineLabel,i,0);
fileLayout->addWidget(permissionLineEdit,i,1);
++i;
KPrefsWidBool *sb = addWidBool(i18n("Make backup before saving"),
&(prefs->mMakeFileBackup),filePage);
fileLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1);
++i;
// Timeout page
//////////////////////////////////////////////////////
QWidget *timeoutPage = new QWidget( this );
@@ -214,54 +246,63 @@ PWMConfigWidget::PWMConfigWidget(PWMPrefs *prefs, QWidget *parent, const char *n
connect( permissionLineEdit, SIGNAL( textChanged(const QString&) ), this, SLOT( modified() ) );
connect( pwTimeoutSpinBox, SIGNAL( valueChanged(int) ), this, SLOT( modified() ) );
connect( lockTimeoutSpinBox, SIGNAL( valueChanged(int) ), this, SLOT( modified() ) );
connect( autostartLineEdit, SIGNAL( textChanged(const QString&) ), this, SLOT( modified() ) );
connect( browserLineEdit, SIGNAL( textChanged(const QString&) ), this, SLOT( modified() ) );
connect( xtermLineEdit, SIGNAL( textChanged(const QString&) ), this, SLOT( modified() ) );
}
void PWMConfigWidget::usrReadConfig()
{
PWMPrefs* prefs = PWMPrefs::instance();
+
setFilePermissions(prefs->mFilePermissions);
pwTimeoutSpinBox->setValue(prefs->mPwTimeout);
lockTimeoutSpinBox->setValue(prefs->mLockTimeout);
autostartLineEdit->setURL(prefs->mAutoStart);
browserLineEdit->setText(prefs->mBrowserCommand);
xtermLineEdit->setText(prefs->mXTermCommand);
+ kcfg_compression->setCurrentItem(prefs->mCompression);
+ kcfg_cryptAlgo->setCurrentItem(prefs->mCryptAlgo);
+ kcfg_hashAlgo->setCurrentItem(prefs->mHashAlgo);
}
void PWMConfigWidget::usrWriteConfig()
{
PWMPrefs* prefs = PWMPrefs::instance();
prefs->mFilePermissions = getFilePermissions();
prefs->mPwTimeout = pwTimeoutSpinBox->value();
prefs->mLockTimeout = lockTimeoutSpinBox->value();
prefs->mAutoStart = autostartLineEdit->url();
prefs->mBrowserCommand = browserLineEdit->text();
prefs->mXTermCommand = xtermLineEdit->text();
+
+ prefs->mCompression = kcfg_compression->currentItem();
+ prefs->mCryptAlgo = kcfg_cryptAlgo->currentItem();
+ prefs->mHashAlgo = kcfg_hashAlgo->currentItem();
+
}
int PWMConfigWidget::getFilePermissions()
{
char octalDigits[] = "01234567";
bool isOctal;
QString permString(permissionLineEdit->text());
int i, j, length = permString.length();
if (length != 3) {
printWarn("Wrong permission string length! Please enter "
"the string like the following example: 600");
return CONF_DEFAULT_FILEPERMISSIONS;
}
for (i = 0; i < length; ++i) {
isOctal = false;
for (j = 0; j < 8; ++j) {
diff --git a/pwmanager/pwmanager/kcmconfigs/pwmconfigwidget.h b/pwmanager/pwmanager/kcmconfigs/pwmconfigwidget.h
index 1c7f5bf..0fad6af 100644
--- a/pwmanager/pwmanager/kcmconfigs/pwmconfigwidget.h
+++ b/pwmanager/pwmanager/kcmconfigs/pwmconfigwidget.h
@@ -17,45 +17,51 @@
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
$Id$
*/
#ifndef PWMCONFIGWIDGET_H
#define PWMCONFIGWIDGET_H
#include <kprefswidget.h>
class PWMPrefs;
class KURLRequester;
+class QComboBox;
+
class PWMConfigWidget : public KPrefsWidget
{
Q_OBJECT
public:
PWMConfigWidget(PWMPrefs *prefs, QWidget *parent, const char *name = 0 );
protected:
/** Implement this to read custom configuration widgets. */
virtual void usrReadConfig();
/** Implement this to write custom configuration widgets. */
virtual void usrWriteConfig();
private:
QLineEdit* permissionLineEdit;
QSpinBox* pwTimeoutSpinBox;
QSpinBox* lockTimeoutSpinBox;
KURLRequester* autostartLineEdit;
QLineEdit* browserLineEdit;
QLineEdit* xtermLineEdit;
-
+ QComboBox* kcfg_compression;
+ QComboBox* kcfg_cryptAlgo;
+ QComboBox* kcfg_hashAlgo;
+
+
private:
int getFilePermissions();
void setFilePermissions(int perm);
};
#endif