Further cleanups after removing GrandCentral support
authorepage <eopage@byu.net>
Sat, 29 Aug 2009 01:11:15 +0000 (01:11 +0000)
committerepage <eopage@byu.net>
Sat, 29 Aug 2009 01:11:15 +0000 (01:11 +0000)
git-svn-id: file:///svnroot/gc-dialer/trunk@424 c39d3808-3fe2-4d86-a59f-b7f623ee9f21

src/dc_glade.py
src/gv_views.py

index 99889c5..bcefda0 100755 (executable)
@@ -226,18 +226,13 @@ class Dialcentral(object):
                        except OSError, e:
                                if e.errno != 17:
                                        raise
-                       gcCookiePath = os.path.join(constants._data_path_, "gc_cookies.txt")
                        gvCookiePath = os.path.join(constants._data_path_, "gv_cookies.txt")
-                       self._defaultBackendId = self._guess_preferred_backend((
-                               (self.GV_BACKEND, gvCookiePath),
-                       ))
 
                        self._phoneBackends.update({
                                self.GV_BACKEND: gv_backend.GVDialer(gvCookiePath),
                        })
                        with gtk_toolbox.gtk_lock():
                                unifiedDialpad = gv_views.Dialpad(self._widgetTree, self._errorDisplay)
-                               unifiedDialpad.set_number("")
                                self._dialpads.update({
                                        self.GV_BACKEND: unifiedDialpad,
                                })
@@ -265,20 +260,20 @@ class Dialcentral(object):
 
                        fsContactsPath = os.path.join(constants._data_path_, "contacts")
                        fileBackend = file_backend.FilesystemAddressBookFactory(fsContactsPath)
-                       for backendId in (self.GV_BACKEND, ):
-                               self._dialpads[backendId].number_selected = self._select_action
-                               self._recentViews[backendId].number_selected = self._select_action
-                               self._messagesViews[backendId].number_selected = self._select_action
-                               self._contactsViews[backendId].number_selected = self._select_action
-
-                               addressBooks = [
-                                       self._phoneBackends[backendId],
-                                       fileBackend,
-                               ]
-                               mergedBook = gv_views.MergedAddressBook(addressBooks, gv_views.MergedAddressBook.advanced_lastname_sorter)
-                               self._contactsViews[backendId].append(mergedBook)
-                               self._contactsViews[backendId].extend(addressBooks)
-                               self._contactsViews[backendId].open_addressbook(*self._contactsViews[backendId].get_addressbooks().next()[0][0:2])
+
+                       self._dialpads[self.GV_BACKEND].number_selected = self._select_action
+                       self._recentViews[self.GV_BACKEND].number_selected = self._select_action
+                       self._messagesViews[self.GV_BACKEND].number_selected = self._select_action
+                       self._contactsViews[self.GV_BACKEND].number_selected = self._select_action
+
+                       addressBooks = [
+                               self._phoneBackends[self.GV_BACKEND],
+                               fileBackend,
+                       ]
+                       mergedBook = gv_views.MergedAddressBook(addressBooks, gv_views.MergedAddressBook.advanced_lastname_sorter)
+                       self._contactsViews[self.GV_BACKEND].append(mergedBook)
+                       self._contactsViews[self.GV_BACKEND].extend(addressBooks)
+                       self._contactsViews[self.GV_BACKEND].open_addressbook(*self._contactsViews[self.GV_BACKEND].get_addressbooks().next()[0][0:2])
 
                        callbackMapping = {
                                "on_paste": self._on_paste,
@@ -395,12 +390,9 @@ class Dialcentral(object):
                for attemptCount in xrange(numOfAttempts):
                        if loggedIn:
                                break
-                       availableServices = (
-                               (self.GV_BACKEND, "Google Voice"),
-                       )
                        with gtk_toolbox.gtk_lock():
-                               credentials = self._credentialsDialog.request_credentials_from(
-                                       availableServices, defaultCredentials = self._credentials
+                               credentials = self._credentialsDialog.request_credentials(
+                                       defaultCredentials = self._credentials
                                )
                        tmpServiceId, username, password = credentials
                        loggedIn = self._phoneBackends[tmpServiceId].login(username, password)
@@ -538,14 +530,6 @@ class Dialcentral(object):
                        config.add_section(sectionName)
                        view.save_settings(config, sectionName)
 
-       def _guess_preferred_backend(self, backendAndCookiePaths):
-               modTimeAndPath = [
-                       (getmtime_nothrow(path), backendId, path)
-                       for backendId, path in backendAndCookiePaths
-               ]
-               modTimeAndPath.sort()
-               return modTimeAndPath[-1][1]
-
        def _save_settings(self):
                """
                @note Thread Agnostic
index 9cd8053..42268da 100644 (file)
@@ -482,14 +482,12 @@ class Dialpad(object):
                self._window = gtk_toolbox.find_parent_window(self._numberdisplay)
 
        def enable(self):
-               self.set_number(self._phonenumber)
                self._dialButton.grab_focus()
                self._backTapHandler.enable()
 
        def disable(self):
                self._reset_back_button()
                self._backTapHandler.disable()
-               self.set_number("")
 
        def number_selected(self, action, number, message):
                """