diff -ur /usr/share/gajim/src/config.py ../BUILD/gajim-0.10.1.6/src/config.py
|
old
|
new
|
|
| 3021 | 3021 | self.go_online_checkbutton.show() |
| 3022 | 3022 | self.show_vcard_checkbutton.show() |
| 3023 | 3023 | img = self.xml.get_widget('finish_image') |
| 3024 | | path_to_file = os.path.join(gajim.DATA_DIR, 'pixmaps', 'gajim.png') |
| | 3024 | path_to_file = gtkgui_helpers.get_icon_path('gajim.png', 48) |
| 3025 | 3025 | img.set_from_file(path_to_file) |
| 3026 | 3026 | |
| 3027 | 3027 | finish_text = '<big><b>%s</b></big>\n\n%s' % ( |
diff -ur /usr/share/gajim/src/dialogs.py ../BUILD/gajim-0.10.1.6/src/dialogs.py
|
old
|
new
|
|
| 767 | 767 | if gtk.pygtk_version >= (2, 8, 0) and gtk.gtk_version >= (2, 8, 0): |
| 768 | 768 | dlg.props.wrap_license = True |
| 769 | 769 | |
| 770 | | pixbuf = gtk.gdk.pixbuf_new_from_file(os.path.join( |
| 771 | | gajim.DATA_DIR, 'pixmaps', 'gajim_about.png')) |
| | 770 | pixbuf = gtkgui_helpers.get_icon_pixmap('gajim-about', 64) |
| 772 | 771 | |
| 773 | 772 | dlg.set_logo(pixbuf) |
| 774 | 773 | #here you write your name in the form Name FamilyName <someone@somewhere> |
| … |
… |
|
| 1342 | 1341 | |
| 1343 | 1342 | # default image |
| 1344 | 1343 | if not path_to_image: |
| 1345 | | path_to_image = os.path.abspath( |
| 1346 | | os.path.join(gajim.DATA_DIR, 'pixmaps', 'events', |
| 1347 | | 'chat_msg_recv.png')) # img to display |
| | 1344 | path_to_image = gtkgui_helpers.get_icon_path('chat_msg_recv.png', 48) # img to display |
| 1348 | 1345 | |
| 1349 | 1346 | if event_type == _('Contact Signed In'): |
| 1350 | 1347 | bg_color = 'limegreen' |
diff -ur /usr/share/gajim/src/gajim.py ../BUILD/gajim-0.10.1.6/src/gajim.py
|
old
|
new
|
|
| 153 | 153 | pid_filename += '.pid' |
| 154 | 154 | import dialogs |
| 155 | 155 | if os.path.exists(pid_filename): |
| 156 | | path_to_file = os.path.join(gajim.DATA_DIR, 'pixmaps/gajim.png') |
| 157 | | pix = gtk.gdk.pixbuf_new_from_file(path_to_file) |
| | 156 | pix = gtkgui_helpers.get_icon_pixmap('gajim') |
| 158 | 157 | gtk.window_set_default_icon(pix) # set the icon to all newly opened wind |
| 159 | 158 | pritext = _('Gajim is already running') |
| 160 | 159 | sectext = _('Another instance of Gajim seems to be running\nRun anyway?') |
| … |
… |
|
| 301 | 300 | |
| 302 | 301 | def handle_event_connection_lost(self, account, array): |
| 303 | 302 | # ('CONNECTION_LOST', account, [title, text]) |
| 304 | | path = os.path.join(gajim.DATA_DIR, 'pixmaps', 'events', |
| 305 | | 'connection_lost.png') |
| 306 | | path = gtkgui_helpers.get_path_to_generic_or_avatar(path) |
| | 303 | image = gtkgui_helpers.get_icon_path('gajim-connection_lost', 48) |
| | 304 | path = gtkgui_helpers.get_path_to_generic_or_avatar(image) |
| 307 | 305 | notify.popup(_('Connection Failed'), account, account, |
| 308 | 306 | 'connection_failed', path, array[0], array[1]) |
| 309 | 307 | |
| … |
… |
|
| 973 | 971 | array[3])) |
| 974 | 972 | |
| 975 | 973 | if helpers.allow_showing_notification(account, 'notify_on_new_message'): |
| 976 | | path = os.path.join(gajim.DATA_DIR, 'pixmaps', 'events', |
| 977 | | 'gc_invitation.png') |
| | 974 | path = gtkgui_helpers.get_icon_path('gajim-gc_invitation.png', 48) |
| 978 | 975 | path = gtkgui_helpers.get_path_to_generic_or_avatar(path) |
| 979 | 976 | event_type = _('Groupchat Invitation') |
| 980 | 977 | notify.popup(event_type, jid, account, 'gc-invitation', path, |
| … |
… |
|
| 1076 | 1073 | self.add_event(account, jid, 'file-send-error', file_props) |
| 1077 | 1074 | |
| 1078 | 1075 | if helpers.allow_showing_notification(account): |
| 1079 | | img = os.path.join(gajim.DATA_DIR, 'pixmaps', 'events', 'ft_error.png') |
| | 1076 | img = gtkhui_helpers.get_icon_path('gajim-ft_error', 48) |
| 1080 | 1077 | path = gtkgui_helpers.get_path_to_generic_or_avatar(img) |
| 1081 | 1078 | event_type = _('File Transfer Error') |
| 1082 | 1079 | notify.popup(event_type, jid, account, 'file-send-error', path, |
| … |
… |
|
| 1087 | 1084 | gmail_new_messages = int(array[1]) |
| 1088 | 1085 | gmail_messages_list = array[2] |
| 1089 | 1086 | if gajim.config.get('notify_on_new_gmail_email'): |
| 1090 | | img = os.path.join(gajim.DATA_DIR, 'pixmaps', 'events', |
| 1091 | | 'new_email_recv.png') |
| | 1087 | img = gtkgui_helpers.get_image_path('gajim-new_email_recv', 48) |
| 1092 | 1088 | title = _('New mail on %(gmail_mail_address)s') % \ |
| 1093 | 1089 | {'gmail_mail_address': jid} |
| 1094 | 1090 | text = i18n.ngettext('You have %d new mail conversation', |
| … |
… |
|
| 1211 | 1207 | |
| 1212 | 1208 | if helpers.allow_showing_notification(account): |
| 1213 | 1209 | # check if we should be notified |
| 1214 | | img = os.path.join(gajim.DATA_DIR, 'pixmaps', 'events', 'ft_error.png') |
| 1215 | | |
| | 1210 | img = gtkgui_helpers.get_icon_path('gajim-ft_error', 48) |
| 1216 | 1211 | path = gtkgui_helpers.get_path_to_generic_or_avatar(img) |
| 1217 | 1212 | event_type = _('File Transfer Error') |
| 1218 | 1213 | notify.popup(event_type, jid, account, msg_type, path, |
| … |
… |
|
| 1233 | 1228 | self.add_event(account, jid, 'file-request', file_props) |
| 1234 | 1229 | |
| 1235 | 1230 | if helpers.allow_showing_notification(account): |
| 1236 | | img = os.path.join(gajim.DATA_DIR, 'pixmaps', 'events', |
| 1237 | | 'ft_request.png') |
| | 1231 | img = gtkgui_helpers.get_icon_path('gajim-ft_request', 48) |
| 1238 | 1232 | txt = _('%s wants to send you a file.') % gajim.get_name_from_jid( |
| 1239 | 1233 | account, jid) |
| 1240 | 1234 | path = gtkgui_helpers.get_path_to_generic_or_avatar(img) |
| … |
… |
|
| 1299 | 1293 | if event_type == _('File Transfer Completed'): |
| 1300 | 1294 | txt = _('You successfully received %(filename)s from %(name)s.')\ |
| 1301 | 1295 | % {'filename': filename, 'name': name} |
| 1302 | | img = 'ft_done.png' |
| | 1296 | img = 'gajim-ft_done' |
| 1303 | 1297 | else: # ft stopped |
| 1304 | 1298 | txt = _('File transfer of %(filename)s from %(name)s stopped.')\ |
| 1305 | 1299 | % {'filename': filename, 'name': name} |
| 1306 | | img = 'ft_stopped.png' |
| | 1300 | img = 'gajim-ft_stopped' |
| 1307 | 1301 | else: |
| 1308 | 1302 | receiver = file_props['receiver'] |
| 1309 | 1303 | if hasattr(receiver, 'jid'): |
| … |
… |
|
| 1316 | 1310 | if event_type == _('File Transfer Completed'): |
| 1317 | 1311 | txt = _('You successfully sent %(filename)s to %(name)s.')\ |
| 1318 | 1312 | % {'filename': filename, 'name': name} |
| 1319 | | img = 'ft_done.png' |
| | 1313 | img = 'gajim-ft_done' |
| 1320 | 1314 | else: # ft stopped |
| 1321 | 1315 | txt = _('File transfer of %(filename)s to %(name)s stopped.')\ |
| 1322 | 1316 | % {'filename': filename, 'name': name} |
| 1323 | | img = 'ft_stopped.png' |
| 1324 | | img = os.path.join(gajim.DATA_DIR, 'pixmaps', 'events', img) |
| | 1317 | img = 'gajim-ft_stopped' |
| | 1318 | img = gtkgui_helpers.get_icon_path(img, 48) |
| 1325 | 1319 | path = gtkgui_helpers.get_path_to_generic_or_avatar(img) |
| 1326 | 1320 | else: |
| 1327 | 1321 | txt = '' |
| … |
… |
|
| 1947 | 1941 | |
| 1948 | 1942 | self.show_vcard_when_connect = [] |
| 1949 | 1943 | |
| 1950 | | path_to_file = os.path.join(gajim.DATA_DIR, 'pixmaps/gajim.png') |
| 1951 | | pix = gtk.gdk.pixbuf_new_from_file(path_to_file) |
| | 1944 | pix = gtkgui_helpers.get_icon_pixmap('gajim') |
| | 1945 | path_to_file = gtkgui_helpers.get_icon_path('gajim') |
| 1952 | 1946 | gtk.window_set_default_icon(pix) # set the icon to all newly opened windows |
| 1953 | 1947 | self.roster.window.set_icon_from_file(path_to_file) # and to roster window |
| 1954 | 1948 | self.sleeper = common.sleepy.Sleepy( |
diff -ur /usr/share/gajim/src/gtkgui_helpers.py ../BUILD/gajim-0.10.1.6/src/gtkgui_helpers.py
|
old
|
new
|
|
| 48 | 48 | screen_w = gtk.gdk.screen_width() |
| 49 | 49 | screen_h = gtk.gdk.screen_height() |
| 50 | 50 | |
| | 51 | gtk_icon_theme = gtk.icon_theme_get_default() |
| | 52 | |
| | 53 | def get_icon_pixmap(icon_name, size = 16): |
| | 54 | try: |
| | 55 | return gtk_icon_theme.load_icon(icon_name, size, 0) |
| | 56 | except gobject.GError, e: |
| | 57 | print ("Unable to load icon %s" % icon_name), e |
| | 58 | |
| | 59 | def get_icon_path(icon_name, size = 16): |
| | 60 | try: |
| | 61 | icon_info = gtk_icon_theme.lookup_icon(icon_name, size, 0) |
| | 62 | if icon_info == None: |
| | 63 | print "Icon not found: %s" % icon_name |
| | 64 | return "" |
| | 65 | else: |
| | 66 | return icon_info.get_filename() |
| | 67 | except gobject.GError, e: |
| | 68 | print ("Unable to find icon %s" % icon_name), e |
| | 69 | |
| 51 | 70 | GLADE_DIR = os.path.join('..', 'data', 'glade') |
| 52 | 71 | def get_glade(file_name, root = None): |
| 53 | 72 | file_path = os.path.join(GLADE_DIR, file_name) |
diff -ur /usr/share/gajim/src/history_manager.py ../BUILD/gajim-0.10.1.6/src/history_manager.py
|
old
|
new
|
|
| 56 | 56 | |
| 57 | 57 | class HistoryManager: |
| 58 | 58 | def __init__(self): |
| 59 | | path_to_file = os.path.join(gajim.DATA_DIR, 'pixmaps/gajim.png') |
| | 59 | path_to_file = gtkgui_helpers.get_icon_path('gajim') |
| 60 | 60 | pix = gtk.gdk.pixbuf_new_from_file(path_to_file) |
| 61 | 61 | gtk.window_set_default_icon(pix) # set the icon to all newly opened windows |
| 62 | 62 | |
diff -ur /usr/share/gajim/src/notify.py ../BUILD/gajim-0.10.1.6/src/notify.py
|
old
|
new
|
|
| 201 | 201 | if status_message: |
| 202 | 202 | text = text + " : " + status_message |
| 203 | 203 | popup(_('Contact Changed Status'), jid, account, |
| 204 | | path_to_image = path, title = title, text = text) |
| | 204 | image = path, title = title, text = text) |
| 205 | 205 | elif event == 'contact_connected': |
| 206 | 206 | title = _('%(nickname)s Signed In') % \ |
| 207 | 207 | {'nickname': gajim.get_name_from_jid(account, jid)} |
| … |
… |
|
| 209 | 209 | if status_message: |
| 210 | 210 | text = status_message |
| 211 | 211 | popup(_('Contact Signed In'), jid, account, |
| 212 | | path_to_image = path, title = title, text = text) |
| | 212 | image = path, title = title, text = text) |
| 213 | 213 | elif event == 'contact_disconnected': |
| 214 | 214 | title = _('%(nickname)s Signed Out') % \ |
| 215 | 215 | {'nickname': gajim.get_name_from_jid(account, jid)} |
| … |
… |
|
| 217 | 217 | if status_message: |
| 218 | 218 | text = status_message |
| 219 | 219 | popup(_('Contact Signed Out'), jid, account, |
| 220 | | path_to_image = path, title = title, text = text) |
| | 220 | image = path, title = title, text = text) |
| 221 | 221 | elif event == 'new_message': |
| 222 | 222 | if message_type == 'normal': # single message |
| 223 | 223 | event_type = _('New Single Message') |
| 224 | | img = os.path.join(gajim.DATA_DIR, 'pixmaps', 'events', |
| 225 | | 'single_msg_recv.png') |
| | 224 | img = 'gajim-single_msg_recv' |
| 226 | 225 | title = _('New Single Message from %(nickname)s') % \ |
| 227 | 226 | {'nickname': nickname} |
| 228 | 227 | text = message |
| 229 | 228 | elif message_type == 'pm': # private message |
| 230 | 229 | event_type = _('New Private Message') |
| 231 | 230 | room_name = gajim.get_nick_from_jid(jid) |
| 232 | | img = os.path.join(gajim.DATA_DIR, 'pixmaps', 'events', |
| 233 | | 'priv_msg_recv.png') |
| | 231 | img = 'gajim-priv_msg_recv' |
| 234 | 232 | title = _('New Private Message from group chat %s') % room_name |
| 235 | 233 | text = _('%(nickname)s: %(message)s') % {'nickname': nickname, |
| 236 | 234 | 'message': message} |
| 237 | 235 | else: # chat message |
| 238 | 236 | event_type = _('New Message') |
| 239 | | img = os.path.join(gajim.DATA_DIR, 'pixmaps', 'events', |
| 240 | | 'chat_msg_recv.png') |
| | 237 | img = 'gajim-chat_msg_recv.png' |
| 241 | 238 | title = _('New Message from %(nickname)s') % \ |
| 242 | 239 | {'nickname': nickname} |
| 243 | 240 | text = message |
| 244 | | path = gtkgui_helpers.get_path_to_generic_or_avatar(img) |
| 245 | 241 | popup(event_type, jid, account, message_type, |
| 246 | | path_to_image = path, title = title, text = text) |
| | 242 | image = img, title = title, text = text) |
| 247 | 243 | |
| 248 | 244 | if do_sound: |
| 249 | 245 | snd_file = None |
| … |
… |
|
| 275 | 271 | except: |
| 276 | 272 | pass |
| 277 | 273 | |
| 278 | | def popup(event_type, jid, account, msg_type = '', path_to_image = None, |
| | 274 | def popup(event_type, jid, account, msg_type = '', image = None, |
| 279 | 275 | title = None, text = None): |
| 280 | 276 | '''Notifies a user of an event. It first tries to a valid implementation of |
| 281 | 277 | the Desktop Notification Specification. If that fails, then we fall back to |
| … |
… |
|
| 286 | 282 | if gajim.config.get('use_notif_daemon') and dbus_support.supported: |
| 287 | 283 | try: |
| 288 | 284 | DesktopNotification(event_type, jid, account, msg_type, |
| 289 | | path_to_image, title, text) |
| | 285 | image, title, text) |
| 290 | 286 | return # sucessfully did D-Bus Notification procedure! |
| 291 | 287 | except dbus.dbus_bindings.DBusException, e: |
| 292 | 288 | # Connection to D-Bus failed |
| … |
… |
|
| 301 | 297 | if not title: |
| 302 | 298 | title = event_type |
| 303 | 299 | # default image |
| 304 | | if not path_to_image: |
| 305 | | path_to_image = os.path.abspath( |
| 306 | | os.path.join(gajim.DATA_DIR, 'pixmaps', 'events', |
| 307 | | 'chat_msg_recv.png')) # img to display |
| | 300 | if not image: |
| | 301 | path_to_image = gtkgui_helpers.get_icon_path('gajim-chat_msg_recv', 48) # img to display |
| | 302 | else: |
| | 303 | path_to_image = gtkgui_helpers.get_icon_path(image, 48) |
| 308 | 304 | |
| 309 | 305 | |
| 310 | 306 | notification = pynotify.Notification(title, text) |
| … |
… |
|
| 433 | 429 | ntype = 'connection.failed' |
| 434 | 430 | else: |
| 435 | 431 | # default failsafe values |
| 436 | | self.path_to_image = os.path.abspath( |
| 437 | | os.path.join(gajim.DATA_DIR, 'pixmaps', 'events', |
| 438 | | 'chat_msg_recv.png')) # img to display |
| | 432 | self.path_to_image = gtkgui_helpers.get_icon_path('gajim-chat_msg_recv', 48) # img to display |
| 439 | 433 | ntype = 'im' # Notification Type |
| 440 | 434 | |
| 441 | 435 | self.notif = dbus_support.get_notifications_interface() |
diff -ur /usr/share/gajim/src/roster_window.py ../BUILD/gajim-0.10.1.6/src/roster_window.py
|
old
|
new
|
|
| 1417 | 1417 | |
| 1418 | 1418 | if not our_jid: |
| 1419 | 1419 | # add a special img for rename menuitem |
| 1420 | | path_to_kbd_input_img = os.path.join(gajim.DATA_DIR, 'pixmaps', |
| 1421 | | 'kbd_input.png') |
| | 1420 | path_to_kbd_input_img = gtkgui_helpers.get_icon_path('gajim-kbd_input') |
| 1422 | 1421 | img = gtk.Image() |
| 1423 | 1422 | img.set_from_file(path_to_kbd_input_img) |
| 1424 | 1423 | rename_menuitem.set_image(img) |
| … |
… |
|
| 1536 | 1535 | |
| 1537 | 1536 | if not our_jid: |
| 1538 | 1537 | # add a special img for rename menuitem |
| 1539 | | path_to_kbd_input_img = os.path.join(gajim.DATA_DIR, 'pixmaps', |
| 1540 | | 'kbd_input.png') |
| | 1538 | path_to_kbd_input_img = gtkgui_helpers.get_icon_path('kbd_input.png') |
| 1541 | 1539 | img = gtk.Image() |
| 1542 | 1540 | img.set_from_file(path_to_kbd_input_img) |
| 1543 | 1541 | rename_menuitem.set_image(img) |
| … |
… |
|
| 1829 | 1827 | |
| 1830 | 1828 | rename_item = gtk.ImageMenuItem(_('Re_name')) |
| 1831 | 1829 | # add a special img for rename menuitem |
| 1832 | | path_to_kbd_input_img = os.path.join(gajim.DATA_DIR, 'pixmaps', |
| 1833 | | 'kbd_input.png') |
| | 1830 | path_to_kbd_input_img = gtkgui_helpers.get_icon_path('gajim-kbd_input') |
| 1834 | 1831 | img = gtk.Image() |
| 1835 | 1832 | img.set_from_file(path_to_kbd_input_img) |
| 1836 | 1833 | rename_item.set_image(img) |
| … |
… |
|
| 1890 | 1887 | |
| 1891 | 1888 | item = gtk.ImageMenuItem(_('_Rename')) |
| 1892 | 1889 | # add a special img for rename menuitem |
| 1893 | | path_to_kbd_input_img = os.path.join(gajim.DATA_DIR, 'pixmaps', |
| 1894 | | 'kbd_input.png') |
| | 1890 | path_to_kbd_input_img = gtkgui_helpers.get_icon_path('gajim-kbd_input') |
| 1895 | 1891 | img = gtk.Image() |
| 1896 | 1892 | img.set_from_file(path_to_kbd_input_img) |
| 1897 | 1893 | item.set_image(img) |
| … |
… |
|
| 1976 | 1972 | sub_menu.append(item) |
| 1977 | 1973 | |
| 1978 | 1974 | item = gtk.ImageMenuItem(_('_Change Status Message')) |
| 1979 | | path = os.path.join(gajim.DATA_DIR, 'pixmaps', 'kbd_input.png') |
| | 1975 | path = gtkgui_helpers.get_icon_path('gajim-kbd_input') |
| 1980 | 1976 | img = gtk.Image() |
| 1981 | 1977 | img.set_from_file(path) |
| 1982 | 1978 | item.set_image(img) |
| … |
… |
|
| 2038 | 2034 | sub_menu.append(item) |
| 2039 | 2035 | |
| 2040 | 2036 | item = gtk.ImageMenuItem(_('_Change Status Message')) |
| 2041 | | path = os.path.join(gajim.DATA_DIR, 'pixmaps', 'kbd_input.png') |
| | 2037 | path = gtkgui_helpers.get_icon_path('gajim-kbd_input') |
| 2042 | 2038 | img = gtk.Image() |
| 2043 | 2039 | img.set_from_file(path) |
| 2044 | 2040 | item.set_image(img) |
| … |
… |
|
| 4067 | 4063 | # Add a Separator (self.iter_is_separator() checks on string SEPARATOR) |
| 4068 | 4064 | liststore.append(['SEPARATOR', None, '', True]) |
| 4069 | 4065 | |
| 4070 | | path = os.path.join(gajim.DATA_DIR, 'pixmaps', 'kbd_input.png') |
| | 4066 | path = gtk_gui_helpers.get_icon_path('gajim-kbd_input') |
| 4071 | 4067 | img = gtk.Image() |
| 4072 | 4068 | img.set_from_file(path) |
| 4073 | 4069 | # sensitivity to False because by default we're offline |
diff -ur /usr/share/gajim/src/systray.py ../BUILD/gajim-0.10.1.6/src/systray.py
|
old
|
new
|
|
| 139 | 139 | sub_menu.append(item) |
| 140 | 140 | |
| 141 | 141 | item = gtk.ImageMenuItem(_('_Change Status Message...')) |
| 142 | | path = os.path.join(gajim.DATA_DIR, 'pixmaps', 'kbd_input.png') |
| | 142 | path = gtkgui_helpers.get_icon_path('gajim-kbd_input') |
| 143 | 143 | img = gtk.Image() |
| 144 | 144 | img.set_from_file(path) |
| 145 | 145 | item.set_image(img) |