add shortcut für "copy selection to file"

This commit is contained in:
2024-03-21 19:41:27 +01:00
parent 165b6e0a63
commit 03d615bff0
4 changed files with 35 additions and 32 deletions

View File

@@ -5,8 +5,8 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: RavenLog\n" "Project-Id-Version: RavenLog\n"
"POT-Creation-Date: 2024-03-21 19:17+0100\n" "POT-Creation-Date: 2024-03-21 19:39+0100\n"
"PO-Revision-Date: 2024-03-21 19:17+0100\n" "PO-Revision-Date: 2024-03-21 19:40+0100\n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
"Language: de\n" "Language: de\n"
@@ -170,7 +170,7 @@ msgstr "nur Treffer"
msgid "({hits} lines)" msgid "({hits} lines)"
msgstr "({hits} Zeilen)" msgstr "({hits} Zeilen)"
#: src/plugins/logfileplugin.py:35 src/ui/bigtext/bigtext.py:254 #: src/plugins/logfileplugin.py:35 src/ui/bigtext/bigtext.py:258
msgid "&Highlighter" msgid "&Highlighter"
msgstr "&Hervorhebungen" msgstr "&Hervorhebungen"
@@ -214,39 +214,39 @@ msgstr ""
msgid "h" msgid "h"
msgstr "" msgstr ""
#: src/ui/bigtext/bigtext.py:235 #: src/ui/bigtext/bigtext.py:238
msgid "&Copy to Clipboard" msgid "&Copy to Clipboard"
msgstr "In Zwischenablage &Kopieren" msgstr "In Zwischenablage &Kopieren"
#: src/ui/bigtext/bigtext.py:243 #: src/ui/bigtext/bigtext.py:246
msgid "Copy to &File" msgid "Copy to &File"
msgstr "In &Datei Kopieren" msgstr "In &Datei Kopieren"
#: src/ui/bigtext/bigtext.py:248 #: src/ui/bigtext/bigtext.py:252
msgid "Select &All" msgid "Select &All"
msgstr "&Alles Selektieren" msgstr "&Alles Selektieren"
#: src/ui/bigtext/bigtext.py:410 #: src/ui/bigtext/bigtext.py:414
msgid "data selection" msgid "warning"
msgstr "selektion" msgstr "Achtung"
#: src/ui/bigtext/bigtext.py:411 #: src/ui/bigtext/bigtext.py:415
msgid "You have selected <b>{0}</b> of data." msgid "You have selected <b>{0}</b> of data."
msgstr "Du hast <b>{0}</b> selektiert." msgstr "Du hast <b>{0}</b> selektiert."
#: src/ui/bigtext/bigtext.py:416 #: src/ui/bigtext/bigtext.py:420
msgid "Copy {0} to Clipboard" msgid "Copy {0} to Clipboard"
msgstr "Kopiere {0} in die Zwischenablage" msgstr "Kopiere {0} in die Zwischenablage"
#: src/ui/bigtext/bigtext.py:420 #: src/ui/bigtext/bigtext.py:424
msgid "Write to File" msgid "Write to File"
msgstr "Schreibe in Datei" msgstr "Schreibe in Datei"
#: src/ui/bigtext/bigtext.py:444 #: src/ui/bigtext/bigtext.py:448
msgid "Save File" msgid "Save File"
msgstr "Speichere Datei" msgstr "Speichere Datei"
#: src/ui/bigtext/bigtext.py:481 #: src/ui/bigtext/bigtext.py:485
msgid "selected {0} - {1:,.0f}:{2:,.0f}" msgid "selected {0} - {1:,.0f}:{2:,.0f}"
msgstr "selektiert {0} - {1:,.0f}:{2:,.0f}" msgstr "selektiert {0} - {1:,.0f}:{2:,.0f}"
@@ -358,6 +358,9 @@ msgstr "Grau"
msgid "transparent" msgid "transparent"
msgstr "Transparent" msgstr "Transparent"
#~ msgid "data selection"
#~ msgstr "selektion"
#~ msgid "Log file viewer" #~ msgid "Log file viewer"
#~ msgstr "Betrachter für Logdateien" #~ msgstr "Betrachter für Logdateien"

View File

