Prompt Enhancer: clean ON/OFF toggle with green/grey status labels
This commit is contained in:
@@ -3507,13 +3507,16 @@ class EditEndpointDialog(Gtk.Dialog):
|
||||
self._switch_enhancer = Gtk.Switch()
|
||||
self._switch_enhancer.set_active(self._data.get("prompt_enhancer", False))
|
||||
enhancer_box.pack_start(self._switch_enhancer, False, False, 0)
|
||||
enhancer_box.pack_start(Gtk.Label(label="Prompt Enhancer"), False, False, 0)
|
||||
self._enhancer_status_lbl = Gtk.Label()
|
||||
enhancer_box.pack_start(self._enhancer_status_lbl, False, False, 0)
|
||||
self._switch_enhancer.connect("notify::active", lambda *a: self._on_enhancer_toggled())
|
||||
self._combo_enhancer_mode = Gtk.ComboBoxText()
|
||||
for mode in ["offline", "ai-powered"]:
|
||||
self._combo_enhancer_mode.append(mode, mode.capitalize())
|
||||
self._combo_enhancer_mode.set_active_id(self._data.get("prompt_enhancer_mode", "offline"))
|
||||
enhancer_box.pack_start(self._combo_enhancer_mode, False, False, 6)
|
||||
add_row(8, "Enhance:", enhancer_box)
|
||||
add_row(8, "Prompt Enhancer:", enhancer_box)
|
||||
self._on_enhancer_toggled()
|
||||
|
||||
self._entry_enhancer_model = Gtk.Entry()
|
||||
self._entry_enhancer_model.set_placeholder_text("e.g. deepseek/deepseek-v4-flash (ai-powered mode only)")
|
||||
@@ -3671,6 +3674,13 @@ class EditEndpointDialog(Gtk.Dialog):
|
||||
else:
|
||||
self._lbl_reasoning.set_markup('<span foreground="#e67e22" weight="bold">OFF</span>')
|
||||
|
||||
def _on_enhancer_toggled(self, *_):
|
||||
active = self._switch_enhancer.get_active()
|
||||
if active:
|
||||
self._enhancer_status_lbl.set_markup('<span foreground="#27ae60" weight="bold">ON</span>')
|
||||
else:
|
||||
self._enhancer_status_lbl.set_markup('<span foreground="#888888" weight="bold">OFF</span>')
|
||||
|
||||
def _do_oauth_login(self):
|
||||
preset_name = self._combo_preset.get_active_text() or "Custom"
|
||||
preset = PROVIDER_PRESETS.get(preset_name, {})
|
||||
|
||||
Reference in New Issue
Block a user