[latexila/wip/latexila-next] Connect to the LatexilaBuildView::jump-to-file signal



commit b97f085a512b956dae50b6c281239e0a0e71cbce
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Wed Sep 17 20:17:25 2014 +0200

    Connect to the LatexilaBuildView::jump-to-file signal

 src/liblatexila/latexila-build-view.c |    2 +-
 src/main_window_build_tools.vala      |    8 ++++++++
 2 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/src/liblatexila/latexila-build-view.c b/src/liblatexila/latexila-build-view.c
index e196b47..ec6b7b7 100644
--- a/src/liblatexila/latexila-build-view.c
+++ b/src/liblatexila/latexila-build-view.c
@@ -368,7 +368,7 @@ latexila_build_view_class_init (LatexilaBuildViewClass *klass)
    * selected. The row must contain a file, otherwise the signal is not emitted.
    * The file should be opened and presented to the user. If @start_line and
    * @end_line are not -1, jump to the @start_line and select those lines. If
-   * only @start_line is provided, jump to it and select it.
+   * @start_line is provided, @end_line is also provided (different than -1).
    */
   signals[SIGNAL_JUMP_TO_FILE] = g_signal_new ("jump-to-file",
                                                LATEXILA_TYPE_BUILD_VIEW,
diff --git a/src/main_window_build_tools.vala b/src/main_window_build_tools.vala
index de272e2..ca13a6a 100644
--- a/src/main_window_build_tools.vala
+++ b/src/main_window_build_tools.vala
@@ -102,6 +102,14 @@ public class MainWindowBuildTools
     {
         _build_view = build_view;
         connect_toggle_actions ();
+
+        _build_view.jump_to_file.connect ((file, start_line, end_line) =>
+        {
+            if (start_line == -1)
+                _main_window.open_document (file);
+            else
+                _main_window.jump_to_file_position (file, start_line - 1, end_line -1);
+        });
     }
 
     public void set_bottom_panel (BottomPanel bottom_panel)


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