Skip to content

Commit ff42c90

Browse files
committed
refactor: collapse extra fields into expander for cleaner Connection tab
Move TOTP secret, tags, credential profile, KeePassXC button, and template checkbox into a Gtk.Expander 'Extra options' — collapsed by default. The Connection tab now shows only essential fields: - host, port, user, password (with eye/gen buttons), private key - SSH key management frame (for SSH/SFTP) - command preview Secondary fields are one click away in the expander, keeping the dialog clean for 90% of users while preserving all functionality for power users.
1 parent ca07e3d commit ff42c90

2 files changed

Lines changed: 24 additions & 14 deletions

File tree

gtk3/session_dialog.py

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -272,23 +272,43 @@ def _build_tab_connessione(self) -> Gtk.Widget:
272272
self._row_user_pwd.pack_start(pwd_box, True, True, 0)
273273
vbox.pack_start(self._row_user_pwd, False, False, 0)
274274

275+
# ── Opzioni extra (collassate di default) ──────────────────────
276+
self._expander_extra = Gtk.Expander(label=t("sd.extra.expander"))
277+
self._expander_extra.set_expanded(False)
278+
extra_vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=0)
279+
extra_vbox.set_margin_start(4); extra_vbox.set_margin_end(4)
280+
extra_vbox.set_margin_top(4)
281+
275282
self.entry_totp_secret = _entry(placeholder="JBSWY3DPEHPK3PXP (opzionale)")
276283
self.entry_totp_secret.set_tooltip_text(t("tt.totp_secret"))
277284
self._row_totp = self._conn_row(t("sd.totp_secret") + ":", self.entry_totp_secret)
278-
vbox.pack_start(self._row_totp, False, False, 0)
285+
extra_vbox.pack_start(self._row_totp, False, False, 0)
279286

280287
self.entry_tags = _entry(placeholder="es. prod,database,critico")
281288
self.entry_tags.set_tooltip_text(t("tt.tags"))
282289
self._row_tags = self._conn_row(t("sd.tags") + ":", self.entry_tags)
283-
vbox.pack_start(self._row_tags, False, False, 0)
290+
extra_vbox.pack_start(self._row_tags, False, False, 0)
284291

285292
self.combo_credential_profile = Gtk.ComboBoxText()
286293
self.combo_credential_profile.append("", t("sd.cred.from_session"))
287294
self.combo_credential_profile.append("ask", t("sd.cred.ask"))
288295
self._refresh_credential_profiles()
289296
self.combo_credential_profile.set_tooltip_text(t("tt.credential_profile"))
290297
self._row_credential_profile = self._conn_row(t("settings.cred.edit_title") + ":", self.combo_credential_profile)
291-
vbox.pack_start(self._row_credential_profile, False, False, 0)
298+
extra_vbox.pack_start(self._row_credential_profile, False, False, 0)
299+
300+
self._btn_keepass = Gtk.Button(label=t("sd.keepass.btn"))
301+
self._btn_keepass.set_tooltip_text(t("tt.keepass_btn"))
302+
self._btn_keepass.connect("clicked", lambda b: self._on_keepass_fetch())
303+
self._row_keepass = self._conn_row("", self._btn_keepass)
304+
extra_vbox.pack_start(self._row_keepass, False, False, 2)
305+
306+
self.chk_is_template = _check(t("sd.template.checkbox"))
307+
self.chk_is_template.set_tooltip_text(t("tt.template_checkbox"))
308+
extra_vbox.pack_start(self.chk_is_template, False, False, 4)
309+
310+
self._expander_extra.add(extra_vbox)
311+
vbox.pack_start(self._expander_extra, False, False, 0)
292312

293313
pkey_box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=4)
294314
self.entry_pkey = _entry()
@@ -415,17 +435,6 @@ def _build_tab_connessione(self) -> Gtk.Widget:
415435
self._row_exec_cmd = self._conn_row(t("sd.exec.cmd"), self.entry_exec_cmd)
416436
vbox.pack_start(self._row_exec_cmd, False, False, 0)
417437

418-
# Bottone KeePassXC (user + password)
419-
self._btn_keepass = Gtk.Button(label=t("sd.keepass.btn"))
420-
self._btn_keepass.set_tooltip_text(t("tt.keepass_btn"))
421-
self._btn_keepass.connect("clicked", lambda b: self._on_keepass_fetch())
422-
self._row_keepass = self._conn_row("", self._btn_keepass)
423-
vbox.pack_start(self._row_keepass, False, False, 0)
424-
425-
self.chk_is_template = _check(t("sd.template.checkbox"))
426-
self.chk_is_template.set_tooltip_text(t("tt.template_checkbox"))
427-
vbox.pack_start(self.chk_is_template, False, False, 8)
428-
429438
# ── Anteprima comando ───────────────────────────────────────────
430439
self._cmd_preview_frame = Gtk.Frame(label=t("sd.cmd_preview_title"))
431440
self._cmd_preview_frame.set_label_align(0.02, 0.5)

gtk3/translations.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -758,6 +758,7 @@ def init_from_settings() -> None:
758758
"sd.template.label": {"it": "Template:", "en": "Template:", "de": "Vorlage:", "fr": "Modèle :", "es": "Plantilla:"},
759759
"sd.template.none": {"it": "(nessun template)", "en": "(no template)", "de": "(keine Vorlage)", "fr": "(aucun modèle)", "es": "(sin plantilla)"},
760760
"sd.template.checkbox": {"it": "💠 Usa come template", "en": "💠 Use as template", "de": "💠 Als Vorlage verwenden", "fr": "💠 Utiliser comme modèle", "es": "💠 Usar como plantilla"},
761+
"sd.extra.expander": {"it": "⚙ Opzioni extra", "en": "⚙ Extra options", "de": "⚙ Zusätzliche Optionen", "fr": "⚙ Options supplémentaires", "es": "⚙ Opciones extra"},
761762
"sd.tab.tunnel": {"it": "Tunnel", "en": "Tunnel", "de": "Tunnel", "fr": "Tunnel", "es": "Túnel"},
762763
"sd.grp.ssh_open": {"it": "Apertura SSH:", "en": "SSH open mode:", "de": "SSH-Öffnung:", "fr": "Ouverture SSH :", "es": "Apertura SSH:"},
763764
"sd.grp.sftp_open":{"it": "Apertura SFTP:", "en": "SFTP open mode:","de": "SFTP-Öffnung:", "fr": "Ouverture SFTP :", "es": "Apertura SFTP:"},

0 commit comments

Comments
 (0)