gajim.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2026
October
September
August
July
June
May
April
March
February
January
2025
December
November
October
September
August
July
June
May
April
March
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
List overview
Download
Commits
----- 2026 -----
October 2026
September 2026
August 2026
July 2026
June 2026
May 2026
April 2026
March 2026
February 2026
January 2026
----- 2025 -----
December 2025
November 2025
October 2025
September 2025
August 2025
July 2025
June 2025
May 2025
April 2025
March 2025
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
commits@gajim.org
17632 discussions
Start a n
N
ew thread
[Git][gajim/gajim][master] 5 commits: CI: Update pylint test
by Philipp Hörist
30 Nov '19
30 Nov '19
Philipp Hörist pushed to branch master at gajim / gajim Commits: 7c82ad3c by Philipp Hörist at 2019-11-30T21:28:31Z CI: Update pylint test - - - - - d3c8145c by Philipp Hörist at 2019-11-30T21:30:53Z GroupchatCreation: Remove unused method - - - - - a9d90da2 by Philipp Hörist at 2019-11-30T21:39:45Z GroupchatRoster: Don't shadow Gtk.Widget.draw() - - - - - f2248c3b by Philipp Hörist at 2019-11-30T21:41:33Z RosterItemExchange: Correctly draw contact after update - - - - - 97313071 by Philipp Hörist at 2019-11-30T21:43:48Z Accounts: Remove unused method - - - - - 6 changed files: - gajim/groupchat_control.py - gajim/gtk/accounts.py - gajim/gtk/groupchat_creation.py - gajim/gtk/groupchat_roster.py - gajim/gtk/roster_item_exchange.py - scripts/dev/pylint-ci.sh Changes: ===================================== gajim/groupchat_control.py ===================================== @@ -1130,7 +1130,7 @@ class GroupchatControl(ChatControlBase): app.gc_connected[self.account][self.room_jid] = value def got_connected(self): - self.roster.draw() + self.roster.initial_draw() if self.disco_info.has_mam: # Request MAM ===================================== gajim/gtk/accounts.py ===================================== @@ -600,25 +600,6 @@ class GenericSettingPage(Gtk.Box): def on_row_activated(_listbox, row): row.on_row_activated() - def set_entry_text(self, toggle, update=False): - account_label = app.get_account_label(self.account) - if update: - self.entry.set_text(account_label) - return - if toggle.get_active(): - self.entry.set_sensitive(True) - self.entry.grab_focus() - else: - self.entry.set_sensitive(False) - value = self.entry.get_text() - if not value: - value = account_label - app.config.set_per('accounts', self.account, - 'account_label', value or self.account) - if app.config.get_per('accounts', self.account, 'active'): - app.interface.roster.draw_account(self.account) - gui_menu_builder.build_accounts_menu() - class GeneralPage(GenericSettingPage): ===================================== gajim/gtk/groupchat_creation.py ===================================== @@ -173,9 +173,6 @@ class CreateGroupchatWindow(Gtk.ApplicationWindow): self._update_entry_completion(entry, text) self._validate_jid(text) - def _on_server_entry_changed(self, _widget): - self._update_create_button() - def _on_address_entry_activate(self, _widget): self._on_create_clicked() ===================================== gajim/gtk/groupchat_roster.py ===================================== @@ -367,7 +367,7 @@ class GroupchatRoster(Gtk.ScrolledWindow, EventHelper): self.enable_sort(False) self.enable_sort(True) - def draw(self): + def initial_draw(self): self.enable_sort(True) self.set_model() self._roster.expand_all() ===================================== gajim/gtk/roster_item_exchange.py ===================================== @@ -227,7 +227,7 @@ class RosterItemExchangeWindow(Gtk.ApplicationWindow): con = app.connections[self.account] con.get_module('Roster').update_contact( jid, model[iter_][2], groups) - self.draw_contact(jid, self.account) + con.get_module('Roster').draw_contact(jid, self.account) # Update opened chats ctrl = app.interface.msg_win_mgr.get_control(jid, self.account) ===================================== scripts/dev/pylint-ci.sh ===================================== @@ -5,10 +5,12 @@ set -e PYLINT=${PYLINT:-pylint} +IGNORE_ERRORS=C0103,C0302,C0301,C0330,E0401,E0611,E1101,E1133,E1136,R0201,R0901,R0904,R0912,R0913,R0914,R0915,R0916,R1702,R1710,W0201,W0212,W0221,W0223,W0231,W0233,W0603,W0613 + "$PYLINT" --version -"$PYLINT" --disable=C0103,C0302,C0301,C0330,E0401,E0611,E1101,E1133,E1136,R0201,R0901,R0904,R0912,R0913,R0914,R0915,R0916,R1702,R1710,W0201,W0212,W0221,W0223,W0231,W0233,W0603,W0613 "$@" -"$PYLINT" --disable=E0401 "$@/common/modules" +"$PYLINT" --disable=IGNORE_ERRORS --ignore=modules "$@" +"$PYLINT" --disable=E0401 "$@/common/modules" # C0103 invalid-name # C0301 line-too-long View it on GitLab:
https://dev.gajim.org/gajim/gajim/compare/f6451dbd43ebc7ec7b58f4be0f52fd538…
-- View it on GitLab:
https://dev.gajim.org/gajim/gajim/compare/f6451dbd43ebc7ec7b58f4be0f52fd538…
You're receiving this email because of your account on
dev.gajim.org
.
1
0
0
0
[Git][gajim/gajim][master] 4 commits: CSSConfig: Fix pylint errors
by Philipp Hörist
30 Nov '19
30 Nov '19
Philipp Hörist pushed to branch master at gajim / gajim Commits: 53ede60d by Philipp Hörist at 2019-11-30T20:33:25Z CSSConfig: Fix pylint errors - - - - - 5c587855 by Philipp Hörist at 2019-11-30T20:50:03Z Dialogs: Fix pylint errors - - - - - b42a1ca1 by Philipp Hörist at 2019-11-30T21:04:07Z Fail CI on any pylint errors We now call pylint multipletimes, until now only the last command return code was evaluated - - - - - f6451dbd by Philipp Hörist at 2019-11-30T21:04:48Z Settings: Remove unused import - - - - - 4 changed files: - gajim/gtk/css_config.py - gajim/gtk/dialogs.py - gajim/gtk/settings.py - scripts/dev/pylint-ci.sh Changes: ===================================== gajim/gtk/css_config.py ===================================== @@ -36,7 +36,8 @@ settings = Gtk.Settings.get_default() class CSSConfig(): def __init__(self): - """CSSConfig handles loading and storing of all relevant Gajim style files + """ + CSSConfig handles loading and storing of all relevant Gajim style files The order in which CSSConfig loads the styles @@ -138,14 +139,15 @@ class CSSConfig(): def _load_css_from_file(self, filename, priority): path = os.path.join(configpaths.get('STYLE'), filename) try: - with open(path, "r") as f: - css = f.read() + with open(path, "r") as file_: + css = file_.read() except Exception as exc: log.error('Error loading css: %s', exc) return self._activate_css(css, priority) - def _activate_css(self, css, priority): + @staticmethod + def _activate_css(css, priority): try: provider = Gtk.CssProvider() provider.load_from_data(bytes(css.encode('utf-8'))) @@ -247,7 +249,7 @@ class CSSConfig(): if not pre: self._add_to_cache(selector, attr, value) self._write(pre) - return + return None # The rule was not found, so we add it to this theme log.info('Set %s %s %s', selector, attr, value) @@ -255,6 +257,7 @@ class CSSConfig(): rule.style[attr] = value css.add(rule) self._write(pre) + return None def set_font(self, selector, description, pre=False): css = self._css @@ -297,13 +300,14 @@ class CSSConfig(): family = description.get_family() return family, size, style, weight - def _get_default_rule(self, selector, attr): + def _get_default_rule(self, selector, _attr): for rule in self._default_css: if rule.type != rule.STYLE_RULE: continue if rule.selectorText == selector: log.info('Get Default Rule %s', selector) return rule + return None def get_font(self, selector, pre=False): if pre: @@ -316,7 +320,7 @@ class CSSConfig(): pass if css is None: - return + return None for rule in css: if rule.type != rule.STYLE_RULE: @@ -335,10 +339,11 @@ class CSSConfig(): return desc self._add_to_cache(selector, 'fontdescription', None) + return None def _get_description_from_css(self, family, size, style, weight): if family is None: - return + return None desc = Pango.FontDescription() desc.set_family(family) if weight is not None: @@ -403,6 +408,7 @@ class CSSConfig(): value = rule if rule is None else rule.style[attr] self._add_to_cache(selector, attr, value) return value + return None def remove_value(self, selector, attr, pre=False): if attr == StyleAttr.FONT: @@ -423,6 +429,7 @@ class CSSConfig(): rule.style.removeProperty(attr) break self._write(pre) + return None def remove_font(self, selector, pre=False): css = self._css ===================================== gajim/gtk/dialogs.py ===================================== @@ -74,20 +74,33 @@ class DialogButton(namedtuple('DialogButton', ('response text callback args ' class HigDialog(Gtk.MessageDialog): - def __init__(self, parent, type_, buttons, pritext, sectext, - on_response_ok=None, on_response_cancel=None, on_response_yes=None, - on_response_no=None): + def __init__(self, + parent, + type_, + buttons, + pritext, + sectext, + on_response_ok=None, + on_response_cancel=None, + on_response_yes=None, + on_response_no=None): self.call_cancel_on_destroy = True - Gtk.MessageDialog.__init__(self, transient_for=parent, - modal=True, destroy_with_parent=True, - message_type=type_, buttons=buttons, text=pritext) + Gtk.MessageDialog.__init__(self, + transient_for=parent, + modal=True, + destroy_with_parent=True, + message_type=type_, + buttons=buttons, + text=pritext) self.format_secondary_markup(sectext) - self.possible_responses = {Gtk.ResponseType.OK: on_response_ok, + self.possible_responses = { + Gtk.ResponseType.OK: on_response_ok, Gtk.ResponseType.CANCEL: on_response_cancel, Gtk.ResponseType.YES: on_response_yes, - Gtk.ResponseType.NO: on_response_no} + Gtk.ResponseType.NO: on_response_no + } self.connect('response', self.on_response) self.connect('destroy', self.on_dialog_destroy) @@ -101,14 +114,14 @@ class HigDialog(Gtk.MessageDialog): if len(self.possible_responses[response_id]) == 1: self.possible_responses[response_id][0](dialog) else: - self.possible_responses[response_id][0](dialog, - *self.possible_responses[response_id][1:]) + self.possible_responses[response_id][0]( + dialog, *self.possible_responses[response_id][1:]) else: self.possible_responses[response_id](dialog) - def on_dialog_destroy(self, widget): + def on_dialog_destroy(self, _widget): if not self.call_cancel_on_destroy: - return + return None cancel_handler = self.possible_responses[Gtk.ResponseType.CANCEL] if not cancel_handler: return False @@ -116,13 +129,14 @@ class HigDialog(Gtk.MessageDialog): cancel_handler[0](None, *cancel_handler[1:]) else: cancel_handler(None) + return None def popup(self): """ Show dialog """ vb = self.get_children()[0].get_children()[0] # Give focus to top vbox -# vb.set_flags(Gtk.CAN_FOCUS) + # vb.set_flags(Gtk.CAN_FOCUS) vb.grab_focus() self.show_all() @@ -145,8 +159,12 @@ class WarningDialog(HigDialog): def __init__(self, pritext, sectext='', transient_for=None): if transient_for is None: transient_for = app.app.get_active_window() - HigDialog.__init__(self, transient_for, Gtk.MessageType.WARNING, - Gtk.ButtonsType.OK, pritext, sectext) + HigDialog.__init__(self, + transient_for, + Gtk.MessageType.WARNING, + Gtk.ButtonsType.OK, + pritext, + sectext) self.set_modal(False) self.popup() @@ -159,8 +177,12 @@ class InformationDialog(HigDialog): def __init__(self, pritext, sectext='', transient_for=None): if transient_for is None: transient_for = app.app.get_active_window() - HigDialog.__init__(self, transient_for, Gtk.MessageType.INFO, Gtk.ButtonsType.OK, - pritext, sectext) + HigDialog.__init__(self, + transient_for, + Gtk.MessageType.INFO, + Gtk.ButtonsType.OK, + pritext, + sectext) self.set_modal(False) self.popup() @@ -170,13 +192,22 @@ class ErrorDialog(HigDialog): HIG compliant error dialog """ - def __init__(self, pritext, sectext='', on_response_ok=None, - on_response_cancel=None, transient_for=None): + def __init__(self, + pritext, + sectext='', + on_response_ok=None, + on_response_cancel=None, + transient_for=None): if transient_for is None: transient_for = app.app.get_active_window() - HigDialog.__init__(self, transient_for, Gtk.MessageType.ERROR, Gtk.ButtonsType.OK, - pritext, sectext, on_response_ok=on_response_ok, - on_response_cancel=on_response_cancel) + HigDialog.__init__(self, + transient_for, + Gtk.MessageType.ERROR, + Gtk.ButtonsType.OK, + pritext, + sectext, + on_response_ok=on_response_ok, + on_response_cancel=on_response_cancel) self.popup() @@ -236,7 +267,7 @@ class CertificateDialog(Gtk.ApplicationWindow): self._ui.connect_signals(self) self.show_all() - def _on_copy_cert_info_button_clicked(self, widget): + def _on_copy_cert_info_button_clicked(self, _widget): clipboard_text = \ self._headline + '\n\n' + \ _('Issued to\n') + \ @@ -300,16 +331,16 @@ class InvitationReceivedDialog(Gtk.ApplicationWindow): self._ui.comment_label.show() self._ui.comment_label.set_text(comment) - def on_message_mnemonic_activate(self, widget, group_cycling=False): + def on_message_mnemonic_activate(self, _widget, _group_cycling=False): self._ui.message_expander.set_expanded(True) - def on_accept_button_clicked(self, widget): + def on_accept_button_clicked(self, _widget): app.interface.show_or_join_groupchat(self.account, self.room_jid, password=self.password) self.destroy() - def on_decline_button_clicked(self, widget): + def on_decline_button_clicked(self, _widget): text = self._ui.decline_message.get_text() app.connections[self.account].get_module('MUC').decline( self.room_jid, self.from_, text) @@ -328,7 +359,7 @@ class PassphraseDialog: self.window.set_title(titletext) self._ui.message_label.set_text(labeltext) - self.ok = False + self._ok = False self.cancel_handler = cancel_handler self.ok_handler = ok_handler @@ -347,7 +378,7 @@ class PassphraseDialog: else: self._ui.save_passphrase_checkbutton.hide() - def on_okbutton_clicked(self, widget): + def on_okbutton_clicked(self, _widget): if not self.ok_handler: return @@ -358,7 +389,7 @@ class PassphraseDialog: else: checked = False - self.ok = True + self._ok = True self.window.destroy() @@ -367,11 +398,11 @@ class PassphraseDialog: else: self.ok_handler(passph, checked) - def on_cancelbutton_clicked(self, widget): + def on_cancelbutton_clicked(self, _widget): self.window.destroy() - def on_passphrase_dialog_destroy(self, widget): - if self.cancel_handler and not self.ok: + def on_passphrase_dialog_destroy(self, _widget): + if self.cancel_handler and not self._ok: self.cancel_handler() @@ -493,5 +524,5 @@ class ShortcutsWindow: self.window.show_all() self.window.present() - def _on_window_destroy(self, widget): + def _on_window_destroy(self, _widget): self.window = None ===================================== gajim/gtk/settings.py ===================================== @@ -24,8 +24,6 @@ from gajim.common import app from gajim.common import passwords from gajim.common.i18n import _ -from gajim.common.exceptions import GajimGeneralException - from gajim import gtkgui_helpers from gajim.gtk.util import get_image_button ===================================== scripts/dev/pylint-ci.sh ===================================== @@ -1,4 +1,8 @@ #!/bin/sh + +# exit when any command fails +set -e + PYLINT=${PYLINT:-pylint} "$PYLINT" --version View it on GitLab:
https://dev.gajim.org/gajim/gajim/compare/765180d14bc43bddd67f9e5cb8cefa11c…
-- View it on GitLab:
https://dev.gajim.org/gajim/gajim/compare/765180d14bc43bddd67f9e5cb8cefa11c…
You're receiving this email because of your account on
dev.gajim.org
.
1
0
0
0
[Git][gajim/gajim][master] Remove Plugin examples
by Philipp Hörist
30 Nov '19
30 Nov '19
Philipp Hörist pushed to branch master at gajim / gajim Commits: 765180d1 by Philipp Hörist at 2019-11-30T19:56:54Z Remove Plugin examples These examples are outdated The plugin repository should contain enough working examples - - - - - 10 changed files: - − plugins/events_dump/__init__.py - − plugins/events_dump/manifest.ini - − plugins/events_dump/plugin.py - − plugins/new_events_example/__init__.py - − plugins/new_events_example/manifest.ini - − plugins/new_events_example/plugin.py - − plugins/roster_buttons/__init__.py - − plugins/roster_buttons/manifest.ini - − plugins/roster_buttons/plugin.py - − plugins/roster_buttons/roster_buttons.ui Changes: ===================================== plugins/events_dump/__init__.py deleted ===================================== @@ -1 +0,0 @@ -from .plugin import EventsDumpPlugin ===================================== plugins/events_dump/manifest.ini deleted ===================================== @@ -1,8 +0,0 @@ -[info] -name: Events Dump -short_name: events_dump -version: 0.1 -description: Dumps info about selected events to console. -authors = Mateusz Biliński <mateusz(a)bilinski.it> -homepage =
http://blog.bilinski.it
- ===================================== plugins/events_dump/plugin.py deleted ===================================== @@ -1,123 +0,0 @@ -# -*- coding: utf-8 -*- -## -## This file is part of Gajim. -## -## Gajim is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published -## by the Free Software Foundation; version 3 only. -## -## Gajim is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with Gajim. If not, see <
http://www.gnu.org/licenses/
>. -## -''' -Events Dump plugin. - -Dumps info about selected events to console. - -:author: Mateusz Biliński <mateusz(a)bilinski.it> -:since: 10th August 2008 -:copyright: Copyright (2008) Mateusz Biliński <mateusz(a)bilinski.it> -:license: GPL -''' - -import types -from pprint import pformat - -from gajim.plugins import GajimPlugin -from gajim.plugins.helpers import log_calls, log -from gajim.common import ged - -class EventsDumpPlugin(GajimPlugin): - - @log_calls('EventsDumpPlugin') - def init(self): - self.description = _('Dumps info about selected events to console.') - self.config_dialog = None - #self.gui_extension_points = {} - #self.config_default_values = {} - events_from_old_dbus_support = [ - 'Roster', 'AccountPresence', 'ContactPresence', - 'ContactAbsence', 'ContactStatus', 'NewMessage', - 'Subscribe', 'Subscribed', 'Unsubscribed', - 'NewAccount', 'VcardInfo', 'LastStatusTime', - 'OsInfo', 'GCPresence', 'GCMessage', 'RosterInfo', - 'NewGmail'] - - events_from_src_gajim = [ - 'ROSTER', 'WARNING', 'ERROR', - 'INFORMATION', 'ERROR_ANSWER', 'STATUS', - 'NOTIFY', 'MSGERROR', 'MSGSENT', 'MSGNOTSENT', - 'SUBSCRIBED', 'UNSUBSCRIBED', 'SUBSCRIBE', - 'AGENT_ERROR_INFO', 'AGENT_ERROR_ITEMS', - 'AGENT_REMOVED', 'REGISTER_AGENT_INFO', - 'AGENT_INFO_ITEMS', 'AGENT_INFO_INFO', - 'QUIT', 'NEW_ACC_CONNECTED', - 'NEW_ACC_NOT_CONNECTED', 'ACC_OK', 'ACC_NOT_OK', - 'MYVCARD', 'VCARD', 'LAST_STATUS_TIME', 'OS_INFO', - 'GC_NOTIFY', 'GC_MSG', 'GC_SUBJECT', 'GC_CONFIG', - 'GC_CONFIG_CHANGE', 'GC_INVITATION', - 'GC_AFFILIATION', 'GC_PASSWORD_REQUIRED', - 'BAD_PASSPHRASE', 'ROSTER_INFO', 'BOOKMARKS', - 'CON_TYPE', 'CONNECTION_LOST', 'FILE_REQUEST', - 'FILE_REQUEST_ERROR', 'FILE_SEND_ERROR', - 'STANZA_ARRIVED', 'STANZA_SENT', - 'HTTP_AUTH', 'VCARD_PUBLISHED', - 'VCARD_NOT_PUBLISHED', 'ASK_NEW_NICK', 'SIGNED_IN', - 'METACONTACTS', 'ATOM_ENTRY', 'FAILED_DECRYPT', - 'PRIVACY_LISTS_RECEIVED', 'PRIVACY_LIST_RECEIVED', - 'PRIVACY_LISTS_ACTIVE_DEFAULT', - 'PRIVACY_LIST_REMOVED', 'ZC_NAME_CONFLICT', - 'PING_SENT', 'PING_REPLY', 'PING_ERROR', - 'SEARCH_FORM', 'SEARCH_RESULT', - 'RESOURCE_CONFLICT', 'PEP_CONFIG', - 'UNIQUE_ROOM_ID_UNSUPPORTED', - 'UNIQUE_ROOM_ID_SUPPORTED', 'SESSION_NEG', - 'GPG_PASSWORD_REQUIRED', 'SSL_ERROR', - 'FINGERPRINT_ERROR', 'PLAIN_CONNECTION', - 'PUBSUB_NODE_REMOVED', 'PUBSUB_NODE_NOT_REMOVED'] - - network_events_from_core = ['raw-message-received', - 'raw-iq-received', - 'raw-pres-received'] - - network_events_generated_in_nec = [ - 'customized-message-received', - 'more-customized-message-received', - 'modify-only-message-received', - 'enriched-chat-message-received'] - - self.events_names = [] - self.events_names += network_events_from_core - self.events_names += network_events_generated_in_nec - - self.events_handlers = {} - self._set_handling_methods() - - @log_calls('EventsDumpPlugin') - def activate(self): - pass - - @log_calls('EventsDumpPlugin') - def deactivate(self): - pass - - @log_calls('EventsDumpPlugin') - def _set_handling_methods(self): - for event_name in self.events_names: - setattr(self, event_name, - types.MethodType( - self._generate_handling_method(event_name), - self)) - self.events_handlers[event_name] = (ged.POSTCORE, - getattr(self, event_name)) - - def _generate_handling_method(self, event_name): - def handler(self, *args): - print ("Event '%s' occured. Arguments: %s\n\n===\n" % (event_name, pformat(args))) - - return handler ===================================== plugins/new_events_example/__init__.py deleted ===================================== @@ -1 +0,0 @@ -from .plugin import NewEventsExamplePlugin ===================================== plugins/new_events_example/manifest.ini deleted ===================================== @@ -1,11 +0,0 @@ -[info] -name: New Events Example -short_name: new_events_example -version: 0.1 -description: Shows how to generate new network events based on existing one using Network Events Controller. -authors = Mateusz Biliński <mateusz(a)bilinski.it> -homepage =
http://blog.bilinski.it
- - - - ===================================== plugins/new_events_example/plugin.py deleted ===================================== @@ -1,140 +0,0 @@ -# -*- coding: utf-8 -*- -## -## This file is part of Gajim. -## -## Gajim is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published -## by the Free Software Foundation; version 3 only. -## -## Gajim is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with Gajim. If not, see <
http://www.gnu.org/licenses/
>. -## -''' -New Events Example plugin. - -Demonstrates how to use Network Events Controller to generate new events -based on existing one. - -:author: Mateusz Biliński <mateusz(a)bilinski.it> -:since: 15th August 2008 -:copyright: Copyright (2008) Mateusz Biliński <mateusz(a)bilinski.it> -:license: GPL -''' - -#import new # Depricated in python3 for types module -from pprint import pformat - -from gajim.common import helpers -from gajim.common import app - -from gajim.plugins import GajimPlugin -from gajim.plugins.helpers import log_calls, log -from gajim.common import ged -from gajim.common import nec - -class NewEventsExamplePlugin(GajimPlugin): - - @log_calls('NewEventsExamplePlugin') - def init(self): - self.description = _('Shows how to generate new network events based ' - 'on existing one using Network Events Controller.') - self.config_dialog = None - #self.gui_extension_points = {} - #self.config_default_values = {} - - self.events_handlers = {'raw-message-received' : - (ged.POSTCORE, self.raw_message_received), - 'customized-message-received' : - (ged.POSTCORE, self.customized_message_received), - 'enriched-chat-message-received' : - (ged.POSTCORE, self.enriched_chat_message_received)} - - self.events = [CustomizedMessageReceivedEvent, - MoreCustomizedMessageReceivedEvent, - ModifyOnlyMessageReceivedEvent, - EnrichedChatMessageReceivedEvent] - - def enriched_chat_message_received(self, event_object): - pass - # print "Event '%s' occured. Event object: %s\n\n===\n" % \ - # (event_object.name, event_object) - - def raw_message_received(self, event_object): - pass - # print "Event '%s' occured. Event object: %s\n\n===\n" % \ - # (event_object.name,event_object) - - def customized_message_received(self, event_object): - pass - # print "Event '%s' occured. Event object: %s\n\n===\n" % \ - # (event_object.name, event_object - - @log_calls('NewEventsExamplePlugin') - def activate(self): - pass - - @log_calls('NewEventsExamplePlugin') - def deactivate(self): - pass - -class CustomizedMessageReceivedEvent(nec.NetworkIncomingEvent): - name = 'customized-message-received' - base_network_events = ['raw-message-received'] - - def generate(self): - return True - -class MoreCustomizedMessageReceivedEvent(nec.NetworkIncomingEvent): - ''' - Shows chain of custom created events. - - This one is based on custom 'customized-messsage-received'. - ''' - name = 'more-customized-message-received' - base_network_events = ['customized-message-received'] - - def generate(self): - return True - -class ModifyOnlyMessageReceivedEvent(nec.NetworkIncomingEvent): - name = 'modify-only-message-received' - base_network_events = ['raw-message-received'] - - def generate(self): - msg_type = self.base_event.stanza.attrs.get('type', None) - if msg_type == u'chat': - msg_text = ''.join(self.base_event.stanza.kids[0].data) - self.base_event.stanza.kids[0].setData( - u'%s [MODIFIED BY CUSTOM NETWORK EVENT]' % (msg_text)) - - return False - -class EnrichedChatMessageReceivedEvent(nec.NetworkIncomingEvent): - ''' - Generates more friendly (in use by handlers) network event for - received chat message. - ''' - name = 'enriched-chat-message-received' - base_network_events = ['raw-message-received'] - - def generate(self): - msg_type = self.base_event.stanza.attrs.get('type', None) - if msg_type == u'chat': - self.stanza = self.base_event.stanza - self.conn = self.base_event.conn - self.from_jid = helpers.get_full_jid_from_iq(self.stanza) - self.from_jid_without_resource = app.get_jid_without_resource( - self.from_jid) - self.account = self.conn.name - self.from_nickname = app.get_contact_name_from_jid( self.account, - self.from_jid_without_resource) - self.msg_text = ''.join(self.stanza.kids[0].data) - - return True - - return False ===================================== plugins/roster_buttons/__init__.py deleted ===================================== @@ -1,4 +0,0 @@ - -__all__ = ['RosterButtonsPlugin'] - -from .plugin import RosterButtonsPlugin ===================================== plugins/roster_buttons/manifest.ini deleted ===================================== @@ -1,10 +0,0 @@ -[info] -name: Roster Buttons -short_name: roster_buttons -version: 0.1 -description: Adds quick action buttons to roster window. -authors = Mateusz Biliński <mateusz(a)bilinski.it> -homepage =
http://blog.bilinski.it
- - - ===================================== plugins/roster_buttons/plugin.py deleted ===================================== @@ -1,80 +0,0 @@ -# -*- coding: utf-8 -*- - -## This file is part of Gajim. -## -## Gajim is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published -## by the Free Software Foundation; version 3 only. -## -## Gajim is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with Gajim. If not, see <
http://www.gnu.org/licenses/
>. -## - -''' -Roster buttons plug-in. - -:author: Mateusz Biliński <mateusz(a)bilinski.it> -:since: 14th June 2008 -:copyright: Copyright (2008) Mateusz Biliński <mateusz(a)bilinski.it> -:license: GPL -''' - -import sys - -import gtk -from gajim.common import app - -from gajim.plugins import GajimPlugin -from gajim.plugins.helpers import log, log_calls - -class RosterButtonsPlugin(GajimPlugin): - - @log_calls('RosterButtonsPlugin') - def init(self): - self.description = _('Adds quick action buttons to roster window.') - self.GTK_BUILDER_FILE_PATH = self.local_file_path('roster_buttons.ui') - - self.config_dialog = None - - @log_calls('RosterButtonsPlugin') - def activate(self): - self.roster_vbox = app.interface.roster.xml.get_object('roster_vbox2') - self.show_offline_contacts_menuitem = app.interface.roster.xml.get_object('show_offline_contacts_menuitem') - self.xml = gtk.Builder() - self.xml.set_translation_domain('gajim_plugins') - self.xml.add_objects_from_file(self.GTK_BUILDER_FILE_PATH, - ['roster_buttons_buttonbox']) - self.buttonbox = self.xml.get_object('roster_buttons_buttonbox') - - self.roster_vbox.pack_start(self.buttonbox, expand=False) - self.roster_vbox.reorder_child(self.buttonbox, 0) - self.xml.connect_signals(self) - - @log_calls('RosterButtonsPlugin') - def deactivate(self): - self.roster_vbox.remove(self.buttonbox) - - self.buttonbox = None - self.xml = None - - @log_calls('RosterButtonsPlugin') - def on_roster_button_1_clicked(self, button): - #gajim.interface.roster.on_show_offline_contacts_menuitem_activate(None) - self.show_offline_contacts_menuitem.set_active(not self.show_offline_contacts_menuitem.get_active()) - - @log_calls('RosterButtonsPlugin') - def on_roster_button_2_clicked(self, button): - pass - - @log_calls('RosterButtonsPlugin') - def on_roster_button_3_clicked(self, button): - pass - - @log_calls('RosterButtonsPlugin') - def on_roster_button_4_clicked(self, button): - pass ===================================== plugins/roster_buttons/roster_buttons.ui deleted ===================================== @@ -1,70 +0,0 @@ -<?xml version="1.0"?> -<interface> - <requires lib="gtk+" version="2.16"/> - <!-- interface-naming-policy toplevel-contextual --> - <object class="GtkWindow" id="window1"> - <child> - <object class="GtkHButtonBox" id="roster_buttons_buttonbox"> - <property name="visible">True</property> - <property name="homogeneous">True</property> - <property name="layout_style">spread</property> - <child> - <object class="GtkButton" id="roster_button_1"> - <property name="label">1</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - <signal name="clicked" handler="on_roster_button_1_clicked"/> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkButton" id="roster_button_2"> - <property name="label">2</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - <signal name="clicked" handler="on_roster_button_2_clicked"/> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">1</property> - </packing> - </child> - <child> - <object class="GtkButton" id="roster_button_3"> - <property name="label">3</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - <signal name="clicked" handler="on_roster_button_3_clicked"/> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">2</property> - </packing> - </child> - <child> - <object class="GtkButton" id="roster_button_4"> - <property name="label">4</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - <signal name="clicked" handler="on_roster_button_4_clicked"/> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">3</property> - </packing> - </child> - </object> - </child> - </object> -</interface> View it on GitLab:
https://dev.gajim.org/gajim/gajim/commit/765180d14bc43bddd67f9e5cb8cefa11c3…
-- View it on GitLab:
https://dev.gajim.org/gajim/gajim/commit/765180d14bc43bddd67f9e5cb8cefa11c3…
You're receiving this email because of your account on
dev.gajim.org
.
1
0
0
0
[Git][gajim/gajim][master] Make change password dialog an Assistant
by Philipp Hörist
30 Nov '19
30 Nov '19
Philipp Hörist pushed to branch master at gajim / gajim Commits: 0aaa9c41 by Philipp Hörist at 2019-11-30T19:53:11Z Make change password dialog an Assistant - - - - - 6 changed files: - − gajim/data/gui/change_password_dialog.ui - + gajim/gtk/change_password.py - gajim/gtk/const.py - gajim/gtk/dialogs.py - gajim/gtk/settings.py - + test/gtk/change_password.py Changes: ===================================== gajim/data/gui/change_password_dialog.ui deleted ===================================== @@ -1,56 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.22.1 --> -<interface> - <requires lib="gtk+" version="3.12"/> - <object class="GtkBox" id="change_password_box"> - <property name="width_request">220</property> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="margin_bottom">12</property> - <property name="orientation">vertical</property> - <property name="spacing">6</property> - <child> - <object class="GtkEntry" id="password1_entry"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="visibility">False</property> - <property name="placeholder_text" translatable="yes">New Password</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkEntry" id="password2_entry"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="visibility">False</property> - <property name="activates_default">True</property> - <property name="placeholder_text" translatable="yes">Confirm New Password</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> - </child> - <child> - <object class="GtkLabel" id="error_label"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="wrap">True</property> - <property name="xalign">0</property> - <style> - <class name="error-color"/> - </style> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">2</property> - </packing> - </child> - </object> -</interface> ===================================== gajim/gtk/change_password.py ===================================== @@ -0,0 +1,242 @@ +# This file is part of Gajim. +# +# Gajim is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published +# by the Free Software Foundation; version 3 only. +# +# Gajim is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Gajim. If not, see <
http://www.gnu.org/licenses/
>. + +import logging + +from gi.repository import Gtk + +from nbxmpp.util import is_error_result + +from gajim.common import app +from gajim.common.i18n import _ +from gajim.common import passwords +from gajim.common.helpers import to_user_string + +from gajim.gtk.assistant import Assistant +from gajim.gtk.assistant import Page +from gajim.gtk.dataform import DataFormWidget +from gajim.gtk.util import ensure_not_destroyed + +log = logging.getLogger('gajim.gtk.change_password') + + +class ChangePassword(Assistant): + def __init__(self, account): + Assistant.__init__(self) + + self.account = account + self._con = app.connections.get(account) + self._destroyed = False + + self.add_button('apply', _('Change'), 'suggested-action', + complete=True) + self.add_button('close', _('Close')) + self.add_button('back', _('Back')) + + self.add_pages({'password': EnterPassword(), + 'next_stage': NextStage()}) + + progress = self.add_default_page('progress') + progress.set_title(_('Changing Password...')) + progress.set_text(_('Trying to change password...')) + + success = self.add_default_page('success') + success.set_title(_('Password Changed')) + success.set_heading(_('Password Changed')) + success.set_text(_('Your password has successfully been changed.')) + + error = self.add_default_page('error') + error.set_title(_('Password Change Failed')) + error.set_heading(_('Password Change Failed')) + error.set_text( + _('An error occured while trying to change your password.')) + + self.set_button_visible_func(self._visible_func) + + self.connect('button-clicked', self._on_button_clicked) + self.connect('page-changed', self._on_page_changed) + self.connect('destroy', self._on_destroy) + + self.show_all() + + @staticmethod + def _visible_func(_assistant, page_name): + if page_name in ('password', 'next_stage'): + return ['apply'] + + if page_name == 'progress': + return None + + if page_name == 'error': + return ['back'] + + if page_name == 'success': + return ['close'] + raise ValueError('page %s unknown' % page_name) + + def _on_button_clicked(self, _assistant, button_name): + page = self.get_current_page() + if button_name == 'apply': + self.show_page('progress', Gtk.StackTransitionType.SLIDE_LEFT) + self._on_apply(next_stage=page == 'next_stage') + + elif button_name == 'back': + self.show_page('password', Gtk.StackTransitionType.SLIDE_RIGHT) + + elif button_name == 'close': + self.destroy() + + def _on_page_changed(self, _assistant, page_name): + if page_name in ('password', 'next_stage'): + self.set_default_button('apply') + + elif page_name == 'success': + password = self.get_page('password').get_password() + passwords.save_password(self.account, password) + self.set_default_button('close') + + elif page_name == 'error': + self.set_default_button('back') + + def _on_apply(self, next_stage=False): + register = self._con.connection.get_module('Register') + if next_stage: + form = self.get_page('next_stage').get_submit_form() + register.change_password_with_form( + form, callback=self._on_change_password) + else: + password = self.get_page('password').get_password() + register.change_password(password, + callback=self._on_change_password) + + @ensure_not_destroyed + def _on_change_password(self, result): + if is_error_result(result): + error_text = to_user_string(result) + self.get_page('error').set_text(error_text) + self.show_page('error', Gtk.StackTransitionType.SLIDE_LEFT) + elif result.successful: + self.show_page('success') + else: + self.get_page('next_stage').set_form(result.form) + self.show_page('next_stage', Gtk.StackTransitionType.SLIDE_LEFT) + + def _on_destroy(self, *args): + self._destroyed = True + + +class EnterPassword(Page): + def __init__(self): + Page.__init__(self) + self.complete = False + self.title = _('Change Password') + + heading = Gtk.Label(label=_('Change Password')) + heading.get_style_context().add_class('large-header') + heading.set_max_width_chars(30) + heading.set_line_wrap(True) + heading.set_halign(Gtk.Align.CENTER) + heading.set_justify(Gtk.Justification.CENTER) + + label = Gtk.Label(label=_('Please enter your new password.')) + label.set_max_width_chars(50) + label.set_line_wrap(True) + label.set_halign(Gtk.Align.CENTER) + label.set_justify(Gtk.Justification.CENTER) + label.set_margin_bottom(12) + + self._password1_entry = Gtk.Entry() + self._password1_entry.set_input_purpose(Gtk.InputPurpose.PASSWORD) + self._password1_entry.set_visibility(False) + self._password1_entry.set_invisible_char('•') + self._password1_entry.set_valign(Gtk.Align.END) + self._password1_entry.set_placeholder_text( + _('Enter new password...')) + self._password1_entry.connect('changed', self._on_changed) + self._password2_entry = Gtk.Entry() + self._password2_entry.set_input_purpose(Gtk.InputPurpose.PASSWORD) + self._password2_entry.set_visibility(False) + self._password2_entry.set_invisible_char('•') + self._password2_entry.set_activates_default(True) + self._password2_entry.set_valign(Gtk.Align.START) + self._password2_entry.set_placeholder_text( + _('Confirm new password...')) + self._password2_entry.connect('changed', self._on_changed) + + self.pack_start(heading, False, True, 0) + self.pack_start(label, False, True, 0) + self.pack_start(self._password1_entry, True, True, 0) + self.pack_start(self._password2_entry, True, True, 0) + self._show_icon(False) + self.show_all() + + def _show_icon(self, show): + if show: + self._password2_entry.set_icon_from_icon_name( + Gtk.EntryIconPosition.SECONDARY, 'dialog-warning-symbolic') + self._password2_entry.set_icon_tooltip_text( + Gtk.EntryIconPosition.SECONDARY, _('Passwords do not match')) + else: + self._password2_entry.set_icon_from_icon_name( + Gtk.EntryIconPosition.SECONDARY, None) + + def _on_changed(self, _entry): + password1 = self._password1_entry.get_text() + if not password1: + self._show_icon(True) + self._set_complete(False) + return + + password2 = self._password2_entry.get_text() + if password1 != password2: + self._show_icon(True) + self._set_complete(False) + return + self._show_icon(False) + self._set_complete(True) + + def _set_complete(self, state): + self.complete = state + self.get_toplevel().update_page_complete() + + def get_password(self): + return self._password1_entry.get_text() + + +class NextStage(Page): + def __init__(self): + Page.__init__(self) + self.set_valign(Gtk.Align.FILL) + self.complete = False + self.title = _('Change Password') + self._current_form = None + + self.show_all() + + def _on_is_valid(self, _widget, is_valid): + self.complete = is_valid + self.get_toplevel().update_page_complete() + + def set_form(self, form): + if self._current_form is not None: + self.remove(self._current_form) + self._current_form.destroy() + self._current_form = DataFormWidget(form) + self._current_form.connect('is-valid', self._on_is_valid) + self._current_form.validate() + self.pack_start(self._current_form, True, True, 0) + self._current_form.show_all() + + def get_submit_form(self): + return self._current_form.get_submit_form() ===================================== gajim/gtk/const.py ===================================== @@ -130,4 +130,5 @@ WINDOW_MODULES = { 'CertificateDialog': 'gajim.gtk.dialogs', 'SubscriptionRequest': 'gajim.gtk.subscription_request', 'RemoveAccount': 'gajim.gtk.remove_account', + 'ChangePassword': 'gajim.gtk.change_password', } ===================================== gajim/gtk/dialogs.py ===================================== @@ -258,59 +258,6 @@ class CertificateDialog(Gtk.ApplicationWindow): self._clipboard.set_text(clipboard_text, -1) -class ChangePasswordDialog(Gtk.Dialog): - def __init__(self, account, success_cb, transient_for): - super().__init__(title=_('Change Password'), - transient_for=transient_for, - destroy_with_parent=True) - - self._account = account - self._success_cb = success_cb - - self._builder = get_builder('change_password_dialog.ui') - self.get_content_area().add( - self._builder.get_object('change_password_box')) - self._password1_entry = self._builder.get_object('password1_entry') - self._password2_entry = self._builder.get_object('password2_entry') - self._error_label = self._builder.get_object('error_label') - - self.add_button(_('_OK'), Gtk.ResponseType.OK) - self.set_default_response(Gtk.ResponseType.OK) - self.get_style_context().add_class('dialog-margin') - self.connect('response', self._on_dialog_response) - self.show_all() - - def _on_dialog_response(self, dialog, response): - if response != Gtk.ResponseType.OK: - self.destroy() - return - - password1 = self._password1_entry.get_text() - if not password1: - self._error_label.set_text(_('You must enter a password')) - return - password2 = self._password2_entry.get_text() - if password1 != password2: - self._error_label.set_text(_('Passwords do not match')) - return - - self._password1_entry.set_sensitive(False) - self._password2_entry.set_sensitive(False) - - con = app.connections[self._account] - con.get_module('Register').change_password( - password1, self._on_success, self._on_error) - - def _on_success(self): - self._success_cb(self._password1_entry.get_text()) - self.destroy() - - def _on_error(self, error_text): - self._error_label.set_text(error_text) - self._password1_entry.set_sensitive(True) - self._password2_entry.set_sensitive(True) - - class InvitationReceivedDialog(Gtk.ApplicationWindow): def __init__(self, account, event): Gtk.ApplicationWindow.__init__(self) ===================================== gajim/gtk/settings.py ===================================== @@ -28,9 +28,9 @@ from gajim.common.exceptions import GajimGeneralException from gajim import gtkgui_helpers -from gajim.gtk.dialogs import ChangePasswordDialog from gajim.gtk.util import get_image_button from gajim.gtk.util import MaxWidthComboBoxText +from gajim.gtk.util import open_window from gajim.gtk.const import SettingKind from gajim.gtk.const import SettingType @@ -635,18 +635,10 @@ class CutstomHostnameSetting(DialogSetting): class ChangePasswordSetting(DialogSetting): def __init__(self, *args, **kwargs): DialogSetting.__init__(self, *args, **kwargs) - self.change_dialog = None def show_dialog(self, parent): - try: - self.change_dialog = ChangePasswordDialog( - self.account, self.on_changed, parent) - except GajimGeneralException: - return - self.change_dialog.set_modal(True) - - def on_changed(self, new_password): - self.set_value(new_password) + parent.destroy() + open_window('ChangePassword', account=self.account) def update_activatable(self, name, value): activatable = False ===================================== test/gtk/change_password.py ===================================== @@ -0,0 +1,37 @@ +from functools import partial + +import gi +gi.require_version('Gtk', '3.0') +from gi.repository import Gtk + +from nbxmpp.modules.dataforms import create_field +from nbxmpp.modules.dataforms import SimpleDataForm + +from gajim.common.const import CSSPriority + +from gajim.gtk.change_password import ChangePassword + +from test.gtk import util +util.load_style('gajim.css', CSSPriority.APPLICATION) + +fields = [ + create_field(typ='text-single', label='Username', var='username'), + create_field(typ='text-single', label='Old Password', var='old_password'), + create_field(typ='text-single', label='Mothers name', var='mother', required=True), +] + +form = SimpleDataForm(type_='form', fields=fields) + +def _apply(self, next_stage=False): + if next_stage: + print(self.get_page('next_stage').get_submit_form()) + else: + self.get_page('next_stage').set_form(form) + self.show_page('next_stage', Gtk.StackTransitionType.SLIDE_LEFT) + +win = ChangePassword(None) +win._on_apply = partial(_apply, win) + +win.connect('destroy', Gtk.main_quit) +win.show_all() +Gtk.main() View it on GitLab:
https://dev.gajim.org/gajim/gajim/commit/0aaa9c41b8288de75bda3712f3e08b8e94…
-- View it on GitLab:
https://dev.gajim.org/gajim/gajim/commit/0aaa9c41b8288de75bda3712f3e08b8e94…
You're receiving this email because of your account on
dev.gajim.org
.
1
0
0
0
[Git][gajim/gajim][master] 2 commits: Dialogs: Remove obsolete ConfirmationDialogDoubleRadio
by Philipp Hörist
30 Nov '19
30 Nov '19
Philipp Hörist pushed to branch master at gajim / gajim Commits: 2321839c by Daniel Brötzmann at 2019-11-30T14:54:53Z Dialogs: Remove obsolete ConfirmationDialogDoubleRadio - - - - - f5ea6686 by Daniel Brötzmann at 2019-11-30T14:54:53Z Dialogs: Remove obsolete ConfirmationDialog - - - - - 1 changed file: - gajim/gtk/dialogs.py Changes: ===================================== gajim/gtk/dialogs.py ===================================== @@ -137,39 +137,6 @@ class AspellDictError: 'Highlighting misspelled words feature will not be used') % lang) -class ConfirmationDialog(HigDialog): - """ - HIG compliant confirmation dialog - """ - - def __init__(self, pritext, sectext='', on_response_ok=None, - on_response_cancel=None, transient_for=None): - self.user_response_ok = on_response_ok - self.user_response_cancel = on_response_cancel - HigDialog.__init__(self, transient_for, - Gtk.MessageType.QUESTION, Gtk.ButtonsType.OK_CANCEL, pritext, sectext, - self.on_response_ok, self.on_response_cancel) - self.popup() - - def on_response_ok(self, widget): - if self.user_response_ok: - if isinstance(self.user_response_ok, tuple): - self.user_response_ok[0](*self.user_response_ok[1:]) - else: - self.user_response_ok() - self.call_cancel_on_destroy = False - self.destroy() - - def on_response_cancel(self, widget): - if self.user_response_cancel: - if isinstance(self.user_response_cancel, tuple): - self.user_response_cancel[0](*self.user_response_ok[1:]) - else: - self.user_response_cancel() - self.call_cancel_on_destroy = False - self.destroy() - - class WarningDialog(HigDialog): """ HIG compliant warning dialog @@ -213,69 +180,6 @@ class ErrorDialog(HigDialog): self.popup() -class ConfirmationDialogDoubleRadio(ConfirmationDialog): - """ - HIG compliant confirmation dialog with 2 radios - """ - def __init__(self, pritext, sectext='', radiotext1='', radiotext2='', - on_response_ok=None, on_response_cancel=None, is_modal=True, transient_for=None): - self.user_response_ok = on_response_ok - self.user_response_cancel = on_response_cancel - - if transient_for is None: - transient_for = app.app.get_active_window() - HigDialog.__init__(self, transient_for, Gtk.MessageType.QUESTION, - Gtk.ButtonsType.OK_CANCEL, pritext, sectext, self.on_response_ok, - self.on_response_cancel) - - self.set_default_response(Gtk.ResponseType.OK) - - ok_button = self.get_widget_for_response(Gtk.ResponseType.OK) - ok_button.grab_focus() - - vbox = self.get_content_area() - self.radiobutton1 = Gtk.RadioButton(label=radiotext1) - vbox.pack_start(self.radiobutton1, False, True, 0) - - self.radiobutton2 = Gtk.RadioButton(group=self.radiobutton1, - label=radiotext2) - vbox.pack_start(self.radiobutton2, False, True, 0) - - self.set_modal(is_modal) - self.popup() - - def on_response_ok(self, widget): - if self.user_response_ok: - if isinstance(self.user_response_ok, tuple): - self.user_response_ok[0](self.is_checked(), - *self.user_response_ok[1:]) - else: - self.user_response_ok(self.is_checked()) - self.call_cancel_on_destroy = False - self.destroy() - - def on_response_cancel(self, widget): - if self.user_response_cancel: - if isinstance(self.user_response_cancel, tuple): - self.user_response_cancel[0](*self.user_response_cancel[1:]) - else: - self.user_response_cancel() - self.call_cancel_on_destroy = False - self.destroy() - - def is_checked(self): - ''' Get active state of the checkbutton ''' - if self.radiobutton1: - is_checked_1 = self.radiobutton1.get_active() - else: - is_checked_1 = False - if self.radiobutton2: - is_checked_2 = self.radiobutton2.get_active() - else: - is_checked_2 = False - return [is_checked_1, is_checked_2] - - class CertificateDialog(Gtk.ApplicationWindow): def __init__(self, transient_for, account, cert): Gtk.ApplicationWindow.__init__(self) View it on GitLab:
https://dev.gajim.org/gajim/gajim/compare/c9e23a094e1583a6e91c6d3120568b2f9…
-- View it on GitLab:
https://dev.gajim.org/gajim/gajim/compare/c9e23a094e1583a6e91c6d3120568b2f9…
You're receiving this email because of your account on
dev.gajim.org
.
1
0
0
0
[Git][gajim/gajim][master] Make remove account dialog an Assistant
by Philipp Hörist
30 Nov '19
30 Nov '19
Philipp Hörist pushed to branch master at gajim / gajim Commits: c9e23a09 by Philipp Hörist at 2019-11-30T14:54:30Z Make remove account dialog an Assistant - - - - - 7 changed files: - gajim/common/connection.py - − gajim/data/gui/remove_account_window.ui - gajim/dialog_messages.py - gajim/gtk/accounts.py - gajim/gtk/const.py - + gajim/gtk/remove_account.py - gajim/gui_interface.py Changes: ===================================== gajim/common/connection.py ===================================== @@ -438,9 +438,6 @@ class Connection(CommonConnection, ConnectionHandlers): self.new_account_form = None self.last_sent = [] - self._unregister_account = False - self._unregister_account_cb = None - self.music_track_info = 0 self.register_supported = False @@ -541,7 +538,7 @@ class Connection(CommonConnection, ConnectionHandlers): log.info('Starting to disconnect %s', self.name) disconnect_cb = partial(self._on_disconnect, reconnect) self.connection.disconnect_handlers = [disconnect_cb] - if immediately: + if immediately or self.removing_account: self.connection.disconnect() else: self.connection.start_disconnect() @@ -562,7 +559,7 @@ class Connection(CommonConnection, ConnectionHandlers): log.info('Disconnect %s, reconnect: %s', self.name, reconnect) - if reconnect: + if reconnect and not self.removing_account: if app.account_is_connected(self.name): # we cannot change our status to offline or connecting # after we auth to server @@ -1263,10 +1260,7 @@ class Connection(CommonConnection, ConnectionHandlers): self._register_new_handlers(con) def _on_auth_successful(self): - if self._unregister_account: - self._on_unregister_account_connect() - else: - self.connection.bind() + self.connection.bind() def _on_auth_failed(self, reason, text): if not app.config.get_per('accounts', self.name, 'savepass'): @@ -1675,41 +1669,12 @@ class Connection(CommonConnection, ConnectionHandlers): stanza_id=obj.stanza_id, additional_data=obj.additional_data)) - def unregister_account(self, on_remove_success): - self._unregister_account = True - self._unregister_account_cb = on_remove_success - if self.connected == 0: - self.connect_and_auth() - else: - self._on_unregister_account_connect() - - def _on_unregister_account_connect(self): - self.removing_account = True - if app.account_is_connected(self.name): - hostname = app.config.get_per('accounts', self.name, 'hostname') - iq = nbxmpp.Iq(typ='set', to=hostname) - id_ = self.connection.getAnID() - iq.setID(id_) - iq.setTag(nbxmpp.NS_REGISTER + ' query').setTag('remove') - def _on_answer(con, result): - if result.getID() == id_: - self._on_unregister_finished(True) - return - app.nec.push_incoming_event(InformationEvent( - None, dialog_name='unregister-error', - kwargs={'server': hostname, 'error': result.getErrorMsg()})) - self._on_unregister_finished(False) - self.connection.RegisterHandler( - 'iq', _on_answer, 'result', system=True) - self.connection.SendAndWaitForResponse(iq) + def unregister_account(self, callback): + if not app.account_is_connected(self.name): return - self._on_unregister_finished(False) - self.removing_account = False - - def _on_unregister_finished(self, result): - self._unregister_account_cb(result) - self._unregister_account = False - self._unregister_account_cb = None + self.removing_account = True + self.connection.get_module('Register').unregister( + callback=callback) def _reconnect_alarm(self): if not app.config.get_per('accounts', self.name, 'active'): ===================================== gajim/data/gui/remove_account_window.ui deleted ===================================== @@ -1,161 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.22.1 --> -<interface> - <requires lib="gtk+" version="3.20"/> - <object class="GtkWindow" id="remove_account_window"> - <property name="can_focus">False</property> - <property name="border_width">18</property> - <property name="resizable">False</property> - <property name="type_hint">dialog</property> - <signal name="destroy" handler="_on_destroy" swapped="no"/> - <child> - <placeholder/> - </child> - <child> - <object class="GtkBox"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="orientation">vertical</property> - <property name="spacing">18</property> - <child> - <object class="GtkLabel"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="halign">start</property> - <property name="label" translatable="yes">What do you want to do?</property> - <property name="use_markup">True</property> - <style> - <class name="large-header"/> - </style> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkBox"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="spacing">12</property> - <child> - <object class="GtkImage"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="icon_name">user-trash-symbolic</property> - <property name="icon_size">6</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkBox"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="orientation">vertical</property> - <property name="spacing">6</property> - <child> - <object class="GtkRadioButton" id="remove_only_radiobutton"> - <property name="label" translatable="yes">Remove account _only from Gajim</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="halign">start</property> - <property name="use_underline">True</property> - <property name="active">True</property> - <property name="draw_indicator">True</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkRadioButton" id="remove_and_unregister_radiobutton"> - <property name="label" translatable="yes">Remove account from Gajim and from _server</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="halign">start</property> - <property name="use_underline">True</property> - <property name="active">True</property> - <property name="draw_indicator">True</property> - <property name="group">remove_only_radiobutton</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">1</property> - </packing> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> - </child> - <child> - <object class="GtkButtonBox"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="spacing">12</property> - <property name="layout_style">end</property> - <child> - <object class="GtkButton" id="cancel_button"> - <property name="label">_Cancel</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="can_default">True</property> - <property name="receives_default">False</property> - <property name="use_underline">True</property> - <signal name="clicked" handler="on_cancel_button_clicked" swapped="no"/> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkButton" id="remove_button"> - <property name="label" translatable="yes">_Remove</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="can_default">True</property> - <property name="receives_default">False</property> - <property name="use_underline">True</property> - <signal name="clicked" handler="on_remove_button_clicked" swapped="no"/> - <style> - <class name="destructive-action"/> - </style> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">1</property> - </packing> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">2</property> - </packing> - </child> - </object> - </child> - </object> -</interface> ===================================== gajim/dialog_messages.py ===================================== @@ -88,11 +88,6 @@ messages = { _('This account %s doesn\'t support invisibility.'), ErrorDialog), - 'unregister-error': Message( - _('Unregister Failed'), - _('Unregistration on server %(server)s failed: %(error)s'), - ErrorDialog), - 'agent-register-success': Message( _('Registration Succeeded'), _('Registration with agent %s succeeded.'), ===================================== gajim/gtk/accounts.py ===================================== @@ -31,16 +31,12 @@ from gajim import gui_menu_builder from gajim.gtk.dialogs import DialogButton from gajim.gtk.dialogs import NewConfirmationDialog -from gajim.gtk.dialogs import ConfirmationDialogDoubleRadio -from gajim.gtk.dialogs import ErrorDialog -from gajim.gtk.dialogs import PassphraseDialog from gajim.gtk.const import Setting from gajim.gtk.const import SettingKind from gajim.gtk.const import SettingType from gajim.gtk.settings import SettingsDialog from gajim.gtk.settings import SettingsBox -from gajim.gtk.util import get_builder -from gajim.gtk.util import get_app_window +from gajim.gtk.util import open_window log = logging.getLogger('gajim.gtk.accounts') @@ -159,7 +155,8 @@ class AccountsWindow(Gtk.ApplicationWindow): values.append(app.config.get_per('accounts', account, setting)) return values - def on_remove_account(self, account): + @staticmethod + def on_remove_account(account): if app.events.get_events(account): app.interface.raise_dialog('unread-events-on-remove-account') return @@ -168,39 +165,7 @@ class AccountsWindow(Gtk.ApplicationWindow): # Should never happen as button is insensitive return - win_opened = False - if app.interface.msg_win_mgr.get_controls(acct=account): - win_opened = True - elif account in app.interface.instances: - for key in app.interface.instances[account]: - if (app.interface.instances[account][key] and - key != 'remove_account'): - win_opened = True - break - - # Detect if we have opened windows for this account - - def remove(): - if (account in app.interface.instances and - 'remove_account' in app.interface.instances[account]): - dialog = app.interface.instances[account]['remove_account'] - dialog.window.present() - else: - if account not in app.interface.instances: - app.interface.instances[account] = {} - app.interface.instances[account]['remove_account'] = \ - RemoveAccountWindow(account) - if win_opened: - NewConfirmationDialog( - _('Remove Account'), - _('You still have open chats in your account %s') % account, - _('All chat and group chat windows will be closed.'), - [DialogButton.make('Cancel'), - DialogButton.make('Remove', - callback=remove)], - transient_for=self).show() - else: - remove() + open_window('RemoveAccount', account=account) def remove_account(self, account): del self._need_relogin[account] @@ -909,138 +874,3 @@ class LoginDialog(SettingsDialog): savepass = app.config.get_per('accounts', self.account, 'savepass') if not savepass: passwords.delete_password(self.account) - - -class RemoveAccountWindow: - """ - Ask whether to remove from gajim only or both from gajim and the server, - then remove the account given - """ - - def _on_destroy(self, _widget): - if self.account in app.interface.instances: - del app.interface.instances[self.account]['remove_account'] - - def on_cancel_button_clicked(self, _widget): - self._ui.remove_account_window.destroy() - - def __init__(self, account): - self.account = account - self._ui = get_builder('remove_account_window.ui') - active_window = app.app.get_active_window() - self._ui.remove_account_window.set_transient_for(active_window) - self._ui.remove_account_window.set_title( - _('Removing account %s') % self.account) - self._ui.connect_signals(self) - self._ui.remove_account_window.show_all() - - def on_remove_button_clicked(self, _widget): - def remove(): - if self.account in app.connections and \ - app.connections[self.account].connected and \ - not self._ui.remove_and_unregister_radiobutton.get_active(): - # change status to offline only if we will not - # remove this JID from server - app.connections[self.account].change_status('offline', - 'offline') - if self._ui.remove_and_unregister_radiobutton.get_active(): - if not self.account in app.connections: - ErrorDialog( - _('Account is disabled'), - _('To unregister from a server, the account must be ' - 'enabled.'), - transient_for=self._ui.remove_account_window) - return - if not app.connections[self.account].password: - def on_ok(passphrase, _checked): - if passphrase == -1: - # We don't remove account cause we - # canceled pw window - return - app.connections[self.account].password = passphrase - app.connections[self.account].unregister_account( - self._on_remove_success) - - PassphraseDialog( - _('Password required'), - _('Enter your password for account %s') % self.account, - _('Save password'), ok_handler=on_ok, - transient_for=self._ui.remove_account_window) - return - app.connections[self.account].unregister_account( - self._on_remove_success) - else: - self._on_remove_success(True) - - if (self.account in app.connections and - app.connections[self.account].connected): - NewConfirmationDialog( - _('Remove Account'), - _('Still connected to the server'), - _('Account \'%s\' is still connected to the server. If you ' - 'remove it, the connection will be lost.') % self.account, - [DialogButton.make('Cancel'), - DialogButton.make('Remove', - callback=remove)], - transient_for=self._ui.remove_account_window).show() - else: - remove() - - def on_remove_response_ok(self, is_checked): - if is_checked[0]: - self._on_remove_success(True) - - def _on_remove_success(self, res): - # action of unregistration has failed, we don't remove the account - # Error message is send by connect_and_auth() - if not res: - ConfirmationDialogDoubleRadio( - _('Connection to server %s failed') % self.account, - _('What would you like to do?'), - _('Remove only from Gajim'), - _('Don\'t remove anything. I\'ll try again later'), - on_response_ok=self.on_remove_response_ok, is_modal=False, - transient_for=self._ui.remove_account_window) - return - # Close all opened windows - app.interface.roster.close_all(self.account, force=True) - if self.account in app.connections: - app.connections[self.account].disconnect(reconnect=False) - app.connections[self.account].cleanup() - del app.connections[self.account] - app.logger.remove_roster(app.get_jid_from_account(self.account)) - # Delete password must be before del_per() because it calls set_per() - # which would recreate the account with defaults values if not found - passwords.delete_password(self.account) - app.config.del_per('accounts', self.account) - del app.interface.instances[self.account] - if self.account in app.nicks: - del app.interface.minimized_controls[self.account] - del app.nicks[self.account] - del app.block_signed_in_notifications[self.account] - del app.groups[self.account] - app.contacts.remove_account(self.account) - del app.gc_connected[self.account] - del app.automatic_rooms[self.account] - del app.to_be_removed[self.account] - del app.newly_added[self.account] - del app.sleeper_state[self.account] - del app.last_message_time[self.account] - del app.status_before_autoaway[self.account] - del app.gajim_optional_features[self.account] - del app.caps_hash[self.account] - if len(app.connections) >= 2: # Do not merge accounts if only one exists - app.interface.roster.regroup = app.config.get('mergeaccounts') - else: - app.interface.roster.regroup = False - app.interface.roster.setup_and_draw_roster() - app.app.remove_account_actions(self.account) - gui_menu_builder.build_accounts_menu() - - window = get_app_window('AccountsWindow') - if window is not None: - window.remove_account(self.account) - self._ui.remove_account_window.destroy() - - def destroy(self): - self._ui.remove_account_window.destroy() ===================================== gajim/gtk/const.py ===================================== @@ -129,4 +129,5 @@ WINDOW_MODULES = { 'AdvancedConfig': 'gajim.gtk.advanced_config', 'CertificateDialog': 'gajim.gtk.dialogs', 'SubscriptionRequest': 'gajim.gtk.subscription_request', + 'RemoveAccount': 'gajim.gtk.remove_account', } ===================================== gajim/gtk/remove_account.py ===================================== @@ -0,0 +1,174 @@ +# This file is part of Gajim. +# +# Gajim is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published +# by the Free Software Foundation; version 3 only. +# +# Gajim is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Gajim. If not, see <
http://www.gnu.org/licenses/
>. + +import logging + +from gi.repository import Gtk + +from nbxmpp.util import is_error_result + +from gajim.common import app +from gajim.common.i18n import _ +from gajim.common.helpers import to_user_string + +from gajim.gtk.assistant import Assistant +from gajim.gtk.assistant import Page +from gajim.gtk.util import ensure_not_destroyed + +log = logging.getLogger('gajim.gtk.remove_account') + + +class RemoveAccount(Assistant): + def __init__(self, account): + Assistant.__init__(self) + + self.account = account + self._con = app.connections.get(account) + self._destroyed = False + + self.add_button('remove', _('Remove'), 'destructive-action') + self.add_button('close', _('Close')) + self.add_button('back', _('Back')) + + self.add_pages({'remove_choice': RemoveChoice(account)}) + + progress = self.add_default_page('progress') + progress.set_title(_('Removing Account...')) + progress.set_text(_('Trying to remove account...')) + + success = self.add_default_page('success') + success.set_title(_('Account Removed')) + success.set_heading(_('Account Removed')) + success.set_text( + _('Your account has has been unregistered successfully.')) + + error = self.add_default_page('error') + error.set_title(_('Account Removal Failed')) + error.set_heading(_('Account Removal Failed')) + + self.set_button_visible_func(self._visible_func) + + self.connect('button-clicked', self._on_button_clicked) + self.connect('page-changed', self._on_page_changed) + self.connect('destroy', self._on_destroy) + + self.show_all() + + @staticmethod + def _visible_func(_assistant, page_name): + if page_name == 'remove_choice': + return ['remove'] + + if page_name == 'progress': + return None + + if page_name == 'error': + return ['back'] + + if page_name == 'success': + return ['close'] + raise ValueError('page %s unknown' % page_name) + + def _on_button_clicked(self, _assistant, button_name): + page = self.get_current_page() + if button_name == 'remove': + if page == 'remove_choice': + self.show_page('progress', Gtk.StackTransitionType.SLIDE_LEFT) + self._on_remove() + return + + if button_name == 'back': + if page == 'error': + self.show_page('remove_choice', + Gtk.StackTransitionType.SLIDE_RIGHT) + return + + if button_name == 'close': + self.destroy() + + def _on_page_changed(self, _assistant, page_name): + if page_name == 'remove_choice': + self.set_default_button('remove') + + elif page_name == 'success': + self.set_default_button('close') + + elif page_name == 'error': + self.set_default_button('back') + + def _on_remove(self, *args): + if self.get_page('remove_choice').is_remove_from_server(): + self._con.unregister_account(self._on_remove_response) + else: + if app.account_is_connected(self.account): + self._con.change_status('offline', 'offline') + app.interface.remove_account(self.account) + self.destroy() + + @ensure_not_destroyed + def _on_remove_response(self, result): + if is_error_result(result): + self._con.removing_account = False + error_text = to_user_string(result) + self.get_page('error').set_text(error_text) + self.show_page('error') + else: + app.interface.remove_account(self.account) + self.show_page('success') + + def _on_destroy(self, *args): + self._destroyed = True + + +class RemoveChoice(Page): + def __init__(self, account): + Page.__init__(self) + self.title = _('Remove Account') + + heading = Gtk.Label(label=_('Remove Account')) + heading.get_style_context().add_class('large-header') + heading.set_max_width_chars(30) + heading.set_line_wrap(True) + heading.set_halign(Gtk.Align.CENTER) + heading.set_justify(Gtk.Justification.CENTER) + + label = Gtk.Label(label=_('This will remove your account from Gajim.')) + label.set_max_width_chars(50) + label.set_line_wrap(True) + label.set_halign(Gtk.Align.CENTER) + label.set_justify(Gtk.Justification.CENTER) + + service = app.connections[account].get_own_jid().getDomain() + check_label = Gtk.Label() + check_label.set_markup( + _('Do you want to unregister your account on <b>%s</b> as ' + 'well?') % service) + check_label.set_max_width_chars(50) + check_label.set_line_wrap(True) + check_label.set_halign(Gtk.Align.CENTER) + check_label.set_justify(Gtk.Justification.CENTER) + check_label.set_margin_top(40) + + self._server = Gtk.CheckButton.new_with_mnemonic( + _('_Unregister account from service')) + self._server.set_halign(Gtk.Align.CENTER) + + self.pack_start(heading, False, True, 0) + self.pack_start(label, False, True, 0) + self.pack_start(check_label, False, True, 0) + self.pack_start(self._server, False, True, 0) + self.show_all() + + def is_remove_from_server(self): + return self._server.get_active() ===================================== gajim/gui_interface.py ===================================== @@ -109,6 +109,7 @@ from gajim.gtk.roster_item_exchange import RosterItemExchangeWindow from gajim.gtk.util import get_show_in_roster from gajim.gtk.util import get_show_in_systray from gajim.gtk.util import open_window +from gajim.gtk.util import get_app_window from gajim.gtk.const import ControlType @@ -1797,6 +1798,46 @@ class Interface: self.roster.setup_and_draw_roster() gui_menu_builder.build_accounts_menu() + def remove_account(self, account): + # Close all opened windows + self.roster.close_all(account, force=True) + if account in app.connections: + app.connections[account].disconnect(reconnect=False) + app.connections[account].cleanup() + del app.connections[account] + app.logger.remove_roster(app.get_jid_from_account(account)) + # Delete password must be before del_per() because it calls set_per() + # which would recreate the account with defaults values if not found + passwords.delete_password(account) + app.config.del_per('accounts', account) + del self.instances[account] + if account in app.nicks: + del self.minimized_controls[account] + del app.nicks[account] + del app.block_signed_in_notifications[account] + del app.groups[account] + app.contacts.remove_account(account) + del app.gc_connected[account] + del app.automatic_rooms[account] + del app.to_be_removed[account] + del app.newly_added[account] + del app.sleeper_state[account] + del app.last_message_time[account] + del app.status_before_autoaway[account] + del app.gajim_optional_features[account] + del app.caps_hash[account] + if len(app.connections) >= 2: # Do not merge accounts if only one exists + self.roster.regroup = app.config.get('mergeaccounts') + else: + self.roster.regroup = False + self.roster.setup_and_draw_roster() + app.app.remove_account_actions(account) + gui_menu_builder.build_accounts_menu() + + window = get_app_window('AccountsWindow') + if window is not None: + window.remove_account(account) + def autoconnect(self): """ Auto connect at startup View it on GitLab:
https://dev.gajim.org/gajim/gajim/commit/c9e23a094e1583a6e91c6d3120568b2f99…
-- View it on GitLab:
https://dev.gajim.org/gajim/gajim/commit/c9e23a094e1583a6e91c6d3120568b2f99…
You're receiving this email because of your account on
dev.gajim.org
.
1
0
0
0
[Git][gajim/gajim][master] Assistant: Add page complete state
by Philipp Hörist
30 Nov '19
30 Nov '19
Philipp Hörist pushed to branch master at gajim / gajim Commits: c35ba59a by Philipp Hörist at 2019-11-30T11:37:10Z Assistant: Add page complete state Set buttons sensitive depending on if the page is complete - - - - - 2 changed files: - gajim/gtk/assistant.py - test/gtk/assistant.py Changes: ===================================== gajim/gtk/assistant.py ===================================== @@ -67,6 +67,7 @@ class Assistant(Gtk.ApplicationWindow, EventHelper): page_name = self._ui.stack.get_visible_child_name() buttons = self._button_visible_func(self, page_name) self._set_buttons_visible(buttons) + self.update_page_complete() self.emit('page-changed', page_name) Gtk.ApplicationWindow.show_all(self) @@ -74,20 +75,30 @@ class Assistant(Gtk.ApplicationWindow, EventHelper): if event.keyval == Gdk.KEY_Escape: self.destroy() + def update_page_complete(self): + page_widget = self._ui.stack.get_visible_child() + for button, complete in self._buttons.values(): + if complete: + button.set_sensitive(page_widget.complete) + + def update_title(self): + self.set_title(self._ui.stack.get_visible_child().title) + def set_button_visible_func(self, func): self._button_visible_func = func def set_default_button(self, button_name): - self._buttons[button_name].grab_default() + button, _ = self._buttons[button_name] + button.grab_default() - def add_button(self, name, label, css_class=None): + def add_button(self, name, label, css_class=None, complete=False): button = Gtk.Button(label=label, can_default=True, no_show_all=True) button.connect('clicked', self.__on_button_clicked) if css_class is not None: button.get_style_context().add_class(css_class) - self._buttons[name] = button + self._buttons[name] = (button, complete) self._ui.action_area.pack_end(button, False, False, 0) def add_pages(self, pages): @@ -121,21 +132,24 @@ class Assistant(Gtk.ApplicationWindow, EventHelper): return self._pages[name] def _set_buttons_visible(self, buttons): - for button in self._buttons.values(): + for button, _ in self._buttons.values(): button.hide() if buttons is None: return for button_name in buttons: - self._buttons[button_name].show() + button, _ = self._buttons[button_name] + button.show() def _on_visible_child_name(self, stack, _param): - self.set_title(stack.get_visible_child().title) + self.update_title() + self.update_page_complete() self.emit('page-changed', stack.get_visible_child_name()) def __on_button_clicked(self, button): - for button_name, button_ in self._buttons.items(): + for button_name, button_data in self._buttons.items(): + button_ = button_data[0] if button_ == button: self.emit('button-clicked', button_name) return @@ -146,12 +160,18 @@ class Assistant(Gtk.ApplicationWindow, EventHelper): class Page(Gtk.Box): - def __init__(self, icon_name, icon_css_class): - super().__init__(orientation=Gtk.Orientation.VERTICAL) + def __init__(self): + Gtk.Box.__init__(self, orientation=Gtk.Orientation.VERTICAL) self.set_spacing(18) self.set_valign(Gtk.Align.CENTER) self.title = '' + self.complete = True + + +class DefaultPage(Page): + def __init__(self, icon_name, icon_css_class): + Page.__init__(self) self._heading = Gtk.Label() self._heading.get_style_context().add_class('large-header') @@ -184,27 +204,23 @@ class Page(Gtk.Box): self.title = title -class ErrorPage(Page): +class ErrorPage(DefaultPage): def __init__(self): - Page.__init__(self, - icon_name='dialog-error-symbolic', - icon_css_class='error-color') + DefaultPage.__init__(self, + icon_name='dialog-error-symbolic', + icon_css_class='error-color') -class SuccessPage(Page): +class SuccessPage(DefaultPage): def __init__(self): - Page.__init__(self, - icon_name='object-select-symbolic', - icon_css_class='success-color') + DefaultPage.__init__(self, + icon_name='object-select-symbolic', + icon_css_class='success-color') -class ProgressPage(Gtk.Box): +class ProgressPage(Page): def __init__(self): - super().__init__(orientation=Gtk.Orientation.VERTICAL) - self.set_spacing(18) - self.set_valign(Gtk.Align.CENTER) - - self.title = '' + Page.__init__(self) self._label = Gtk.Label() self._label.set_max_width_chars(50) ===================================== test/gtk/assistant.py ===================================== @@ -5,6 +5,7 @@ from gi.repository import Gtk from gajim.common.const import CSSPriority from gajim.gtk.assistant import Assistant +from gajim.gtk.assistant import Page from test.gtk import util util.load_style('gajim.css', CSSPriority.APPLICATION) @@ -30,7 +31,7 @@ class TestAssistant(Assistant): success.set_heading('Success Heading') success.set_text('This is the success text') - self.add_button('forward', 'Forward', 'suggested-action') + self.add_button('forward', 'Forward', 'suggested-action', complete=True) self.add_button('close', 'Close', 'destructive-action') self.add_button('back', 'Back') @@ -93,14 +94,13 @@ class TestAssistant(Assistant): self.set_default_button('back') -class Start(Gtk.Box): +class Start(Page): + def __init__(self): + Page.__init__(self) - title = 'Start' + self.title = 'Start' + self.complete = False - def __init__(self): - super().__init__(orientation=Gtk.Orientation.VERTICAL) - self.set_spacing(18) - self.set_valign(Gtk.Align.CENTER) heading = Gtk.Label(label='Test Assistant') heading.get_style_context().add_class('large-header') @@ -111,21 +111,22 @@ class Start(Gtk.Box): label1.set_justify(Gtk.Justification.CENTER) label1.set_margin_bottom(24) - label2 = Gtk.Label(label='This is label 2 with some more text') - label2.set_max_width_chars(50) - label2.set_line_wrap(True) - label2.set_halign(Gtk.Align.CENTER) - label2.set_justify(Gtk.Justification.CENTER) + entry = Gtk.Entry(activates_default=True) + entry.connect('changed', self._on_changed) self._server = Gtk.CheckButton.new_with_mnemonic('A fancy checkbox') self._server.set_halign(Gtk.Align.CENTER) self.pack_start(heading, False, True, 0) self.pack_start(label1, False, True, 0) - self.pack_start(label2, False, True, 0) + self.pack_start(entry, False, True, 0) self.pack_start(self._server, False, True, 0) self.show_all() + def _on_changed(self, entry): + self.complete = bool(entry.get_text()) + self.get_toplevel().update_page_complete() + win = TestAssistant() win.connect('destroy', Gtk.main_quit) View it on GitLab:
https://dev.gajim.org/gajim/gajim/commit/c35ba59a4eb3a3dd16792871c371065af9…
-- View it on GitLab:
https://dev.gajim.org/gajim/gajim/commit/c35ba59a4eb3a3dd16792871c371065af9…
You're receiving this email because of your account on
dev.gajim.org
.
1
0
0
0
[Git][gajim/gajim][master] Assistant: Add default progress page
by Philipp Hörist
29 Nov '19
29 Nov '19
Philipp Hörist pushed to branch master at gajim / gajim Commits: c1682551 by Philipp Hörist at 2019-11-29T22:55:55Z Assistant: Add default progress page - - - - - 2 changed files: - gajim/gtk/assistant.py - test/gtk/assistant.py Changes: ===================================== gajim/gtk/assistant.py ===================================== @@ -100,6 +100,8 @@ class Assistant(Gtk.ApplicationWindow, EventHelper): page = SuccessPage() elif name == 'error': page = ErrorPage() + elif name == 'progress': + page = ProgressPage() else: raise ValueError('Unknown page: %s' % name) @@ -194,3 +196,32 @@ class SuccessPage(Page): Page.__init__(self, icon_name='object-select-symbolic', icon_css_class='success-color') + + +class ProgressPage(Gtk.Box): + def __init__(self): + super().__init__(orientation=Gtk.Orientation.VERTICAL) + self.set_spacing(18) + self.set_valign(Gtk.Align.CENTER) + + self.title = '' + + self._label = Gtk.Label() + self._label.set_max_width_chars(50) + self._label.set_line_wrap(True) + self._label.set_halign(Gtk.Align.CENTER) + self._label.set_justify(Gtk.Justification.CENTER) + + spinner = Gtk.Spinner() + spinner.start() + + self.pack_start(spinner, True, True, 0) + self.pack_start(self._label, False, True, 0) + + self.show_all() + + def set_text(self, text): + self._label.set_text(text) + + def set_title(self, title): + self.title = title ===================================== test/gtk/assistant.py ===================================== @@ -14,8 +14,11 @@ class TestAssistant(Assistant): def __init__(self): Assistant.__init__(self) - self.add_pages({'start': Start(), - 'progress': Progress()}) + self.add_pages({'start': Start()}) + + progress = self.add_default_page('progress') + progress.set_title('Executing...') + progress.set_text('Something is in progress...') error = self.add_default_page('error') error.set_title('Error') @@ -90,26 +93,6 @@ class TestAssistant(Assistant): self.set_default_button('back') -class Progress(Gtk.Box): - - title = 'Progress' - - def __init__(self): - super().__init__(orientation=Gtk.Orientation.VERTICAL) - self.set_spacing(18) - self.set_valign(Gtk.Align.CENTER) - label = Gtk.Label(label='Test label...') - label.set_max_width_chars(50) - label.set_line_wrap(True) - label.set_halign(Gtk.Align.CENTER) - label.set_justify(Gtk.Justification.CENTER) - spinner = Gtk.Spinner() - self.pack_start(label, False, True, 0) - self.pack_start(spinner, False, True, 0) - spinner.start() - self.show_all() - - class Start(Gtk.Box): title = 'Start' View it on GitLab:
https://dev.gajim.org/gajim/gajim/commit/c1682551038a380aeb68f8e26e82dfdb48…
-- View it on GitLab:
https://dev.gajim.org/gajim/gajim/commit/c1682551038a380aeb68f8e26e82dfdb48…
You're receiving this email because of your account on
dev.gajim.org
.
1
0
0
0
[Git][gajim/gajim][master] Assistant: return page on add_default_page()
by Philipp Hörist
29 Nov '19
29 Nov '19
Philipp Hörist pushed to branch master at gajim / gajim Commits: a350f3ed by Philipp Hörist at 2019-11-29T22:48:44Z Assistant: return page on add_default_page() - - - - - 2 changed files: - gajim/gtk/assistant.py - test/gtk/assistant.py Changes: ===================================== gajim/gtk/assistant.py ===================================== @@ -105,6 +105,7 @@ class Assistant(Gtk.ApplicationWindow, EventHelper): self._pages[name] = page self._ui.stack.add_named(page, name) + return page def get_current_page(self): return self._ui.stack.get_visible_child_name() ===================================== test/gtk/assistant.py ===================================== @@ -17,18 +17,15 @@ class TestAssistant(Assistant): self.add_pages({'start': Start(), 'progress': Progress()}) - self.add_default_page('error') - self.add_default_page('success') - - success_page = self.get_page('success') - success_page.set_title('Success') - success_page.set_heading('Success Heading') - success_page.set_text('This is the success text') - - error_page = self.get_page('error') - error_page.set_title('Error') - error_page.set_heading('Error Heading') - error_page.set_text('This is the error text') + error = self.add_default_page('error') + error.set_title('Error') + error.set_heading('Error Heading') + error.set_text('This is the error text') + + success = self.add_default_page('success') + success.set_title('Success') + success.set_heading('Success Heading') + success.set_text('This is the success text') self.add_button('forward', 'Forward', 'suggested-action') self.add_button('close', 'Close', 'destructive-action') View it on GitLab:
https://dev.gajim.org/gajim/gajim/commit/a350f3ed88a03817606e4d7218f1069146…
-- View it on GitLab:
https://dev.gajim.org/gajim/gajim/commit/a350f3ed88a03817606e4d7218f1069146…
You're receiving this email because of your account on
dev.gajim.org
.
1
0
0
0
[Git][gajim/gajim][master] Assistant: Add get_page()
by Philipp Hörist
29 Nov '19
29 Nov '19
Philipp Hörist pushed to branch master at gajim / gajim Commits: fe6842af by Philipp Hörist at 2019-11-29T22:29:01Z Assistant: Add get_page() Use get_page() instead of page specific methods - - - - - 2 changed files: - gajim/gtk/assistant.py - test/gtk/assistant.py Changes: ===================================== gajim/gtk/assistant.py ===================================== @@ -114,11 +114,8 @@ class Assistant(Gtk.ApplicationWindow, EventHelper): self._set_buttons_visible(buttons) self._ui.stack.set_visible_child_full(name, transition) - def get_error_page(self): - return self._pages['error'] - - def get_success_page(self): - return self._pages['success'] + def get_page(self, name): + return self._pages[name] def _set_buttons_visible(self, buttons): for button in self._buttons.values(): ===================================== test/gtk/assistant.py ===================================== @@ -20,6 +20,16 @@ class TestAssistant(Assistant): self.add_default_page('error') self.add_default_page('success') + success_page = self.get_page('success') + success_page.set_title('Success') + success_page.set_heading('Success Heading') + success_page.set_text('This is the success text') + + error_page = self.get_page('error') + error_page.set_title('Error') + error_page.set_heading('Error Heading') + error_page.set_text('This is the error text') + self.add_button('forward', 'Forward', 'suggested-action') self.add_button('close', 'Close', 'destructive-action') self.add_button('back', 'Back') @@ -77,17 +87,9 @@ class TestAssistant(Assistant): self.set_default_button('forward') elif page_name == 'success': - success_page = self.get_success_page() - success_page.set_title('Success') - success_page.set_heading('Success Heading') - success_page.set_text('This is the success text') self.set_default_button('forward') elif page_name == 'error': - error_page = self.get_error_page() - error_page.set_title('Error') - error_page.set_heading('Error Heading') - error_page.set_text('This is the error text') self.set_default_button('back') View it on GitLab:
https://dev.gajim.org/gajim/gajim/commit/fe6842af7a792415b208cd510a8a6a11b9…
-- View it on GitLab:
https://dev.gajim.org/gajim/gajim/commit/fe6842af7a792415b208cd510a8a6a11b9…
You're receiving this email because of your account on
dev.gajim.org
.
1
0
0
0
← Newer
1
...
388
389
390
391
392
393
394
...
1764
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
Results per page:
10
25
50
100
200