[latexila] Build View: add the 'show details' button



commit 251873e9788bdaeaa043aabd5253a2ee30f9f5f4
Author: SÃbastien Wilmet <swilmet src gnome org>
Date:   Sat Jul 14 00:18:49 2012 +0200

    Build View: add the 'show details' button
    
    It will replace the setting about the latexmk post-processor. The show
    details button is more general, easier to use (when implemented ;) ),
    and will not require to re-run the build tool to see more details.

 src/build_view.vala  |    2 ++
 src/main_window.vala |   32 ++++++++++++++++++++++++++------
 src/ui/ui.xml        |    2 ++
 3 files changed, 30 insertions(+), 6 deletions(-)
---
diff --git a/src/build_view.vala b/src/build_view.vala
index fcb0dad..ebba41d 100644
--- a/src/build_view.vala
+++ b/src/build_view.vala
@@ -85,6 +85,8 @@ public class BuildView : TreeView
 
     public bool show_warnings { get; set; }
     public bool show_badboxes { get; set; }
+    public bool show_details { get; set; default = false; }
+    public bool has_details { get; set; default = false; }
 
     private unowned MainWindow _main_window;
     private TreeStore _store;
diff --git a/src/main_window.vala b/src/main_window.vala
index bb972ad..3d8440a 100644
--- a/src/main_window.vala
+++ b/src/main_window.vala
@@ -174,6 +174,8 @@ public class MainWindow : Window
             N_("Show or hide the side panel"), null },
         { "ViewBottomPanel", null, N_("_Bottom panel"), null,
             N_("Show or hide the bottom panel"), null },
+        { "BuildShowDetails", Stock.ZOOM_IN, N_("Show _Details"), null,
+            N_("Show Details"), null },
         { "BuildShowWarnings", Stock.DIALOG_WARNING, N_("Show _Warnings"), null,
             N_("Show Warnings"), null },
         { "BuildShowBadBoxes", "badbox", N_("Show _Bad Boxes"), null,
@@ -672,21 +674,39 @@ public class MainWindow : Window
 
     private void show_or_hide_build_messages ()
     {
+        GLib.Settings settings = new GLib.Settings ("org.gnome.latexila.preferences.ui");
+
+        /* Show details */
+
+        ToggleAction action_details =
+            action_group.get_action ("BuildShowDetails") as ToggleAction;
+
+        action_details.bind_property ("active", _build_view, "show-details",
+            BindingFlags.DEFAULT);
+
+        _build_view.bind_property ("has-details", action_details, "sensitive",
+            BindingFlags.SYNC_CREATE);
+
+        action_details.active = false;
+
+        /* Show warnings */
+
         ToggleAction action_warnings =
             action_group.get_action ("BuildShowWarnings") as ToggleAction;
 
-        ToggleAction action_badboxes =
-            action_group.get_action ("BuildShowBadBoxes") as ToggleAction;
-
         _build_view.bind_property ("show-warnings", action_warnings, "active",
             BindingFlags.BIDIRECTIONAL);
 
+        action_warnings.active = settings.get_boolean ("show-build-warnings");
+
+        /* Show badboxes */
+
+        ToggleAction action_badboxes =
+            action_group.get_action ("BuildShowBadBoxes") as ToggleAction;
+
         _build_view.bind_property ("show-badboxes", action_badboxes, "active",
             BindingFlags.BIDIRECTIONAL);
 
-        GLib.Settings settings = new GLib.Settings ("org.gnome.latexila.preferences.ui");
-
-        action_warnings.active = settings.get_boolean ("show-build-warnings");
         action_badboxes.active = settings.get_boolean ("show-build-badboxes");
     }
 
diff --git a/src/ui/ui.xml b/src/ui/ui.xml
index 090b0be..d988e15 100644
--- a/src/ui/ui.xml
+++ b/src/ui/ui.xml
@@ -79,6 +79,7 @@ along with LaTeXila.  If not, see <http://www.gnu.org/licenses/>.
       <menuitem action="BuildStopExecution" />
       <menuitem action="BuildViewLog" />
       <separator />
+      <menuitem action="BuildShowDetails" />
       <menuitem action="BuildShowWarnings" />
       <menuitem action="BuildShowBadBoxes" />
     </menu>
@@ -493,6 +494,7 @@ along with LaTeXila.  If not, see <http://www.gnu.org/licenses/>.
   <toolbar name="BuildToolbar">
     <toolitem action="BuildStopExecution" />
     <toolitem action="BuildViewLog" />
+    <toolitem action="BuildShowDetails" />
     <toolitem action="BuildShowWarnings" />
     <toolitem action="BuildShowBadBoxes" />
   </toolbar>



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