[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdeutils/kwallet
From:       George Staikos <staikos () kde ! org>
Date:       2004-11-12 11:26:53
Message-ID: 20041112112653.18DAB16C5F () office ! kde ! org
[Download RAW message or body]

CVS commit by staikos: 

fix some weird little buglets with creating new wallets and cancelling part
way through


  M +9 -1      kwalleteditor.cpp   1.52
  M +3 -0      kwalleteditor.h   1.20
  M +9 -2      kwalletmanager.cpp   1.51
  M +1 -0      kwalletmanager.h   1.20


--- kdeutils/kwallet/kwalleteditor.cpp  #1.51:1.52
@@ -59,4 +59,5 @@
 KWalletEditor::KWalletEditor(const QString& wallet, bool isPath, QWidget *parent, const char *name)
 : KMainWindow(parent, name), _walletName(wallet), _nonLocal(isPath) {
+        _newWallet = false;
         _ww = new WalletWidget(this, "Wallet Widget");
         QVBoxLayout *box = new QVBoxLayout(_ww->_folderDetails);
@@ -654,6 +655,9 @@ void KWalletEditor::walletOpened(bool su
                 updateFolderList();
         } else {
+                if (!_newWallet) {
                 KMessageBox::sorry(this, i18n("Unable to open the requested wallet."));
         }
+                close();
+        }
 }
 
@@ -859,4 +863,8 @@ void KWalletEditor::exportXML() {
 
 
+void KWalletEditor::setNewWallet(bool x) {
+        _newWallet = x;
+}
+
 #include "kwalleteditor.moc"
 

--- kdeutils/kwallet/kwalleteditor.h  #1.19:1.20
@@ -43,4 +43,6 @@ class KWalletEditor : public KMainWindow
                 bool isOpen() const { return _w != 0L; }
 
+                void setNewWallet(bool newWallet);
+
         public slots:
                 void walletClosed();
@@ -101,4 +103,5 @@ class KWalletEditor : public KMainWindow
                 KWMapEditor *_mapEditor;
                 QCheckBox *_mapEditorShowHide;
+                bool _newWallet;
 };
 

--- kdeutils/kwallet/kwalletmanager.cpp  #1.50:1.51
@@ -267,5 +267,11 @@ void KWalletManager::deleteWallet() {
 }
 
+
 void KWalletManager::openWallet(const QString& walletName) {
+        openWallet(walletName, false);
+}
+
+
+void KWalletManager::openWallet(const QString& walletName, bool newWallet) {
         // Don't allow a wallet to open in two windows
         for (KMainWindow *w = _windows.first(); w; w = _windows.next()) {
@@ -278,4 +284,5 @@ void KWalletManager::openWallet(const QS
 
         KWalletEditor *we = new KWalletEditor(walletName, false, this, "Wallet Editor");
+        we->setNewWallet(newWallet);
         if (we->isOpen()) {
                 connect(we, SIGNAL(editorClosed(KMainWindow*)),
@@ -283,5 +290,5 @@ void KWalletManager::openWallet(const QS
                 we->show();
                 _windows.append(we);
-        } else {
+        } else if (!newWallet) {
                 KMessageBox::sorry(this, i18n("Error opening wallet %1.").arg(walletName));
                 delete we;
@@ -364,5 +371,5 @@ void KWalletManager::createWallet() {
         // Small race here - the wallet could be created on us already.
         if (!n.isEmpty()) {
-                openWallet(n);
+                openWallet(n, true);
         }
 }

--- kdeutils/kwallet/kwalletmanager.h  #1.19:1.20
@@ -49,4 +49,5 @@ class KWalletManager : public KMainWindo
                 void changeWalletPassword(const QString& walletName);
                 void openWallet(const QString& walletName);
+                void openWallet(const QString& walletName, bool newWallet);
                 void openWalletFile(const QString& path);
                 void openWallet(QIconViewItem *item);


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic