From e73ca51d05c05c2c48180dbb80c1766ae5df9d01 Mon Sep 17 00:00:00 2001 From: Moritz Lipp Date: Wed, 7 Mar 2012 01:08:17 +0100 Subject: [PATCH] Disable fullscreen mode if no document has been opened --- po/de.po | 9 +++++---- shortcuts.c | 6 ++++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/po/de.po b/po/de.po index 387f854..fa05807 100644 --- a/po/de.po +++ b/po/de.po @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-03-06 21:54+0100\n" +"POT-Creation-Date: 2012-03-07 01:01+0100\n" "PO-Revision-Date: 2012-03-05 17:26+0100\n" "Last-Translator: Sebastian Ramacher \n" "Language-Team: pwmt.org \n" @@ -123,22 +123,23 @@ msgstr "Speichere Dokument (und überschreibe bestehende)" msgid "Save attachments" msgstr "Speichere Anhänge" -#: ../callbacks.c:149 +#: ../callbacks.c:150 msgid "Failed to run xdg-open." msgstr "Konnte xdg-open nicht ausführen." -#: ../callbacks.c:175 +#: ../callbacks.c:176 #, c-format msgid "Invalid input '%s' given." msgstr "Ungültige Eingabe '%s' angegeben." -#: ../callbacks.c:209 +#: ../callbacks.c:210 #, c-format msgid "Invalid index '%s' given." msgstr "Ungültiger Index '%s' angegeben." #: ../commands.c:28 ../commands.c:63 ../commands.c:90 ../commands.c:132 #: ../commands.c:220 ../commands.c:237 ../commands.c:263 ../commands.c:337 +#: ../shortcuts.c:768 msgid "No document opened." msgstr "Kein Dokument geöffnet." diff --git a/shortcuts.c b/shortcuts.c index fa84006..57a6fca 100644 --- a/shortcuts.c +++ b/shortcuts.c @@ -7,6 +7,7 @@ #include #include #include +#include #include "callbacks.h" #include "shortcuts.h" @@ -763,6 +764,11 @@ sc_toggle_fullscreen(girara_session_t* session, girara_argument_t* g_return_val_if_fail(session->global.data != NULL, false); zathura_t* zathura = session->global.data; + if (zathura->document == NULL) { + girara_notify(session, GIRARA_WARNING, _("No document opened.")); + return false; + } + static bool fullscreen = false; static int pages_per_row = 1; static double zoom = 1.0;