diff options
author | Juhani Krekelä | 2021-07-24 19:15:10 +0300 |
---|---|---|
committer | Wolfgang Müller | 2021-07-24 18:55:04 +0200 |
commit | 4295134455ea99ad14a0eb43ed31e03fbeebb623 (patch) | |
tree | 6d668dce7b207e6051ffde950ccafc12b041a092 | |
parent | 8a87662e4d2be193e3110903e83f12347a12d4cb (diff) | |
download | weltschmerz-4295134455ea99ad14a0eb43ed31e03fbeebb623.tar.gz |
Unify context menus for URLs and OSC 8 hyperlinks
Currently weltschmerz has separate context menus for the two types of
URIs one can interact with, even though they contain the same option
with only a little different phrasing. This makes both use the same
context menu, and standardizes terminology to "URI".
This unification is in preparation for an upcoming "Open with …" feature
which will programmatically add items to context menu for URIs. Without
this, we would need to duplicate logic for each of the separate menus.
Diffstat (limited to '')
-rw-r--r-- | po/de.po | 46 | ||||
-rw-r--r-- | po/fi.po | 42 | ||||
-rw-r--r-- | po/weltschmerz.pot | 36 | ||||
-rw-r--r-- | terminal.ui | 34 | ||||
-rw-r--r-- | terminal.vala | 12 |
5 files changed, 60 insertions, 110 deletions
@@ -7,16 +7,16 @@ msgid "" msgstr "" "Project-Id-Version: weltschmerz\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-06-26 20:31+0200\n" -"PO-Revision-Date: 2021-06-26 20:35+0200\n" -"Last-Translator: Wolfgang Müller <wolf@oriole.systems>\n" +"POT-Creation-Date: 2021-07-20 20:19+0300\n" +"PO-Revision-Date: 2021-07-20 20:22+0300\n" +"Last-Translator: Juhani Krekelä <juhani@krekelä.fi>\n" "Language-Team: Wolfgang Müller\n" "Language: de\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Generator: Poedit 2.2.4\n" +"X-Generator: Poedit 2.3\n" #. TRANSLATORS: %s is the list of unknown keys joined with ', ' #: configreader.vala:111 @@ -45,62 +45,54 @@ msgid "invalid cursor blink setting '%s' in %s.%s" msgstr "ungültige Cursor-Blinkeinstellung '%s' in %s.%s" #: terminal.ui:16 -msgid "_Copy hyperlink" -msgstr "Hyperlink _kopieren" +msgid "_Copy URI" +msgstr "URI _kopieren" #: terminal.ui:19 -msgid "Copy the hyperlink's URI to the clipboard" -msgstr "Kopiert die URL des Hyperlinks in die Zwischenablage" +msgid "Copy the URI to the clipboard" +msgstr "Kopiert die URI in die Zwischenablage" -#: terminal.ui:38 -msgid "_Copy URL" -msgstr "URL _kopieren" - -#: terminal.ui:41 -msgid "Copy the URL to the clipboard" -msgstr "Kopiert die URL in die Zwischenablage" - -#: terminal.ui:75 +#: terminal.ui:53 msgid "Copy as _HTML" msgstr "Als _HTML kopieren" -#: terminal.ui:78 +#: terminal.ui:56 msgid "Copy the selection as HTML" msgstr "Kopiert die Auswahl als HTML" -#: terminal.ui:102 +#: terminal.ui:80 msgid "Open _terminal" msgstr "_Terminal öffnen" -#: terminal.ui:105 +#: terminal.ui:83 msgid "Open new terminal window in the current directory" msgstr "Öffnet ein neues Terminalfenster im aktuellen Verzeichnis" -#: terminal.ui:115 +#: terminal.ui:93 msgid "_Open directory" msgstr "_Verzeichnis öffnen" -#: terminal.ui:118 +#: terminal.ui:96 msgid "Open current directory in the file manager" msgstr "Öffnet das aktuelle Verzeichnis im Dateimanager" -#: terminal.ui:193 +#: terminal.ui:171 msgid "Search..." msgstr "Suchen..." -#: terminal.ui:212 +#: terminal.ui:190 msgid "Go to next result" msgstr "Gehe zum nächsten Suchergebnis" -#: terminal.ui:228 +#: terminal.ui:206 msgid "Go to previous result" msgstr "Gehe zum vorherigen Suchergebnis" -#: terminal.vala:141 +#: terminal.vala:139 msgid "Configuration loaded with warnings:" msgstr "Konfiguration wurde mit Warnungen geladen:" -#: terminal.vala:144 +#: terminal.vala:142 msgid "Configuration loaded successfully." msgstr "Konfiguration wurde erfolgreich geladen." @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: weltschmerz\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-06-26 20:31+0200\n" -"PO-Revision-Date: 2021-06-28 15:43+0300\n" +"POT-Creation-Date: 2021-07-20 20:19+0300\n" +"PO-Revision-Date: 2021-07-20 20:22+0300\n" "Last-Translator: Juhani Krekelä <juhani@krekelä.fi>\n" "Language-Team: nortti\n" "Language: fi\n" @@ -45,62 +45,54 @@ msgid "invalid cursor blink setting '%s' in %s.%s" msgstr "tuntematon osoitiimen välkkymisasetus '%s' asetuksessa %s.%s" #: terminal.ui:16 -msgid "_Copy hyperlink" -msgstr "_Kopioi hyperlinkki" +msgid "_Copy URI" +msgstr "_Kopioi URI" #: terminal.ui:19 -msgid "Copy the hyperlink's URI to the clipboard" -msgstr "Kopioi hyperlinkin URI leikepöydälle" +msgid "Copy the URI to the clipboard" +msgstr "Kopioi URI leikepöydälle" -#: terminal.ui:38 -msgid "_Copy URL" -msgstr "_Kopioi URL" - -#: terminal.ui:41 -msgid "Copy the URL to the clipboard" -msgstr "Kopioi URL leikepöydälle" - -#: terminal.ui:75 +#: terminal.ui:53 msgid "Copy as _HTML" msgstr "Kopioi _HTML:nä" -#: terminal.ui:78 +#: terminal.ui:56 msgid "Copy the selection as HTML" msgstr "Kopioi valinta HTML:nä" -#: terminal.ui:102 +#: terminal.ui:80 msgid "Open _terminal" msgstr "Avaa _pääte" -#: terminal.ui:105 +#: terminal.ui:83 msgid "Open new terminal window in the current directory" msgstr "Avaa pääteikkuna tämänhetkisessä hakemistossa" -#: terminal.ui:115 +#: terminal.ui:93 msgid "_Open directory" msgstr "_Avaa hakemisto" -#: terminal.ui:118 +#: terminal.ui:96 msgid "Open current directory in the file manager" msgstr "Avaa tämänhetkinen hakemisto tiedostoselaimessa" -#: terminal.ui:193 +#: terminal.ui:171 msgid "Search..." msgstr "Etsi..." -#: terminal.ui:212 +#: terminal.ui:190 msgid "Go to next result" msgstr "Seuraava osuma" -#: terminal.ui:228 +#: terminal.ui:206 msgid "Go to previous result" msgstr "Edellinen osuma" -#: terminal.vala:141 +#: terminal.vala:139 msgid "Configuration loaded with warnings:" msgstr "Asetukset ladattu varoituksin:" -#: terminal.vala:144 +#: terminal.vala:142 msgid "Configuration loaded successfully." msgstr "Asetukset ladattu onnistuneesti." diff --git a/po/weltschmerz.pot b/po/weltschmerz.pot index 4029cc6..fd35ae0 100644 --- a/po/weltschmerz.pot +++ b/po/weltschmerz.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: weltschmerz\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-06-26 20:31+0200\n" +"POT-Creation-Date: 2021-07-20 20:19+0300\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" @@ -45,62 +45,54 @@ msgid "invalid cursor blink setting '%s' in %s.%s" msgstr "" #: terminal.ui:16 -msgid "_Copy hyperlink" +msgid "_Copy URI" msgstr "" #: terminal.ui:19 -msgid "Copy the hyperlink's URI to the clipboard" +msgid "Copy the URI to the clipboard" msgstr "" -#: terminal.ui:38 -msgid "_Copy URL" -msgstr "" - -#: terminal.ui:41 -msgid "Copy the URL to the clipboard" -msgstr "" - -#: terminal.ui:75 +#: terminal.ui:53 msgid "Copy as _HTML" msgstr "" -#: terminal.ui:78 +#: terminal.ui:56 msgid "Copy the selection as HTML" msgstr "" -#: terminal.ui:102 +#: terminal.ui:80 msgid "Open _terminal" msgstr "" -#: terminal.ui:105 +#: terminal.ui:83 msgid "Open new terminal window in the current directory" msgstr "" -#: terminal.ui:115 +#: terminal.ui:93 msgid "_Open directory" msgstr "" -#: terminal.ui:118 +#: terminal.ui:96 msgid "Open current directory in the file manager" msgstr "" -#: terminal.ui:193 +#: terminal.ui:171 msgid "Search..." msgstr "" -#: terminal.ui:212 +#: terminal.ui:190 msgid "Go to next result" msgstr "" -#: terminal.ui:228 +#: terminal.ui:206 msgid "Go to previous result" msgstr "" -#: terminal.vala:141 +#: terminal.vala:139 msgid "Configuration loaded with warnings:" msgstr "" -#: terminal.vala:144 +#: terminal.vala:142 msgid "Configuration loaded successfully." msgstr "" diff --git a/terminal.ui b/terminal.ui index 68a36b7..57e4ad9 100644 --- a/terminal.ui +++ b/terminal.ui @@ -3,44 +3,22 @@ <interface> <requires lib="gtk+" version="3.24"/> <requires lib="vte-2.91" version="0.54"/> - <object class="GtkImage" id="copy_hyperlink_image"> + <object class="GtkImage" id="copy_uri_image"> <property name="visible">True</property> <property name="can-focus">False</property> <property name="icon-name">edit-copy</property> </object> - <object class="GtkMenu" id="hyperlink_context_menu"> + <object class="GtkMenu" id="uri_context_menu"> <property name="visible">True</property> <property name="can-focus">False</property> <child> - <object class="GtkImageMenuItem" id="copy_hyperlink_item"> - <property name="label" translatable="yes">_Copy hyperlink</property> + <object class="GtkImageMenuItem" id="copy_uri_item"> + <property name="label" translatable="yes">_Copy URI</property> <property name="visible">True</property> <property name="can-focus">False</property> - <property name="tooltip-text" translatable="yes">Copy the hyperlink's URI to the clipboard</property> + <property name="tooltip-text" translatable="yes">Copy the URI to the clipboard</property> <property name="use-underline">True</property> - <property name="image">copy_hyperlink_image</property> - <property name="use-stock">False</property> - <property name="always-show-image">True</property> - <signal name="activate" handler="uri_copy" swapped="no"/> - </object> - </child> - </object> - <object class="GtkImage" id="copy_url_image"> - <property name="visible">True</property> - <property name="can-focus">False</property> - <property name="icon-name">edit-copy</property> - </object> - <object class="GtkMenu" id="url_context_menu"> - <property name="visible">True</property> - <property name="can-focus">False</property> - <child> - <object class="GtkImageMenuItem" id="copy_url_item"> - <property name="label" translatable="yes">_Copy URL</property> - <property name="visible">True</property> - <property name="can-focus">False</property> - <property name="tooltip-text" translatable="yes">Copy the URL to the clipboard</property> - <property name="use-underline">True</property> - <property name="image">copy_url_image</property> + <property name="image">copy_uri_image</property> <property name="use-stock">False</property> <property name="always-show-image">True</property> <signal name="activate" handler="uri_copy" swapped="no"/> diff --git a/terminal.vala b/terminal.vala index 076d665..13409f4 100644 --- a/terminal.vala +++ b/terminal.vala @@ -24,8 +24,7 @@ class Terminal : Gtk.Overlay { [GtkChild] unowned Gtk.InfoBar infobar; [GtkChild] unowned Gtk.Label infobar_label; [GtkChild] unowned Gtk.Menu standard_context_menu; - [GtkChild] unowned Gtk.Menu url_context_menu; - [GtkChild] unowned Gtk.Menu hyperlink_context_menu; + [GtkChild] unowned Gtk.Menu uri_context_menu; [GtkChild] unowned Gtk.MenuItem copy_item_text; [GtkChild] unowned Gtk.MenuItem copy_item_html; [GtkChild] unowned Gtk.MenuItem open_terminal_item; @@ -62,8 +61,7 @@ class Terminal : Gtk.Overlay { vte.search_set_wrap_around(true); - url_context_menu.attach_to_widget(vte, null); - hyperlink_context_menu.attach_to_widget(vte, null); + uri_context_menu.attach_to_widget(vte, null); standard_context_menu.attach_to_widget(vte, null); clipboard = Gtk.Clipboard.get_default(window.get_display()); @@ -403,10 +401,8 @@ class Terminal : Gtk.Overlay { url_match = vte.match_check_event(event, null); hyperlink_match = vte.hyperlink_check_event(event); - if (url_match != null) { - url_context_menu.popup_at_pointer(event); - } else if (hyperlink_match != null) { - hyperlink_context_menu.popup_at_pointer(event); + if (url_match != null || hyperlink_match != null) { + uri_context_menu.popup_at_pointer(event); } else { copy_item_text.set_sensitive(vte.get_has_selection()); copy_item_html.set_sensitive(vte.get_has_selection()); |