[gitg/gnome-3-20] Set primary selection to selected commit SHA1



commit f6e5e1153fd3db3f3e80b4f090034dcfc0ae4689
Author: Jesse van den Kieboom <jessevdk gnome org>
Date:   Sun Jun 5 12:05:52 2016 +0200

    Set primary selection to selected commit SHA1
    
    https://bugzilla.gnome.org/show_bug.cgi?id=763087

 gitg/history/gitg-history.vala |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/gitg/history/gitg-history.vala b/gitg/history/gitg-history.vala
index 31a0ab7..5fd0a36 100644
--- a/gitg/history/gitg-history.vala
+++ b/gitg/history/gitg-history.vala
@@ -526,6 +526,14 @@ namespace GitgHistory
 
                        d_main.commit_list_view.get_selection().changed.connect((sel) => {
                                selection_changed();
+
+                               // Set primary selection to sha1 of first selected commit
+                               var clip = ((Gtk.Widget)application).get_clipboard(Gdk.SELECTION_PRIMARY);
+
+                               foreach_selected((commit) => {
+                                       clip.set_text(commit.get_id().to_string(), -1);
+                                       return false;
+                               });
                        });
 
                        var engine = Gitg.PluginsEngine.get_default();


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]