Philipp Hörist pushed to branch modal at gajim / gajim
Commits:
8a0472bf by Philipp Hörist at 2026-07-24T21:54:02+02:00
cfix: Simplify password warning
- - - - -
4374d253 by Philipp Hörist at 2026-07-24T21:54:30+02:00
cfix: Don't move content when warning is displayed
- - - - -
2 changed files:
- gajim/data/gui/openpgp/unlock.ui
- gajim/gtk/openpgp_secret.py
Changes:
=====================================
gajim/data/gui/openpgp/unlock.ui
=====================================
@@ -7,7 +7,8 @@
<property name="halign">center</property>
<property name="valign">center</property>
<property name="orientation">vertical</property>
- <property name="spacing">6</property>
+ <property name="spacing">12</property>
+ <property name="height-request">150</property>
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">Enter your account
password to unlock the secret key</property>
@@ -16,7 +17,6 @@
<property name="justify">center</property>
<style>
<class name="dimmed" />
- <class name="mb-18" />
</style>
</object>
</child>
=====================================
gajim/gtk/openpgp_secret.py
=====================================
@@ -69,6 +69,8 @@ def _on_assistant_button_clicked(
) -> None:
match button_name:
case "unlock":
+ if not self.get_page("unlock").check_unlock():
+ return
self.get_page("share").generate()
self.show_page("share")
@@ -90,46 +92,28 @@ class UnlockPage(AssistantPage):
def __init__(self, account: str) -> None:
AssistantPage.__init__(self)
self.title = _("Enter Password to Unlock")
- self.complete = False
-
- self._password_check_timeout_id = None
+ self.complete = True
self._cur_password = passwords.get_password(account)
self._connect(self._password_entry, "changed", self._on_changed)
def _on_changed(self, _password_entry: Gtk.PasswordEntry) -> None:
- if self._password_check_timeout_id is not None:
- GLib.source_remove(self._password_check_timeout_id)
- self._password_check_timeout_id = None
-
if self._cur_password is None:
self.set_warning(_("No account password found, unlocking not
possible"))
self.set_complete(False)
return
- if not self._password_entry.get_text():
- self.set_complete(False)
- self.set_warning(None)
- return
-
- self._password_check_timeout_id = GLib.timeout_add(
- 800, self.delayed_password_check
- )
-
- def delayed_password_check(self) -> None:
- assert self._password_check_timeout_id is not None
- GLib.source_remove(self._password_check_timeout_id)
- self._password_check_timeout_id = None
+ self.set_warning(None)
+ def check_unlock(self) -> bool:
cur_password = self._password_entry.get_text()
if cur_password != self._cur_password:
self.set_warning(_("Password incorrect"))
- self.set_complete(False)
- return
+ return False
self.set_warning(None)
- self.set_complete(True)
+ return True
def set_warning(self, text: str | None) -> None:
self._warning_label.set_text(text or "")
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/compare/be96223d22586a3826597fd3fa4c533ae6198ca5...4374d253f0c8b5324c23a6f60b6e948a46d77300
--
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/compare/be96223d22586a3826597fd3fa4c533ae6198ca5...4374d253f0c8b5324c23a6f60b6e948a46d77300
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]