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


Commits:
ed4c9823 by Philipp Hörist at 2022-10-27T19:58:47+02:00
fix: AccountPage: Disable profile button when not connected

Fixes #11249

- - - - -


3 changed files:

- gajim/data/gui/account_page.ui
- gajim/gtk/account_page.py
- gajim/gtk/builder.pyi


Changes:

=====================================
gajim/data/gui/account_page.ui
=====================================
@@ -154,14 +154,13 @@
                           </packing>
                         </child>
                         <child type="overlay">
-                          <object class="GtkButton">
+                          <object class="GtkButton" id='edit_profile_button'>
                             <property name="visible">True</property>
                             <property name="can-focus">True</property>
                             <property name="receives-default">True</property>
                             <property name="tooltip-text" 
translatable="yes">Edit Profile…</property>
                             <property name="halign">end</property>
                             <property name="valign">start</property>
-                            <signal name="clicked" handler="_on_edit_profile" 
swapped="no"/>
                             <child>
                               <object class="GtkImage">
                                 <property name="visible">True</property>


=====================================
gajim/gtk/account_page.py
=====================================
@@ -19,6 +19,7 @@
 
 from gi.repository import Gdk
 from gi.repository import Gio
+from gi.repository import GLib
 from gi.repository import Gtk
 
 from nbxmpp.protocol import JID
@@ -85,6 +86,11 @@ def __init__(self, account: str) -> None:
             roster_menu.append(label, f'win.{action}')
         self._ui.roster_menu_button.set_menu_model(roster_menu)
 
+        self._ui.edit_profile_button.set_action_name(
+            f'app.{self._account}-profile')
+        self._ui.edit_profile_button.set_action_target_value(
+            GLib.Variant('s', self._account))
+
         self._ui.connect_signals(self)
 
         app.settings.connect_signal(
@@ -117,9 +123,6 @@ def _on_account_label_changed(self, value: str, *args: Any) 
-> None:
     def _on_avatar_update(self, *args: Any) -> None:
         self.update()
 
-    def _on_edit_profile(self, _button: Gtk.Button) -> None:
-        open_window('ProfileWindow', account=self._account)
-
     def _on_account_settings(self, _button: Gtk.Button) -> None:
         window = open_window('AccountsWindow')
         window.select_account(self._account)


=====================================
gajim/gtk/builder.pyi
=====================================
@@ -16,6 +16,7 @@ class AccountPageBuilder(Builder):
     roster_search_entry: Gtk.SearchEntry
     account_box: Gtk.Box
     avatar_image: Gtk.Image
+    edit_profile_button: Gtk.Button
     account_label: Gtk.Label
     account_action_box: Gtk.Box
     adhoc_commands_button: Gtk.Button



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/ed4c9823085b209efbad9ebc4fd6895144efaab6

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/ed4c9823085b209efbad9ebc4fd6895144efaab6
You're receiving this email because of your account on dev.gajim.org.


_______________________________________________
Commits mailing list
[email protected]
https://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to