From d3af231d5f8ec23ce9bfb03b739b1ec956523b27 Mon Sep 17 00:00:00 2001 From: Nikos Kouremenos Date: Fri, 19 Aug 2005 14:24:42 +0000 Subject: [PATCH] try to use a HigDialog and not a glade dialog for InitationReceivedDialog class --- src/dialogs.py | 42 ++++++---- src/gtkgui.glade | 202 ----------------------------------------------- 2 files changed, 25 insertions(+), 219 deletions(-) diff --git a/src/dialogs.py b/src/dialogs.py index f8d3820d7..e74697fae 100644 --- a/src/dialogs.py +++ b/src/dialogs.py @@ -1179,28 +1179,36 @@ class XMLConsoleWindow: del self.plugin.windows[self.account]['xml_console'] widget.destroy() -class InvitationDialog: +class InvitationReceivedDialog(HigDialog): def __init__(self, plugin, account, room_jid, contact_jid, password = None, comment = None): self.plugin = plugin self.account = account - self.xml = gtk.glade.XML(GTKGUI_GLADE, 'invitation_dialog', APP) - self.window = self.xml.get_widget('invitation_dialog') - self.invitation_label = self.xml.get_widget('invitation_label') - #FIXME: add pango markup - #DO_NOT_TRANSLATE_4_08 - string = _('You have been invited to the %s room by %s') % (room_jid, contact_jid) + items = [('inv-deny', _('_Deny'), 0, 0, None), + ('inv-accept', ('_Accept'), 0, 0, None)] + + # use regular stock icons. + aliases = [('inv-deny', gtk.STOCK_CANCEL), + ('inv-accept', gtk.STOCK_APPLY),] + + gtk.stock_add(items) + factory = gtk.IconFactory() + factory.add_default() + style= window.get_style() + for new_stock, alias in aliases: + icon_set = style.lookup_icon_set(alias) + factory.add(new_stock, icon_set) + + # Create the relabeled buttons + btn_deny = gtk.Button(stock = 'inv-deny') + btn_accept = gtk.Button(stock = 'inv-accept') + + #FIXME: add pano markup + pritext = _('You have been invited to the %s room by %s') % (room_jid, contact_jid) if comment is not None: - #DO_NOT_TRANSLATE_4_08 string += '\n' + _('Comment: %s') % comment - self.invitation_label.set_text(string) + HigDialog.__init__(self, None, pritext, sectext, + gtk.STOCK_DIALOG_WARNING, [ [btn_deny, gtk.RESPONSE_NO], + [ btn_accept, gtk.RESPONSE_YES ] ]) - self.window.show_all() - self.xml.signal_autoconnect(self) - - def on_accept_button_clicked(self, widget): - pass # FIXME: join room - - def on_decline_button_clicked(self, widget): - self.window.destroy() diff --git a/src/gtkgui.glade b/src/gtkgui.glade index 39df11b47..6334d9390 100644 --- a/src/gtkgui.glade +++ b/src/gtkgui.glade @@ -17770,206 +17770,4 @@ Maybe I'll refactor later - - Invitation Received - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - True - - - - True - False - 0 - - - - True - GTK_BUTTONBOX_END - - - - True - True - GTK_RELIEF_NORMAL - True - 0 - - - - - True - 0.5 - 0.5 - 0 - 0 - 0 - 0 - 0 - 0 - - - - True - False - 2 - - - - True - gtk-cancel - 4 - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - True - _Decline - True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - - - - - - - True - True - True - True - True - GTK_RELIEF_NORMAL - True - -10 - - - - - True - 0.5 - 0.5 - 0 - 0 - 0 - 0 - 0 - 0 - - - - True - False - 2 - - - - True - gtk-apply - 4 - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - True - _Accept - True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - - - - - - 0 - False - True - GTK_PACK_END - - - - - - True - - False - True - GTK_JUSTIFY_LEFT - True - False - 0.5 - 0.5 - 0 - 0 - - - 0 - True - True - - - - - -