@@ -5,7 +5,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2024-03-21 19:17+0100\n" "POT-Creation-Date: 2024-03-21 19:39+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -164,7 +164,7 @@ msgstr ""
msgid "({hits} lines)" msgid "({hits} lines)"
msgstr "" msgstr ""
#: src/plugins/logfileplugin.py:35 src/ui/bigtext/bigtext.py:254 #: src/plugins/logfileplugin.py:35 src/ui/bigtext/bigtext.py:258
msgid "&Highlighter" msgid "&Highlighter"
msgstr "" msgstr ""
@@ -208,46 +208,42 @@ msgstr ""
msgid "h" msgid "h"
msgstr "" msgstr ""
#: src/ui/bigtext/bigtext.py:235 #: src/ui/bigtext/bigtext.py:238
msgid "&Copy to Clipboard" msgid "&Copy to Clipboard"
msgstr "" msgstr ""
#: src/ui/bigtext/bigtext.py:243 #: src/ui/bigtext/bigtext.py:246
msgid "Copy to &File" msgid "Copy to &File"
msgstr "" msgstr ""
#: src/ui/bigtext/bigtext.py:248 #: src/ui/bigtext/bigtext.py:252
msgid "Select &All" msgid "Select &All"
msgstr "" msgstr ""
#: src/ui/bigtext/bigtext.py:410 #: src/ui/bigtext/bigtext.py:414
msgid "data selection" msgid "warning"
msgstr "" msgstr ""
#: src/ui/bigtext/bigtext.py:411 #: src/ui/bigtext/bigtext.py:415
msgid "You have selected <b>{0}</b> of data." msgid "You have selected <b>{0}</b> of data."
msgstr "" msgstr ""
#: src/ui/bigtext/bigtext.py:416 #: src/ui/bigtext/bigtext.py:420
msgid "Copy {0} to Clipboard" msgid "Copy {0} to Clipboard"
msgstr "" msgstr ""
#: src/ui/bigtext/bigtext.py:420 #: src/ui/bigtext/bigtext.py:424
msgid "Write to File" msgid "Write to File"
msgstr "" msgstr ""
#: src/ui/bigtext/bigtext.py:444 #: src/ui/bigtext/bigtext.py:448
msgid "Save File" msgid "Save File"
msgstr "" msgstr ""
#: src/ui/bigtext/bigtext.py:481 #: src/ui/bigtext/bigtext.py:485
msgid "selected {0} - {1:,.0f}:{2:,.0f}" msgid "selected {0} - {1:,.0f}:{2:,.0f}"
msgstr "" msgstr ""
#: src/ui/bigtext/bigtext.py:484
msgid ""
msgstr ""
#: src/ui/bigtext/newhighlightingdialog.py:20 #: src/ui/bigtext/newhighlightingdialog.py:20
msgid "Manage Highlighting" msgid "Manage Highlighting"
msgstr "" msgstr ""

View File

@@ -211,11 +211,14 @@ class InnerBigText(QWidget):
self.scroll_by_lines(-3) self.scroll_by_lines(-3)
if e.key() == 16777237: # page down if e.key() == 16777237: # page down
self.scroll_by_lines(3) self.scroll_by_lines(3)
elif e.modifiers() == Qt.KeyboardModifier.ControlModifier | Qt.KeyboardModifier.ShiftModifier and e.key() == 67: # ctrl + shift + c
self._copy_selection_to_file()
elif e.modifiers() == Qt.KeyboardModifier.ControlModifier and e.key() == 67: # ctrl + c elif e.modifiers() == Qt.KeyboardModifier.ControlModifier and e.key() == 67: # ctrl + c
self.copy_selection() self.copy_selection()
elif e.modifiers() == Qt.KeyboardModifier.ControlModifier and e.key() == 65: # ctrl + a elif e.modifiers() == Qt.KeyboardModifier.ControlModifier and e.key() == 65: # ctrl + a
self._select_all() self._select_all()
def wheelEvent(self, event: QWheelEvent): def wheelEvent(self, event: QWheelEvent):
direction = 1 if event.angleDelta().y() < 0 else -1 direction = 1 if event.angleDelta().y() < 0 else -1
if event.modifiers() == Qt.KeyboardModifier.ControlModifier: if event.modifiers() == Qt.KeyboardModifier.ControlModifier:
@@ -243,6 +246,7 @@ class InnerBigText(QWidget):
_("Copy to &File"), self, _("Copy to &File"), self,
triggered=self._copy_selection_to_file) triggered=self._copy_selection_to_file)
copy_to_file.setDisabled(not self._has_selection()) copy_to_file.setDisabled(not self._has_selection())
copy_to_file.setShortcut("Shift+CTRL+C")
menu.addAction(copy_to_file) menu.addAction(copy_to_file)
select_all = QAction(Icon("icons/myicons/select-all.svg"), _("Select &All"), self, select_all = QAction(Icon("icons/myicons/select-all.svg"), _("Select &All"), self,
@@ -407,7 +411,7 @@ class InnerBigText(QWidget):
if end - start > (1024 ** 2) * 5: if end - start > (1024 ** 2) * 5:
you_sure = QMessageBox( you_sure = QMessageBox(
QMessageBox.Icon.Warning, QMessageBox.Icon.Warning,
_("data selection"), _("warning"),
_( _(
"You have selected <b>{0}</b> of data.").format(bytes_human_readable)) "You have selected <b>{0}</b> of data.").format(bytes_human_readable))
# noinspection PyTypeChecker # noinspection PyTypeChecker
@@ -481,7 +485,7 @@ class InnerBigText(QWidget):
_("selected {0} - {1:,.0f}:{2:,.0f}").format(bytes_human_readable, start_byte, _("selected {0} - {1:,.0f}:{2:,.0f}").format(bytes_human_readable, start_byte,
end_byte - 1)) end_byte - 1))
else: else:
PluginRegistry.execute("update_status_bar", _("")) PluginRegistry.execute("update_status_bar", "")
def _file_changed(self): def _file_changed(self):
if self._follow_tail: if self._follow_tail: