mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-12-28 19:36:00 +01:00
Show notification after text has been selected
This commit is contained in:
parent
593d8063fe
commit
67b58ef8e8
2 changed files with 32 additions and 12 deletions
|
@ -3,6 +3,9 @@
|
|||
#include <girara/utils.h>
|
||||
#include <girara/settings.h>
|
||||
#include <girara/datastructures.h>
|
||||
#include <girara/session.h>
|
||||
#include <string.h>
|
||||
#include <glib/gi18n.h>
|
||||
|
||||
#include "page_widget.h"
|
||||
#include "render.h"
|
||||
|
@ -522,7 +525,19 @@ cb_zathura_page_widget_button_release_event(GtkWidget* widget, GdkEventButton* b
|
|||
|
||||
char* text = zathura_page_get_text(priv->page, tmp, NULL);
|
||||
if (text != NULL) {
|
||||
if (strlen(text) > 0) {
|
||||
/* copy to clipboard */
|
||||
gtk_clipboard_set_text(gtk_clipboard_get(GDK_SELECTION_PRIMARY), text, -1);
|
||||
|
||||
|
||||
if (priv->page != NULL && priv->page->document != NULL && priv->page->document->zathura != NULL) {
|
||||
zathura_t* zathura = priv->page->document->zathura;
|
||||
char* stripped_text = g_strdelimit(g_strdup(text), "\n\t\r\n", ' ');
|
||||
girara_notify(zathura->ui.session, GIRARA_INFO, _("Copied selected text to clipbard: %s"), stripped_text);
|
||||
g_free(stripped_text);
|
||||
}
|
||||
}
|
||||
|
||||
g_free(text);
|
||||
}
|
||||
}
|
||||
|
|
13
po/de.po
13
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-07 01:01+0100\n"
|
||||
"POT-Creation-Date: 2012-03-07 09:16+0100\n"
|
||||
"PO-Revision-Date: 2012-03-05 17:26+0100\n"
|
||||
"Last-Translator: Sebastian Ramacher <s.ramacher@gmx.at>\n"
|
||||
"Language-Team: pwmt.org <mail@pwmt.org>\n"
|
||||
|
@ -123,16 +123,16 @@ msgstr "Speichere Dokument (und überschreibe bestehende)"
|
|||
msgid "Save attachments"
|
||||
msgstr "Speichere Anhänge"
|
||||
|
||||
#: ../callbacks.c:150
|
||||
#: ../callbacks.c:154
|
||||
msgid "Failed to run xdg-open."
|
||||
msgstr "Konnte xdg-open nicht ausführen."
|
||||
|
||||
#: ../callbacks.c:176
|
||||
#: ../callbacks.c:180
|
||||
#, c-format
|
||||
msgid "Invalid input '%s' given."
|
||||
msgstr "Ungültige Eingabe '%s' angegeben."
|
||||
|
||||
#: ../callbacks.c:210
|
||||
#: ../callbacks.c:214
|
||||
#, c-format
|
||||
msgid "Invalid index '%s' given."
|
||||
msgstr "Ungültiger Index '%s' angegeben."
|
||||
|
@ -238,3 +238,8 @@ msgstr "Pfad zum Pluginverzeichnis"
|
|||
#: ../zathura.c:59
|
||||
msgid "Fork into the background"
|
||||
msgstr "Forkt den Prozess in den Hintergrund"
|
||||
|
||||
#: ../page_widget.c:536
|
||||
#, c-format
|
||||
msgid "Copied selected text to clipbard: %s"
|
||||
msgstr "Der gewählte Text wurde in die Zwischenablage kopiert: %s"
|
||||
|
|
Loading…
Reference in a new issue