Fixing various bugs with clearing account info
authorEd Page <eopage@byu.net>
Thu, 3 Feb 2011 05:03:45 +0000 (23:03 -0600)
committerEd Page <eopage@byu.net>
Thu, 3 Feb 2011 05:03:45 +0000 (23:03 -0600)
src/dialcentral_qt.py
src/dialogs.py
src/session.py
src/util/qore_utils.py

index 887c939..eb5f218 100755 (executable)
@@ -556,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)
index 39ee7f1..3fb4f00 100644 (file)
@@ -21,6 +21,7 @@ _moduleLogger = logging.getLogger(__name__)
 class CredentialsDialog(object):
 
        def __init__(self, app):
+               self._app = app
                self._usernameField = QtGui.QLineEdit()
                self._passwordField = QtGui.QLineEdit()
                self._passwordField.setEchoMode(QtGui.QLineEdit.Password)
@@ -89,6 +90,7 @@ class CredentialsDialog(object):
 class AboutDialog(object):
 
        def __init__(self, app):
+               self._app = app
                self._title = QtGui.QLabel(
                        "<h1>%s</h1><h3>Version: %s</h3>" % (
                                constants.__pretty_app_name__, constants.__version__
@@ -167,6 +169,7 @@ class AccountDialog(object):
        ]
 
        def __init__(self, app):
+               self._app = app
                self._doClear = False
 
                self._accountNumberLabel = QtGui.QLabel("NUMBER NOT SET")
index cbfc3ef..7697bf1 100644 (file)
@@ -549,11 +549,11 @@ class Session(QtCore.QObject):
                oldCallback = self._callback
 
                self._contacts = {}
-               self._contactUpdateTime = datetime.datetime(1, 1, 1)
+               self._contactUpdateTime = datetime.datetime(1971, 1, 1)
                self._messages = []
-               self._messageUpdateTime = datetime.datetime(1, 1, 1)
+               self._messageUpdateTime = datetime.datetime(1971, 1, 1)
                self._history = []
-               self._historyUpdateTime = datetime.datetime(1, 1, 1)
+               self._historyUpdateTime = datetime.datetime(1971, 1, 1)
                self._dnd = False
                self._callback = ""
 
index 491c96d..c86cfbc 100644 (file)
@@ -85,7 +85,7 @@ class AsyncPool(QtCore.QObject):
        def __init__(self):
                QtCore.QObject.__init__(self)
                self._thread = QThread44()
-               self._isRunning = True
+               self._isRunning = False
                self._parent = _ParentThread(self)
                self._worker = _WorkerThread(self)
                self._worker.moveToThread(self._thread)
@@ -96,6 +96,7 @@ class AsyncPool(QtCore.QObject):
 
        def start(self):
                self._thread.start()
+               self._isRunning = True
 
        def stop(self):
                self._isRunning = False