...
 
Commits (16)
LaTeXila NEWS
Release 3.16.2
--------------
* Ensure that the personal build tools are correctly saved
* A few other small bug fixes
* Translation update
Release 3.16.1
--------------
* Fix the build with -Werror=format-security (Kalev Lember)
* Important bug fix when deleting several templates at once
Release 3.16.0
--------------
* Show information about LaTeXila fundraiser
......
......@@ -5,7 +5,7 @@
AC_PREREQ([2.64])
AC_INIT([LaTeXila],
[3.16.0],
[3.16.2],
[https://bugzilla.gnome.org/enter_bug.cgi?product=latexila],
[latexila],
[https://wiki.gnome.org/Apps/LaTeXila])
......
......@@ -15,6 +15,10 @@
\begin{document}
\begin{frame}
\titlepage
\end{frame}
\end{document}
</chunk>
</template>
<template xmlns:its="http://www.w3.org/2005/11/its">
<translatableChunk its:locNote="There is a helper script in data/templates/tex2po.sh">
<translatableChunk>
\documentclass[a4paper,11pt]{letter}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
......
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2014-10-05 19:04+0200\n"
"POT-Creation-Date: 2015-04-12 15:00+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......@@ -23,7 +23,6 @@ msgid ""
msgstr ""
#. (itstool) path: template/translatableChunk
#. There is a helper script in data/templates/tex2po.sh
#: letter.xml:2
#, no-wrap
msgid ""
......
......@@ -241,4 +241,5 @@ latexila_utils_str_replace
latexila_utils_file_query_exists_async
latexila_utils_file_query_exists_finish
latexila_utils_show_uri
latexila_utils_create_parent_directories
</SECTION>
......@@ -19,6 +19,7 @@ lv
nb
nl
pl
pt
pt_BR
ru
sl
......
......@@ -29,3 +29,4 @@ src/tab_info_bar.c
src/templates.c
src/templates_dialogs.c
src/utils.c
sub/data/latexila.desktop.in
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -201,7 +201,7 @@ public class DocumentView : Gtk.SourceView
DialogFlags.DESTROY_WITH_PARENT,
MessageType.ERROR,
ButtonsType.NONE,
_("No dictionaries available for the spell checking."));
"%s", _("No dictionaries available for the spell checking."));
dialog.add_buttons (_("_Help"), ResponseType.HELP,
_("_OK"), ResponseType.OK,
......
......@@ -46,9 +46,23 @@ public class LatexilaApp : Gtk.Application
shutdown.connect (() =>
{
hold ();
Projects.get_default ().save ();
MostUsedSymbols.get_default ().save ();
Gtk.AccelMap.save (get_accel_filename ());
/* Save accel file */
string accel_filename = get_accel_filename ();
File accel_file = File.new_for_path (accel_filename);
try
{
Latexila.utils_create_parent_directories (accel_file);
Gtk.AccelMap.save (accel_filename);
}
catch (Error error)
{
warning ("Error when saving accel file: %s", error.message);
}
release ();
});
}
......
......@@ -30,6 +30,7 @@
#include "latexila-build-tools-personal.h"
#include <gio/gio.h>
#include "latexila-build-tool.h"
#include "latexila-utils.h"
static LatexilaBuildToolsPersonal *instance = NULL;
......@@ -161,6 +162,7 @@ latexila_build_tools_personal_save (LatexilaBuildToolsPersonal *build_tools)
GString *contents;
GList *cur_build_tool;
GFile *xml_file;
GError *error = NULL;
g_return_if_fail (LATEXILA_IS_BUILD_TOOLS_PERSONAL (build_tools));
......@@ -184,14 +186,18 @@ latexila_build_tools_personal_save (LatexilaBuildToolsPersonal *build_tools)
g_string_append (contents, "</tools>\n");
xml_file = get_xml_file ();
latexila_utils_create_parent_directories (xml_file, &error);
if (error == NULL)
{
/* Avoid finalization of build_tools during the async operation. And keep the
* application running.
*/
g_object_ref (build_tools);
g_application_hold (g_application_get_default ());
xml_file = get_xml_file ();
g_file_replace_contents_async (xml_file,
contents->str,
contents->len,
......@@ -201,6 +207,13 @@ latexila_build_tools_personal_save (LatexilaBuildToolsPersonal *build_tools)
NULL,
(GAsyncReadyCallback) save_cb,
build_tools);
}
else
{
g_warning ("Error while saving the personal build tools: %s",
error->message);
g_error_free (error);
}
g_object_unref (xml_file);
}
......
......@@ -293,7 +293,7 @@ parser_text (GMarkupParseContext *context,
{
LatexilaBuildTools *build_tools = user_data;
const gchar *element_name = g_markup_parse_context_get_element (context);
gchar *stripped_text = g_strdup (text);
gchar *stripped_text = g_strndup (text, text_len);
stripped_text = g_strstrip (stripped_text);
if (g_str_equal (element_name, "job"))
......
......@@ -336,3 +336,49 @@ latexila_utils_show_uri (GdkScreen *screen,
g_free (extension);
}
}
/**
* latexila_utils_create_parent_directories:
* @file: a file
* @error: (out) (optional): a location to a %NULL #GError, or %NULL.
*
* Synchronously creates parent directories of @file, so that @file can be
* saved.
*
* Returns: whether the directories are correctly created. %FALSE is returned on
* error.
*/
gboolean
latexila_utils_create_parent_directories (GFile *file,
GError **error)
{
GFile *parent;
GError *my_error = NULL;
g_return_val_if_fail (G_IS_FILE (file), FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
parent = g_file_get_parent (file);
if (parent == NULL)
return TRUE;
g_file_make_directory_with_parents (parent, NULL, &my_error);
g_object_unref (parent);
if (my_error != NULL)
{
if (g_error_matches (my_error, G_IO_ERROR, G_IO_ERROR_EXISTS))
{
g_error_free (my_error);
return TRUE;
}
else
{
g_propagate_error (error, my_error);
return FALSE;
}
}
return TRUE;
}
......@@ -52,6 +52,9 @@ void latexila_utils_show_uri (GdkScreen *s
guint32 timestamp,
GError **error);
gboolean latexila_utils_create_parent_directories (GFile *file,
GError **error);
G_END_DECLS
#endif /* __LATEXILA_UTILS_H__ */
......@@ -274,12 +274,18 @@ public class DeleteTemplateDialog : Dialog
while (run () == ResponseType.ACCEPT)
{
TreeSelection select = templates_list.get_selection ();
List<TreePath> selected_items = select.get_selected_rows (null);
uint nb_selected_items = selected_items.length ();
unowned TreeModel model;
List<TreePath> selected_rows = select.get_selected_rows (out model);
List<TreeRowReference> row_refs = null;
foreach (TreePath path in selected_rows)
{
row_refs.prepend (new TreeRowReference (model, path));
}
for (int item_num = 0 ; item_num < nb_selected_items ; item_num++)
foreach (TreeRowReference row_ref in row_refs)
{
TreePath path = selected_items.nth_data (item_num);
TreePath path = row_ref.get_path ();
templates.delete_personal_template (path);
template_deleted = true;
}
......