summaryrefslogtreecommitdiff
blob: 007cd25c8c9d9c3960bcddb08df4f2bd58548a1b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
diff -r 09d54b679f9d src/message_window.py
--- a/src/message_window.py	Wed Dec 01 17:03:38 2010 +0300
+++ b/src/message_window.py	Fri Dec 10 19:14:34 2010 +0300
@@ -75,6 +75,7 @@
         self.widget_name = 'message_window'
         self.xml = gtkgui_helpers.get_gtk_builder('%s.ui' % self.widget_name)
         self.window = self.xml.get_object(self.widget_name)
+        self.window.set_wmclass("%s - Gajim" % self.make_wmname(False), "gajim[%s]" % self.type_)
         self.notebook = self.xml.get_object('notebook')
         self.parent_paned = None
 
@@ -443,6 +444,20 @@
         if icon:
             self.window.set_icon(icon.get_pixbuf())
 
+    def make_wmname(self, translate=True):
+        if not translate:
+            tr = lambda x: x
+        else:
+            tr = _
+        if self.type_ == 'chat':
+            label = tr('Chats')
+        elif self.type_ == 'gc':
+            label = tr('Group Chats')
+        else:
+            label = tr('Private Chats')
+
+        return label
+
     def show_title(self, urgent=True, control=None):
         """
         Redraw the window's title
@@ -481,12 +496,7 @@
         window_mode = gajim.interface.msg_win_mgr.mode
         if window_mode == MessageWindowMgr.ONE_MSG_WINDOW_PERTYPE:
             # Show the plural form since number of tabs > 1
-            if self.type_ == 'chat':
-                label = _('Chats')
-            elif self.type_ == 'gc':
-                label = _('Group Chats')
-            else:
-                label = _('Private Chats')
+            label = self.make_wmname()
         elif window_mode == MessageWindowMgr.ONE_MSG_WINDOW_ALWAYS_WITH_ROSTER:
             label = None
         elif self.get_num_controls() == 1: