Merge branch 'develop' of pwmt.org:zathura into develop

This commit is contained in:
Moritz Lipp 2012-08-14 11:45:16 +02:00
commit 8908e1cb06
9 changed files with 57 additions and 15 deletions

View file

@ -32,7 +32,7 @@ compare_case_insensitive(const char* str1, const char* str2)
static girara_list_t*
list_files(zathura_t* zathura, const char* current_path, const char* current_file,
int current_file_length, bool is_dir, bool check_file_ext)
unsigned int current_file_length, bool is_dir, bool check_file_ext)
{
if (zathura == NULL || zathura->ui.session == NULL || current_path == NULL) {
return NULL;

View file

@ -161,6 +161,8 @@ config_load_default(zathura_t* zathura)
girara_setting_add(gsession, "abort-clear-search", &bool_value, BOOLEAN, false, _("Clear search results on abort"), NULL, NULL);
bool_value = false;
girara_setting_add(gsession, "window-title-basename", &bool_value, BOOLEAN, false, _("Use basename of the file in the window title"), NULL, NULL);
bool_value = false;
girara_setting_add(gsession, "synctex", &bool_value, BOOLEAN, false, _("Enable syntex support"), NULL, NULL);
/* define default shortcuts */
girara_shortcut_add(gsession, GDK_CONTROL_MASK, GDK_KEY_c, NULL, sc_abort, 0, 0, NULL);

5
main.c
View file

@ -40,6 +40,7 @@ main(int argc, char* argv[])
gchar* synctex_editor = NULL;
bool forkback = false;
bool print_version = false;
bool synctex = false;
#if (GTK_MAJOR_VERSION == 3)
Window embed = 0;
@ -56,6 +57,7 @@ main(int argc, char* argv[])
{ "password", 'w', 0, G_OPTION_ARG_STRING, &password, _("Document password"), "password" },
{ "debug", 'l', 0, G_OPTION_ARG_STRING, &loglevel, _("Log level (debug, info, warning, error)"), "level" },
{ "version", 'v', 0, G_OPTION_ARG_NONE, &print_version, _("Print version information"), NULL },
{ "synctex", 's', 0, G_OPTION_ARG_NONE, &synctex, _("Enable synctex support"), NULL },
{ "synctex-editor-command", 'x', 0, G_OPTION_ARG_STRING, &synctex_editor, _("Synctex editor (forwarded to the synctex command)"), "cmd" },
{ NULL, '\0', 0, 0, NULL, NULL, NULL }
};
@ -108,6 +110,9 @@ main(int argc, char* argv[])
return -1;
}
/* Enable/Disable synctex support */
zathura_set_syntex(zathura, synctex);
/* Print version */
if (print_version == true) {
char* string = zathura_get_version_string(zathura, false);

View file

@ -613,7 +613,10 @@ cb_zathura_page_widget_button_release_event(GtkWidget* widget, GdkEventButton* b
} else {
redraw_rect(ZATHURA_PAGE(widget), &priv->mouse.selection);
if (priv->zathura->synctex.enabled && button->state & GDK_CONTROL_MASK) {
bool synctex = false;
girara_setting_get(priv->zathura->ui.session, "synctex", &synctex);
if (synctex == true && button->state & GDK_CONTROL_MASK) {
/* synctex backwards sync */
double scale = zathura_document_get_scale(document);
int x = button->x / scale, y = button->y / scale;

View file

@ -7,16 +7,15 @@
msgid ""
msgstr ""
"Project-Id-Version: zathura\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-08-05 16:09+0200\n"
"PO-Revision-Date: 2012-07-02 12:58+0000\n"
"Report-Msgid-Bugs-To: http://bt.pwmt.org/\n"
"POT-Creation-Date: 2012-08-05 15:45+0200\n"
"PO-Revision-Date: 2012-08-07 22:54+0000\n"
"Last-Translator: Stéphane Aulery <lkppo@free.fr>\n"
"Language-Team: French (http://www.transifex.net/projects/p/zathura/language/"
"fr/)\n"
"Language: fr\n"
"Language-Team: French (http://www.transifex.com/projects/p/zathura/language/fr/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: fr\n"
"Plural-Forms: nplurals=2; plural=(n > 1)\n"
#: ../callbacks.c:204
@ -160,7 +159,7 @@ msgstr "Nombre de page par rangée"
#: ../config.c:113
msgid "Column of the first page"
msgstr ""
msgstr "Colonne de la première page"
#: ../config.c:115
msgid "Scroll step"
@ -168,7 +167,7 @@ msgstr "Facteur de défilement"
#: ../config.c:117
msgid "Horizontal scroll step"
msgstr ""
msgstr "Pas de défilement horizontal"
#: ../config.c:119
msgid "Zoom minimum"
@ -208,7 +207,7 @@ msgstr "Recoloriser les pages"
#: ../config.c:138
msgid "When recoloring keep original hue and adjust lightness only"
msgstr ""
msgstr "Lors du recalibrage des couleurs garder la teinte d'origine et ajuster seulement la luminosité"
#: ../config.c:140
msgid "Wrap scrolling"
@ -220,11 +219,11 @@ msgstr "Augmenter le nombre de pages par rangée"
#: ../config.c:144
msgid "Horizontally centered zoom"
msgstr ""
msgstr "Zoom centré horizontalement"
#: ../config.c:146
msgid "Center result horizontally"
msgstr ""
msgstr "Centrer le résultat horizontalement"
#: ../config.c:148
msgid "Transparency for highlighting"
@ -260,7 +259,7 @@ msgstr "Effacer les résultats de recherche en cas d'abandon"
#: ../config.c:163
msgid "Use basename of the file in the window title"
msgstr ""
msgstr "Utiliser le nom de base dans le titre de la fenêtre"
#. define default inputbar commands
#: ../config.c:291
@ -373,7 +372,7 @@ msgstr "Afficher les informations de version "
#: ../main.c:59
msgid "Synctex editor (forwarded to the synctex command)"
msgstr ""
msgstr "Éditeur Synctex (transférer à la commande synctex)"
#: ../page-widget.c:456
msgid "Loading..."

View file

@ -44,6 +44,15 @@ OPTIONS
--fork
Fork into the background
-l [level], --debug [level]
Set log debug level (debug, info, warning, error)
-s, --synctex
Enable syntex support
-x [cmd], --syntec-editor-command [cmd]
Set the syntex editor command
MOUSE AND KEY BINDINGS
======================

View file

@ -374,6 +374,15 @@ zathura_set_synctex_editor_command(zathura_t* zathura, const char* command)
}
}
void
zathura_set_syntex(zathura_t* zathura, bool value)
{
g_return_if_fail(zathura != NULL);
g_return_if_fail(zathura->ui.session != NULL);
girara_setting_set(zathura->ui.session, "synctex", &value);
}
void
zathura_set_argv(zathura_t* zathura, char** argv)
{

View file

@ -4,6 +4,13 @@ Type=Application
Name=Zathura
Comment=A minimalistic document viewer
Comment[de]=Ein minimalistischer Dokumenten-Betrachter
Comment[fr]=Un visionneur de document minimaliste
Comment[ru]=Минималистичный просмотрщик документов
Comment[tr]=Minimalist bir belge görüntüleyicisi
Comment[es_CL]=Un visor de documentos minimalista
Comment[uk_UA]=Легкий переглядач документів
Comment[it]=Un visualizzatore di documenti minimalista
Comment[pl]=Minimalistyczna przeglądarka dokumentów
Exec=zathura %f
Terminal=false
Categories=Office;Viewer;

View file

@ -191,6 +191,14 @@ void zathura_set_plugin_dir(zathura_t* zathura, const char* dir);
*/
void zathura_set_synctex_editor_command(zathura_t* zathura, const char* command);
/**
* En/Disable zathuras syntex support
*
* @param zathura The zathura session
* @param value The value
*/
void zathura_set_syntex(zathura_t* zathura, bool value);
/**
* Sets the program parameters
*