Philipp Hörist pushed to branch master at gajim / gajim
Commits: 3e0557da by Philipp Hörist at 2018-05-20T20:15:08+02:00 Dont build menu for Local account
- - - - -
3 changed files:
- gajim/application.py - gajim/common/contacts.py - gajim/gui_menu_builder.py
Changes:
===================================== gajim/application.py ===================================== --- a/gajim/application.py +++ b/gajim/application.py @@ -358,6 +358,8 @@ class GajimApplication(Gtk.Application): accounts_list = sorted(app.config.get_per('accounts')) if not accounts_list: return + if 'Local' in accounts_list: + accounts_list.remove('Local') if len(accounts_list) > 1: for acc in accounts_list: self.add_account_actions(acc) @@ -365,6 +367,8 @@ class GajimApplication(Gtk.Application): self.add_account_actions(accounts_list[0])
def add_account_actions(self, account): + if account == 'Local': + return for action in self.account_actions: action_name, func, state, type_ = action action_name = account + action_name @@ -384,6 +388,8 @@ class GajimApplication(Gtk.Application): self.remove_action(action_name)
def set_account_actions_state(self, account, new_state=False): + if account == 'Local': + return for action in self.account_actions: action_name, _, state, _ = action if not new_state and state in ('online', 'feature'):
===================================== gajim/common/contacts.py ===================================== --- a/gajim/common/contacts.py +++ b/gajim/common/contacts.py @@ -237,8 +237,12 @@ class LegacyContactsAPI: GC_Contacts()) self._metacontact_manager.add_account(account_name)
- def get_accounts(self): - return list(self._accounts.keys()) + def get_accounts(self, zeroconf=True): + accounts = list(self._accounts.keys()) + if not zeroconf: + if 'Local' in accounts: + accounts.remove('Local') + return accounts
def remove_account(self, account): del self._accounts[account]
===================================== gajim/gui_menu_builder.py ===================================== --- a/gajim/gui_menu_builder.py +++ b/gajim/gui_menu_builder.py @@ -781,7 +781,7 @@ def build_accounts_menu():
acc_menu = menubar.get_item_link(menu_position, 'submenu') acc_menu.remove_all() - accounts_list = sorted(app.contacts.get_accounts()) + accounts_list = sorted(app.contacts.get_accounts(zeroconf=False)) if not accounts_list: no_accounts = _('No Accounts available') acc_menu.append_item(Gio.MenuItem.new(no_accounts, None))
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/3e0557dae69e2e435229d6f81a6aaa304f4...
--- View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/3e0557dae69e2e435229d6f81a6aaa304f4... You're receiving this email because of your account on dev.gajim.org.