self._loginSink = gtk_toolbox.threaded_stage(
gtk_toolbox.comap(
- self.attempt_login,
+ self._attempt_login,
gtk_toolbox.null_sink(),
)
)
finally:
self._spawn_attempt_login(2)
- def attempt_login(self, numOfAttempts = 10, force = False):
+ def _spawn_attempt_login(self, *args):
+ self._loginSink.send(args)
+
+ def _attempt_login(self, numOfAttempts = 10, force = False):
"""
@todo Handle user notification better like attempting to login and failed login
with gtk_toolbox.gtk_lock():
self._change_loggedin_status(serviceId)
+ if loggedIn:
+ hildonize.show_information_banner(self._window, "Logged In")
except Exception, e:
with gtk_toolbox.gtk_lock():
self._errorDisplay.push_exception()
- def _spawn_attempt_login(self, *args):
- self._loginSink.send(args)
-
def refresh_session(self):
"""
@note Thread agnostic
dialed = False
try:
self._phoneBackends[self._selectedBackendId].send_sms(number, message)
+ hildonize.show_information_banner(self._window, "Sending to %s" % number)
dialed = True
except Exception, e:
self._errorDisplay.push_exception()
try:
assert self._phoneBackends[self._selectedBackendId].get_callback_number() != "", "No callback number specified"
self._phoneBackends[self._selectedBackendId].dial(number)
+ hildonize.show_information_banner(self._window, "Calling %s" % number)
dialed = True
except Exception, e:
self._errorDisplay.push_exception()
mappedItem = function(*item)
target.send(mappedItem)
except Exception, e:
- target.throw(e.__class__, e.message)
+ logging.exception("Forwarding exception!")
+ target.throw(e.__class__, str(e))
def _flush_queue(queue):
self.push_exception()
def push_exception(self):
- userMessage = str(sys.exc_value)
+ userMessage = str(sys.exc_info()[1])
self.push_message(userMessage)
logging.exception(userMessage)
self._calendar.select_month(self._displayDate.month, self._displayDate.year)
self._calendar.select_day(self._displayDate.day)
except Exception, e:
- logging.exception(e.message)
+ logging.exception(e)
class QuickAddView(object):
pass
def _idly_populate_recentview(self):
+ with gtk_toolbox.gtk_lock():
+ banner = hildonize.show_busy_banner_start(self._window, "Loading Recent History")
try:
self._recentmodel.clear()
self._isPopulated = True
self._recentmodel.append(item)
except Exception, e:
self._errorDisplay.push_exception_with_lock()
+ finally:
+ with gtk_toolbox.gtk_lock():
+ hildonize.show_busy_banner_end(banner)
return False
pass
def _idly_populate_messageview(self):
+ with gtk_toolbox.gtk_lock():
+ banner = hildonize.show_busy_banner_start(self._window, "Loading Messages")
try:
self._messagemodel.clear()
self._isPopulated = True
self._messagemodel.append(row)
except Exception, e:
self._errorDisplay.push_exception_with_lock()
+ finally:
+ with gtk_toolbox.gtk_lock():
+ hildonize.show_busy_banner_end(banner)
return False
config.set(sectionName, "selectedAddressbook", str(self._selectedComboIndex))
def _idly_populate_contactsview(self):
+ with gtk_toolbox.gtk_lock():
+ banner = hildonize.show_busy_banner_start(self._window, "Loading Contacts")
try:
addressBook = None
while addressBook is not self._addressBook:
self._isPopulated = True
except Exception, e:
self._errorDisplay.push_exception_with_lock()
+ finally:
+ with gtk_toolbox.gtk_lock():
+ hildonize.show_busy_banner_end(banner)
return False
def _on_addressbook_button_changed(self, *args, **kwds):
set_cell_thumb_selectable = _null_set_cell_thumb_selectable
+def _hildon_show_information_banner(parent, message):
+ hildon.hildon_banner_show_information(parent, "", message)
+
+
+def _null_show_information_banner(parent, message):
+ pass
+
+
+try:
+ hildon.hildon_banner_show_information
+ show_information_banner = _hildon_show_information_banner
+except AttributeError:
+ show_information_banner = _null_show_information_banner
+
+
+def _fremantle_show_busy_banner_start(parent, message):
+ hildon.hildon_gtk_window_set_progress_indicator(parent, True)
+ return parent
+
+
+def _fremantle_show_busy_banner_end(parent):
+ hildon.hildon_gtk_window_set_progress_indicator(parent, False)
+
+
+def _hildon_show_busy_banner_start(parent, message):
+ return hildon.hildon_banner_show_animation(parent, "", message)
+
+
+def _hildon_show_busy_banner_end(banner):
+ banner.destroy()
+
+
+def _null_show_busy_banner_start(parent, message):
+ return None
+
+
+def _null_show_busy_banner_end(banner):
+ return None
+
+
+try:
+ hildon.hildon_gtk_window_set_progress_indicator
+ show_busy_banner_start = _fremantle_show_busy_banner_start
+ show_busy_banner_end = _fremantle_show_busy_banner_end
+except AttributeError:
+ try:
+ hildon.hildon_banner_show_animation
+ show_busy_banner_start = _hildon_show_busy_banner_start
+ show_busy_banner_end = _hildon_show_busy_banner_end
+ except AttributeError:
+ show_busy_banner_start = _null_show_busy_banner_start
+ show_busy_banner_end = _null_show_busy_banner_end
+
+
def _hildon_hildonize_text_entry(textEntry):
textEntry.set_property('hildon-input-mode', 7)
* Simplified menus
* Fremantle: Making various areas pannable
* Phone selection and SMS Message dialogs now use a tree view for the top part. This gives highlighting of the last message, easier scrolling, easier code, etc
+* Added notifcations for various things like login and dialing
* UI Tweak: Switch to accounts tab when logging in and callback is blank as a sublte hint to configure it
* UI Tweak: Switch to accounts tab on failed login to remind the user they are not logged in
* Bug Fix: some dependencies for Diablo