Fixing an issue of escaping spaces which meant no line breaks, bad bad bad on my...
[gc-dialer] / src / dialcentral_qt.py
index 7edcfd2..20c3bf5 100755 (executable)
@@ -258,6 +258,10 @@ class DelayedWidget(object):
                else:
                        self._child.disable()
 
+       @property
+       def child(self):
+               return self._child
+
        def enable(self):
                self._isEnabled = True
                if self._child is not None:
@@ -552,6 +556,10 @@ class MainWindow(qwrappers.WindowWrapper):
                if response == QtGui.QDialog.Accepted:
                        if self._accountDialog.doClear:
                                self._session.logout_and_clear()
+                               self._defaultCredentials = "", ""
+                               self._curentCredentials = "", ""
+                               for tab in self._tabsContents:
+                                       tab.disable()
                        else:
                                callbackNumber = self._accountDialog.selectedCallback
                                self._session.set_callback_number(callbackNumber)
@@ -560,6 +568,7 @@ class MainWindow(qwrappers.WindowWrapper):
                                self._app.notifyOnMissed = self._accountDialog.notifyOnMissed
                                self._app.notifyOnVoicemail = self._accountDialog.notifyOnVoicemail
                                self._app.notifyOnSms = self._accountDialog.notifyOnSms
+                               self._app.save_settings()
                elif response == QtGui.QDialog.Rejected:
                        _moduleLogger.info("Cancelled")
                else:
@@ -604,6 +613,7 @@ class MainWindow(qwrappers.WindowWrapper):
                                self._smsEntryDialog = dialogs.SMSEntryWindow(self.window, self._app, self._session, self._errorLog)
                                self._smsEntryDialog.window.destroyed.connect(self._on_child_close)
                                self._smsEntryDialog.window.closed.connect(self._on_child_close)
+                               self._smsEntryDialog.window.show()
 
        @misc_utils.log_exception(_moduleLogger)
        def _on_child_close(self, obj = None):
@@ -636,11 +646,13 @@ class MainWindow(qwrappers.WindowWrapper):
        def _on_import(self, checked = True):
                with qui_utils.notify_error(self._errorLog):
                        csvName = QtGui.QFileDialog.getOpenFileName(self._window, caption="Import", filter="CSV Files (*.csv)")
+                       csvName = unicode(csvName)
                        if not csvName:
                                return
                        import shutil
                        shutil.copy2(csvName, self._app.fsContactsPath)
-                       self._tabsContents[self.CONTACTS_TAB].update_addressbooks()
+                       if self._tabsContents[self.CONTACTS_TAB].has_child:
+                               self._tabsContents[self.CONTACTS_TAB].child.update_addressbooks()
 
        @QtCore.pyqtSlot()
        @QtCore.pyqtSlot(bool)