[latexila] Build View: text is selectable, so we can copy/paste it



commit 9bc5c119b4110e5801e835b345d7ca7a1661ce87
Author: SÃbastien Wilmet <swilmet src gnome org>
Date:   Thu Jun 23 19:12:48 2011 +0200

    Build View: text is selectable, so we can copy/paste it
    
    My first idea was to add a menu on right click, to copy the row contents
    in the clipboard. But it's easier to set the text editable. If the user
    edit the text, the changes are not taken into account. And it's better
    like this because for copy/paste a command, we can select the command
    without the dollar sign.

 TODO                |    3 ---
 src/build_view.vala |    9 +++++++--
 2 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/TODO b/TODO
index 0d337d6..5d82ad1 100644
--- a/TODO
+++ b/TODO
@@ -18,9 +18,6 @@ LaTeXila 2.2
 	  subsections, etc.) and we want to shift it to the left so it becomes a chapter (the
 	  subsections becomes sections, etc.).
 
-- Build Tools:
-	- right click menu in bottom panel: copy the line to the clipboard
-
 - Write some documentation:
 	- explain the build tools, how to create a new one, etc.
 	- the difference between Latexmk and Rubber
diff --git a/src/build_view.vala b/src/build_view.vala
index 82bc2a0..7dd2b6a 100644
--- a/src/build_view.vala
+++ b/src/build_view.vala
@@ -127,6 +127,8 @@ public class BuildView : HBox
 
         CellRendererText renderer_text = new CellRendererText ();
         renderer_text.weight_set = true;
+        renderer_text.editable = true;
+        renderer_text.editable_set = true;
         column_job.pack_start (renderer_text, true);
         column_job.add_attribute (renderer_text, "text", BuildInfo.MESSAGE);
         column_job.add_attribute (renderer_text, "weight", BuildInfo.WEIGHT);
@@ -213,11 +215,14 @@ public class BuildView : HBox
                     view.collapse_row (path);
                 else
                     view.expand_to_path (path);
+
+                // the row is not selected
+                return false;
             }
         }
 
-        // the row is not selected
-        return false;
+        // the row is selected, so we can copy/paste its content
+        return true;
     }
 
     private void jump_to_file (string filename, int start_line, int end_line)



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