diff --git a/README b/README index e1d35c9edb6d3099328007f3a5ebbd5baa62c92a..4240a0a284f6ce0cf0b74c2bce4d859f931f02e1 100644 --- a/README +++ b/README @@ -34,3 +34,9 @@ Enjoy! (C) 2005 The Gajim Team http://gajim.org + + + +ps. +sounds & emoticons taken from Psi +'gossip' iconstyle taken from Imendio Gossip diff --git a/plugins/gtkgui/chat.py b/plugins/gtkgui/chat.py index 76cf0e0c81775deb21ab0e22268f92334bf403a1..71702529ea846d4b3e5381c5c8e55b56503cd005 100644 --- a/plugins/gtkgui/chat.py +++ b/plugins/gtkgui/chat.py @@ -116,7 +116,7 @@ class Chat: def on_window_destroy(self, widget, kind): #kind is 'chats' or 'gc' #clean self.plugin.windows[self.account][kind] for jid in self.xmls: - if self.nb_unread[jid] > 0: + if self.plugin.systray_enabled and self.nb_unread[jid] > 0: self.plugin.systray.remove_jid(jid, self.account) del self.plugin.windows[self.account][kind][jid] if self.print_time_timeout_id.has_key(jid): @@ -154,7 +154,8 @@ class Chat: self.nb_unread[jid] = 0 self.redraw_tab(jid) self.show_title() - self.plugin.systray.remove_jid(jid, self.account) + if self.plugin.systray_enabled: + self.plugin.systray.remove_jid(jid, self.account) def on_chat_notebook_switch_page(self, notebook, page, page_num): new_child = notebook.get_nth_page(page_num) @@ -175,7 +176,8 @@ class Chat: self.nb_unread[new_jid] = 0 self.redraw_tab(new_jid) self.show_title() - self.plugin.systray.remove_jid(new_jid, self.account) + if self.plugin.systray_enabled: + self.plugin.systray.remove_jid(new_jid, self.account) def active_tab(self, jid): self.notebook.set_current_page(\ @@ -188,7 +190,8 @@ class Chat: if self.nb_unread[jid] > 0: self.nb_unread[jid] = 0 self.show_title() - self.plugin.systray.remove_jid(jid, self.account) + if self.plugin.systray_enabled: + self.plugin.systray.remove_jid(jid, self.account) if self.print_time_timeout_id.has_key(jid): gobject.source_remove(self.print_time_timeout_id[jid]) del self.print_time_timeout_id[jid] @@ -331,7 +334,8 @@ class Chat: self.nb_unread[jid] = 0 self.redraw_tab(jid) self.show_title() - self.plugin.systray.remove_jid(jid, self.account) + if self.plugin.systray_enabled: + self.plugin.systray.remove_jid(jid, self.account) def on_conversation_textview_motion_notify_event(self, widget, event): """change the cursor to a hand when we are on a mail or an url""" @@ -484,12 +488,14 @@ class Chat: self.plugin.emoticons[emot_ascii]) elif special_text.startswith('mailto:'): #it's a mail + special_text = special_text[0:-1] tags.append('mail') use_other_tags = False elif self.plugin.sth_at_sth_dot_sth_re.match(special_text): #it's a mail tags.append('mail') use_other_tags = False + special_text = special_text[0:-1] elif special_text.startswith('*'): # it's a bold text tags.append('bold') if special_text[1] == '/': # it's also italic @@ -589,6 +595,7 @@ class Chat: if ((jid != self.get_active_jid()) or (not self.window.is_active()) or \ (not end)) and kind == 'incoming': self.nb_unread[jid] += 1 - self.plugin.systray.add_jid(jid, self.account) + if self.plugin.systray_enabled: + self.plugin.systray.add_jid(jid, self.account) self.redraw_tab(jid) self.show_title() diff --git a/plugins/gtkgui/config.py b/plugins/gtkgui/config.py index 981e6da72d70bf3ef0534595d3d4cb15dbca749d..eef2b919c59da249fd9fd30fbe419b01d5a8143a 100644 --- a/plugins/gtkgui/config.py +++ b/plugins/gtkgui/config.py @@ -716,11 +716,12 @@ class Preferences_window: self.notebook = self.xml.get_widget('preferences_notebook') #trayicon - st = self.plugin.config['trayicon'] - self.tray_icon_checkbutton.set_active(st) - if isinstance(self.plugin.systray, gtkgui.systrayDummy): + if self.plugin.systray_capabilities: + st = self.plugin.config['trayicon'] + self.tray_icon_checkbutton.set_active(st) + else: self.tray_icon_checkbutton.set_sensitive(False) - + #Save position st = self.plugin.config['saveposition'] self.xml.get_widget('save_position_checkbutton').set_active(st) diff --git a/plugins/gtkgui/gtkgui.py b/plugins/gtkgui/gtkgui.py index c10ce4e8d7e17bc31aca8cc19c9def4b04ab511b..28591c0900470dfd37db6d5019f2f3bc455d8e97 100644 --- a/plugins/gtkgui/gtkgui.py +++ b/plugins/gtkgui/gtkgui.py @@ -738,13 +738,11 @@ class plugin: # [^\s*] anything but whitespaces and '*' # (?<!\S) is a one char lookbehind assertion and asks for any leading whitespace # and mathces beginning of lines so we have correct formatting detection - # even if the the text is just '*something*' + # even if the the text is just '*foo*' # (?!\S) is the same thing but it's a lookahead assertion - # basic_pattern is one string literal. - # I've put spaces to make the regexp look better. - links = r'\bhttp://[^)\s]+|' r'\bhttps://[^)\s]+|' r'\bnews://[^)\s]+|' r'\bftp://[^)\s]+|' r'\bed2k://[^)\s]+|' r'\bwww\.[^)\s]+|' r'\bftp\.[^)\s]+|' + links = r'\bhttp://\S+|' r'\bhttps://\S+|' r'\bnews://\S+|' r'\bftp://\S+|' r'\bed2k://\S+|' r'\bwww\.\S+|' r'\bftp\.\S+|' #2nd one: at_least_one_char@at_least_one_char.at_least_one_char - mail = r'\bmailto:[^)\s]+|' r'\b[^)\s]+@[^)\s]+\.[^)\s]+|' + mail = r'\bmailto:\S+|' r'\b\S+@\S+\.\S+|' #detects eg. *b* *bold* *bold bold* test *bold* #doesn't detect (it's a feature :P) * bold* *bold * * bold * test*bold* @@ -908,8 +906,9 @@ class plugin: except: # user doesn't have trayicon capabilities self.config['trayicon'] = 0 self.send('CONFIG', None, ('GtkGui', self.config, 'GtkGui')) - self.systray = systrayDummy() + self.systray_capabilities = False else: + self.systray_capabilities = True self.systray = systray(self) else: self.systray = systray(self) diff --git a/plugins/gtkgui/roster_window.py b/plugins/gtkgui/roster_window.py index 0824fe0653dd1059e64890c72ba360bac41c94bc..f8c8d68f1c1c8cf891217ec2e5a2a1588b216626 100644 --- a/plugins/gtkgui/roster_window.py +++ b/plugins/gtkgui/roster_window.py @@ -877,7 +877,8 @@ class Roster_window: model = self.tree.get_model() self.plugin.queues[account][jid] = Queue.Queue(50) self.redraw_jid(jid, account) - self.plugin.systray.add_jid(jid, account) + if self.plugin.systray_enabled: + self.plugin.systray.add_jid(jid, account) self.plugin.queues[account][jid].put((msg, tim)) self.nb_unread += 1 self.show_title() @@ -1307,7 +1308,20 @@ class Roster_window: cell = gtk.CellRendererText() self.cb.pack_start(cell, True) self.cb.add_attribute(cell, 'text', 0) - for status in ['online', 'away', 'xa', 'dnd', 'invisible', 'offline']: + for status in ['online', 'dnd', 'away', 'xa', 'invisible', 'offline']: + ''' GIVES ERROR in core.py line: 805 + First I like status to be Online and not online + and jargon word as dnd and xa should be as I have them + that means either this code, or changing 'xa' and 'dnd' all over + you know the core better yann so let us talk on this + if status == 'dnd': + status_better = 'Busy' + elif status == 'xa': + status_better = 'Extended Away' + else: + status_better = status.capitalize() + iter = liststore.append([status_better, self.pixbufs[status]]) + ''' iter = liststore.append([status, self.pixbufs[status]]) self.cb.show_all() self.cb.set_model(liststore) diff --git a/plugins/gtkgui/systray.py b/plugins/gtkgui/systray.py index 744db6ee74aa576c4d5d824f2bc82676bcedfd69..f37a69b9c4304fbc855608d97a00349a6750a063 100644 --- a/plugins/gtkgui/systray.py +++ b/plugins/gtkgui/systray.py @@ -31,22 +31,6 @@ gtk.glade.textdomain(APP) GTKGUI_GLADE='plugins/gtkgui/gtkgui.glade' -class systrayDummy: - """Class when we don't want icon in the systray""" - def add_jid(self, jid, account): - pass - def remove_jid(self, jid, account): - pass - def set_status(self, status): - pass - def show_icon(self): - pass - def hide_icon(self): - pass - def __init__(self): - self.t = gtk.Button() - self.jids = [] - class systray: """Class for icon in the systray""" def set_img(self): @@ -61,8 +45,6 @@ class systray: self.img_tray.set_from_pixbuf(image.get_pixbuf()) def add_jid(self, jid, account): - if not self.t: # the systray is hidden - return list = [account, jid] if not list in self.jids: self.jids.append(list) @@ -83,8 +65,6 @@ class systray: self.tip.set_tip(self.t, label) def remove_jid(self, jid, account): - if not self.t: # the systray is hidden - return list = [account, jid] if list in self.jids: self.jids.remove(list) diff --git a/plugins/gtkgui/tabbed_chat_window.py b/plugins/gtkgui/tabbed_chat_window.py index 441bf4fc45474fbca9fbeb9edfea5c71d8dbbdce..724032d7c2aee69a7dec736f4e885b0d6c2cab36 100644 --- a/plugins/gtkgui/tabbed_chat_window.py +++ b/plugins/gtkgui/tabbed_chat_window.py @@ -200,7 +200,8 @@ class Tabbed_chat_window(Chat): self.plugin.roster.show_title() del self.plugin.queues[self.account][jid] self.plugin.roster.redraw_jid(jid, self.account) - self.plugin.systray.remove_jid(jid, self.account) + if self.plugin.systray_enabled: + self.plugin.systray.remove_jid(jid, self.account) showOffline = self.plugin.config['showoffline'] if (user.show == 'offline' or user.show == 'error') and \ not showOffline: