[latexila] Get rid of TabInfoBar, use the new API of GtefInfoBar



commit dab2fa6b5d8981bd102e1c0909d610608a5ca587
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Thu Nov 17 21:31:10 2016 +0100

    Get rid of TabInfoBar, use the new API of GtefInfoBar
    
    The latest version of Gtef is required (currently git master).

 configure.ac          |    2 +-
 po/POTFILES.in        |    1 -
 po/POTFILES.skip      |    1 -
 src/Makefile.am       |    1 -
 src/document.vala     |    8 ++--
 src/document_tab.vala |    9 ++++--
 src/tab_info_bar.vala |   80 -------------------------------------------------
 7 files changed, 11 insertions(+), 91 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 7f115f9..f75440f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -28,7 +28,7 @@ LT_INIT
 GLIB_REQUIRED_VERSION="2.50"
 GTK_REQUIRED_VERSION="3.20"
 GTKSOURCEVIEW_REQUIRED_VERSION="3.23.1"
-GTEF_REQUIRED_VERSION="0.1.1"
+GTEF_REQUIRED_VERSION="1.1.1"
 GSPELL_REQUIRED_VERSION="1.0"
 VALA_REQUIRED_VERSION="0.34"
 GEE_REQUIRED_VERSION="0.10"
diff --git a/po/POTFILES.in b/po/POTFILES.in
index ae6bee5..176ec7b 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -62,7 +62,6 @@ src/structure_model.vala
 src/structure.vala
 src/symbols.vala
 src/symbols_view.vala
-src/tab_info_bar.vala
 [type: gettext/glade]src/ui/menus.ui
 [type: gettext/glade]src/ui/preferences_dialog.ui
 src/utils.vala
diff --git a/po/POTFILES.skip b/po/POTFILES.skip
index 7c495a2..b1f56b6 100644
--- a/po/POTFILES.skip
+++ b/po/POTFILES.skip
@@ -43,7 +43,6 @@ src/structure_model.c
 src/symbols.c
 src/symbols_view.c
 src/synctex.c
-src/tab_info_bar.c
 src/templates.c
 src/templates_dialogs.c
 src/utils.c
diff --git a/src/Makefile.am b/src/Makefile.am
index a424ba2..4103784 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -60,7 +60,6 @@ vala_files =                          \
        structure.vala                  \
        symbols.vala                    \
        symbols_view.vala               \
-       tab_info_bar.vala               \
        utils.vala
 
 latexila_SOURCES =                             \
diff --git a/src/document.vala b/src/document.vala
index beb8122..967ac8f 100644
--- a/src/document.vala
+++ b/src/document.vala
@@ -189,7 +189,7 @@ public class Document : Gtef.Buffer
                     .printf (location.get_parse_name ());
                 string secondary_msg =
                     _("If you save it, all the external changes could be lost. Save it anyway?");
-                TabInfoBar infobar = tab.add_message (primary_msg, secondary_msg,
+                Gtef.InfoBar infobar = tab.add_message (primary_msg, secondary_msg,
                     MessageType.WARNING);
                 infobar.add_button (_("_Save Anyway"), ResponseType.YES);
                 infobar.add_button (_("_Don't Save"), ResponseType.CANCEL);
@@ -205,9 +205,9 @@ public class Document : Gtef.Buffer
                 warning ("%s", e.message);
 
                 string primary_msg = _("Impossible to save the file.");
-                TabInfoBar infobar = tab.add_message (primary_msg, e.message,
+                Gtef.InfoBar infobar = tab.add_message (primary_msg, e.message,
                     MessageType.ERROR);
-                infobar.add_ok_button ();
+                infobar.add_close_button ();
             }
         }
     }
@@ -553,7 +553,7 @@ public class Document : Gtef.Buffer
 
         /* Warn the user that the file can be lost */
 
-        TabInfoBar infobar = tab.add_message (
+        Gtef.InfoBar infobar = tab.add_message (
             _("The file has a temporary location. The data can be lost after rebooting your computer."),
             _("Do you want to save the file in a safer place?"),
             MessageType.WARNING);
diff --git a/src/document_tab.vala b/src/document_tab.vala
index 40dd0da..180cd3f 100644
--- a/src/document_tab.vala
+++ b/src/document_tab.vala
@@ -202,11 +202,14 @@ public class DocumentTab : Grid
         });
     }
 
-    public TabInfoBar add_message (string primary_msg, string secondary_msg,
+    public Gtef.InfoBar add_message (string primary_msg, string secondary_msg,
         MessageType msg_type)
     {
-        TabInfoBar infobar = new TabInfoBar (primary_msg, secondary_msg, msg_type);
+        Gtef.InfoBar infobar = new Gtef.InfoBar.simple (msg_type, primary_msg,
+            secondary_msg);
         attach_next_to (infobar, get_child_at (0, 0), PositionType.TOP, 1, 1);
+        infobar.show ();
+
         return infobar;
     }
 
@@ -285,7 +288,7 @@ public class DocumentTab : Grid
             else
                 secondary_msg = _("Do you want to reload the file?");
 
-            TabInfoBar infobar = add_message (primary_msg, secondary_msg,
+            Gtef.InfoBar infobar = add_message (primary_msg, secondary_msg,
                 MessageType.WARNING);
             infobar.add_button (_("_Reload"), ResponseType.OK);
             infobar.add_button (_("_Cancel"), ResponseType.CANCEL);


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