Skip to content

Commit

Permalink
Added Alternate Past command
Browse files Browse the repository at this point in the history
Added Quit command
  • Loading branch information
Alberto Aldegheri committed Sep 17, 2011
1 parent 72efec3 commit 75c8993
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/ui/controller.vala
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,9 @@ namespace Synapse.Gui
reset_search (true, true);
view.set_list_visible (false);
break;
case KeyComboConfig.Commands.EXIT_SYNAPSE:
Gtk.main_quit ();
break;
case KeyComboConfig.Commands.PASTE:
var display = Gdk.Screen.get_default ().get_display ();
var clipboard = Gtk.Clipboard.get_for_display (display, Gdk.SELECTION_CLIPBOARD);
Expand Down
7 changes: 7 additions & 0 deletions src/ui/keybindings.vala
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ namespace Synapse.Gui
LAST_RESULT,
CLEAR_SEARCH_OR_HIDE,
PASTE,
EXIT_SYNAPSE,

TOTAL_COMMANDS
}
Expand All @@ -66,6 +67,8 @@ namespace Synapse.Gui
public string prev_search_type { get; set; default = "<Shift>ISO_Left_Tab"; }
public string cancel { get; set; default = "Escape"; }
public string paste { get; set; default = "<Control>v"; }
public string alt_paste { get; set; default = "<Shift>Insert"; }
public string exit { get; set; default = "<Control>q"; }

private class KeyComboStorage: GLib.Object
{
Expand Down Expand Up @@ -188,6 +191,10 @@ namespace Synapse.Gui
kcs.set_keycombo_command (keyval, mods, Commands.CLEAR_SEARCH_OR_HIDE);
name_to_key_mod (paste, out keyval, out mods);
kcs.set_keycombo_command (keyval, mods, Commands.PASTE);
name_to_key_mod (alt_paste, out keyval, out mods);
kcs.set_keycombo_command (keyval, mods, Commands.PASTE);
name_to_key_mod (exit, out keyval, out mods);
kcs.set_keycombo_command (keyval, mods, Commands.EXIT_SYNAPSE);
}


Expand Down
4 changes: 3 additions & 1 deletion src/ui/settings.vala
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,9 @@ namespace Synapse.Gui
{"prev-category", _("Previous Category")},
{"next-search-type", _("Next Pane")},
{"prev-search-type", _("Previous Pane")},
{"paste", _("Paste")}
{"paste", _("Paste")},
{"alt_paste", _("Alternate Paste")},
{"exit", _("Quit")}
};

private UI.Widgets.TileView tile_view;
Expand Down

0 comments on commit 75c8993

Please sign in to comment.