summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--pwmanager/pwmanager/findwnd_emb.cpp6
-rw-r--r--pwmanager/pwmanager/getmasterpwwnd_emb.cpp2
-rw-r--r--pwmanager/pwmanager/kcmconfigs/pwmconfigwidget.cpp11
-rw-r--r--pwmanager/pwmanager/main.cpp7
-rw-r--r--pwmanager/pwmanager/pwmviewstyle_0.cpp4
-rw-r--r--pwmanager/pwmanager/pwmviewstyle_1.cpp4
6 files changed, 21 insertions, 13 deletions
diff --git a/pwmanager/pwmanager/findwnd_emb.cpp b/pwmanager/pwmanager/findwnd_emb.cpp
index 6db2684..6dcabe8 100644
--- a/pwmanager/pwmanager/findwnd_emb.cpp
+++ b/pwmanager/pwmanager/findwnd_emb.cpp
@@ -1,123 +1,123 @@
/*
This file is part of PwManager/Platform independent.
Copyright (c) 2004 Ulf Schenk
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
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$
*/
#include "findwnd_emb.h"
#include <klocale.h>
#include <qcheckbox.h>
#include <qbuttongroup.h>
#include <qradiobutton.h>
#include <qlayout.h>
#include <klineedit.h>
#include <qlabel.h>
/*
#include <qvariant.h>
#include <qlabel.h>
#include <qlineedit.h>
#include <qpushbutton.h>
#include <qcheckbox.h>
#include <qbuttongroup.h>
#include <qradiobutton.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>
*/
/*
* Constructs a findWnd as a child of 'parent', with the
* name 'name'.
*/
findWnd::findWnd( QWidget* parent, const char* name )
: KDialogBase( KDialogBase::Plain, i18n( "Find" ),
KDialogBase::Ok | KDialogBase::Cancel,
KDialogBase::Ok, parent, name, true )
{
QWidget *page = plainPage();
QVBoxLayout *layout = new QVBoxLayout( page );
layout->setMargin( KDialogBase::marginHint() );
layout->setSpacing( KDialogBase::spacingHint() );
exactCheckBox = new QCheckBox( i18n( "&Exact match" ), page );
layout->addWidget( exactCheckBox );
caseSensCheckBox = new QCheckBox( i18n( "&Case sensitive" ), page );
layout->addWidget( caseSensCheckBox );
QButtonGroup* buttonGroup1 = new QButtonGroup(1, Qt::Horizontal, i18n( "Search in Column" ), page );
layout->addWidget( buttonGroup1 );
descRadioButton = new QRadioButton( i18n( "&Description" ), buttonGroup1 );
pwRadioButton = new QRadioButton( i18n( "&Password" ), buttonGroup1 );
commentRadioButton = new QRadioButton( i18n( "C&omment" ), buttonGroup1 );
nameRadioButton = new QRadioButton( i18n( "&Username" ), buttonGroup1 );
urlRadioButton = new QRadioButton( i18n( "U&RL" ), buttonGroup1 );
launcherRadioButton = new QRadioButton( i18n( "&Launcher" ), buttonGroup1 );
descRadioButton->setChecked( TRUE );
findLineEdit = new KLineEdit( page );
- QLabel* label = new QLabel( findLineEdit, i18n( "Find:" ), page );
- layout->addWidget( label );
+ // QLabel* label = new QLabel( findLineEdit, i18n( "Find:" ), page );
+ //layout->addWidget( label );
layout->addWidget( findLineEdit );
setButtonText( KDialogBase::Ok, "&Find" );
setButtonText( KDialogBase::Cancel, "&Close" );
- // resize( QSize(200, 150) );
+ resize( sizeHint() );
connect( buttonGroup1, SIGNAL( clicked(int) ), this, SLOT( selectionChanged_slot() ) );
connect( findLineEdit, SIGNAL( textChanged(const QString&) ), this, SLOT( selectionChanged_slot() ) );
connect( caseSensCheckBox, SIGNAL( stateChanged(int) ), this, SLOT( selectionChanged_slot() ) );
connect( exactCheckBox, SIGNAL( stateChanged(int) ), this, SLOT( selectionChanged_slot() ) );
}
/*
* Destroys the object and frees any allocated resources
*/
findWnd::~findWnd()
{
// no need to delete child widgets, Qt does it all for us
}
void findWnd::findButton_slot()
{
qWarning( "findWnd::findButton_slot(): Not implemented yet" );
}
void findWnd::selectionChanged_slot()
{
qWarning( "findWnd::selectionChanged_slot(): Not implemented yet" );
}
void findWnd::closeButton_slot()
{
qWarning( "findWnd::closeButton_slot(): Not implemented yet" );
}
diff --git a/pwmanager/pwmanager/getmasterpwwnd_emb.cpp b/pwmanager/pwmanager/getmasterpwwnd_emb.cpp
index ff4c28a..7f4ccef 100644
--- a/pwmanager/pwmanager/getmasterpwwnd_emb.cpp
+++ b/pwmanager/pwmanager/getmasterpwwnd_emb.cpp
@@ -1,196 +1,196 @@
/*
This file is part of PwManager/Platform independent.
Copyright (c) 2004 Ulf Schenk
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
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$
*/
#include "getmasterpwwnd_emb.h"
#include "klocale.h"
/*
#include <qvariant.h>
#include <qpushbutton.h>
#include <qlabel.h>
#include <qlineedit.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>
*/
#include <qwidget.h>
#include <qlayout.h>
#include <qlabel.h>
#include <qlineedit.h>
#include <qpushbutton.h>
/*
* Constructs a getMasterPwWnd as a child of 'parent', with the
* name 'name'
*/
getMasterPwWnd::getMasterPwWnd( QWidget* parent, const char* name)
: KDialogBase( KDialogBase::Plain, i18n( "Master-password" ),
KDialogBase::Ok | KDialogBase::Cancel,
KDialogBase::Ok, parent, name, true )
{
QWidget *page = plainPage();
QVBoxLayout *pageLayout = new QVBoxLayout( page );
pwLineEdit = new QLineEdit( page, "pwLineEdit" );
pwLineEdit->setEchoMode( QLineEdit::Password );
QLabel* textLabel1 = new QLabel( pwLineEdit, i18n("Please enter the master-password:"), page, "textLabel1" );
textLabel1->setAlignment( int( QLabel::WordBreak | QLabel::AlignCenter ) );
pageLayout->addWidget(textLabel1);
pageLayout->addWidget(pwLineEdit);
QWidget* numberBox = new QWidget( page );
numberBox->setFixedHeight(100);
numberBox->setFixedWidth(100);
QGridLayout* numberLayout = new QGridLayout( numberBox, 4, 3 );
numberLayout->setMargin( 0 );
numberLayout->setSpacing( 0 );
QPushButton* p1 = new QPushButton( i18n("1"), numberBox );
numberLayout->addWidget( p1, 0, 0 );
QPushButton* p2 = new QPushButton( i18n("2"), numberBox );
numberLayout->addWidget( p2, 0, 1 );
QPushButton* p3 = new QPushButton( i18n("3"), numberBox );
numberLayout->addWidget( p3, 0, 2 );
QPushButton* p4 = new QPushButton( i18n("4"), numberBox );
numberLayout->addWidget( p4, 1, 0 );
QPushButton* p5 = new QPushButton( i18n("5"), numberBox );
numberLayout->addWidget( p5, 1, 1 );
QPushButton* p6 = new QPushButton( i18n("6"), numberBox );
numberLayout->addWidget( p6, 1, 2 );
QPushButton* p7 = new QPushButton( i18n("7"), numberBox );
numberLayout->addWidget( p7, 2, 0 );
QPushButton* p8 = new QPushButton( i18n("8"), numberBox );
numberLayout->addWidget( p8, 2, 1 );
QPushButton* p9 = new QPushButton( i18n("9"), numberBox );
numberLayout->addWidget( p9, 2, 2 );
QPushButton* clear = new QPushButton( i18n("x"), numberBox );
numberLayout->addWidget( clear, 3, 0 );
QPushButton* p0 = new QPushButton( i18n("0"), numberBox );
numberLayout->addWidget( p0, 3, 1 );
QPushButton* backspace = new QPushButton( i18n("-"), numberBox );
numberLayout->addWidget( backspace, 3, 2 );
pageLayout->addWidget(numberBox);
- resize( QSize(200, 180) );
+ resize( 200,sizeHint().height() );
connect( p0, SIGNAL( clicked() ), this, SLOT( add0() ) );
connect( p1, SIGNAL( clicked() ), this, SLOT( add1() ) );
connect( p2, SIGNAL( clicked() ), this, SLOT( add2() ) );
connect( p3, SIGNAL( clicked() ), this, SLOT( add3() ) );
connect( p4, SIGNAL( clicked() ), this, SLOT( add4() ) );
connect( p5, SIGNAL( clicked() ), this, SLOT( add5() ) );
connect( p6, SIGNAL( clicked() ), this, SLOT( add6() ) );
connect( p7, SIGNAL( clicked() ), this, SLOT( add7() ) );
connect( p8, SIGNAL( clicked() ), this, SLOT( add8() ) );
connect( p9, SIGNAL( clicked() ), this, SLOT( add9() ) );
connect( backspace, SIGNAL( clicked() ), this, SLOT( backspace() ) );
connect( clear, SIGNAL( clicked() ), this, SLOT( clear() ) );
}
/*
* Destroys the object and frees any allocated resources
*/
getMasterPwWnd::~getMasterPwWnd()
{
// no need to delete child widgets, Qt does it all for us
}
void getMasterPwWnd::okButton_slot()
{
qWarning( "getMasterPwWnd::okButton_slot(): Not implemented yet" );
}
void getMasterPwWnd::cancelButton_slot()
{
qWarning( "getMasterPwWnd::cancelButton_slot(): Not implemented yet" );
}
void getMasterPwWnd::add0()
{
addCharacter("0");
}
void getMasterPwWnd::add1()
{
addCharacter("1");
}
void getMasterPwWnd::add2()
{
addCharacter("2");
}
void getMasterPwWnd::add3()
{
addCharacter("3");
}
void getMasterPwWnd::add4()
{
addCharacter("4");
}
void getMasterPwWnd::add5()
{
addCharacter("5");
}
void getMasterPwWnd::add6()
{
addCharacter("6");
}
void getMasterPwWnd::add7()
{
addCharacter("7");
}
void getMasterPwWnd::add8()
{
addCharacter("8");
}
void getMasterPwWnd::add9()
{
addCharacter("9");
}
void getMasterPwWnd::backspace()
{
QString old = pwLineEdit->text();
old.truncate(old.length()-1);
pwLineEdit->setText(old);
}
void getMasterPwWnd::clear()
{
pwLineEdit->setText("");
}
void getMasterPwWnd::addCharacter(const QString& s)
{
QString old = pwLineEdit->text();
pwLineEdit->setText(old + s);
}
diff --git a/pwmanager/pwmanager/kcmconfigs/pwmconfigwidget.cpp b/pwmanager/pwmanager/kcmconfigs/pwmconfigwidget.cpp
index 525bdaa..720dfcc 100644
--- a/pwmanager/pwmanager/kcmconfigs/pwmconfigwidget.cpp
+++ b/pwmanager/pwmanager/kcmconfigs/pwmconfigwidget.cpp
@@ -1,336 +1,343 @@
/*
This file is part of KAddressBook.
Copyright (c) 2003 Tobias Koenig <tokoe@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
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.
*/
#include <qcheckbox.h>
#include <qframe.h>
#include <qgroupbox.h>
#include <qlayout.h>
#include <qpushbutton.h>
#include <qtabwidget.h>
#include <qcombobox.h>
#include <qlineedit.h>
#include <qspinbox.h>
#include <qlabel.h>
#include <qfile.h>
#include <qvbox.h>
#include <kconfig.h>
#include <kdebug.h>
#include <kdialog.h>
#include <klistview.h>
#include <klocale.h>
#include <kglobal.h>
#include <kmessagebox.h>
#include <kstandarddirs.h>
#include <kio/kfile/kurlrequester.h>
#include "pwmprefs.h"
#include "pwmconfigwidget.h"
#include "pwmexception.h"
PWMConfigWidget::PWMConfigWidget(PWMPrefs *prefs, QWidget *parent, const char *name )
: KPrefsWidget(prefs, parent, name )
{
QVBoxLayout *topLayout = new QVBoxLayout( this, 0,
KDialog::spacingHint() );
QTabWidget *tabWidget = new QTabWidget( this );
topLayout->addWidget( tabWidget );
// windowsStyle page
//////////////////////////////////////////////////////
QWidget *windowStylePage = new QWidget( this );
QGridLayout *windowStyleLayout = new QGridLayout( windowStylePage, 3, 3);
int i = 0;
KPrefsWidRadios * windowStyle = addWidRadios(i18n("Window-style:") ,&(prefs->mMainViewStyle), windowStylePage);
windowStyle->addRadio(i18n("Category on top"));
windowStyle->addRadio(i18n("Category-list left/top"));
windowStyleLayout->addMultiCellWidget( (QWidget*)windowStyle->groupBox(),i,i,0,2);
++i;
+
+ QLabel* lab = new QLabel(i18n("<b>Font for Password entries:</b>"), windowStylePage);
+ windowStyleLayout->addMultiCellWidget( lab,i,i,0,2);
+
+ ++i;
+
KPrefsWidFont *selEntrFont =
- addWidFont(i18n("Password"),i18n("Font for Pw entries:"),
+ addWidFont(i18n("Password"),i18n("Font:"),
&(prefs->mEntryFont),windowStylePage);
windowStyleLayout->addWidget(selEntrFont->label(),i,0);
windowStyleLayout->addWidget(selEntrFont->preview(),i,1);
windowStyleLayout->addWidget(selEntrFont->button(),i,2);
++i;
-
+ lab = new QLabel(i18n(""), windowStylePage);
+ windowStyleLayout->addMultiCellWidget( lab,i,i,0,2);
// File page
//////////////////////////////////////////////////////
QWidget *filePage = new QWidget( this );
QGridLayout *fileLayout = new QGridLayout( filePage, 3, 2);
i = 0;
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 );
QGridLayout *timeoutLayout = new QGridLayout( timeoutPage, 3, 2);
i = 0;
pwTimeoutSpinBox = new QSpinBox( timeoutPage, "pwTimeoutSpinBox" );
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);
timeoutLayout->addMultiCellWidget(timeoutLabel,i, i, 0 ,0);
timeoutLayout->addWidget(pwTimeoutSpinBox,i,1);
++i;
lockTimeoutSpinBox = new QSpinBox( timeoutPage, "lockTimeoutSpinBox" );
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);
timeoutLayout->addMultiCellWidget(lockTimeoutLabel,i, i, 0 ,0);
timeoutLayout->addWidget(lockTimeoutSpinBox,i,1);
++i;
sb = addWidBool(i18n("deep-lock on autolock"),
&(prefs->mAutoDeeplock),timeoutPage);
timeoutLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1);
++i;
// Autostart page
//////////////////////////////////////////////////////
QWidget *autostartPage = new QWidget( this );
QGridLayout *autostartLayout = new QGridLayout( autostartPage, 3, 2);
i = 0;
autostartLineEdit = new KURLRequester(autostartPage, "autoStartLineEdit");
QLabel* autostartLineLabel = new QLabel(autostartLineEdit, "Open this file automatically on startup:",autostartPage);
autostartLayout->addMultiCellWidget(autostartLineLabel,i,i,0,1);
++i;
autostartLayout->addMultiCellWidget(autostartLineEdit,i,i,0,1);
++i;
sb = addWidBool(i18n("open deeplocked"),
&(prefs->mAutostartDeeplocked),autostartPage);
autostartLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1);
++i;
// external app page
//////////////////////////////////////////////////////
QWidget *externalappPage = new QWidget( this );
QGridLayout *externalappLayout = new QGridLayout( externalappPage, 3, 2);
i = 0;
browserLineEdit = new QLineEdit(externalappPage);
QLabel* browserLineLabel = new QLabel(browserLineEdit, i18n("Favourite browser:"), externalappPage);
externalappLayout->addWidget(browserLineLabel,i,0);
externalappLayout->addWidget(browserLineEdit,i,1);
++i;
xtermLineEdit = new QLineEdit(externalappPage);
QLabel* xtermLineLabel = new QLabel(xtermLineEdit, i18n("Favourite x-terminal:"), externalappPage);
externalappLayout->addWidget(xtermLineLabel,i,0);
externalappLayout->addWidget(xtermLineEdit,i,1);
++i;
// miscelaneous page
//////////////////////////////////////////////////////
QWidget *miscPage = new QWidget( this );
QGridLayout *miscLayout = new QGridLayout( miscPage, 3, 2);
i = 0;
sb = addWidBool(i18n("Show icon in system-tray"),&(prefs->mTray),miscPage);
miscLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1);
++i;
sb = addWidBool(i18n("Open document with passwords unlocked"),&(prefs->mUnlockOnOpen),miscPage);
miscLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1);
++i;
sb = addWidBool(i18n("auto-minimize to tray on startup"),&(prefs->mAutoMinimizeOnStart),miscPage);
miscLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1);
sb->checkBox()->setEnabled (FALSE);
++i;
KPrefsWidRadios * minimizeRadio = addWidRadios(i18n("auto-lock on minimize:") ,&(prefs->mMinimizeLock), miscPage);
minimizeRadio->addRadio(i18n("don't lock"));
minimizeRadio->addRadio(i18n("normal lock"));
minimizeRadio->addRadio(i18n("deep-lock"));
miscLayout->addMultiCellWidget( (QWidget*)minimizeRadio->groupBox(),i,i,0,2);
++i;
sb = addWidBool(i18n("KWallet emulation"),&(prefs->mKWalletEmu),miscPage);
miscLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1);
++i;
sb = addWidBool(i18n("Close instead Minimize into tray"),&(prefs->mClose),miscPage);
miscLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1);
++i;
tabWidget->addTab( windowStylePage, i18n( "Look && feel" ) );
tabWidget->addTab( filePage, i18n( "File" ) );
tabWidget->addTab( timeoutPage, i18n( "Timeout" ) );
tabWidget->addTab( autostartPage, i18n( "Autostart" ) );
tabWidget->addTab( externalappPage, i18n( "External apps" ) );
tabWidget->addTab( miscPage, i18n( "Miscellaneous" ) );
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) {
if (permString.at(i) == octalDigits[j]) {
isOctal = true;
break;
}
}
if (!isOctal) {
printWarn("CONFIG: File-permissions: This is "
"not an octal number ");
return CONF_DEFAULT_FILEPERMISSIONS;
}
}
int ret = strtol(permString.latin1(), 0, 8);
if (ret == 0) {
/* either an error occured, or the user did really type 000 */
printWarn("CONFIG: File-permissions: Hm, either conversion error, "
"or you really typed 000. 8-)");
return CONF_DEFAULT_FILEPERMISSIONS;
}
return ret;
}
void PWMConfigWidget::setFilePermissions(int perm)
{
char tmpBuf[30];
sprintf(tmpBuf, "%o", perm);
permissionLineEdit->setText(tmpBuf);
}
diff --git a/pwmanager/pwmanager/main.cpp b/pwmanager/pwmanager/main.cpp
index 3ae4d55..3f2d055 100644
--- a/pwmanager/pwmanager/main.cpp
+++ b/pwmanager/pwmanager/main.cpp
@@ -1,212 +1,213 @@
/***************************************************************************
* *
* copyright (C) 2003, 2004 by Michael Buesch *
* email: mbuesch@freenet.de *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License version 2 *
* as published by the Free Software Foundation. *
* *
***************************************************************************/
/***************************************************************************
* copyright (C) 2004 by Ulf Schenk
* This file is originaly based on version 1.0.1 of pwmanager
* and was modified to run on embedded devices that run microkde
*
* $Id$
**************************************************************************/
#ifndef PWM_EMBEDDED
#include <kcmdlineargs.h>
#include <kaboutdata.h>
#else
#include <qdir.h>
#include <kpimglobalprefs.h>
#endif
#include <klocale.h>
#include <kstandarddirs.h>
#include "pwmexception.h"
#include "pwminit.h"
#define LICENSE_FILE (::locate("data", "pwmanager/pwmanager_license_text"))
int PwMApplication::newInstance()
{
static bool initial = true;
if (initial) {
initial = false;
init = new PwMInit(this);
init->initializeApp();
} else {
BUG_ON(!init);
printInfo("passing parameters to old instance.");
init->handleCmdLineArgs(false);
}
return EXIT_SUCCESS;
}
static const char *description = I18N_NOOP("PwManager\n"
"The convenient way of managing passwords");
#ifndef PWM_EMBEDDED
static KCmdLineOptions options[] =
{
{ "minimized", I18N_NOOP("Windows minimized"), 0 },
{ "mintray", I18N_NOOP("Windows minimized to tray"), 0 },
{ "open-deeplocked", I18N_NOOP("Open all \"files\" deeplocked"), 0 },
{ "skip-self-test", I18N_NOOP("Don't run a self-test on startup"), 0 },
{ "+[files...]", I18N_NOOP("Files to open on startup"), 0 },
{ 0, 0, 0 }
};
#endif
#ifdef PWM_DEBUG
static void printDebugConfigureInfo()
{
cout << "================================" << endl;
cout << PROG_NAME " version " PACKAGE_VER << endl;
#ifdef CONFIG_KEYCARD
cout << "CONFIG_KEYCARD: enabled" << endl;
#else
cout << "CONFIG_KEYCARD: disabled" << endl;
#endif
#ifdef CONFIG_KWALLETIF
cout << "CONFIG_KWALLETIF: enabled" << endl;
#else
cout << "CONFIG_KWALLETIF: disabled" << endl;
#endif
#ifdef BIG_ENDIAN_HOST
cout << "Endianess: big-endian" << endl;
#else
cout << "Endianess: little-endian" << endl;
#endif
cout << "sizeof(long): " << sizeof(long) << endl;
cout << "================================" << endl;
}
#else // PWM_DEBUG
static inline void printDebugConfigureInfo() { /* nothing */ }
#endif // PWM_DEBUG
#ifndef PWM_EMBEDDED
static void addAuthors(KAboutData *aboutData)
{
aboutData->addAuthor("Michael Buesch",
I18N_NOOP(
"main programming and current maintainer"),
"mbuesch@freenet.de");
aboutData->addAuthor("Matt Scifo",
I18N_NOOP(
"original implementaion of \n"
"\"categories\" and the password-tree \n"
"in the system-tray. Original implementations of \n"
"numerous view-improvements."),
"mscifo@o1.com");
aboutData->addCredit("Elias Probst",
I18N_NOOP(
"Gentoo ebuild maintainer."),
"elias.probst@gmx.de");
aboutData->addCredit("George Staikos",
I18N_NOOP("KWallet"),
"staikos@kde.org");
aboutData->addCredit("Matthew Palmer",
I18N_NOOP("rc2 code"),
"mjp16@uow.edu.au");
aboutData->addCredit("Olivier Sessink",
I18N_NOOP("gpasman"),
"gpasman@nl.linux.org");
aboutData->addCredit("The libgcrypt developers",
I18N_NOOP("Blowfish and SHA1 algorithms"),
0, "ftp://ftp.gnupg.org/gcrypt/alpha/libgcrypt/");
aboutData->addCredit("Troy Engel",
I18N_NOOP("kpasman"),
"tengel@sonic.net");
aboutData->addCredit("Wickey",
I18N_NOOP("graphics-design in older versions."),
"wickey@gmx.at");
aboutData->addCredit("Ian MacGregor",
I18N_NOOP(
"original documentation author."));
}
#endif
int main(int argc, char *argv[])
{
printDebugConfigureInfo();
#ifndef PWM_EMBEDDED
KAboutData aboutData(PACKAGE_NAME, PROG_NAME,
PACKAGE_VER, description, KAboutData::License_File,
"(c) 2003, 2004 Michael Buesch and the PwManager Team", 0,
"http://passwordmanager.sourceforge.net/",
"mbuesch@freenet.de");
addAuthors(&aboutData);
KCmdLineArgs::init(argc, argv, &aboutData);
KCmdLineArgs::addCmdLineOptions(options);
KUniqueApplication::addCmdLineOptions();
if (!KUniqueApplication::start()) {
printInfo("already running.");
return EXIT_SUCCESS;
}
PwMApplication a;
aboutData.setLicenseTextFile(LICENSE_FILE);
return a.exec();
#else
bool exitHelp = false;
if ( argc > 1 ) {
QString command = argv[1];
if ( command == "-help" ){
printf("PWM/PI command line commands:\n");
printf(" no command: Start PWM/PI in usual way\n");
printf(" -help: This output\n");
printf(" PWM/PI is exiting now. Bye!\n");
exitHelp = true;
}
}
if ( ! exitHelp ) {
PwMApplication a(argc, argv);
KGlobal::setAppName( "pwmanager" );
#ifndef DESKTOP_VERSION
- //US if ( QApplication::desktop()->width() > 320 )
- //US KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/pwmanager/icons22/");
- //US else
+ //qDebug("width %d ",QApplication::desktop()->width() );
+ if ( QApplication::desktop()->width() > 320 )
+ KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/pwmanager/icons22/");
+ else
KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/pwmanager/icons16/");
#else
QString fileName ;
fileName = qApp->applicationDirPath () + "/kdepim/pwmanager/icons22/";
KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName));
QApplication::addLibraryPath ( qApp->applicationDirPath () );
#endif
KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "pwmanager")));
KPimGlobalPrefs::instance()->setGlobalConfig();
a.newInstance();
//US KAddressBookMain m ;
//US QObject::connect(&a, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & )));
/*US
#ifndef DESKTOP_VERSION
a.showMainWidget( &m );
#else
a.setMainWidget( &m );
m.resize (640, 480 );
m.show();
#endif
*/
a.exec();
}
qDebug("PWMPI: Bye! ");
#endif
}
diff --git a/pwmanager/pwmanager/pwmviewstyle_0.cpp b/pwmanager/pwmanager/pwmviewstyle_0.cpp
index 7262684..1453d03 100644
--- a/pwmanager/pwmanager/pwmviewstyle_0.cpp
+++ b/pwmanager/pwmanager/pwmviewstyle_0.cpp
@@ -1,112 +1,112 @@
/***************************************************************************
* *
* copyright (C) 2004 by Michael Buesch *
* email: mbuesch@freenet.de *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License version 2 *
* as published by the Free Software Foundation. *
* *
***************************************************************************/
/***************************************************************************
* copyright (C) 2004 by Ulf Schenk
* This file is originaly based on version 1.0.1 of pwmanager
* and was modified to run on embedded devices that run microkde
*
* $Id$
**************************************************************************/
#include "pwmviewstyle_0.h"
#include "pwmview.h"
#include "listviewpwm.h"
#include "commentbox.h"
#include <klocale.h>
#include "pwmprefs.h"
PwMViewStyle_0::PwMViewStyle_0(PwMView *view)
: QObject()
{
vbox1 = new QVBox(view);
vbox1->setSpacing(3);
hbox1 = new QHBox(vbox1);
- hbox1->setSpacing(10);
+ hbox1->setSpacing(3);
categoriesTitle = new QLabel(hbox1);
categoriesTitle->setText(i18n("Categories:"));
categoriesCombo = new QComboBox(hbox1);
renCatButton = new QPushButton(i18n("&Rename"), hbox1);
delCatButton = new QPushButton(i18n("&Delete"), hbox1);
#ifndef PWM_EMBEDDED
splitter1 = new QSplitter(vbox1);
splitter1->setOrientation(Qt::Vertical);
#else
splitter1 = new KDGanttMinimizeSplitter( Qt::Vertical, vbox1);
- splitter1->setMinimizeDirection ( KDGanttMinimizeSplitter::Up );
+ splitter1->setMinimizeDirection ( KDGanttMinimizeSplitter::Down );
//US topLayout->addWidget(mMiniSplitter );
#endif
lv = new ListViewPwM(splitter1);
commentBox = new CommentBox(splitter1);
// set sizes and styles
commentBox->resize(commentBox->size().width(), 60);
categoriesTitle->setAlignment(Qt::AlignVCenter | Qt::AlignRight);
// connections
connect(categoriesCombo, SIGNAL(activated(int)),
view, SLOT(shiftToView()));
connect(renCatButton, SIGNAL(clicked()),
view, SLOT(renCatButton_slot()));
connect(delCatButton, SIGNAL(clicked()),
view, SLOT(delCatButton_slot()));
}
PwMViewStyle_0::~PwMViewStyle_0()
{
delete vbox1;
}
void PwMViewStyle_0::delCategory(const QString &cat)
{
PWM_ASSERT(categoriesCombo);
int i, count = categoriesCombo->count();
for (i = 0; i < count; ++i) {
if (categoriesCombo->text(i) == cat) {
categoriesCombo->removeItem(i);
return;
}
}
BUG();
}
void PwMViewStyle_0::selectCategory(const QString &cat)
{
PWM_ASSERT(categoriesCombo);
int i, count = categoriesCombo->count();
for (i = 0; i < count; ++i) {
if (categoriesCombo->text(i) == cat) {
categoriesCombo->setCurrentItem(i);
return;
}
}
// fall back to 0
categoriesCombo->setCurrentItem(0);
}
//US ENH: I need a place to load the view dependend settings. Eg. splittersize
void PwMViewStyle_0::restoreSettings(PWMPrefs* prefs)
{
//load and store the size of the listviewcolumns
lv->restoreLayout(prefs->getConfig(), "listview");
splitter1->setSizes( prefs->mCommentSplitter );
}
//US ENH: I need a place to load the view dependend settings. Eg. splittersize
void PwMViewStyle_0::saveSettings(PWMPrefs* prefs)
{
//store the size of the listviewcolumns
lv->saveLayout(prefs->getConfig(), "listview");
prefs->mCommentSplitter = splitter1->sizes();
}
diff --git a/pwmanager/pwmanager/pwmviewstyle_1.cpp b/pwmanager/pwmanager/pwmviewstyle_1.cpp
index 374c698..a85cece 100644
--- a/pwmanager/pwmanager/pwmviewstyle_1.cpp
+++ b/pwmanager/pwmanager/pwmviewstyle_1.cpp
@@ -1,152 +1,152 @@
/***************************************************************************
* *
* copyright (C) 2004 by Michael Buesch *
* email: mbuesch@freenet.de *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License version 2 *
* as published by the Free Software Foundation. *
* *
***************************************************************************/
/***************************************************************************
* copyright (C) 2004 by Ulf Schenk
* This file is originaly based on version 1.0.1 of pwmanager
* and was modified to run on embedded devices that run microkde
*
* $Id$
**************************************************************************/
#include "pwmviewstyle_1.h"
#include "pwmview.h"
#include "listviewpwm.h"
#include "commentbox.h"
#include <klocale.h>
#include "pwmprefs.h"
#define INITIAL_CATEGORIES_WIDTH 100
PwMViewStyle_1::PwMViewStyle_1(PwMView *view)
: QObject()
{
#ifndef PWM_EMBEDDED
splitter = new QSplitter(view);
#else
splitter = new KDGanttMinimizeSplitter( Qt::Horizontal, view);
- splitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right );
+ splitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Left );
//US topLayout->addWidget(mMiniSplitter );
#endif
vbox1 = new QVBox(splitter);
categoriesTitle = new QLabel(vbox1);
categoriesList = new QListBox(vbox1);
#ifndef PWM_EMBEDDED
splitter2 = new QSplitter(splitter);
splitter2->setOrientation(Qt::Vertical);
#else
splitter2 = new KDGanttMinimizeSplitter( Qt::Vertical, splitter);
- splitter2->setMinimizeDirection ( KDGanttMinimizeSplitter::Right );
+ splitter2->setMinimizeDirection ( KDGanttMinimizeSplitter::Down );
//US topLayout->addWidget(mMiniSplitter );
#endif
lv = new ListViewPwM(splitter2);
commentBox = new CommentBox(splitter2);
// set sizes and styles
//US commentBox->resize(commentBox->size().width(), 60);
QValueList<int> sizes;
#ifndef PWM_EMBEDDED
sizes.push_back(INITIAL_CATEGORIES_WIDTH);
sizes.push_back(view->height() - INITIAL_CATEGORIES_WIDTH);
#else
sizes.append(INITIAL_CATEGORIES_WIDTH);
sizes.append(view->height() - INITIAL_CATEGORIES_WIDTH);
#endif
//US splitter->setSizes(sizes);
categoriesTitle->setAlignment(Qt::AlignHCenter);
#ifndef PWM_EMBEDDED
categoriesTitle->setFrameShape(QFrame::MenuBarPanel);
#else
categoriesTitle->setFrameShape(QFrame::StyledPanel);
#endif
categoriesTitle->setText(i18n("Categories:"));
catCtxMenu = new QPopupMenu(view);
catCtxMenu->insertItem(i18n("&Rename"),
view, SLOT(renCatButton_slot()));
catCtxMenu->insertItem(i18n("&Delete"),
view, SLOT(delCatButton_slot()));
// connections
connect(categoriesList, SIGNAL(highlighted(int)),
view, SLOT(shiftToView()));
connect(categoriesList,
SIGNAL(rightButtonClicked(QListBoxItem *, const QPoint &)),
this,
SLOT(catRightClick(QListBoxItem *, const QPoint &)));
}
PwMViewStyle_1::~PwMViewStyle_1()
{
delete catCtxMenu;
delete splitter;
}
void PwMViewStyle_1::catRightClick(QListBoxItem *item, const QPoint &point)
{
if (!item)
return;
catCtxMenu->move(point);
catCtxMenu->show();
}
void PwMViewStyle_1::delCategory(const QString &cat)
{
PWM_ASSERT(categoriesList);
int i, count = categoriesList->count();
for (i = 0; i < count; ++i) {
if (categoriesList->text(i) == cat) {
categoriesList->removeItem(i);
return;
}
}
BUG();
}
void PwMViewStyle_1::selectCategory(const QString &cat)
{
PWM_ASSERT(categoriesList);
int i, count = categoriesList->count();
for (i = 0; i < count; ++i) {
if (categoriesList->text(i) == cat) {
categoriesList->setCurrentItem(i);
return;
}
}
// fall back to 0
categoriesList->setCurrentItem(0);
}
//US ENH: I need a place to load the view dependend settings. Eg. splittersize
void PwMViewStyle_1::restoreSettings(PWMPrefs* prefs)
{
//load and store the size of the listviewcolumns
lv->restoreLayout(prefs->getConfig(), "listview");
splitter->setSizes( prefs->mCategorySplitter );
splitter2->setSizes( prefs->mCommentSplitter );
}
//US ENH: I need a place to load the view dependend settings. Eg. splittersize
void PwMViewStyle_1::saveSettings(PWMPrefs* prefs)
{
//store the size of the listviewcolumns
lv->saveLayout(prefs->getConfig(), "listview");
prefs->mCategorySplitter = splitter->sizes();
prefs->mCommentSplitter = splitter2->sizes();
}
#ifndef PWM_EMBEDDED
#include "pwmviewstyle_1.moc"
#endif