summaryrefslogtreecommitdiffabout
path: root/pwmanager
Side-by-side diff
Diffstat (limited to 'pwmanager') (more/less context) (ignore whitespace changes)
-rw-r--r--pwmanager/pwmanager/getmasterpwwnd_emb.cpp2
-rw-r--r--pwmanager/pwmanager/kcmconfigs/pwmconfigwidget.cpp4
-rw-r--r--pwmanager/pwmanager/libgcryptif.cpp5
-rw-r--r--pwmanager/pwmanager/main.cpp1
-rw-r--r--pwmanager/pwmanager/pwm.cpp10
-rw-r--r--pwmanager/pwmanager/pwmdoc.cpp1
-rw-r--r--pwmanager/pwmanager/pwmdocui.cpp15
-rw-r--r--pwmanager/pwmanager/pwminit.cpp17
8 files changed, 40 insertions, 15 deletions
diff --git a/pwmanager/pwmanager/getmasterpwwnd_emb.cpp b/pwmanager/pwmanager/getmasterpwwnd_emb.cpp
index 8404c3e..678f05f 100644
--- a/pwmanager/pwmanager/getmasterpwwnd_emb.cpp
+++ b/pwmanager/pwmanager/getmasterpwwnd_emb.cpp
@@ -121,17 +121,17 @@ getMasterPwWnd::getMasterPwWnd( QWidget* parent, const char* name)
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() ) );
-
+ pwLineEdit->setFocus();
}
/*
* Destroys the object and frees any allocated resources
*/
getMasterPwWnd::~getMasterPwWnd()
{
diff --git a/pwmanager/pwmanager/kcmconfigs/pwmconfigwidget.cpp b/pwmanager/pwmanager/kcmconfigs/pwmconfigwidget.cpp
index 26b9708..a8696ea 100644
--- a/pwmanager/pwmanager/kcmconfigs/pwmconfigwidget.cpp
+++ b/pwmanager/pwmanager/kcmconfigs/pwmconfigwidget.cpp
@@ -143,23 +143,23 @@ PWMConfigWidget::PWMConfigWidget(PWMPrefs *prefs, QWidget *parent, const char *n
++i;
// Timeout page
//////////////////////////////////////////////////////
QWidget *timeoutPage = new QWidget( this );
QGridLayout *timeoutLayout = new QGridLayout( timeoutPage, 3, 2);
i = 0;
- pwTimeoutSpinBox = new QSpinBox( timeoutPage, "pwTimeoutSpinBox" );
+ pwTimeoutSpinBox = new QSpinBox( 0,600,10,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" );
+ lockTimeoutSpinBox = new QSpinBox( 0,600,10,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);
diff --git a/pwmanager/pwmanager/libgcryptif.cpp b/pwmanager/pwmanager/libgcryptif.cpp
index eafd318..ff94bf6 100644
--- a/pwmanager/pwmanager/libgcryptif.cpp
+++ b/pwmanager/pwmanager/libgcryptif.cpp
@@ -434,16 +434,21 @@ void LibGCryptIf::padData(unsigned char *buf,
void LibGCryptIf::unpadData(const unsigned char *buf,
size_t *bufLen)
{
size_t pos;
BUG_ON(*bufLen % 8);
pos = *bufLen - 1;
while (buf[pos] != static_cast<char>(0x01)) {
+ qDebug("pos %d %d %d", pos, buf[pos], static_cast<char>(0x01) );
BUG_ON(!pos);
+ //LR BUG we should terminte the loop if p == 0
+ if ( pos == 0 )
+ break;
--pos;
}
*bufLen = pos;
+ qDebug("ente ");
}
#endif // CONFIG_PWMANAGER_GCRY
diff --git a/pwmanager/pwmanager/main.cpp b/pwmanager/pwmanager/main.cpp
index 1ca7ba8..70df15d 100644
--- a/pwmanager/pwmanager/main.cpp
+++ b/pwmanager/pwmanager/main.cpp
@@ -204,16 +204,17 @@ int main(int argc, char *argv[])
#ifndef DESKTOP_VERSION
a.showMainWidget( &m );
#else
a.setMainWidget( &m );
m.resize (640, 480 );
m.show();
#endif
*/
+ QObject::connect( &a, SIGNAL( lastWindowClosed()), &a, SLOT (quit()));
a.exec();
KPimGlobalPrefs::instance()->writeConfig();
}
qDebug("PWMPI: Bye! ");
#endif
}
diff --git a/pwmanager/pwmanager/pwm.cpp b/pwmanager/pwmanager/pwm.cpp
index 1ab2b71..2b8f2fa 100644
--- a/pwmanager/pwmanager/pwm.cpp
+++ b/pwmanager/pwmanager/pwm.cpp
@@ -188,21 +188,23 @@ PwM::PwM(PwMInit *_init, PwMDoc *doc,
view = makeNewListView(doc);
setCentralWidget(view);
updateCaption();
showStatMsg(i18n("Ready."));
}
PwM::~PwM()
{
- //qDebug("PwM::~PwM()");
+ qDebug("PwM::~PwM() %x", this);
disconnect(curDoc(), SIGNAL(docClosed(PwMDoc *)),
this, SLOT(docClosed(PwMDoc *)));
conf()->confWndMainWndSize(size());
- emit closed(this);
+ //LR closing of windows changed
+ //needed for fastload option on PDA
+ //emit closed(this);
//qDebug("PwM::~PwM() emited closed(this)");
delete view;
delete syncManager;
}
void PwM::initMenubar()
{
KIconLoader* picons;
@@ -882,21 +884,25 @@ void PwM::config_slot()
void PwM::activateMpButton(bool activate)
{
managePopup->setItemEnabled(BUTTON_POPUP_MANAGE_CHANGEMP, activate);
}
void PwM::closeEvent(QCloseEvent *e)
{
+ qDebug("PwM::closeEvent ");
+ emit closed( this );
+ return;
e->accept();
}
void PwM::docClosed(PwMDoc *doc)
{
+ qDebug("PwM::docClosed ");
PARAM_UNUSED(doc);
PWM_ASSERT(doc == curDoc());
close();
}
void PwM::find_slot()
{
PWM_ASSERT(curDoc());
diff --git a/pwmanager/pwmanager/pwmdoc.cpp b/pwmanager/pwmanager/pwmdoc.cpp
index 129bf7b..cf8690f 100644
--- a/pwmanager/pwmanager/pwmdoc.cpp
+++ b/pwmanager/pwmanager/pwmdoc.cpp
@@ -2972,16 +2972,17 @@ QString PwMDoc::getTitle()
title += " ";
title += tostr(unnamedNum).c_str();
}
return title;
}
bool PwMDoc::tryDelete()
{
+
if (deleted)
return true;
int ret;
if (isDirty()) {
ret = dirtyAskSave(getTitle());
if (ret == 0) { // save to disk
if (!saveDocUi(this))
goto out_ignore;
diff --git a/pwmanager/pwmanager/pwmdocui.cpp b/pwmanager/pwmanager/pwmdocui.cpp
index 71b4a8d..a9916c2 100644
--- a/pwmanager/pwmanager/pwmdocui.cpp
+++ b/pwmanager/pwmanager/pwmdocui.cpp
@@ -199,43 +199,46 @@ void PwMDocUi::cantDeeplock_notSavedMsgBox()
}
void PwMDocUi::gpmPwLenErrMsgBox()
{
KMessageBox::error(currentView,
i18n("GPasman does not support passwords\n"
"shorter than 4 characters! Please try\n"
"again with a longer password."),
- i18n("password too short"));
+ i18n("Password too short"));
}
int PwMDocUi::dirtyAskSave(const QString &docTitle)
{
int ret;
#ifndef PWM_EMBEDDED
ret = KMessageBox::questionYesNoCancel(currentView,
- i18n("The list \"") +
+ i18n("The list\n\"") +
docTitle +
i18n
("\" has been modified.\n"
"Do you want to save it?"),
- i18n("save?"));
+ i18n("Save?"));
if (ret == KMessageBox::Yes) {
return 0;
} else if (ret == KMessageBox::No) {
return 1;
}
#else
+ QString doc = docTitle;
+ if ( doc.length() > 33 )
+ doc = "..." + doc.right(30);
ret = KMessageBox::warningYesNoCancel(currentView,
- i18n("The list \"") +
- docTitle +
+ i18n("The list\n \"") +
+ doc +
i18n
("\"\nhas been modified.\n"
"Do you want to save it?"),
- i18n("save?"));
+ i18n("Save?"));
if (ret == KMessageBox::Yes) {
return 0;
} else if (ret == KMessageBox::No) {
return 1;
}
#endif
diff --git a/pwmanager/pwmanager/pwminit.cpp b/pwmanager/pwmanager/pwminit.cpp
index d775aa9..fbd17a7 100644
--- a/pwmanager/pwmanager/pwminit.cpp
+++ b/pwmanager/pwmanager/pwminit.cpp
@@ -83,16 +83,17 @@ PwMInit::PwMInit(PwMApplication *_app)
, _tray (0)
{
sig_init_pointer = this;
app = _app;
}
PwMInit::~PwMInit()
{
+ qDebug("PwMInit::~PwMInit() ");
#ifndef PWM_EMBEDDED
SelfTest::cancel();
// close all open mainwnds
QValueList<PwM *>::iterator i = _mainWndList.begin(),
end = _mainWndList.end();
#else
// close all open mainwnds
@@ -174,17 +175,16 @@ void PwMInit::initializeApp()
// }
} else {
createMainWnd(conf()->confGlobAutoStart(),
openDeeplocked,
true,
0,
savedCmd.minimized);
}
-
runStatus = running;
}
void PwMInit::shutdownApp(int exitStatus)
{
printDebug(string("PwMInit::shutdownApp(")
+ tostr(exitStatus) + ") called.");
PWM_ASSERT((runStatus == running) || (runStatus == init));
@@ -317,20 +317,18 @@ PwM * PwMInit::createMainWnd(const QString &loadFile,
else
newWnd->show();
#else //PWM_EMBEDDED
#ifndef DESKTOP_VERSION
app->showMainWidget( newWnd );
#else //DESKTOP_VERSION
- app->setMainWidget( newWnd );
newWnd->resize (640, 480 );
newWnd->show();
- qDebug("show ");
#endif //DESKTOP_VERSION
#endif //PWM_EMBEDDED
if (loadFile != QString::null &&
loadFile != "") {
newWnd->openDoc(loadFile, loadFileDeepLocked);
}
@@ -386,32 +384,33 @@ again:
else
doMinimizeToTray = true;
} else {
doDeleteDoc = true;
}
}
if (doMinimizeToTray) {
-
+ qDebug("doMinimizeToTray ");
PWM_ASSERT(_tray);
int mmlock = conf()->confGlobMinimizeLock();
switch (mmlock) {
case 0: // don't lock anything
break;
case 1: // normal lock
wnd->curDoc()->lockAll(true);
break;
case 2: // deep-lock
wnd->curDoc()->deepLock();
break;
default:
WARN();
}
} else if (doDeleteDoc) {
+ qDebug("doDeleteDoc ");
if (!wnd->curDoc()->tryDelete()) {
/* We failed deleting the doc,
* so open a new window with it, again.
*/
createMainWnd(QString::null, false,
false, wnd->curDoc());
}
}
@@ -426,16 +425,26 @@ again:
#endif
while (i != end) {
if (*i == wnd) {
#ifndef PWM_EMBEDDED
_mainWndList.erase(i);
#else
_mainWndList.remove(i);
#endif
+
+ if ( app->mainWidget() == wnd ) {
+ if ( _mainWndList.count() ) {
+#ifndef DESKTOP_VERSION
+ app->showMainWidget(_mainWndList.first() );
+#endif //DESKTOP_VERSION
+
+ }
+ }
+ delete wnd;
goto out_success;
}
++i;
}
BUG();
out_success:
#ifndef PWM_EMBEDDED
if (!_mainWndList.size())