[gnome-boxes] properties-window: Add copy_troubleshooting_log_to_clipboard()



commit 4a6e7a4653b27fe021bccdc4b3f5c243b9ac69c2
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Thu Dec 4 16:58:30 2014 +0000

    properties-window: Add copy_troubleshooting_log_to_clipboard()
    
    Add API to copy the contents of troubleshooting log to clipboard.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=741047

 src/properties-window.vala |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/properties-window.vala b/src/properties-window.vala
index 6c987da..a3b6c95 100644
--- a/src/properties-window.vala
+++ b/src/properties-window.vala
@@ -52,6 +52,13 @@ private class Boxes.PropertiesWindow: Gtk.Window, Boxes.UI {
         page = PropsWindowPage.TROUBLESHOOTING_LOG;
     }
 
+    public void copy_troubleshooting_log_to_clipboard () {
+        var log = troubleshoot_log.view.buffer.text;
+        var clipboard = Gtk.Clipboard.get_for_display (get_display (), Gdk.SELECTION_CLIPBOARD);
+
+        clipboard.set_text (log, -1);
+    }
+
     public void revert_state () {
         if ((app_window.current_item as Machine).state != Machine.MachineState.RUNNING &&
              app_window.previous_ui_state == UIState.DISPLAY)


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