Philipp Hörist pushed to branch openpgp at gajim / gajim
Commits:
4c3476b0 by Philipp Hörist at 2026-04-27T22:35:24+02:00
imprv wizard
- - - - -
2 changed files:
- gajim/data/gui/openpgp/welcome.ui
- gajim/gtk/openpgp_wizard.py
Changes:
=====================================
gajim/data/gui/openpgp/welcome.ui
=====================================
@@ -43,11 +43,6 @@
<property name="label" translatable="yes">Import
Key</property>
</object>
</child>
- <child>
- <object class="GtkButton" id="_restore_backup_button">
- <property name="label" translatable="yes">Restore
Backup</property>
- </object>
- </child>
</object>
</child>
<child>
=====================================
gajim/gtk/openpgp_wizard.py
=====================================
@@ -63,6 +63,7 @@ def __init__(self, account: str, *, backup_mode: bool =
False) -> None:
}
)
+ self.add_button("other-options", _("Other Options"))
self.add_button(
"import", _("Import Key"), complete=True,
css_class="suggested-action"
)
@@ -164,6 +165,9 @@ def _on_assistant_button_clicked(
callback=self._on_backup_result,
)
+ case "other-options":
+ self.show_page("welcome")
+
case "back":
self.show_page("welcome", Gtk.StackTransitionType.SLIDE_RIGHT)
@@ -179,12 +183,6 @@ def _on_welcome_page_button_clicked(
if button_name == "import":
self.show_page("import", Gtk.StackTransitionType.SLIDE_LEFT)
- elif button_name == "restore_backup":
- self.show_page("progress", Gtk.StackTransitionType.SLIDE_LEFT)
- self._client.get_module("OpenPGP").request_secret_key(
- callback=self._on_secret_key_received,
- )
-
elif button_name == "generate":
try:
self._client.get_module("OpenPGP").generate_key()
@@ -238,15 +236,11 @@ def _on_secret_key_received(self, task: Task) -> None:
encrypted_bytes = cast(bytes | None, task.finish())
except Exception as error:
log.error("Error on secret key request: %s", error)
- self._show_error_page(_("Error"), _("Error"), str(error))
+ self.show_page("welcome", Gtk.StackTransitionType.SLIDE_LEFT)
return
if not encrypted_bytes:
- self._show_error_page(
- _("No Backup Found"),
- _("No Backup Found"),
- _("Gajim can't find any backup of your OpenPGP key on the
server"),
- )
+ self.show_page("welcome", Gtk.StackTransitionType.SLIDE_LEFT)
return
self._encrypted_backup_bytes = encrypted_bytes
@@ -261,7 +255,6 @@ class WelcomePage(AssistantPage):
}
_import_button: Gtk.Button = Gtk.Template.Child()
- _restore_backup_button: Gtk.Button = Gtk.Template.Child()
_generate_button: Gtk.Button = Gtk.Template.Child()
def __init__(self) -> None:
@@ -269,12 +262,6 @@ def __init__(self) -> None:
self.title = _("Setup OpenPGP Encryption")
self._connect(self._import_button, "clicked", self._on_button_clicked,
"import")
- self._connect(
- self._restore_backup_button,
- "clicked",
- self._on_button_clicked,
- "restore_backup",
- )
self._connect(
self._generate_button, "clicked", self._on_button_clicked,
"generate"
)
@@ -330,7 +317,7 @@ def __init__(self) -> None:
self._connect(self._password_entry, "changed", self._on_entry_changed)
def get_visible_buttons(self) -> list[str]:
- return ["back", "restore"]
+ return ["other-options", "restore"]
def _on_entry_changed(self, entry: Gtk.PasswordEntry) -> None:
## TODO validate input against regex
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/commit/4c3476b0d9ac6f03b767b20935643f00cad1dd14
--
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/commit/4c3476b0d9ac6f03b767b20935643f00cad1dd14
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]