Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prompt for screen reader shortcut after a timeout #711

Merged
merged 8 commits into from
Jul 21, 2023
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion data/installer.metainfo.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,15 @@
<update_contact>contact_at_elementary.io</update_contact>

<releases>
<release version="1.0.8" date="2023-07-20" urgency="medium">
<release version="1.1.0" date="2023-07-20" urgency="medium">
<description>
<p>Improvements:</p>
<ul>
<li>Updated translations</li>
</ul>
</description>
<issues>
<issue url="https://github.com/elementary/installer/issues/471">Automatically prompt for screen reader after a timeout</issue>
<issue url="https://github.com/elementary/installer/issues/590">Laptop goes to standby during installation process</issue>
<issue url="https://github.com/elementary/installer/issues/617">Installer not showing disk or partitions, can't install</issue>
</issues>
Expand Down
28 changes: 27 additions & 1 deletion src/MainWindow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class Installer.MainWindow : Hdy.Window {
private EncryptView encrypt_view;
private ErrorView error_view;
private bool check_ignored = false;

private uint orca_timeout_id = 0;

construct {
language_view = new LanguageView ();
Expand Down Expand Up @@ -78,6 +78,11 @@ public class Installer.MainWindow : Hdy.Window {
add (overlay);

language_view.next_step.connect (() => {
// Don't prompt for screen reader if we're able to navigate without it
if (orca_timeout_id != 0) {
Source.remove (orca_timeout_id);
zeebok marked this conversation as resolved.
Show resolved Hide resolved
}

// Reset when language selection changes
set_infobar_string ();
load_keyboard_view ();
Expand All @@ -102,6 +107,27 @@ public class Installer.MainWindow : Hdy.Window {
battery_infobar.response.connect (() => {
battery_infobar.revealed = false;
});

var mediakeys_settings = new Settings ("org.gnome.settings-daemon.plugins.media-keys");

orca_timeout_id = Timeout.add_seconds (3, () => {
danirabbit marked this conversation as resolved.
Show resolved Hide resolved
var shortcut_string = Granite.accel_to_string (
mediakeys_settings.get_strv ("screenreader")[0]
);

// Espeak can't read ⌘
shortcut_string = shortcut_string.replace ("⌘", "Super");

var orca_prompt = "Screen reader can be turned on with the keyboard shorcut %s".printf (shortcut_string);

try {
Process.spawn_command_line_async ("espeak '%s'".printf (orca_prompt));
} catch (SpawnError e) {
critical ("Couldn't read Orca prompt: %s", e.message);
}

return Source.REMOVE;
});
}

/*
Expand Down
Loading