InformationDialog doesn't use run() anymore

This commit is contained in:
Yann Leboulanger 2005-08-14 16:12:36 +00:00
parent db97d20aec
commit 93293dfdc5
4 changed files with 25 additions and 17 deletions

View file

@ -392,7 +392,7 @@ class AboutDialog:
def __init__(self): def __init__(self):
if gtk.pygtk_version < (2, 6, 0) or gtk.gtk_version < (2, 6, 0): if gtk.pygtk_version < (2, 6, 0) or gtk.gtk_version < (2, 6, 0):
InformationDialog(_('Gajim - a GTK+ Jabber client'), InformationDialog(_('Gajim - a GTK+ Jabber client'),
_('Version %s') % gajim.version).get_response() _('Version %s') % gajim.version)
return return
dlg = gtk.AboutDialog() dlg = gtk.AboutDialog()
@ -513,6 +513,14 @@ class InformationDialog(HigDialog):
self, None, pritext, sectext, gtk.STOCK_DIALOG_INFO, self, None, pritext, sectext, gtk.STOCK_DIALOG_INFO,
[ [ gtk.STOCK_OK, gtk.RESPONSE_OK ] ] [ [ gtk.STOCK_OK, gtk.RESPONSE_OK ] ]
) )
hbox = self.action_area
ok_button = hbox.get_children()[0]
ok_button.connect('clicked', self.on_ok_button_clicked)
self.show_all()
def on_ok_button_clicked(self, widget):
self.destroy()
class BaseTooltip: class BaseTooltip:
''' Base Tooltip . Usage: ''' Base Tooltip . Usage:
tooltip = BaseTooltip() tooltip = BaseTooltip()
@ -1653,14 +1661,14 @@ class FileTransfersWindow:
def show_request_error(self, file_props): def show_request_error(self, file_props):
self.window.present() self.window.present()
self.window.window.focus() self.window.window.focus()
InformationDialog(_('File transfer canceled'), _('Connection with peer cannot be established.')).get_response() InformationDialog(_('File transfer canceled'), _('Connection with peer cannot be established.'))
self.tree.get_selection().unselect_all() self.tree.get_selection().unselect_all()
def show_send_error(self, file_props): def show_send_error(self, file_props):
self.window.present() self.window.present()
self.window.window.focus() self.window.window.focus()
InformationDialog(_('File transfer canceled'), InformationDialog(_('File transfer canceled'),
_('Connection with peer cannot be established.')).get_response() _('Connection with peer cannot be established.'))
self.tree.get_selection().unselect_all() self.tree.get_selection().unselect_all()
def show_stopped(self, jid, file_props): def show_stopped(self, jid, file_props):

View file

@ -145,7 +145,7 @@ class Interface:
def handle_event_information(self, unused, data): def handle_event_information(self, unused, data):
#('INFORMATION', account, (title_text, section_text)) #('INFORMATION', account, (title_text, section_text))
dialogs.InformationDialog(data[0], data[1]).get_response() dialogs.InformationDialog(data[0], data[1])
def handle_event_http_auth(self, account, data): def handle_event_http_auth(self, account, data):
#('HTTP_AUTH', account, (method, url, iq_obj)) #('HTTP_AUTH', account, (method, url, iq_obj))
@ -500,13 +500,13 @@ class Interface:
self.roster.add_contact_to_roster(jid, account) self.roster.add_contact_to_roster(jid, account)
dialogs.InformationDialog(_('Authorization accepted'), dialogs.InformationDialog(_('Authorization accepted'),
_('The contact "%s" has authorized you to see his status.') _('The contact "%s" has authorized you to see his status.')
% jid).get_response() % jid)
if self.remote and self.remote.is_enabled(): if self.remote and self.remote.is_enabled():
self.remote.raise_signal('Subscribed', (account, array)) self.remote.raise_signal('Subscribed', (account, array))
def handle_event_unsubscribed(self, account, jid): def handle_event_unsubscribed(self, account, jid):
dialogs.InformationDialog(_('Contact "%s" removed subscription from you') % jid, dialogs.InformationDialog(_('Contact "%s" removed subscription from you') % jid,
_('You will always see him as offline.')).get_response() _('You will always see him as offline.'))
if self.remote and self.remote.is_enabled(): if self.remote and self.remote.is_enabled():
self.remote.raise_signal('Unsubscribed', (account, jid)) self.remote.raise_signal('Unsubscribed', (account, jid))
@ -540,7 +540,7 @@ class Interface:
#('ACC_OK', account, (name, config)) #('ACC_OK', account, (name, config))
name = array[0] name = array[0]
dialogs.InformationDialog(_('Account registration successful'), dialogs.InformationDialog(_('Account registration successful'),
_('The account "%s" has been registered with the Jabber server.') % name).get_response() _('The account "%s" has been registered with the Jabber server.') % name)
gajim.config.add_per('accounts', name) gajim.config.add_per('accounts', name)
for opt in array[1]: for opt in array[1]:
gajim.config.set_per('accounts', name, opt, array[1][opt]) gajim.config.set_per('accounts', name, opt, array[1][opt])

View file

@ -458,7 +458,7 @@ class GroupchatWindow(chat.Chat):
dialogs.InformationDialog( dialogs.InformationDialog(
_('Bookmark has been added successfully'), _('Bookmark has been added successfully'),
_('You can manage your bookmarks via Actions menu in your roster.')).get_response() _('You can manage your bookmarks via Actions menu in your roster.'))
def on_message_textview_key_press_event(self, widget, event): def on_message_textview_key_press_event(self, widget, event):
"""When a key is pressed: """When a key is pressed:

View file

@ -1018,7 +1018,7 @@ class RosterWindow:
'''Authorize a user (by re-sending auth menuitem)''' '''Authorize a user (by re-sending auth menuitem)'''
gajim.connections[account].send_authorization(jid) gajim.connections[account].send_authorization(jid)
dialogs.InformationDialog(_('Authorization has been sent'), dialogs.InformationDialog(_('Authorization has been sent'),
_('Now "%s" will know your status.') %jid).get_response() _('Now "%s" will know your status.') %jid)
def req_sub(self, widget, jid, txt, account, group=None, pseudo=None): def req_sub(self, widget, jid, txt, account, group=None, pseudo=None):
'''Request subscription to a user''' '''Request subscription to a user'''
@ -1041,7 +1041,7 @@ class RosterWindow:
user1 = gajim.contacts[account][jid][0] user1 = gajim.contacts[account][jid][0]
if not _('not in the roster') in user1.groups: if not _('not in the roster') in user1.groups:
dialogs.InformationDialog(_('Subscription request has been sent'), dialogs.InformationDialog(_('Subscription request has been sent'),
_('If "%s" accepts this request you will know his status.') %jid).get_response() _('If "%s" accepts this request you will know his status.') %jid)
return return
user1.groups = [group] user1.groups = [group]
user1.name = pseudo user1.name = pseudo