timeout in popup. I will also do the rest
This commit is contained in:
parent
6c10fe9a7b
commit
474fe3447e
|
@ -781,17 +781,30 @@ class Popup_window:
|
|||
def __init__(self, plugin=None, account=None):
|
||||
self.plugin = plugin
|
||||
self.account = account
|
||||
self.xml = gtk.glade.XML(GTKGUI_GLADE, 'popup_window', APP)
|
||||
self.window = self.xml.get_widget('popup_window')
|
||||
|
||||
xml = gtk.glade.XML(GTKGUI_GLADE, 'popup_window', APP)
|
||||
self.window = xml.get_widget('popup_window')
|
||||
close_button = xml.get_widget('close_button')
|
||||
|
||||
self.window.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse('green'))
|
||||
|
||||
# position the window to bottom-right of screen
|
||||
gtk.gdk.flush()
|
||||
window_width, window_height = self.window.get_size()
|
||||
self.window.move(gtk.gdk.screen_width() - window_width, gtk.gdk.screen_height() - window_height)
|
||||
self.plugin.roster.popups_height += window_height
|
||||
self.window.move(gtk.gdk.screen_width() - window_width, \
|
||||
gtk.gdk.screen_height() - self.plugin.roster.popups_height)
|
||||
|
||||
self.xml.signal_autoconnect(self)
|
||||
xml.signal_autoconnect(self)
|
||||
close_button.connect('clicked', self.on_close_button_clicked, window_height)
|
||||
self.window.show_all()
|
||||
|
||||
def on_close_button_clicked(self, widget):
|
||||
self.window.hide()
|
||||
gobject.timeout_add(5000, self.on_timeout, window_height)
|
||||
|
||||
def on_close_button_clicked(self, widget, window_height):
|
||||
self.plugin.roster.popups_height -= window_height
|
||||
widget.get_toplevel().destroy()
|
||||
|
||||
def on_timeout(self, window_height):
|
||||
self.plugin.roster.popups_height -= window_height
|
||||
self.window.destroy()
|
||||
|
|
|
@ -9877,21 +9877,6 @@ send a chat message to</property>
|
|||
<property name="homogeneous">False</property>
|
||||
<property name="spacing">5</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkImage" id="event_image">
|
||||
<property name="visible">True</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="event_label">
|
||||
<property name="visible">True</property>
|
||||
|
@ -9923,7 +9908,6 @@ send a chat message to</property>
|
|||
<property name="can_focus">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<signal name="clicked" handler="on_close_button_clicked" last_modification_time="Mon, 04 Apr 2005 16:34:50 GMT"/>
|
||||
|
||||
<child>
|
||||
<widget class="GtkImage" id="image496">
|
||||
|
@ -9952,50 +9936,22 @@ send a chat message to</property>
|
|||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkHBox" id="hbox2946">
|
||||
<widget class="GtkLabel" id="jid_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="spacing">5</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkImage" id="status_image">
|
||||
<property name="visible">True</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="jid_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">jid_label</property>
|
||||
<property name="use_underline">False</property>
|
||||
<property name="use_markup">False</property>
|
||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||
<property name="wrap">False</property>
|
||||
<property name="selectable">False</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
|
||||
<property name="width_chars">-1</property>
|
||||
<property name="single_line_mode">False</property>
|
||||
<property name="angle">0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
<property name="label" translatable="yes">jid_label</property>
|
||||
<property name="use_underline">False</property>
|
||||
<property name="use_markup">False</property>
|
||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||
<property name="wrap">False</property>
|
||||
<property name="selectable">False</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
|
||||
<property name="width_chars">-1</property>
|
||||
<property name="single_line_mode">False</property>
|
||||
<property name="angle">0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
|
|
|
@ -909,7 +909,9 @@ class Roster_window:
|
|||
Popup_window(self.plugin)
|
||||
|
||||
def on_accounts_menuitem_activate(self, widget):
|
||||
if not self.plugin.windows.has_key('accounts'):
|
||||
if self.plugin.windows.has_key('accounts'):
|
||||
self.plugin.windows['accounts'].present()
|
||||
else:
|
||||
self.plugin.windows['accounts'] = Accounts_window(self.plugin)
|
||||
|
||||
def close_all(self, dic):
|
||||
|
@ -1305,6 +1307,7 @@ class Roster_window:
|
|||
self.window.show_all()
|
||||
self.groups = {}
|
||||
self.contacts = {}
|
||||
self.popups_height = 0
|
||||
for a in self.plugin.accounts.keys():
|
||||
self.contacts[a] = {}
|
||||
self.groups[a] = {}
|
||||
|
|
Loading…
Reference in New Issue