Philipp Hörist pushed to branch master at gajim / gajim
Commits: 00e72b1d by Philipp Hörist at 2017-08-23T18:34:17+02:00 Remove unused code
Whatever this was, its not used since 4 years see 8f71d9f21955d30cd47fabdf0b95869603887cb9
- - - - - 44a28770 by Philipp Hörist at 2017-08-23T18:46:43+02:00 Fix method call
Regression from making gajim a module
- - - - - b72c3c10 by Philipp Hörist at 2017-08-23T18:47:39+02:00 Remove unused event handler
There exists no 'default_status_eventbox' anymore in Gajim
- - - - - 80e5c27f by Philipp Hörist at 2017-08-23T18:57:38+02:00 Use correct inherit pattern
- - - - - 6cacc559 by Philipp Hörist at 2017-08-23T19:50:29+02:00 Dont use internal members in Dialogs
vbox and action_area are internal members of Gtk.Dialog. We should use the methods provided by the API to get these Objects.
- - - - - 4a9ba28a by Philipp Hörist at 2017-08-23T20:01:48+02:00 Fix typo
- - - - - 26dda615 by Philipp Hörist at 2017-08-23T20:15:32+02:00 Fix undefined-variable
- - - - - 95f4703d by Philipp Hörist at 2017-08-23T20:24:55+02:00 Fix unexpected-keyword-arg
- - - - -
6 changed files:
- gajim/common/connection_handlers.py - gajim/common/dataforms.py - gajim/config.py - gajim/conversation_textview.py - gajim/dialogs.py - gajim/roster_window.py
Changes:
===================================== gajim/common/connection_handlers.py ===================================== --- a/gajim/common/connection_handlers.py +++ b/gajim/common/connection_handlers.py @@ -1788,7 +1788,7 @@ ConnectionHandlersBase, ConnectionJingle, ConnectionIBBytestream): return
if result.getType() == 'result': - data = msg.getTags('data', namespace=nbxmpp.NS_BOB) + data = result.getTags('data', namespace=nbxmpp.NS_BOB) if data.getAttr('cid') == cid: for func in self.awaiting_cids[cid]: cb = func[0]
===================================== gajim/common/dataforms.py ===================================== --- a/gajim/common/dataforms.py +++ b/gajim/common/dataforms.py @@ -551,7 +551,7 @@ class DataRecord(ExtendedNode): fdel(self) for field in fields: if not isinstance(field, DataField): - ExtendField(extend=field) + ExtendField(field) self.addChild(node=field)
def fdel(self):
===================================== gajim/config.py ===================================== --- a/gajim/config.py +++ b/gajim/config.py @@ -1049,12 +1049,6 @@ class PreferencesWindow: model[iter_][3]) app.config.set_per('defaultstatusmsg', status, 'message', message)
- def on_default_status_expander_activate(self, expander): - eventbox = self.xml.get_object('default_status_eventbox') - vbox = self.xml.get_object('status_vbox') - vbox.set_child_packing(eventbox, not expander.get_expanded(), True, 0, - Gtk.PACK_START) - def save_status_messages(self, model): for msg in app.config.get_per('statusmsg'): app.config.del_per('statusmsg', msg) @@ -2155,8 +2149,8 @@ class AccountsWindow: app.interface.roster.setup_and_draw_roster() self.init_accounts() self.select_account(new_name) - gajim.app.remove_account_actions(old_name) - gajim.app.add_account_actions(new_name) + app.app.remove_account_actions(old_name) + app.app.add_account_actions(new_name) gui_menu_builder.build_accounts_menu()
title = _('Rename Account')
===================================== gajim/conversation_textview.py ===================================== --- a/gajim/conversation_textview.py +++ b/gajim/conversation_textview.py @@ -220,8 +220,6 @@ class ConversationTextview(GObject.GObject): id_ = self.tv.connect('button_press_event', self.on_textview_button_press_event) self.handlers[id_] = self.tv - id_ = self.tv.connect('draw', self.on_textview_draw) - self.handlers[id_] = self.tv
self.account = account self.cursor_changed = False @@ -520,34 +518,6 @@ class ConversationTextview(GObject.GObject): # appeared) GLib.idle_add(self.scroll_to_end_iter)
- def on_textview_draw(self, widget, ctx): - return - #TODO - expalloc = event.area - exp_x0 = expalloc.x - exp_y0 = expalloc.y - exp_x1 = exp_x0 + expalloc.width - exp_y1 = exp_y0 + expalloc.height - - try: - tryfirst = [self.image_cache[(exp_x0, exp_y0)]] - except KeyError: - tryfirst = [] - - for image in tryfirst + self.images: - imgalloc = image.allocation - img_x0 = imgalloc.x - img_y0 = imgalloc.y - img_x1 = img_x0 + imgalloc.width - img_y1 = img_y0 + imgalloc.height - - if img_x0 <= exp_x0 and img_y0 <= exp_y0 and \ - exp_x1 <= img_x1 and exp_y1 <= img_y1: - self.image_cache[(img_x0, img_y0)] = image - widget.propagate_expose(image, event) - return True - return False - def clear(self, tv = None): """ Clear text in the textview
===================================== gajim/dialogs.py ===================================== --- a/gajim/dialogs.py +++ b/gajim/dialogs.py @@ -565,18 +565,17 @@ class TimeoutDialog: Class designed to be derivated to create timeout'd dialogs (dialogs that closes automatically after a timeout) """ - def __init__(self, timeout, on_timeout): + def __init__(self, timeout): self.countdown_left = timeout self.countdown_enabled = True self.title_text = '' - self.on_timeout = on_timeout
def run_timeout(self): if self.countdown_left > 0: self.countdown() GLib.timeout_add_seconds(1, self.countdown)
- def on_timeout(): + def on_timeout(self): """ To be implemented in derivated classes """ @@ -598,7 +597,7 @@ class TimeoutDialog: class ChangeStatusMessageDialog(TimeoutDialog): def __init__(self, on_response, show=None, show_pep=True): countdown_time = app.config.get('change_status_window_timeout') - TimeoutDialog.__init__(self, countdown_time, self.on_timeout) + TimeoutDialog.__init__(self, countdown_time) self.show = show self.pep_dict = {} self.show_pep = show_pep @@ -1390,7 +1389,7 @@ class Dialog(Gtk.Dialog): self.user_response_ok = on_response_ok self.user_response_cancel = on_response_cancel self.set_border_width(6) - self.vbox.set_spacing(12) + self.get_content_area().set_spacing(12) self.set_resizable(False)
for stock, response in buttons: @@ -1423,7 +1422,7 @@ class Dialog(Gtk.Dialog): self.destroy()
def get_button(self, index): - buttons = self.action_area.get_children() + buttons = self.get_action_area().get_children() return index < len(buttons) and buttons[index] or None
@@ -1674,20 +1673,21 @@ class YesNoDialog(HigDialog): sectext, on_response_yes=self.on_response_yes, on_response_no=self.on_response_no)
+ vbox = self.get_content_area() if checktext: self.checkbutton = Gtk.CheckButton.new_with_mnemonic(checktext) - self.vbox.pack_start(self.checkbutton, False, True, 0) + vbox.pack_start(self.checkbutton, False, True, 0) else: self.checkbutton = None if text_label: label = Gtk.Label(label=text_label) - self.vbox.pack_start(label, False, True, 0) + vbox.pack_start(label, False, True, 0) buff = Gtk.TextBuffer() self.textview = Gtk.TextView.new_with_buffer(buff) frame = Gtk.Frame() frame.set_shadow_type(Gtk.ShadowType.IN) frame.add(self.textview) - self.vbox.pack_start(frame, False, True, 0) + vbox.pack_start(frame, False, True, 0) else: self.textview = None self.set_modal(False) @@ -1765,11 +1765,11 @@ class ConfirmationDialogCheck(ConfirmationDialog):
self.set_default_response(Gtk.ResponseType.OK)
- ok_button = self.action_area.get_children()[0] # right to left + ok_button = self.get_action_area().get_children()[0] # right to left ok_button.grab_focus()
self.checkbutton = Gtk.CheckButton.new_with_mnemonic(checktext) - self.vbox.pack_start(self.checkbutton, False, True, 0) + self.get_content_area().pack_start(self.checkbutton, False, True, 0) self.set_modal(is_modal) self.popup()
@@ -1820,21 +1820,22 @@ class ConfirmationDialogDoubleCheck(ConfirmationDialog):
self.set_default_response(Gtk.ResponseType.OK)
- ok_button = self.action_area.get_children()[0] # right to left + ok_button = self.get_action_area().get_children()[0] # right to left ok_button.grab_focus()
+ vbox = self.get_content_area() if checktext1: self.checkbutton1 = Gtk.CheckButton.new_with_mnemonic(checktext1) if tooltip1: self.checkbutton1.set_tooltip_text(tooltip1) - self.vbox.pack_start(self.checkbutton1, False, True, 0) + vbox.pack_start(self.checkbutton1, False, True, 0) else: self.checkbutton1 = None if checktext2: self.checkbutton2 = Gtk.CheckButton.new_with_mnemonic(checktext2) if tooltip2: self.checkbutton2.set_tooltip_text(tooltip2) - self.vbox.pack_start(self.checkbutton2, False, True, 0) + vbox.pack_start(self.checkbutton2, False, True, 0) else: self.checkbutton2 = None
@@ -1889,7 +1890,7 @@ class PlainConnectionDialog(ConfirmationDialogDoubleCheck): ConfirmationDialogDoubleCheck.__init__(self, pritext, sectext, checktext1, checktext2, tooltip1=tooltip1, on_response_ok=on_ok, on_response_cancel=on_cancel, is_modal=False) - self.ok_button = self.action_area.get_children()[0] # right to left + self.ok_button = self.get_action_area().get_children()[0] # right to left self.ok_button.set_sensitive(False) self.checkbutton1.connect('clicked', self.on_checkbutton_clicked) self.set_title(_('Insecure connection')) @@ -1917,15 +1918,16 @@ class ConfirmationDialogDoubleRadio(ConfirmationDialog):
self.set_default_response(Gtk.ResponseType.OK)
- ok_button = self.action_area.get_children()[0] # right to left + ok_button = self.get_action_area().get_children()[0] # right to left ok_button.grab_focus()
+ vbox = self.get_content_area() self.radiobutton1 = Gtk.RadioButton(label=radiotext1) - self.vbox.pack_start(self.radiobutton1, False, True, 0) + vbox.pack_start(self.radiobutton1, False, True, 0)
self.radiobutton2 = Gtk.RadioButton(group=self.radiobutton1, label=radiotext2) - self.vbox.pack_start(self.radiobutton2, False, True, 0) + vbox.pack_start(self.radiobutton2, False, True, 0)
self.set_modal(is_modal) self.popup() @@ -4770,8 +4772,9 @@ class AvatarChooserDialog(ImageChooserDialog): if on_response_clear: button.connect('clicked', self.on_clear) button.show_all() - self.action_area.pack_start(button, True, True, 0) - self.action_area.reorder_child(button, 0) + action_area = self.get_action_area() + action_area.pack_start(button, True, True, 0) + action_area.reorder_child(button, 0)
def on_clear(self, widget): if isinstance(self.response_clear, tuple): @@ -5038,7 +5041,7 @@ class DataFormWindow(Dialog): self.dataform_widget.set_sensitive(True) self.dataform_widget.data_form = self.dataform self.dataform_widget.show_all() - self.vbox.pack_start(self.dataform_widget, True, True, 0) + self.get_content_area().pack_start(self.dataform_widget, True, True, 0)
def on_ok(self): form = self.dataform_widget.data_form @@ -5051,7 +5054,7 @@ class DataFormWindow(Dialog):
class ResourceConflictDialog(TimeoutDialog, InputDialog): def __init__(self, title, text, resource, ok_handler): - TimeoutDialog.__init__(self, 15, self.on_timeout) + TimeoutDialog.__init__(self, 15) InputDialog.__init__(self, title, text, input_str=resource, is_modal=False, ok_handler=ok_handler) self.title_text = title
===================================== gajim/roster_window.py ===================================== --- a/gajim/roster_window.py +++ b/gajim/roster_window.py @@ -3698,7 +3698,7 @@ class RosterWindow: _('You are participating in one or more group chats'), _('Changing your status to invisible will result in ' 'disconnection from those group chats. Are you sure you ' - 'want to go invisible?'), on_reponse_ok=on_ok, + 'want to go invisible?'), on_response_ok=on_ok, on_response_cancel=on_cancel) return
View it on GitLab: https://dev.gajim.org/gajim/gajim/compare/1750217e7fa7a4f1424b7de2437617c476...
--- View it on GitLab: https://dev.gajim.org/gajim/gajim/compare/1750217e7fa7a4f1424b7de2437617c476... You're receiving this email because of your account on dev.gajim.org.