summaryrefslogtreecommitdiffabout
path: root/pwmanager
authorzautrix <zautrix>2004-10-25 22:23:56 (UTC)
committer zautrix <zautrix>2004-10-25 22:23:56 (UTC)
commitdbfa4de9416c28c5424eeee0f36f50de4cfae0ec (patch) (unidiff)
tree31fa0522ff7821f5b7e98123e16f12455eeb01c9 /pwmanager
parent03ca6830a9e6742b8873aee04d77b3e094b65d30 (diff)
downloadkdepimpi-dbfa4de9416c28c5424eeee0f36f50de4cfae0ec.zip
kdepimpi-dbfa4de9416c28c5424eeee0f36f50de4cfae0ec.tar.gz
kdepimpi-dbfa4de9416c28c5424eeee0f36f50de4cfae0ec.tar.bz2
pwmpi windows management fixes
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
@@ -126,7 +126,7 @@ getMasterPwWnd::getMasterPwWnd( QWidget* parent, const char* name)
126 connect( backspace, SIGNAL( clicked() ), this, SLOT( backspace() ) ); 126 connect( backspace, SIGNAL( clicked() ), this, SLOT( backspace() ) );
127 connect( clear, SIGNAL( clicked() ), this, SLOT( clear() ) ); 127 connect( clear, SIGNAL( clicked() ), this, SLOT( clear() ) );
128 128
129 129 pwLineEdit->setFocus();
130 130
131} 131}
132 132
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
148 QGridLayout *timeoutLayout = new QGridLayout( timeoutPage, 3, 2); 148 QGridLayout *timeoutLayout = new QGridLayout( timeoutPage, 3, 2);
149 149
150 i = 0; 150 i = 0;
151 pwTimeoutSpinBox = new QSpinBox( timeoutPage, "pwTimeoutSpinBox" ); 151 pwTimeoutSpinBox = new QSpinBox( 0,600,10,timeoutPage, "pwTimeoutSpinBox" );
152 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); 152 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);
153 timeoutLayout->addMultiCellWidget(timeoutLabel,i, i, 0 ,0); 153 timeoutLayout->addMultiCellWidget(timeoutLabel,i, i, 0 ,0);
154 timeoutLayout->addWidget(pwTimeoutSpinBox,i,1); 154 timeoutLayout->addWidget(pwTimeoutSpinBox,i,1);
155 ++i; 155 ++i;
156 156
157 lockTimeoutSpinBox = new QSpinBox( timeoutPage, "lockTimeoutSpinBox" ); 157 lockTimeoutSpinBox = new QSpinBox( 0,600,10,timeoutPage, "lockTimeoutSpinBox" );
158 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); 158 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);
159 timeoutLayout->addMultiCellWidget(lockTimeoutLabel,i, i, 0 ,0); 159 timeoutLayout->addMultiCellWidget(lockTimeoutLabel,i, i, 0 ,0);
160 timeoutLayout->addWidget(lockTimeoutSpinBox,i,1); 160 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,
439 BUG_ON(*bufLen % 8); 439 BUG_ON(*bufLen % 8);
440 pos = *bufLen - 1; 440 pos = *bufLen - 1;
441 while (buf[pos] != static_cast<char>(0x01)) { 441 while (buf[pos] != static_cast<char>(0x01)) {
442 qDebug("pos %d %d %d", pos, buf[pos], static_cast<char>(0x01) );
442 BUG_ON(!pos); 443 BUG_ON(!pos);
444 //LR BUG we should terminte the loop if p == 0
445 if ( pos == 0 )
446 break;
443 --pos; 447 --pos;
444 } 448 }
445 *bufLen = pos; 449 *bufLen = pos;
450 qDebug("ente ");
446} 451}
447 452
448#endif // CONFIG_PWMANAGER_GCRY 453#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[])
209 m.show(); 209 m.show();
210#endif 210#endif
211 */ 211 */
212 QObject::connect( &a, SIGNAL( lastWindowClosed()), &a, SLOT (quit()));
212 a.exec(); 213 a.exec();
213 KPimGlobalPrefs::instance()->writeConfig(); 214 KPimGlobalPrefs::instance()->writeConfig();
214 } 215 }
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,
193 193
194PwM::~PwM() 194PwM::~PwM()
195{ 195{
196 //qDebug("PwM::~PwM()"); 196 qDebug("PwM::~PwM() %x", this);
197 disconnect(curDoc(), SIGNAL(docClosed(PwMDoc *)), 197 disconnect(curDoc(), SIGNAL(docClosed(PwMDoc *)),
198 this, SLOT(docClosed(PwMDoc *))); 198 this, SLOT(docClosed(PwMDoc *)));
199 conf()->confWndMainWndSize(size()); 199 conf()->confWndMainWndSize(size());
200 emit closed(this); 200 //LR closing of windows changed
201 //needed for fastload option on PDA
202 //emit closed(this);
201 //qDebug("PwM::~PwM() emited closed(this)"); 203 //qDebug("PwM::~PwM() emited closed(this)");
202 delete view; 204 delete view;
203 delete syncManager; 205 delete syncManager;
@@ -887,11 +889,15 @@ void PwM::activateMpButton(bool activate)
887 889
888void PwM::closeEvent(QCloseEvent *e) 890void PwM::closeEvent(QCloseEvent *e)
889{ 891{
892 qDebug("PwM::closeEvent ");
893 emit closed( this );
894 return;
890 e->accept(); 895 e->accept();
891} 896}
892 897
893void PwM::docClosed(PwMDoc *doc) 898void PwM::docClosed(PwMDoc *doc)
894{ 899{
900 qDebug("PwM::docClosed ");
895 PARAM_UNUSED(doc); 901 PARAM_UNUSED(doc);
896 PWM_ASSERT(doc == curDoc()); 902 PWM_ASSERT(doc == curDoc());
897 close(); 903 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()
2977 2977
2978bool PwMDoc::tryDelete() 2978bool PwMDoc::tryDelete()
2979{ 2979{
2980
2980 if (deleted) 2981 if (deleted)
2981 return true; 2982 return true;
2982 int ret; 2983 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()
204 i18n("GPasman does not support passwords\n" 204 i18n("GPasman does not support passwords\n"
205 "shorter than 4 characters! Please try\n" 205 "shorter than 4 characters! Please try\n"
206 "again with a longer password."), 206 "again with a longer password."),
207 i18n("password too short")); 207 i18n("Password too short"));
208} 208}
209 209
210int PwMDocUi::dirtyAskSave(const QString &docTitle) 210int PwMDocUi::dirtyAskSave(const QString &docTitle)
@@ -212,25 +212,28 @@ int PwMDocUi::dirtyAskSave(const QString &docTitle)
212 int ret; 212 int ret;
213#ifndef PWM_EMBEDDED 213#ifndef PWM_EMBEDDED
214 ret = KMessageBox::questionYesNoCancel(currentView, 214 ret = KMessageBox::questionYesNoCancel(currentView,
215 i18n("The list \"") + 215 i18n("The list\n\"") +
216 docTitle + 216 docTitle +
217 i18n 217 i18n
218 ("\" has been modified.\n" 218 ("\" has been modified.\n"
219 "Do you want to save it?"), 219 "Do you want to save it?"),
220 i18n("save?")); 220 i18n("Save?"));
221 if (ret == KMessageBox::Yes) { 221 if (ret == KMessageBox::Yes) {
222 return 0; 222 return 0;
223 } else if (ret == KMessageBox::No) { 223 } else if (ret == KMessageBox::No) {
224 return 1; 224 return 1;
225 } 225 }
226#else 226#else
227 QString doc = docTitle;
228 if ( doc.length() > 33 )
229 doc = "..." + doc.right(30);
227 ret = KMessageBox::warningYesNoCancel(currentView, 230 ret = KMessageBox::warningYesNoCancel(currentView,
228 i18n("The list \"") + 231 i18n("The list\n \"") +
229 docTitle + 232 doc +
230 i18n 233 i18n
231 ("\"\nhas been modified.\n" 234 ("\"\nhas been modified.\n"
232 "Do you want to save it?"), 235 "Do you want to save it?"),
233 i18n("save?")); 236 i18n("Save?"));
234 if (ret == KMessageBox::Yes) { 237 if (ret == KMessageBox::Yes) {
235 return 0; 238 return 0;
236 } else if (ret == KMessageBox::No) { 239 } 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)
88 88
89PwMInit::~PwMInit() 89PwMInit::~PwMInit()
90{ 90{
91 qDebug("PwMInit::~PwMInit() ");
91#ifndef PWM_EMBEDDED 92#ifndef PWM_EMBEDDED
92 SelfTest::cancel(); 93 SelfTest::cancel();
93 // close all open mainwnds 94 // close all open mainwnds
@@ -179,7 +180,6 @@ void PwMInit::initializeApp()
179 0, 180 0,
180 savedCmd.minimized); 181 savedCmd.minimized);
181 } 182 }
182
183 runStatus = running; 183 runStatus = running;
184} 184}
185 185
@@ -322,10 +322,8 @@ PwM * PwMInit::createMainWnd(const QString &loadFile,
322#ifndef DESKTOP_VERSION 322#ifndef DESKTOP_VERSION
323 app->showMainWidget( newWnd ); 323 app->showMainWidget( newWnd );
324#else //DESKTOP_VERSION 324#else //DESKTOP_VERSION
325 app->setMainWidget( newWnd );
326 newWnd->resize (640, 480 ); 325 newWnd->resize (640, 480 );
327 newWnd->show(); 326 newWnd->show();
328 qDebug("show ");
329#endif //DESKTOP_VERSION 327#endif //DESKTOP_VERSION
330 328
331#endif //PWM_EMBEDDED 329#endif //PWM_EMBEDDED
@@ -391,7 +389,7 @@ again:
391 } 389 }
392 390
393 if (doMinimizeToTray) { 391 if (doMinimizeToTray) {
394 392 qDebug("doMinimizeToTray ");
395 PWM_ASSERT(_tray); 393 PWM_ASSERT(_tray);
396 int mmlock = conf()->confGlobMinimizeLock(); 394 int mmlock = conf()->confGlobMinimizeLock();
397 switch (mmlock) { 395 switch (mmlock) {
@@ -407,6 +405,7 @@ again:
407 WARN(); 405 WARN();
408 } 406 }
409 } else if (doDeleteDoc) { 407 } else if (doDeleteDoc) {
408 qDebug("doDeleteDoc ");
410 if (!wnd->curDoc()->tryDelete()) { 409 if (!wnd->curDoc()->tryDelete()) {
411 /* We failed deleting the doc, 410 /* We failed deleting the doc,
412 * so open a new window with it, again. 411 * so open a new window with it, again.
@@ -431,6 +430,16 @@ again:
431#else 430#else
432 _mainWndList.remove(i); 431 _mainWndList.remove(i);
433#endif 432#endif
433
434 if ( app->mainWidget() == wnd ) {
435 if ( _mainWndList.count() ) {
436#ifndef DESKTOP_VERSION
437 app->showMainWidget(_mainWndList.first() );
438#endif //DESKTOP_VERSION
439
440 }
441 }
442 delete wnd;
434 goto out_success; 443 goto out_success;
435 } 444 }
436 ++i; 445 ++i;