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


Commits:
e99813fd by Philipp Hörist at 2026-01-27T23:51:48+01:00
fix: Preferences: Disable password change row when account is disconnected

- - - - -
751921fe by Philipp Hörist at 2026-01-28T00:12:57+01:00
imprv: ChangePassword: Use Gtk.PasswordEntry

- - - - -


2 changed files:

- gajim/gtk/change_password.py
- gajim/gtk/preference/account.py


Changes:

=====================================
gajim/gtk/change_password.py
=====================================
@@ -145,40 +145,41 @@ def __init__(self) -> None:
             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 = Gtk.PasswordEntry(
+            show_peek_icon=True,
+            placeholder_text=_("Enter new password..."),
+            valign=Gtk.Align.END,
+        )
         self._connect(self._password1_entry, "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 = Gtk.PasswordEntry(
+            activates_default=True,
+            show_peek_icon=True,
+            placeholder_text=_("Confirm new password..."),
+            valign=Gtk.Align.START,
+        )
         self._connect(self._password2_entry, "changed", self._on_changed)
 
+        box = Gtk.Box(spacing=12, halign=Gtk.Align.CENTER)
+        self._warning_label = Gtk.Label(max_width_chars=50)
+        self._icon = Gtk.Image(icon_name="lucide-circle-alert-symbolic", 
visible=False)
+        box.append(self._icon)
+        box.append(self._warning_label)
+
         self.append(heading)
         self.append(label)
         self.append(self._password1_entry)
         self.append(self._password2_entry)
+        self.append(box)
         self._hide_warning()
 
     def _hide_warning(self) -> None:
-        self._password1_entry.set_icon_from_icon_name(
-            Gtk.EntryIconPosition.SECONDARY, None
-        )
+        self._icon.set_visible(False)
+        self._warning_label.set_text("")
 
     def _show_warning(self, text: str) -> None:
-        self._password1_entry.set_icon_from_icon_name(
-            Gtk.EntryIconPosition.SECONDARY, "lucide-circle-alert-symbolic"
-        )
-        self._password1_entry.set_icon_tooltip_text(
-            Gtk.EntryIconPosition.SECONDARY, text
-        )
+        self._icon.set_visible(True)
+        self._warning_label.set_text(text)
 
     def _on_changed(self, _entry: Gtk.Entry) -> None:
         password1 = self._password1_entry.get_text()


=====================================
gajim/gtk/preference/account.py
=====================================
@@ -712,6 +712,7 @@ def __init__(self, account: str) -> None:
                 SettingKind.DIALOG,
                 _("Change Password"),
                 SettingType.DIALOG,
+                enabled_func=(lambda: app.account_is_connected(account)),
                 props={"dialog": "ChangePassword"},
             ),
             Setting(



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/compare/43b5bad06dd9a999949f87910b427b41828c71f4...751921fe11c8437ed749457d2b5959f1c1152910

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/compare/43b5bad06dd9a999949f87910b427b41828c71f4...751921fe11c8437ed749457d2b5959f1c1152910
You're receiving this email because of your account on dev.gajim.org.


_______________________________________________
Commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to