From ba7bf984687bee2de2913c21c8a53c4aeed57efc Mon Sep 17 00:00:00 2001 From: Nikos Kouremenos Date: Thu, 21 Apr 2005 21:23:41 +0000 Subject: [PATCH] Popup_ --> Popup_notification --- src/dialogs.py | 22 +++++++++++----------- src/gajim.py | 17 +++++++++-------- src/gtkgui.glade | 8 +++++--- 3 files changed, 25 insertions(+), 22 deletions(-) diff --git a/src/dialogs.py b/src/dialogs.py index 0acac21fe..ff1f64105 100644 --- a/src/dialogs.py +++ b/src/dialogs.py @@ -615,14 +615,14 @@ class Change_password_dialog: self.dialog.destroy() return message -class Popup_window: +class Popup_notification_window: def __init__(self, plugin, event_type, jid, account): self.plugin = plugin self.account = account self.jid = jid - xml = gtk.glade.XML(GTKGUI_GLADE, 'popup_window', APP) - self.window = xml.get_widget('popup_window') + xml = gtk.glade.XML(GTKGUI_GLADE, 'popup_notification_window', APP) + self.window = xml.get_widget('popup_notification_window') close_button = xml.get_widget('close_button') event_type_label = xml.get_widget('event_type_label') event_description_label = xml.get_widget('event_description_label') @@ -661,29 +661,29 @@ class Popup_window: gobject.timeout_add(5000, self.on_timeout) def on_close_button_clicked(self, widget): - self.adjust_height_and_move_popup_windows() + self.adjust_height_and_move_popup_notification_windows() def on_timeout(self): - self.adjust_height_and_move_popup_windows() + self.adjust_height_and_move_popup_notification_windows() - def adjust_height_and_move_popup_windows(self): + def adjust_height_and_move_popup_notification_windows(self): #remove self.plugin.roster.popups_height -= self.window_height self.window.destroy() - if len(self.plugin.roster.popup_windows) > 0: + if len(self.plugin.roster.popup_notification_windows) > 0: # we want to remove the first window added in the list - self.plugin.roster.popup_windows.pop(0) # remove first item + self.plugin.roster.popup_notification_windows.pop(0) # remove 1st item # move the rest of popup windows self.plugin.roster.popups_height = 0 - for window_instance in self.plugin.roster.popup_windows: + for window_instance in self.plugin.roster.popup_notification_windows: window_width, window_height = window_instance.window.get_size() self.plugin.roster.popups_height += window_height window_instance.window.move(gtk.gdk.screen_width() - window_width, \ gtk.gdk.screen_height() - self.plugin.roster.popups_height) - def on_popup_window_button_press_event(self, widget, event): + def on_popup_notification_window_button_press_event(self, widget, event): # use User class, new_chat expects it that way # is it in the roster? if self.plugin.roster.contacts[self.account].has_key(self.jid): @@ -697,4 +697,4 @@ class Popup_window: self.plugin.roster.new_chat(user, self.account) self.plugin.windows[self.account]['chats'][self.jid].active_tab(self.jid) self.plugin.windows[self.account]['chats'][self.jid].window.present() - self.adjust_height_and_move_popup_windows() + self.adjust_height_and_move_popup_notification_windows() diff --git a/src/gajim.py b/src/gajim.py index 32f75f339..b5e7423f7 100755 --- a/src/gajim.py +++ b/src/gajim.py @@ -238,9 +238,9 @@ class Interface: elif gajim.connections[account].connected in (2, 3): #online or chat show_notification = True if show_notification: - instance = dialogs.Popup_window(self, 'Contact Online', jid, \ - account) - self.roster.popup_windows.append(instance) + instance = dialogs.Popup_notification_window(self, + 'Contact Online', jid, account) + self.roster.popup_notification_windows.append(instance) elif old_show > 1 and new_show < 2 and gajim.config.get_per( \ 'soundevents', 'contact_disconnected', 'enabled'): @@ -255,9 +255,9 @@ class Interface: elif gajim.connections[account].connected in (2, 3): #online or chat show_notification = True if show_notification: - instance = dialogs.Popup_window(self, 'Contact Offline', jid, \ - account) - self.roster.popup_windows.append(instance) + instance = dialogs.Popup_notification_window(self, + 'Contact Offline', jid, account) + self.roster.popup_notification_windows.append(instance) elif self.windows[account]['gc'].has_key(ji): #it is a groupchat presence @@ -286,8 +286,9 @@ class Interface: elif gajim.connections[account].connected in (2, 3): #online or chat show_notification = True if show_notification: - instance = dialogs.Popup_window(self, 'New Message', jid, account) - self.roster.popup_windows.append(instance) + instance = dialogs.Popup_notification_window(self, + 'New Message', jid, account) + self.roster.popup_notification_windows.append(instance) self.roster.on_message(jid, array[1], array[2], account) if gajim.config.get_per('soundevents', 'first_message_received', \ 'enabled') and first: diff --git a/src/gtkgui.glade b/src/gtkgui.glade index 1bdbb460a..2f494f9e5 100644 --- a/src/gtkgui.glade +++ b/src/gtkgui.glade @@ -8129,6 +8129,7 @@ Custom 200 True + True GTK_POLICY_AUTOMATIC GTK_POLICY_AUTOMATIC GTK_SHADOW_IN @@ -8137,6 +8138,7 @@ Custom True + True False False True @@ -8172,6 +8174,7 @@ Custom 55 True + True GTK_POLICY_AUTOMATIC GTK_POLICY_AUTOMATIC GTK_SHADOW_IN @@ -8181,7 +8184,6 @@ Custom True True - True True False False @@ -10202,7 +10204,7 @@ send a chat message to - + 4 GTK_WINDOW_POPUP @@ -10216,7 +10218,7 @@ send a chat message to GDK_WINDOW_TYPE_HINT_NORMAL GDK_GRAVITY_SOUTH_EAST True - +