fix gtk warnings in console
This commit is contained in:
parent
3d278f814b
commit
92b50a87a6
|
@ -90,6 +90,9 @@ from common.pep import MOODS, ACTIVITIES
|
||||||
C_PADLOCK_PIXBUF, # use for account row only
|
C_PADLOCK_PIXBUF, # use for account row only
|
||||||
) = range(11)
|
) = range(11)
|
||||||
|
|
||||||
|
empty_pixbuf = GdkPixbuf.Pixbuf.new(GdkPixbuf.Colorspace.RGB, True, 8, 1, 1)
|
||||||
|
|
||||||
|
|
||||||
class RosterWindow:
|
class RosterWindow:
|
||||||
"""
|
"""
|
||||||
Class for main window of the GTK+ interface
|
Class for main window of the GTK+ interface
|
||||||
|
@ -1035,7 +1038,7 @@ class RosterWindow:
|
||||||
Gtk.STOCK_DIALOG_AUTHENTICATION, Gtk.IconSize.MENU)
|
Gtk.STOCK_DIALOG_AUTHENTICATION, Gtk.IconSize.MENU)
|
||||||
self.model[child_iter][C_PADLOCK_PIXBUF] = tls_pixbuf
|
self.model[child_iter][C_PADLOCK_PIXBUF] = tls_pixbuf
|
||||||
else:
|
else:
|
||||||
self.model[child_iter][C_PADLOCK_PIXBUF] = ""
|
self.model[child_iter][C_PADLOCK_PIXBUF] = empty_pixbuf
|
||||||
|
|
||||||
if self.regroup:
|
if self.regroup:
|
||||||
account_name = _('Merged accounts')
|
account_name = _('Merged accounts')
|
||||||
|
@ -1062,27 +1065,27 @@ class RosterWindow:
|
||||||
self.model[child_iter][C_MOOD_PIXBUF] = pep_dict['mood'].\
|
self.model[child_iter][C_MOOD_PIXBUF] = pep_dict['mood'].\
|
||||||
asPixbufIcon()
|
asPixbufIcon()
|
||||||
else:
|
else:
|
||||||
self.model[child_iter][C_MOOD_PIXBUF] = ""
|
self.model[child_iter][C_MOOD_PIXBUF] = empty_pixbuf
|
||||||
|
|
||||||
if gajim.config.get('show_activity_in_roster') and 'activity' in \
|
if gajim.config.get('show_activity_in_roster') and 'activity' in \
|
||||||
pep_dict:
|
pep_dict:
|
||||||
self.model[child_iter][C_ACTIVITY_PIXBUF] = pep_dict['activity'].\
|
self.model[child_iter][C_ACTIVITY_PIXBUF] = pep_dict['activity'].\
|
||||||
asPixbufIcon()
|
asPixbufIcon()
|
||||||
else:
|
else:
|
||||||
self.model[child_iter][C_ACTIVITY_PIXBUF] = ""
|
self.model[child_iter][C_ACTIVITY_PIXBUF] = empty_pixbuf
|
||||||
|
|
||||||
if gajim.config.get('show_tunes_in_roster') and 'tune' in pep_dict:
|
if gajim.config.get('show_tunes_in_roster') and 'tune' in pep_dict:
|
||||||
self.model[child_iter][C_TUNE_PIXBUF] = pep_dict['tune'].\
|
self.model[child_iter][C_TUNE_PIXBUF] = pep_dict['tune'].\
|
||||||
asPixbufIcon()
|
asPixbufIcon()
|
||||||
else:
|
else:
|
||||||
self.model[child_iter][C_TUNE_PIXBUF] = ""
|
self.model[child_iter][C_TUNE_PIXBUF] = empty_pixbuf
|
||||||
|
|
||||||
if gajim.config.get('show_location_in_roster') and 'location' in \
|
if gajim.config.get('show_location_in_roster') and 'location' in \
|
||||||
pep_dict:
|
pep_dict:
|
||||||
self.model[child_iter][C_LOCATION_PIXBUF] = pep_dict['location'].\
|
self.model[child_iter][C_LOCATION_PIXBUF] = pep_dict['location'].\
|
||||||
asPixbufIcon()
|
asPixbufIcon()
|
||||||
else:
|
else:
|
||||||
self.model[child_iter][C_LOCATION_PIXBUF] = ""
|
self.model[child_iter][C_LOCATION_PIXBUF] = empty_pixbuf
|
||||||
|
|
||||||
def _really_draw_accounts(self):
|
def _really_draw_accounts(self):
|
||||||
for acct in self.accounts_to_draw:
|
for acct in self.accounts_to_draw:
|
||||||
|
@ -1339,7 +1342,7 @@ class RosterWindow:
|
||||||
if pep_type in contact.pep:
|
if pep_type in contact.pep:
|
||||||
pixbuf = contact.pep[pep_type].asPixbufIcon()
|
pixbuf = contact.pep[pep_type].asPixbufIcon()
|
||||||
else:
|
else:
|
||||||
pixbuf = ""
|
pixbuf = empty_pixbuf
|
||||||
for child_iter in iters:
|
for child_iter in iters:
|
||||||
self.model[child_iter][model_column] = pixbuf
|
self.model[child_iter][model_column] = pixbuf
|
||||||
|
|
||||||
|
@ -1350,7 +1353,7 @@ class RosterWindow:
|
||||||
jid = self.model[iters[0]][C_JID].decode('utf-8')
|
jid = self.model[iters[0]][C_JID].decode('utf-8')
|
||||||
pixbuf = gtkgui_helpers.get_avatar_pixbuf_from_cache(jid)
|
pixbuf = gtkgui_helpers.get_avatar_pixbuf_from_cache(jid)
|
||||||
if pixbuf in (None, 'ask'):
|
if pixbuf in (None, 'ask'):
|
||||||
scaled_pixbuf = ""
|
scaled_pixbuf = empty_pixbuf
|
||||||
else:
|
else:
|
||||||
scaled_pixbuf = gtkgui_helpers.get_scaled_pixbuf(pixbuf, 'roster')
|
scaled_pixbuf = gtkgui_helpers.get_scaled_pixbuf(pixbuf, 'roster')
|
||||||
for child_iter in iters:
|
for child_iter in iters:
|
||||||
|
@ -2279,7 +2282,7 @@ class RosterWindow:
|
||||||
else:
|
else:
|
||||||
# No need to redraw contacts if we're quitting
|
# No need to redraw contacts if we're quitting
|
||||||
if child_iterA:
|
if child_iterA:
|
||||||
self.model[child_iterA][C_AVATAR_PIXBUF] = ''
|
self.model[child_iterA][C_AVATAR_PIXBUF] = empty_pixbuf
|
||||||
if account in gajim.con_types:
|
if account in gajim.con_types:
|
||||||
gajim.con_types[account] = None
|
gajim.con_types[account] = None
|
||||||
for jid in gajim.contacts.get_jid_list(account):
|
for jid in gajim.contacts.get_jid_list(account):
|
||||||
|
|
Loading…
Reference in New Issue