Skip to content

Commit db17e8e

Browse files
committed
šŸ› fix: fix: verificação md5 em background e atalho ORCA no prĆ©-Calamares
- Adiciona modo --no-gui ao biglinux-verify-md5sum para verificação silenciosa de integridade (sem abrir janela GTK) - Altera services.py para chamar biglinux-verify-md5sum --no-gui, evitando que a janela "Checking system integrity" apareça durante a seleção de idioma no wizard - Adiciona EventControllerKey na janela do pré-Calamares para capturar Super+Alt+S e iniciar o ORCA (mesmo mecanismo do wizard, que funciona corretamente em ambientes com compositor completo como GNOME Shell) - Adiciona descrição acessível na janela do pré-Calamares informando o atalho Super+Alt+S para ativar o leitor de tela - Remove código residual de preferences no handler on_start_orca_action
1 parent c38cd26 commit db17e8e

4 files changed

Lines changed: 67 additions & 9 deletions

File tree

ā€Žbiglinux-livecd/usr/bin/biglinux-verify-md5sumā€Ž

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,44 @@ class VerifyApp(Adw.Application):
367367
)
368368

369369

370+
def verify_headless() -> int:
371+
"""Run verification without GUI. Returns 0 on success, 1 on failure."""
372+
try:
373+
os.remove(FAIL_FLAG)
374+
except FileNotFoundError:
375+
pass
376+
377+
mount_dir = detect_iso_mount()
378+
if not mount_dir:
379+
return 1
380+
381+
original_dir = os.getcwd()
382+
try:
383+
os.chdir(mount_dir)
384+
except OSError:
385+
return 1
386+
387+
for md5_file, sfs_name, _pct in SQUASHFS_FILES:
388+
if not os.path.exists(md5_file):
389+
continue
390+
if not verify_md5_file(md5_file):
391+
os.chdir(original_dir)
392+
try:
393+
with open(FAIL_FLAG, "w") as f:
394+
f.write("1")
395+
except OSError:
396+
pass
397+
return 1
398+
399+
os.chdir(original_dir)
400+
try:
401+
with open(VERIFIED_FLAG, "w") as f:
402+
f.write("1")
403+
except OSError:
404+
pass
405+
return 0
406+
407+
370408
def main():
371409
signal.signal(signal.SIGINT, lambda *_: sys.exit(1))
372410

@@ -388,6 +426,10 @@ def main():
388426
if os.path.exists(VERIFIED_FLAG):
389427
sys.exit(0)
390428

429+
# Headless mode: run verification without GUI
430+
if "--no-gui" in sys.argv:
431+
sys.exit(verify_headless())
432+
391433
Adw.init()
392434
app = VerifyApp()
393435
sys.exit(app.run([]))

ā€Žbiglinux-livecd/usr/share/biglinux/calamares/src/app.pyā€Ž

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,6 @@ def on_start_orca_action(self, action, param):
142142
"""Start ORCA screen reader via Super+Alt+S."""
143143
self.logger.info("Starting ORCA screen reader")
144144
start_orca()
145-
self.logger.info("Preferences action triggered")
146-
147-
# Create a simple toast notification for now
148-
if self.window:
149-
toast = Adw.Toast(title=_("Preferences not implemented yet"), timeout=3)
150-
self.window.show_toast(toast)
151145

152146
def show_error_dialog(self, title, message, details=None):
153147
"""Show error dialog to user"""

ā€Žbiglinux-livecd/usr/share/biglinux/calamares/src/window.pyā€Ž

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
gi.require_version('Gtk', '4.0')
1313
gi.require_version('Adw', '1')
1414

15-
from gi.repository import Gtk, Adw
15+
from gi.repository import Gtk, Adw, Gdk
1616
from .utils.i18n import _
1717
from .utils.constants import DEFAULTS
18-
from .utils.accessibility import announce, set_label, set_description
18+
from .utils.accessibility import announce, set_label, set_description, start_orca
1919
from .pages import MainPage, MaintenancePage, MinimalPage, TipsPage
2020

2121

@@ -55,8 +55,24 @@ def __init__(self, **kwargs):
5555
self.create_pages()
5656
self.setup_navigation()
5757

58+
# KeyboardEventController for Super+Alt+S to start ORCA
59+
key_controller = Gtk.EventControllerKey.new()
60+
key_controller.connect("key-pressed", self._on_key_press_event)
61+
self.add_controller(key_controller)
62+
5863
self.logger.info("Main window initialized")
5964

65+
def _on_key_press_event(self, controller, keyval, keycode, state):
66+
"""Handle global key events — Super+Alt+S starts ORCA screen reader."""
67+
if (
68+
keyval == Gdk.KEY_s
69+
and state & Gdk.ModifierType.SUPER_MASK
70+
and state & Gdk.ModifierType.ALT_MASK
71+
):
72+
start_orca()
73+
return True
74+
return False
75+
6076
def setup_window(self):
6177
"""Configure window properties."""
6278
title = _("{distro} Installation").format(distro=self.distro_name)
@@ -70,6 +86,10 @@ def setup_window(self):
7086

7187
# Accessible label for the window
7288
set_label(self, title)
89+
set_description(
90+
self,
91+
title + " — " + _("press Super+Alt+S to start the screen reader"),
92+
)
7393

7494
def create_layout(self):
7595
"""Create the main window layout using Adw.ToolbarView."""

ā€Žbiglinux-livecd/usr/share/biglinux/livecd/services.pyā€Ž

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,9 @@ def apply_language_settings(self, lang_code: str, timezone: str):
133133
self._run_command(
134134
["localectl", "set-locale", f"LANG={lang_code}.UTF-8"], as_root=True
135135
)
136-
self._run_command(["/usr/bin/biglinux-verify-md5sum"], as_root=False)
136+
self._run_command(
137+
["/usr/bin/biglinux-verify-md5sum", "--no-gui"], as_root=False
138+
)
137139

138140
def apply_keyboard_layout(self, layout: str):
139141
"""Applies the selected keyboard layout."""

0 commit comments

Comments
Ā (0)