mirror of
https://gitlab.gnome.org/GNOME/gitg
synced 2024-10-01 05:33:49 +00:00
Add Support For Multiple Selections in The Commit List View
We can now easily select multiple commits in the commit list view, considering that we only can select at maximum 2 commits at a time. Signed-off-by: MahmoudKhalil <mahmoudkhalil11@gmail.com>
This commit is contained in:
parent
9a7323e736
commit
dfd3f3b61e
|
@ -582,9 +582,18 @@ namespace GitgHistory
|
|||
|
||||
d_main.commit_list_view.model = d_commit_list_model;
|
||||
|
||||
d_main.commit_list_view.get_selection().set_mode(Gtk.SelectionMode.MULTIPLE);
|
||||
d_main.commit_list_view.get_selection().changed.connect((sel) => {
|
||||
selection_changed();
|
||||
|
||||
Gtk.TreePath commit_cursor_path;
|
||||
d_main.commit_list_view.get_cursor(out commit_cursor_path, null);
|
||||
var selected_commits_count = sel.count_selected_rows();
|
||||
if(selected_commits_count > 2)
|
||||
{
|
||||
sel.unselect_all();
|
||||
sel.select_path(commit_cursor_path);
|
||||
}
|
||||
// Set primary selection to sha1 of first selected commit
|
||||
var clip = ((Gtk.Widget)application).get_clipboard(Gdk.SELECTION_PRIMARY);
|
||||
|
||||
|
|
Loading…
Reference in a new issue