From 9af8207148d629e32e29d066b2553f8be1270a77 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Wed, 22 Aug 2007 11:10:54 +0000 Subject: [PATCH] nicer chat2muc window. see #2095 --- data/glade/chat_to_muc_window.glade | 453 +++++++++++----------------- src/dialogs.py | 28 +- 2 files changed, 184 insertions(+), 297 deletions(-) diff --git a/data/glade/chat_to_muc_window.glade b/data/glade/chat_to_muc_window.glade index 350ac8101..6c0dae135 100644 --- a/data/glade/chat_to_muc_window.glade +++ b/data/glade/chat_to_muc_window.glade @@ -1,275 +1,182 @@ - - - + + + - - - 5 - True - Invite Friends ! - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_NORMAL - GDK_GRAVITY_NORTH_WEST - True - False - - - - True - False - 0 - - - - True - You are going to begin a Multi-User Chat. -First please select a MUC server. - False - False - GTK_JUSTIFY_CENTER - True - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 4 - False - False - - - - - - True - False - True - True - - - 0 - False - True - - - - - - True - - - 4 - False - True - - - - - - True - Select the friends you want to invite. - False - False - GTK_JUSTIFY_CENTER - True - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 4 - False - False - - - - - - True - True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT - - - - True - True - False - False - False - True - False - False - False - - - - - - - - 4 - True - True - - - - - - True - False - 0 - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - True - True - - - - - - True - True - gtk-cancel - True - GTK_RELIEF_NORMAL - True - - - - 3 - False - False - - - - - - True - True - GTK_RELIEF_NORMAL - True - - - - - True - 0.5 - 0.5 - 0 - 0 - 0 - 0 - 0 - 0 - - - - True - False - 2 - - - - True - gtk-jump-to - 4 - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - True - In_vite - True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - - - - 3 - False - False - - - - - 4 - False - True - - - - - - + + True + 5 + Invite Friends ! + + + + True + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + You are going to begin a Multi-User Chat. +Select the contacts you want to invite + GTK_JUSTIFY_CENTER + + + False + False + 4 + + + + + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + + + True + True + False + + + + + + + + 4 + 1 + + + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + + + True + Please select a MUC server. + GTK_JUSTIFY_CENTER + True + + + False + False + 4 + + + + + True + + + + + + + False + 1 + + + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + MUC server + + + label_item + + + + + False + 2 + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 6 + GTK_BUTTONBOX_END + + + True + True + gtk-cancel + True + 0 + + + + False + False + 3 + + + + + True + True + 0 + + + + True + 0 + 0 + + + True + 2 + + + True + gtk-jump-to + + + False + False + + + + + True + In_vite + True + + + False + False + 1 + + + + + + + + + False + False + 3 + 1 + + + + + False + 3 + + + + + diff --git a/src/dialogs.py b/src/dialogs.py index fdac5b142..fa1275393 100644 --- a/src/dialogs.py +++ b/src/dialogs.py @@ -3208,13 +3208,11 @@ class TransformChatToMUC: self.xml = gtkgui_helpers.get_glade('chat_to_muc_window.glade') self.window = self.xml.get_widget('chat_to_muc_window') - self.window.connect('key_press_event', self._on_keypress_event) for widget_to_add in ('invite_button', 'cancel_button', 'server_list_comboboxentry', 'guests_treeview', 'server_and_guests_hseparator', 'server_select_label'): self.__dict__[widget_to_add] = self.xml.get_widget(widget_to_add) - self.window.connect('key_press_event', self._on_keypress_event) # set comboboxentry renderer_servers = gtk.CellRendererText() @@ -3269,32 +3267,14 @@ class TransformChatToMUC: name = jid.split('@')[0] self.store.append([name, jid]) - # show all but... + # show all self.window.show_all() - # ...hide this - self.server_selection_visible = True - self.toggle_server_selection_visible() - self.xml.signal_autoconnect(self) - def toggle_server_selection_visible(self): - if self.server_selection_visible: - self.server_selection_visible = False - self.server_and_guests_hseparator.hide() - self.server_list_comboboxentry.hide() - self.server_select_label.hide() - else: - self.server_selection_visible = True - self.server_and_guests_hseparator.show() - self.server_list_comboboxentry.show() - self.server_select_label.show() - - def _on_keypress_event(self, widget, event): - if (event.state & gtk.gdk.MOD1_MASK) and (event.keyval == gtk.keysyms.c \ - or event.keyval == gtk.keysyms.C): - self.toggle_server_selection_visible() - return True + def on_chat_to_muc_window_key_press_event(self, widget, event): + if event.keyval == gtk.keysyms.Escape: # ESCAPE + self.window.destroy() def on_invite_button_clicked(self, widget): server = self.server_list_comboboxentry.get_active_text()