diff options
author | Yann Leboulanger <asterix@lagaule.org> | 2015-07-30 16:18:03 +0300 |
---|---|---|
committer | Yann Leboulanger <asterix@lagaule.org> | 2015-07-30 16:18:03 +0300 |
commit | 9287ad96b016fb80f27b8c82951ccf5480b9f4fa (patch) | |
tree | c8114951afd24db0fceb5e7e01454b247a89e431 | |
parent | 5c0fce96680c1a6cd3c398bda118ecc6ab5cdd3b (diff) |
fix some warnings
-rw-r--r-- | data/iconsets/sun/16x16/closed.png | bin | 133 -> 156 bytes | |||
-rw-r--r-- | data/iconsets/sun/16x16/opened.png | bin | 125 -> 156 bytes | |||
-rw-r--r-- | src/common/socks5.py | 4 | ||||
-rw-r--r-- | src/config.py | 18 | ||||
-rw-r--r-- | src/dataforms_widget.py | 3 | ||||
-rw-r--r-- | src/dialogs.py | 14 | ||||
-rw-r--r-- | src/gajim_themes_window.py | 13 | ||||
-rw-r--r-- | src/secrets.py | 4 | ||||
-rw-r--r-- | src/vcard.py | 4 |
9 files changed, 34 insertions, 26 deletions
diff --git a/data/iconsets/sun/16x16/closed.png b/data/iconsets/sun/16x16/closed.png Binary files differindex d89883096..f3f7eb713 100644 --- a/data/iconsets/sun/16x16/closed.png +++ b/data/iconsets/sun/16x16/closed.png diff --git a/data/iconsets/sun/16x16/opened.png b/data/iconsets/sun/16x16/opened.png Binary files differindex 198a2ed2f..5e1d6a06f 100644 --- a/data/iconsets/sun/16x16/opened.png +++ b/data/iconsets/sun/16x16/opened.png diff --git a/src/common/socks5.py b/src/common/socks5.py index 754089bac..48ca72e8c 100644 --- a/src/common/socks5.py +++ b/src/common/socks5.py @@ -419,10 +419,10 @@ class SocksQueue: self.connected -= 1 def remove_by_mode(self, sid, mode, do_disconnect=True): - for (key, sock) in self.senders.items(): + for (key, sock) in self.senders.copy().items(): if key[0] == sid and sock.mode == mode: self.remove_sender_by_key(key) - for (key, sock) in self.readers.items(): + for (key, sock) in self.readers.copy().items(): if key[0] == sid and sock.mode == mode: self.remove_receiver_by_key(key) diff --git a/src/config.py b/src/config.py index a9b047dd9..c75777677 100644 --- a/src/config.py +++ b/src/config.py @@ -954,22 +954,24 @@ class PreferencesWindow: col = gajim.config.get(c) if col: if isinstance(col_to_widget[c], list): - self.xml.get_object(col_to_widget[c][0]).set_color( - Gdk.color_parse(col)) + rgba = Gdk.RGBA() + rgba.parse(col) + self.xml.get_object(col_to_widget[c][0]).set_rgba(rgba) self.xml.get_object(col_to_widget[c][0]).set_sensitive(True) self.xml.get_object(col_to_widget[c][1]).set_active(True) else: - self.xml.get_object(col_to_widget[c]).set_color( - Gdk.color_parse(col)) + rgba = Gdk.RGBA() + rgba.parse(col) + self.xml.get_object(col_to_widget[c]).set_rgba(rgba) else: + rgba = Gdk.RGBA() + rgba.parse('#000000') if isinstance(col_to_widget[c], list): - self.xml.get_object(col_to_widget[c][0]).set_color( - Gdk.color_parse('#000000')) + self.xml.get_object(col_to_widget[c][0]).set_rgba(rgba) self.xml.get_object(col_to_widget[c][0]).set_sensitive(False) self.xml.get_object(col_to_widget[c][1]).set_active(False) else: - self.xml.get_object(col_to_widget[c]).set_color( - Gdk.color_parse('#000000')) + self.xml.get_object(col_to_widget[c]).set_rgba(rgba) def on_reset_colors_button_clicked(self, widget): col_to_widget = {'inmsgcolor': 'incoming_nick_colorbutton', diff --git a/src/dataforms_widget.py b/src/dataforms_widget.py index 7f979461e..a408a2987 100644 --- a/src/dataforms_widget.py +++ b/src/dataforms_widget.py @@ -421,7 +421,8 @@ class SingleForm(Gtk.Table, object): # 5 option max: show checkbutton widget = Gtk.VBox() for value, label in field.iter_options(): - check = Gtk.CheckButton(label, use_underline=False) + check = Gtk.CheckButton(label=label, + use_underline=False) check.set_active(value in field.values) check.connect('toggled', self.on_list_multi_checkbutton_toggled, field, value) diff --git a/src/dialogs.py b/src/dialogs.py index e71511c1a..76d5b64e5 100644 --- a/src/dialogs.py +++ b/src/dialogs.py @@ -1663,7 +1663,7 @@ class YesNoDialog(HigDialog): on_response_no=self.on_response_no) if checktext: - self.checkbutton = Gtk.CheckButton(checktext) + self.checkbutton = Gtk.CheckButton(label=checktext) self.vbox.pack_start(self.checkbutton, False, True, 0) else: self.checkbutton = None @@ -1756,7 +1756,7 @@ class ConfirmationDialogCheck(ConfirmationDialog): ok_button = self.action_area.get_children()[0] # right to left ok_button.grab_focus() - self.checkbutton = Gtk.CheckButton(checktext) + self.checkbutton = Gtk.CheckButton(label=checktext) self.vbox.pack_start(self.checkbutton, False, True, 0) self.set_modal(is_modal) self.popup() @@ -1812,14 +1812,14 @@ class ConfirmationDialogDoubleCheck(ConfirmationDialog): ok_button.grab_focus() if checktext1: - self.checkbutton1 = Gtk.CheckButton(checktext1) + self.checkbutton1 = Gtk.CheckButton(label=checktext1) if tooltip1: self.checkbutton1.set_tooltip_text(tooltip1) self.vbox.pack_start(self.checkbutton1, False, True, 0) else: self.checkbutton1 = None if checktext2: - self.checkbutton2 = Gtk.CheckButton(checktext2) + self.checkbutton2 = Gtk.CheckButton(label=checktext2) if tooltip2: self.checkbutton2.set_tooltip_text(tooltip2) self.vbox.pack_start(self.checkbutton2, False, True, 0) @@ -1969,7 +1969,7 @@ class FTOverwriteConfirmationDialog(ConfirmationDialog): self.on_response = on_response if propose_resume: - b = Gtk.Button('', Gtk.STOCK_REFRESH) + b = Gtk.Button(label='', stock=Gtk.STOCK_REFRESH) align = b.get_children()[0] hbox = align.get_children()[0] label = hbox.get_children()[1] @@ -1977,7 +1977,7 @@ class FTOverwriteConfirmationDialog(ConfirmationDialog): label.set_use_underline(True) self.add_action_widget(b, 100) - b = Gtk.Button('', Gtk.STOCK_SAVE_AS) + b = Gtk.Button(label='', stock=Gtk.STOCK_SAVE_AS) align = b.get_children()[0] hbox = align.get_children()[0] label = hbox.get_children()[1] @@ -2086,7 +2086,7 @@ class InputDialogCheck(InputDialog): self.input_entry.select_region(0, -1) # select all if checktext: - self.checkbutton = Gtk.CheckButton(checktext) + self.checkbutton = Gtk.CheckButton(label=checktext) self.vbox.pack_start(self.checkbutton, False, True, 0) self.checkbutton.show() diff --git a/src/gajim_themes_window.py b/src/gajim_themes_window.py index 0f3730d1f..f25fb1bce 100644 --- a/src/gajim_themes_window.py +++ b/src/gajim_themes_window.py @@ -199,7 +199,9 @@ class GajimThemesWindow: textcolor = gajim.config.get_per('themes', theme, option + 'textcolor') if textcolor: state = True - self.text_colorbutton.set_color(Gdk.color_parse(textcolor)) + rgba = Gdk.RGBA() + rgba.parse(textcolor) + self.text_colorbutton.set_rgba(rgba) else: state = False self.textcolor_checkbutton.set_active(state) @@ -207,8 +209,9 @@ class GajimThemesWindow: bgcolor = gajim.config.get_per('themes', theme, option + 'bgcolor') if bgcolor: state = True - self.background_colorbutton.set_color(Gdk.color_parse( - bgcolor)) + rgba = Gdk.RGBA() + rgba.parse(bgcolor) + self.background_colorbutton.set_rgba(rgba) else: state = False self.background_checkbutton.set_active(state) @@ -232,7 +235,9 @@ class GajimThemesWindow: 'muc_msg', 'muc_directed_msg'): color = gajim.config.get_per('themes', theme, 'state_' + chatstate + \ '_color') - self.colorbuttons[chatstate].set_color(Gdk.color_parse(color)) + rgba = Gdk.RGBA() + rgba.parse(color) + self.colorbuttons[chatstate].set_rgba(rgba) def on_textcolor_checkbutton_toggled(self, widget): state = widget.get_active() diff --git a/src/secrets.py b/src/secrets.py index f425c2df1..f6e235a9a 100644 --- a/src/secrets.py +++ b/src/secrets.py @@ -31,7 +31,7 @@ import pickle secrets_filename = gajimpaths['SECRETS_FILE'] secrets_cache = None -class Secrets: +class Secrets(): def __init__(self, filename): self.filename = filename self.srs = {} @@ -43,7 +43,7 @@ class Secrets: def save(self): f = open(secrets_filename, 'wb') - pickle.dump(self, f) + pickle.dump(self, f, protocol=2) f.close() def retained_secrets(self, account, bare_jid): diff --git a/src/vcard.py b/src/vcard.py index 76e5be8ed..f51a9852a 100644 --- a/src/vcard.py +++ b/src/vcard.py @@ -197,7 +197,7 @@ class VcardWindow: def set_value(self, entry_name, value): try: if value and entry_name == 'URL_label': - widget = Gtk.LinkButton(value, value) + widget = Gtk.LinkButton(uri=value, label=value) widget.set_alignment(0, 0) widget.show() table = self.xml.get_object('personal_info_table') @@ -555,7 +555,7 @@ class ZeroconfVcardWindow: def set_value(self, entry_name, value): try: if value and entry_name == 'URL_label': - widget = Gtk.LinkButton(value, value) + widget = Gtk.LinkButton(uri=value, label=value) widget.set_alignment(0, 0) table = self.xml.get_object('personal_info_table') table.attach(widget, 1, 4, 3, 4, yoptions = 0) |