Philipp Hörist pushed to branch master at gajim / gajim

Commits:
4d8379f4 by Marc Schink at 2017-04-19T18:17:22+02:00
Disable button if password changing is not supported

- - - - -
14091642 by Philipp Hörist at 2017-04-19T18:54:20+02:00
Merge branch 'change_password_fix' into 'master'

Disable button if password changing is not supported

See merge request !85
- - - - -


2 changed files:

- src/common/connection.py
- src/config.py


Changes:

=====================================
src/common/connection.py
=====================================
--- a/src/common/connection.py
+++ b/src/common/connection.py
@@ -779,6 +779,7 @@ class Connection(CommonConnection, ConnectionHandlers):
         self.music_track_info = 0
         self.location_info = {}
         self.pubsub_supported = False
+        self.register_supported = False
         self.pubsub_publish_options_supported = False
         # Do we auto accept insecure connection
         self.connection_auto_accepted = False
@@ -2001,6 +2002,8 @@ class Connection(CommonConnection, ConnectionHandlers):
                 if nbxmpp.NS_VCARD in obj.features:
                     self.vcard_supported = True
                     get_action(self.name + '-profile').set_enabled(True)
+                if nbxmpp.NS_REGISTER in obj.features:
+                    self.register_supported = True
                 if nbxmpp.NS_PUBSUB in obj.features:
                     self.pubsub_supported = True
                     if nbxmpp.NS_PUBSUB_PUBLISH_OPTIONS in obj.features:


=====================================
src/config.py
=====================================
--- a/src/config.py
+++ b/src/config.py
@@ -1541,6 +1541,7 @@ class AccountsWindow:
         self.accounts_treeview = self.xml.get_object('accounts_treeview')
         self.remove_button = self.xml.get_object('remove_button')
         self.rename_button = self.xml.get_object('rename_button')
+        self.change_password_button = 
self.xml.get_object('change_password_button1')
         path_to_kbd_input_img = gtkgui_helpers.get_icon_path('gajim-kbd_input')
         img = self.xml.get_object('rename_image')
         img.set_from_file(path_to_kbd_input_img)
@@ -1604,6 +1605,7 @@ class AccountsWindow:
         """
         self.remove_button.set_sensitive(False)
         self.rename_button.set_sensitive(False)
+        self.change_password_button.set_sensitive(False)
         self.current_account = None
         model = self.accounts_treeview.get_model()
         model.clear()
@@ -1713,9 +1715,15 @@ class AccountsWindow:
         if account:
             self.remove_button.set_sensitive(True)
             self.rename_button.set_sensitive(True)
+
+            if account != gajim.ZEROCONF_ACC_NAME:
+                self.change_password_button.set_sensitive(
+                    gajim.connections[account].register_supported)
+
         else:
             self.remove_button.set_sensitive(False)
             self.rename_button.set_sensitive(False)
+            self.change_password_button.set_sensitive(False)
         if iter_:
             self.current_account = account
             if account == gajim.ZEROCONF_ACC_NAME:



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/compare/c5aa507ec05f178772944b1a9185cff74cf695a7...14091642c4b5dd33ca280504366b4caacbe52dc9
_______________________________________________
Commits mailing list
Commits@gajim.org
https://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to