Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
5 changes: 5 additions & 0 deletions data/resources/ui/main-window-shortcuts.ui
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
<property name="accelerator">&lt;Primary&gt;u</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut" id="shortcut_update_apps">
<property name="accelerator">&lt;Primary&gt;&lt;Shift&gt;u</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut" id="shortcut_main_menu">
<property name="accelerator">F10</property>
Expand Down
2 changes: 2 additions & 0 deletions src/application.vala
Original file line number Diff line number Diff line change
Expand Up @@ -253,13 +253,15 @@ Examples:
string[] close_accels = { "<Primary>w" };
string[] search_accels = { "<Primary>f" };
string[] check_updates_accels = { "<Primary>u" };
string[] update_apps_accels = { "<Primary><Shift>u" };
string[] menu_accels = { "F10" };
string[] fullscreen_accels = { "F11" };
this.set_accels_for_action("app.show_shortcuts", shortcut_accels);
this.set_accels_for_action("app.show_preferences", preferences_accels);
this.set_accels_for_action("app.close_window", close_accels);
this.set_accels_for_action("win.toggle_search", search_accels);
this.set_accels_for_action("win.check_updates", check_updates_accels);
this.set_accels_for_action("win.update_apps", update_apps_accels);
this.set_accels_for_action("win.show_menu", menu_accels);
this.set_accels_for_action("win.toggle_fullscreen", fullscreen_accels);
}
Expand Down
11 changes: 11 additions & 0 deletions src/windows/main_window.vala
Original file line number Diff line number Diff line change
Expand Up @@ -1233,6 +1233,10 @@ namespace AppManager {
check_updates_action.activate.connect(on_check_updates_accel);
add_window_action(check_updates_action);

var update_apps_action = new GLib.SimpleAction("update_apps", null);
update_apps_action.activate.connect(on_update_apps_accel);
add_window_action(update_apps_action);

var show_menu_action = new GLib.SimpleAction("show_menu", null);
show_menu_action.activate.connect(() => {
if (main_menu_button != null) {
Expand Down Expand Up @@ -1343,6 +1347,12 @@ namespace AppManager {
start_update_check();
}

private void on_update_apps_accel() {
if (update_state == UpdateWorkflowState.READY_TO_UPDATE) {
start_update_install();
}
}

private void toggle_search_mode() {
if (search_bar == null) {
return;
Expand Down Expand Up @@ -1889,6 +1899,7 @@ namespace AppManager {
window_group.title = _("Window");
}
assign_shortcut_title(builder, "shortcut_check_updates", _("Check for updates"));
assign_shortcut_title(builder, "shortcut_update_apps", _("Update apps"));
assign_shortcut_title(builder, "shortcut_main_menu", _("Show main menu"));
assign_shortcut_title(builder, "shortcut_search", _("Search"));
assign_shortcut_title(builder, "shortcut_show_overlay", _("Show shortcuts"));
Expand Down