Changeset 172
- Timestamp:
- 06/09/04 16:22:27 (4 years ago)
- Location:
- trunk
- Files:
-
- 6 added
- 4 modified
-
common/i18n.py (modified) (1 prop)
-
Makefile (modified) (1 diff)
-
plugins/gtkgui/eggtrayicon.c (added)
-
plugins/gtkgui/eggtrayicon.h (added)
-
plugins/gtkgui/gtkgui.glade (modified) (3 diffs)
-
plugins/gtkgui/gtkgui.py (modified) (7 diffs)
-
plugins/gtkgui/Makefile (added)
-
plugins/gtkgui/trayicon.defs (added)
-
plugins/gtkgui/trayiconmodule.c (added)
-
plugins/gtkgui/trayicon.override (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/common/i18n.py
- Property svn:executable deleted
-
trunk/Makefile
r159 r172 1 MODULES = common plugins/gtkgui 2 1 3 all: 2 python setup.py build_ext -i3 mv idle.so common/4 4 msgfmt Messages/fr/LC_MESSAGES/gajim.po -o Messages/fr/LC_MESSAGES/gajim.mo 5 for dir in ${MODULES}; do \ 6 (cd $$dir; make all); \ 7 done 8 9 clean: 10 find -name *.pyc -exec rm {} \; 11 for dir in ${MODULES}; do \ 12 (cd $$dir; make clean); \ 13 done -
trunk/plugins/gtkgui/gtkgui.glade
r169 r172 3 3 4 4 <glade-interface> 5 <requires lib="gnome"/>6 5 7 6 <widget class="GtkWindow" id="Gajim"> … … 11 10 <property name="window_position">GTK_WIN_POS_NONE</property> 12 11 <property name="modal">False</property> 13 <property name="default_width">1 00</property>14 <property name="default_height"> 300</property>12 <property name="default_width">150</property> 13 <property name="default_height">400</property> 15 14 <property name="resizable">True</property> 16 15 <property name="destroy_with_parent">False</property> … … 4063 4062 <property name="editable">True</property> 4064 4063 <property name="overwrite">False</property> 4065 <property name="accepts_tab"> True</property>4064 <property name="accepts_tab">False</property> 4066 4065 <property name="justification">GTK_JUSTIFY_LEFT</property> 4067 4066 <property name="wrap_mode">GTK_WRAP_WORD</property> -
trunk/plugins/gtkgui/gtkgui.py
r169 r172 22 22 import gtk 23 23 from gtk import TRUE, FALSE 24 import trayicon 24 25 import gtk.glade,gobject 25 26 import os,string,time,Queue … … 103 104 self.plugin.roster.tree.get_model().set_value(i, 0, \ 104 105 self.plugin.roster.pixbufs[self.user.show]) 106 self.plugin.set_systray() 105 107 106 108 def on_msg_key_press_event(self, widget, event): … … 840 842 #table to change index in plugin.connected to index in optionmenu 841 843 table = {0:6, 1:0, 2:1, 3:2, 4:3, 5:4} 842 m ini = min(self.plugin.connected.values())844 maxi = max(self.plugin.connected.values()) 843 845 optionmenu = self.xml.get_widget('optionmenu') 844 846 #temporarily block signal in order not to send status that we show 845 847 #in the optionmenu 846 848 optionmenu.handler_block(self.id_signal_optionmenu) 847 optionmenu.set_history(table[m ini])849 optionmenu.set_history(table[maxi]) 848 850 optionmenu.handler_unblock(self.id_signal_optionmenu) 851 statuss = ['offline', 'online', 'away', 'xa', 'dnd', 'invisible'] 852 self.plugin.set_systray(statuss[maxi]) 849 853 850 854 def on_status_changed(self, account, status): … … 892 896 for i in self.get_user_iter(jid, account): 893 897 model.set_value(i, 0, self.pixbufs['message']) 898 self.plugin.set_systray('message') 894 899 tim = time.strftime("[%H:%M:%S]") 895 900 self.plugin.queues[account][jid].put((msg, tim)) … … 1403 1408 return 1 1404 1409 1410 def set_systray_img(self, status): 1411 if not self.roster.pixbufs.has_key(status): 1412 return 1413 pix = self.roster.pixbufs[status] 1414 if isinstance(pix, gtk.gdk.PixbufAnimation): 1415 self.img_tray.set_from_animation(pix) 1416 else: 1417 self.img_tray.set_from_pixbuf(pix) 1418 1419 def set_systray(self, status=None): 1420 if not status: 1421 self.nb_msg -= 1 1422 if self.nb_msg == 0: 1423 self.set_systray_img(self.status) 1424 elif status == 'message': 1425 self.nb_msg += 1 1426 self.set_systray_img('message') 1427 else: 1428 self.status = status 1429 self.set_systray_img(status) 1430 1405 1431 def __init__(self, quIN, quOUT): 1406 1432 gtk.threads_init() … … 1421 1447 self.send('ASK_CONFIG', None, ('GtkGui', 'accounts')) 1422 1448 self.accounts = self.wait('CONFIG') 1449 self.nb_msg = 0 1423 1450 self.windows = {'logs':{}} 1424 1451 self.queues = {} … … 1441 1468 gtk.timeout_add(1000, self.read_sleepy) 1442 1469 self.sleeper = None 1470 t = trayicon.TrayIcon("Gajim") 1471 tip = gtk.Tooltips() 1472 tip.set_tip(t, 'Gajim') 1473 self.img_tray = gtk.Image() 1474 t.add(self.img_tray) 1475 t.show_all() 1476 self.set_systray('offline') 1443 1477 gtk.main() 1444 1478 gtk.threads_leave()
