[latexila] Build View: fix row selection issues



commit 3cfc0e88d0dc6d043c72437b30572404753c63e0
Author: Sébastien Wilmet <swilmet src gnome org>
Date:   Fri Jun 10 23:32:29 2011 +0200

    Build View: fix row selection issues

 src/build_view.vala |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/src/build_view.vala b/src/build_view.vala
index 35d8f52..977aff0 100644
--- a/src/build_view.vala
+++ b/src/build_view.vala
@@ -143,7 +143,14 @@ public class BuildView : HBox
         // selection
         TreeSelection select = view.get_selection ();
         select.set_mode (SelectionMode.SINGLE);
-        select.set_select_function ((select, model, path) => select_row (model, path));
+        select.set_select_function ((select, model, path, path_currently_selected) =>
+        {
+            // always allow deselect
+            if (path_currently_selected)
+                return true;
+
+            return select_row (model, path);
+        });
 
         // double-click
         view.row_activated.connect ((path) => select_row (filtered_model, path));
@@ -217,6 +224,11 @@ public class BuildView : HBox
     {
         File file = File.new_for_path (filename);
         DocumentTab tab = main_window.open_document (file);
+
+        // If the file was not yet opened, it takes some time. If we try to select the
+        // lines when the file is not fully charged, the lines are simply not selected.
+        Utils.flush_queue ();
+
         if (start_line != -1)
         {
             // start_line and end_line begins at 1 (from rubber),



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