[latexila] Open the documentation from the program



commit ee584b86a9c955806e15fd5640f4f58da9ca8531
Author: SÃbastien Wilmet <swilmet src gnome org>
Date:   Sat Jul 9 17:41:09 2011 +0200

    Open the documentation from the program
    
    This is not done with gnome-doc-utils, so it is a bit ugly, and
    translations are not supported.
    
    It is shame but autotools will be required here :(

 CMakeLists.txt        |    3 +++
 TODO                  |   19 ++++++++-----------
 help/C/CMakeLists.txt |    2 ++
 src/config.h.in       |    1 +
 src/main_window.vala  |   18 ++++++++++++++++--
 src/ui/ui.xml         |    1 +
 vapi/config.vapi      |    1 +
 7 files changed, 32 insertions(+), 13 deletions(-)
---
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 96245ea..25e1d2b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -49,6 +49,8 @@ else ()
 	set (DESKTOP_SCHEMAS "0")
 endif ()
 
+set (HELP_DIR ${DATA_DIR}/help/C)
+
 configure_file (${latexila_SOURCE_DIR}/src/config.h.in
 	${latexila_BINARY_DIR}/src/config.h)
 add_definitions (-include config.h)
@@ -82,3 +84,4 @@ else ()
 endif ()
 add_subdirectory (src/ui)
 add_subdirectory (data)
+add_subdirectory (help/C)
diff --git a/TODO b/TODO
index b1f5fc7..3bf19c6 100644
--- a/TODO
+++ b/TODO
@@ -6,27 +6,24 @@ See also the Roadmap:
 LaTeXila 2.2
 ============
 
-- Structure (list of chapters, sections, etc. to easily navigate in a document):
-	- When setting a model, expand all only if the tree is not too big
-
-	- Insert in middle is very slow comparated to insert at the end
-	  => Insert environments as soon as we find the \begin, and then update the item (or delete it)
-
-- Write some documentation:
-	- open the Mallard doc from the program
-	- manage translations
+- Documentation:
+	- use gnome-doc-utils (autotools are required, so bye bye CMake :( )
 
 - Build Tools:
 	- BibTeX: problem writing .blg file
 	- MakeIndex: problem writing .ind file
 	- Some problems with the latex and latexmk post processors
 
+- Structure:
+	- When setting a model, expand all only if the tree is not too big
+
+	- Insert in middle is very slow comparated to insert at the end
+	  => Insert environments as soon as we find the \begin, and then update the item (or delete it)
+
 
 LaTeXila â 2.4
 ==============
 
-- Check spelling
-
 - Auto-completion:
 	- show details by default
 	- complete placeholders (\ref, \cite, ...)
diff --git a/help/C/CMakeLists.txt b/help/C/CMakeLists.txt
new file mode 100644
index 0000000..a3fa9bf
--- /dev/null
+++ b/help/C/CMakeLists.txt
@@ -0,0 +1,2 @@
+file (GLOB pages *.page)
+install (FILES ${pages} DESTINATION ${DATA_DIR}/help/C)
diff --git a/src/config.h.in b/src/config.h.in
index 36b8fed..64ba216 100644
--- a/src/config.h.in
+++ b/src/config.h.in
@@ -28,5 +28,6 @@
 #define SCHEMA_DIR		"@SCHEMA_DIR@"
 #define ICONS_DIR		"@ICONS_DIR@"
 #define DESKTOP_SCHEMAS		@DESKTOP_SCHEMAS@
+#define HELP_DIR		"@HELP_DIR@"
 
 #endif /* LATEXILA_CONFIG_H */
diff --git a/src/main_window.vala b/src/main_window.vala
index 7f4270a..c365437 100644
--- a/src/main_window.vala
+++ b/src/main_window.vala
@@ -153,7 +153,9 @@ public class MainWindow : Window
 
         // Help
         { "Help", null, N_("_Help") },
-        { "HelpLatexReference", Stock.HELP, N_("_LaTeX Reference"), "<Release>F1",
+        { "HelpContents", Stock.HELP, N_("_Contents"), "<Release>F1",
+            N_("Open the LaTeXila documentation"), on_help_contents },
+        { "HelpLatexReference", null, N_("_LaTeX Reference"), null,
             N_("The Kile LaTeX Reference"), on_help_latex_reference },
         { "HelpAbout", Stock.ABOUT, null, null,
             N_("About LaTeXila"), on_about_dialog }
@@ -1838,13 +1840,25 @@ public class MainWindow : Window
 
     /* Help */
 
+    public void on_help_contents ()
+    {
+        try
+        {
+            show_uri (this.get_screen (), "ghelp:" + Config.HELP_DIR, Gdk.CURRENT_TIME);
+        }
+        catch (Error e)
+        {
+            stderr.printf ("Impossible to open the documentation: %s\n", e.message);
+        }
+    }
+
     public void on_help_latex_reference ()
     {
         try
         {
             string uri = Filename.to_uri (Path.build_filename (Config.DATA_DIR,
                 "latexhelp.html", null));
-            show_uri (null, uri, Gdk.CURRENT_TIME);
+            show_uri (this.get_screen (), uri, Gdk.CURRENT_TIME);
         }
         catch (Error e)
         {
diff --git a/src/ui/ui.xml b/src/ui/ui.xml
index a5db2ed..61c9b79 100644
--- a/src/ui/ui.xml
+++ b/src/ui/ui.xml
@@ -370,6 +370,7 @@ along with LaTeXila.  If not, see <http://www.gnu.org/licenses/>.
     </menu>
 
     <menu action="Help">
+      <menuitem action="HelpContents" />
       <menuitem action="HelpLatexReference" />
       <menuitem action="HelpAbout" />
     </menu>
diff --git a/vapi/config.vapi b/vapi/config.vapi
index 4faf2b6..5a9ddd0 100644
--- a/vapi/config.vapi
+++ b/vapi/config.vapi
@@ -9,4 +9,5 @@ namespace Config
     public const string SCHEMA_DIR;
     public const string ICONS_DIR;
     public const bool   DESKTOP_SCHEMAS;
+    public const string HELP_DIR;
 }



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