changeset e93a1877ac69 in /home/hg/repos/gajim
author: Yann Leboulanger asterix@lagaule.org branches: details:http://hg.gajim.org/gajim?cmd=changeset;node=e93a1877ac69 description: fix some warnings
diffstat:
data/iconsets/sun/16x16/closed.png | Bin data/iconsets/sun/16x16/opened.png | Bin src/common/socks5.py | 4 ++-- src/config.py | 18 ++++++++++-------- src/dataforms_widget.py | 3 ++- src/dialogs.py | 14 +++++++------- src/gajim_themes_window.py | 13 +++++++++---- src/secrets.py | 4 ++-- src/vcard.py | 4 ++-- 9 files changed, 34 insertions(+), 26 deletions(-)
diffs (213 lines):
diff -r 7220374a5291 -r e93a1877ac69 data/iconsets/sun/16x16/closed.png Binary file data/iconsets/sun/16x16/closed.png has changed diff -r 7220374a5291 -r e93a1877ac69 data/iconsets/sun/16x16/opened.png Binary file data/iconsets/sun/16x16/opened.png has changed diff -r 7220374a5291 -r e93a1877ac69 src/common/socks5.py --- a/src/common/socks5.py Thu Jul 30 15:15:38 2015 +0200 +++ b/src/common/socks5.py Thu Jul 30 15:18:03 2015 +0200 @@ -419,10 +419,10 @@ 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 -r 7220374a5291 -r e93a1877ac69 src/config.py --- a/src/config.py Thu Jul 30 15:15:38 2015 +0200 +++ b/src/config.py Thu Jul 30 15:18:03 2015 +0200 @@ -954,22 +954,24 @@ 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 -r 7220374a5291 -r e93a1877ac69 src/dataforms_widget.py --- a/src/dataforms_widget.py Thu Jul 30 15:15:38 2015 +0200 +++ b/src/dataforms_widget.py Thu Jul 30 15:18:03 2015 +0200 @@ -421,7 +421,8 @@ # 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 -r 7220374a5291 -r e93a1877ac69 src/dialogs.py --- a/src/dialogs.py Thu Jul 30 15:15:38 2015 +0200 +++ b/src/dialogs.py Thu Jul 30 15:18:03 2015 +0200 @@ -1663,7 +1663,7 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 -r 7220374a5291 -r e93a1877ac69 src/gajim_themes_window.py --- a/src/gajim_themes_window.py Thu Jul 30 15:15:38 2015 +0200 +++ b/src/gajim_themes_window.py Thu Jul 30 15:18:03 2015 +0200 @@ -199,7 +199,9 @@ 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 @@ 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 @@ '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 -r 7220374a5291 -r e93a1877ac69 src/secrets.py --- a/src/secrets.py Thu Jul 30 15:15:38 2015 +0200 +++ b/src/secrets.py Thu Jul 30 15:18:03 2015 +0200 @@ -31,7 +31,7 @@ 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 @@
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 -r 7220374a5291 -r e93a1877ac69 src/vcard.py --- a/src/vcard.py Thu Jul 30 15:15:38 2015 +0200 +++ b/src/vcard.py Thu Jul 30 15:18:03 2015 +0200 @@ -197,7 +197,7 @@ 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 @@ 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)