From: epage Date: Fri, 9 Oct 2009 12:28:42 +0000 (+0000) Subject: Removing the select button, marking the phone selection button as insensitive if... X-Git-Url: https://vcs.maemo.org/git/?a=commitdiff_plain;h=64ed595b2b5c34ebe53ab792ea699396b2a33191;p=gc-dialer Removing the select button, marking the phone selection button as insensitive if no selections can be made, and auto pop it up if there is a choice to be made git-svn-id: file:///svnroot/gc-dialer/trunk@512 c39d3808-3fe2-4d86-a59f-b7f623ee9f21 --- diff --git a/src/dc_glade.py b/src/dc_glade.py index 33ad67a..2c700ff 100755 --- a/src/dc_glade.py +++ b/src/dc_glade.py @@ -136,7 +136,6 @@ class Dialcentral(object): "addressbookSelectButton", "sendSmsButton", "dialButton", - "selectButton", "cancelSmsButton", "callbackSelectButton", "minutesEntryButton", diff --git a/src/dialcentral.glade b/src/dialcentral.glade index 601c6da..c437659 100644 --- a/src/dialcentral.glade +++ b/src/dialcentral.glade @@ -174,10 +174,10 @@ False False - - - + + + True @@ -200,10 +200,10 @@ False False - - - + + + True @@ -226,10 +226,10 @@ False False - - - + + + True @@ -252,10 +252,10 @@ False False - - - + + + True @@ -280,10 +280,10 @@ False False - - - + + + True @@ -308,11 +308,11 @@ False False - - - - + + + + True @@ -335,10 +335,10 @@ False False - - - + + + True @@ -363,11 +363,11 @@ False False - - - - + + + + True @@ -1114,7 +1114,6 @@ True - end Send @@ -1142,19 +1141,6 @@ - - Select - True - True - True - - - False - False - 2 - - - gtk-cancel True @@ -1165,7 +1151,7 @@ False False - 3 + 2 diff --git a/src/gv_views.py b/src/gv_views.py index 7915223..a4fec0e 100644 --- a/src/gv_views.py +++ b/src/gv_views.py @@ -271,7 +271,6 @@ class SmsEntryDialog(object): """ ACTION_CANCEL = "cancel" - ACTION_SELECT = "select" ACTION_DIAL = "dial" ACTION_SEND_SMS = "sms" @@ -286,8 +285,6 @@ class SmsEntryDialog(object): self._smsButton.connect("clicked", self._on_send) self._dialButton = self._widgetTree.get_widget("dialButton") self._dialButton.connect("clicked", self._on_dial) - self._selectButton = self._widgetTree.get_widget("selectButton") - self._selectButton.connect("clicked", self._on_select) self._cancelButton = self._widgetTree.get_widget("cancelSmsButton") self._cancelButton.connect("clicked", self._on_cancel) @@ -319,11 +316,9 @@ class SmsEntryDialog(object): if 0 < len(self._contactDetails): self._numberIndex = 0 self._phoneButton.set_label(self._contactDetails[0][1]) - self._phoneButton.set_sensitive(True) else: self._numberIndex = -1 self._phoneButton.set_label("Error: No Number Available") - self._phoneButton.set_sensitive(False) # Add the column to the messages tree view self._messagemodel.clear() @@ -365,6 +360,12 @@ class SmsEntryDialog(object): self._messagesView.scroll_to_cell((len(messages)-1, )) self._smsEntry.grab_focus() + if 1 < len(self._contactDetails): + self._request_number() + self._phoneButton.set_sensitive(True) + else: + self._phoneButton.set_sensitive(False) + userResponse = self._dialog.run() finally: self._dialog.hide() @@ -405,7 +406,7 @@ class SmsEntryDialog(object): else: self._smsButton.set_sensitive(True) - def _on_phone(self, *args): + def _request_number(self): try: assert 0 <= self._numberIndex, "%r" % self._numberIndex @@ -419,6 +420,9 @@ class SmsEntryDialog(object): except Exception, e: _moduleLogger.exception("%s" % str(e)) + def _on_phone(self, *args): + self._request_number() + def _on_entry_changed(self, *args): self._update_letter_count() @@ -429,10 +433,6 @@ class SmsEntryDialog(object): self._dialog.response(gtk.RESPONSE_OK) self._action = self.ACTION_DIAL - def _on_select(self, *args): - self._dialog.response(gtk.RESPONSE_OK) - self._action = self.ACTION_SELECT - def _on_cancel(self, *args): self._dialog.response(gtk.RESPONSE_CANCEL) self._action = self.ACTION_CANCEL