From dbfa4de9416c28c5424eeee0f36f50de4cfae0ec Mon Sep 17 00:00:00 2001 From: zautrix Date: Mon, 25 Oct 2004 22:23:56 +0000 Subject: pwmpi windows management fixes --- (limited to 'pwmanager') 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 @@ -126,7 +126,7 @@ getMasterPwWnd::getMasterPwWnd( QWidget* parent, const char* name) connect( backspace, SIGNAL( clicked() ), this, SLOT( backspace() ) ); connect( clear, SIGNAL( clicked() ), this, SLOT( clear() ) ); - + pwLineEdit->setFocus(); } 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 @@ -148,13 +148,13 @@ PWMConfigWidget::PWMConfigWidget(PWMPrefs *prefs, QWidget *parent, const char *n 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); 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 @@ -439,10 +439,15 @@ void LibGCryptIf::unpadData(const unsigned char *buf, BUG_ON(*bufLen % 8); pos = *bufLen - 1; while (buf[pos] != static_cast(0x01)) { + qDebug("pos %d %d %d", pos, buf[pos], static_cast(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 @@ -209,6 +209,7 @@ int main(int argc, char *argv[]) m.show(); #endif */ + QObject::connect( &a, SIGNAL( lastWindowClosed()), &a, SLOT (quit())); a.exec(); KPimGlobalPrefs::instance()->writeConfig(); } 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 @@ -193,11 +193,13 @@ PwM::PwM(PwMInit *_init, PwMDoc *doc, 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; @@ -887,11 +889,15 @@ void PwM::activateMpButton(bool 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(); 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 @@ -2977,6 +2977,7 @@ QString PwMDoc::getTitle() bool PwMDoc::tryDelete() { + if (deleted) return true; int ret; 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 @@ -204,7 +204,7 @@ void PwMDocUi::gpmPwLenErrMsgBox() 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) @@ -212,25 +212,28 @@ 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) { 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 @@ -88,6 +88,7 @@ PwMInit::PwMInit(PwMApplication *_app) PwMInit::~PwMInit() { + qDebug("PwMInit::~PwMInit() "); #ifndef PWM_EMBEDDED SelfTest::cancel(); // close all open mainwnds @@ -179,7 +180,6 @@ void PwMInit::initializeApp() 0, savedCmd.minimized); } - runStatus = running; } @@ -322,10 +322,8 @@ PwM * PwMInit::createMainWnd(const QString &loadFile, #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 @@ -391,7 +389,7 @@ again: } if (doMinimizeToTray) { - + qDebug("doMinimizeToTray "); PWM_ASSERT(_tray); int mmlock = conf()->confGlobMinimizeLock(); switch (mmlock) { @@ -407,6 +405,7 @@ again: WARN(); } } else if (doDeleteDoc) { + qDebug("doDeleteDoc "); if (!wnd->curDoc()->tryDelete()) { /* We failed deleting the doc, * so open a new window with it, again. @@ -431,6 +430,16 @@ again: #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; -- cgit v0.9.0.2