remove old highlightingdialog

This commit is contained in:
2023-01-22 19:05:58 +01:00
parent e8fe759f70
commit 04377ca956
8 changed files with 170 additions and 385 deletions

View File

@@ -5,8 +5,8 @@
msgid ""
msgstr ""
"Project-Id-Version: RavenLog\n"
"POT-Creation-Date: 2022-08-25 19:21+0200\n"
"PO-Revision-Date: 2022-08-25 19:23+0200\n"
"POT-Creation-Date: 2023-01-22 18:59+0100\n"
"PO-Revision-Date: 2023-01-22 19:04+0100\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: de\n"
@@ -17,40 +17,36 @@ msgstr ""
"Generated-By: pygettext.py 1.5\n"
"X-Generator: Poedit 3.0.1\n"
#: src/mainwindow.py:34 src/plugins/krowlog/aboutdialog.py:24
#: src/mainwindow.py:32 src/plugins/krowlog/aboutdialog.py:28
#: src/plugins/krowlogplugin.py:85
msgid "KrowLog"
msgstr "KrowLog"
#: src/mainwindow.py:42 src/plugins/openfileplugin.py:30
#: src/mainwindow.py:40 src/plugins/openfileplugin.py:30
msgid "Open &Recent"
msgstr "Zu&letzt geöffnete Dateien"
#: src/mainwindow.py:64
#: src/mainwindow.py:58
msgid "&File"
msgstr "&Datei"
#: src/mainwindow.py:65
#: src/mainwindow.py:59
msgid "&Settings"
msgstr "&Einstellungen"
#: src/mainwindow.py:66
#: src/mainwindow.py:60
msgid "&Window"
msgstr "&Fenster"
#: src/mainwindow.py:67
#: src/mainwindow.py:61
msgid "&Help"
msgstr "&Hilfe"
#: src/mainwindow.py:99 src/ui/bigtext/bigtext.py:188
msgid "&Highlighter"
msgstr "&Hervorhebungen"
#: src/mainwindow.py:106
#: src/mainwindow.py:93
msgid "Highlight &Searches"
msgstr "&Suchtreffer Hervorheben"
#: src/mainwindow.py:114
#: src/mainwindow.py:101
msgid "Open Tab on Save As File"
msgstr "Öffne neues Tab wenn Selektion als neue Datei gespeichert wird"
@@ -78,31 +74,31 @@ msgstr "&Dateibrowser"
msgid "Files Browser"
msgstr "Dateibrowser"
#: src/plugins/krowlog/aboutdialog.py:19
#: src/plugins/krowlog/aboutdialog.py:23
msgid "About KrowLog"
msgstr "Über KrowLog"
#: src/plugins/krowlog/aboutdialog.py:29
#: src/plugins/krowlog/aboutdialog.py:33
msgid "Version: {0}"
msgstr "Version: {0}"
#: src/plugins/krowlog/aboutdialog.py:44
#: src/plugins/krowlog/aboutdialog.py:48
msgid "About"
msgstr "Über KrowLog"
#: src/plugins/krowlog/aboutdialog.py:45
#: src/plugins/krowlog/aboutdialog.py:49
msgid "License"
msgstr "Lizenz"
#: src/plugins/krowlog/aboutdialog.py:58
#: src/plugins/krowlog/aboutdialog.py:62
msgid "Log file viewer"
msgstr "Betrachter für Logdateien"
#: src/plugins/krowlog/aboutdialog.py:59
#: src/plugins/krowlog/aboutdialog.py:63
msgid "(c) 2022 Andreas Huber"
msgstr "(c) 2022 Andreas Huber"
#: src/plugins/krowlog/aboutdialog.py:60
#: src/plugins/krowlog/aboutdialog.py:64
msgid "License: LGPL v3"
msgstr "Lizenz: LGPL v3"
@@ -146,31 +142,35 @@ msgstr "&Über KrowLog"
msgid "E&xit"
msgstr "&Beenden"
#: src/plugins/logfile/filterwidget.py:149
#: src/plugins/logfile/filterwidget.py:156
msgid "Cancel"
msgstr "Abbrechen"
#: src/plugins/logfile/filterwidget.py:155
#: src/plugins/logfile/filterwidget.py:162
msgid "save query"
msgstr "suche speichern"
#: src/plugins/logfile/filterwidget.py:160
#: src/plugins/logfile/filterwidget.py:167
msgid "ignore case"
msgstr "Groß-/Kleinschreibung ignorieren"
#: src/plugins/logfile/filterwidget.py:164
#: src/plugins/logfile/filterwidget.py:171
msgid "regex"
msgstr "RegExp"
#: src/plugins/logfile/filterwidget.py:251
#: src/plugins/logfile/filterwidget.py:259
msgid "({hits} lines)"
msgstr "({hits} Zeilen)"
#: src/plugins/logfileplugin.py:26
#: src/plugins/logfileplugin.py:35 src/ui/bigtext/bigtext.py:240
msgid "&Highlighter"
msgstr "&Hervorhebungen"
#: src/plugins/logfileplugin.py:43
msgid "File not found"
msgstr "Datei nicht gefunden"
#: src/plugins/logfileplugin.py:27
#: src/plugins/logfileplugin.py:44
msgid "'{0}' is not a file or cannot be opened"
msgstr "'{0}' ist keine Datei oder kann nicht geöffnet werden"
@@ -190,157 +190,163 @@ msgstr "&Öffnen..."
msgid "Open File"
msgstr "Öffne Datei"
#: src/ui/bigtext/bigtext.py:171
#: src/ui/bigtext/bigtext.py:223
msgid "&Copy to Clipboard"
msgstr "In Zwischenablage &Kopieren"
#: src/ui/bigtext/bigtext.py:177
#: src/ui/bigtext/bigtext.py:229
msgid "Copy to &File"
msgstr "In &Datei Kopieren"
#: src/ui/bigtext/bigtext.py:182
#: src/ui/bigtext/bigtext.py:234
msgid "Select &All"
msgstr "&Alles Selektieren"
#: src/ui/bigtext/bigtext.py:332
#: src/ui/bigtext/bigtext.py:396
msgid "data selection"
msgstr "selektion"
#: src/ui/bigtext/bigtext.py:333
#: src/ui/bigtext/bigtext.py:397
msgid "You have selected <b>{0}</b> of data."
msgstr "Du hast <b>{0}</b> selektiert."
#: src/ui/bigtext/bigtext.py:336
#: src/ui/bigtext/bigtext.py:401
msgid "Copy {0} to Clipboard"
msgstr "Kopiere {0} in die Zwischenablage"
#: src/ui/bigtext/bigtext.py:338
#: src/ui/bigtext/bigtext.py:403
msgid "Write to File"
msgstr "Schreibe in Datei"
#: src/ui/bigtext/bigtext.py:360
#: src/ui/bigtext/bigtext.py:425
msgid "Save File"
msgstr "Speichere Datei"
#: src/ui/bigtext/highlightingdialog.py:23
#: src/ui/bigtext/newhighlightingdialog.py:20
msgid "Manage Highlighting"
msgstr "Hervorhebungen Verwalten"
#: src/ui/bigtext/highlightingdialog.py:35
msgid "Add"
msgstr "Hinzufügen"
#: src/ui/bigtext/newhighlightingdialog.py:29
msgid "New"
msgstr "Neu"
#: src/ui/bigtext/highlightingdialog.py:39
msgid "Update"
msgstr "Aktualisieren"
#: src/ui/bigtext/highlightingdialog.py:43
#: src/ui/bigtext/newhighlightingdialog.py:33
msgid "Remove"
msgstr "Entfernen"
#: src/ui/bigtext/highlightingdialog.py:47
#: src/ui/bigtext/newhighlightingdialog.py:37
msgid "Up"
msgstr "Hoch"
#: src/ui/bigtext/highlightingdialog.py:51
#: src/ui/bigtext/newhighlightingdialog.py:41
msgid "Down"
msgstr "Runter"
#: src/ui/bigtext/highlightingdialog.py:59
msgid "Query:"
msgstr "Suche:"
#: src/ui/bigtext/highlightingdialog.py:63
msgid "Ignore Case"
msgstr "Groß-/Kleinschreibung ignorieren"
#: src/ui/bigtext/highlightingdialog.py:68
msgid "Regular Expression"
msgstr "Regulärer Ausdruck"
#: src/ui/bigtext/highlightingdialog.py:73
#: src/ui/bigtext/newhighlightingdialog.py:143
msgid "Hit Background:"
msgstr "Trefferhintergrund:"
#: src/ui/bigtext/highlightingdialog.py:78
#: src/ui/bigtext/newhighlightingdialog.py:145
msgid "Hit Background"
msgstr "Trefferhintergrund"
#: src/ui/bigtext/newhighlightingdialog.py:150
msgid "Ignore Case"
msgstr "Groß-/Kleinschreibung ignorieren"
#: src/ui/bigtext/newhighlightingdialog.py:156
msgid "Line Background:"
msgstr "Zeilenhintergrund:"
#: src/ui/bigtext/highlightingdialog.py:142
msgid "unsaved changes"
msgstr "Nicht Gespeicherte Änderungen"
#: src/ui/bigtext/newhighlightingdialog.py:158
msgid "Line Background"
msgstr "Zeilenhintergrund"
#: src/ui/bigtext/highlightingdialog.py:143
msgid "You have unsaved changes."
msgstr "Du hast nicht gespeicherte Änderungen."
#: src/ui/bigtext/newhighlightingdialog.py:163
msgid "Regular Expression"
msgstr "Regulärer Ausdruck"
#: src/ui/colorbutton.py:18
#: src/ui/colorbutton.py:20
msgid "Strawberry Cream"
msgstr "Strawberry Cream"
#: src/ui/colorbutton.py:19
#: src/ui/colorbutton.py:21
msgid "Pale Crimson"
msgstr "Pale Crimson"
#: src/ui/colorbutton.py:21
#: src/ui/colorbutton.py:23
msgid "Broken Buttercup"
msgstr "Pale Crimson"
msgstr "Broken Buttercup"
#: src/ui/colorbutton.py:22
#: src/ui/colorbutton.py:24
msgid "Passion Fruit Sugar"
msgstr "Passion Fruit Sugar"
#: src/ui/colorbutton.py:24
#: src/ui/colorbutton.py:26
msgid "Sunrise Yellow"
msgstr "Sonnenaufganggelb"
#: src/ui/colorbutton.py:25
#: src/ui/colorbutton.py:27
msgid "Magical Mustard"
msgstr "Magischer Senf"
#: src/ui/colorbutton.py:27
#: src/ui/colorbutton.py:29
msgid "Trendy Green"
msgstr "Trendiges Grün"
#: src/ui/colorbutton.py:28
#: src/ui/colorbutton.py:30
msgid "Garden Of Sweden"
msgstr "Garten von Schweden"
#: src/ui/colorbutton.py:30
#: src/ui/colorbutton.py:32
msgid "Light Sky Blue"
msgstr "Helles Himmelsblau"
#: src/ui/colorbutton.py:31
#: src/ui/colorbutton.py:33
msgid "True Blue"
msgstr "Echtes Blau"
#: src/ui/colorbutton.py:33
#: src/ui/colorbutton.py:35
msgid "Fairy Topia"
msgstr "Fairy Topia"
#: src/ui/colorbutton.py:34
#: src/ui/colorbutton.py:36
msgid "Magenta Bachiego"
msgstr "Magenta Bachiego"
#: src/ui/colorbutton.py:36
#: src/ui/colorbutton.py:38
msgid "Breeze of Mist"
msgstr "Nebelbriese"
#: src/ui/colorbutton.py:37
#: src/ui/colorbutton.py:39
msgid "Light Grey"
msgstr "Helles Grau"
#: src/ui/colorbutton.py:38
#: src/ui/colorbutton.py:40
msgid "Grey"
msgstr "Grau"
#: src/ui/colorbutton.py:44
#: src/ui/colorbutton.py:46
msgid "transparent"
msgstr "Transparent"
#: src/ui/colorbutton.py:51
msgid "custom"
msgstr "individuell"
#~ msgid "Add"
#~ msgstr "Hinzufügen"
#~ msgid "Update"
#~ msgstr "Aktualisieren"
#~ msgid "Query:"
#~ msgstr "Suche:"
#~ msgid "unsaved changes"
#~ msgstr "Nicht Gespeicherte Änderungen"
#~ msgid "You have unsaved changes."
#~ msgstr "Du hast nicht gespeicherte Änderungen."
#~ msgid "custom"
#~ msgstr "individuell"
#~ msgid "&Find In Files"
#~ msgstr "In &Dateien Suchen"

View File

@@ -5,7 +5,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2022-08-25 19:21+0200\n"
"POT-Creation-Date: 2023-01-22 18:59+0100\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"
@@ -15,40 +15,36 @@ msgstr ""
"Generated-By: pygettext.py 1.5\n"
#: src/mainwindow.py:34 src/plugins/krowlog/aboutdialog.py:24
#: src/mainwindow.py:32 src/plugins/krowlog/aboutdialog.py:28
#: src/plugins/krowlogplugin.py:85
msgid "KrowLog"
msgstr ""
#: src/mainwindow.py:42 src/plugins/openfileplugin.py:30
#: src/mainwindow.py:40 src/plugins/openfileplugin.py:30
msgid "Open &Recent"
msgstr ""
#: src/mainwindow.py:64
#: src/mainwindow.py:58
msgid "&File"
msgstr ""
#: src/mainwindow.py:65
#: src/mainwindow.py:59
msgid "&Settings"
msgstr ""
#: src/mainwindow.py:66
#: src/mainwindow.py:60
msgid "&Window"
msgstr ""
#: src/mainwindow.py:67
#: src/mainwindow.py:61
msgid "&Help"
msgstr ""
#: src/mainwindow.py:99 src/ui/bigtext/bigtext.py:188
msgid "&Highlighter"
msgstr ""
#: src/mainwindow.py:106
#: src/mainwindow.py:93
msgid "Highlight &Searches"
msgstr ""
#: src/mainwindow.py:114
#: src/mainwindow.py:101
msgid "Open Tab on Save As File"
msgstr ""
@@ -76,31 +72,31 @@ msgstr ""
msgid "Files Browser"
msgstr ""
#: src/plugins/krowlog/aboutdialog.py:19
#: src/plugins/krowlog/aboutdialog.py:23
msgid "About KrowLog"
msgstr ""
#: src/plugins/krowlog/aboutdialog.py:29
#: src/plugins/krowlog/aboutdialog.py:33
msgid "Version: {0}"
msgstr ""
#: src/plugins/krowlog/aboutdialog.py:44
#: src/plugins/krowlog/aboutdialog.py:48
msgid "About"
msgstr ""
#: src/plugins/krowlog/aboutdialog.py:45
#: src/plugins/krowlog/aboutdialog.py:49
msgid "License"
msgstr ""
#: src/plugins/krowlog/aboutdialog.py:58
#: src/plugins/krowlog/aboutdialog.py:62
msgid "Log file viewer"
msgstr ""
#: src/plugins/krowlog/aboutdialog.py:59
#: src/plugins/krowlog/aboutdialog.py:63
msgid "(c) 2022 Andreas Huber"
msgstr ""
#: src/plugins/krowlog/aboutdialog.py:60
#: src/plugins/krowlog/aboutdialog.py:64
msgid "License: LGPL v3"
msgstr ""
@@ -140,31 +136,35 @@ msgstr ""
msgid "E&xit"
msgstr ""
#: src/plugins/logfile/filterwidget.py:149
#: src/plugins/logfile/filterwidget.py:156
msgid "Cancel"
msgstr ""
#: src/plugins/logfile/filterwidget.py:155
#: src/plugins/logfile/filterwidget.py:162
msgid "save query"
msgstr ""
#: src/plugins/logfile/filterwidget.py:160
#: src/plugins/logfile/filterwidget.py:167
msgid "ignore case"
msgstr ""
#: src/plugins/logfile/filterwidget.py:164
#: src/plugins/logfile/filterwidget.py:171
msgid "regex"
msgstr ""
#: src/plugins/logfile/filterwidget.py:251
#: src/plugins/logfile/filterwidget.py:259
msgid "({hits} lines)"
msgstr ""
#: src/plugins/logfileplugin.py:26
#: src/plugins/logfileplugin.py:35 src/ui/bigtext/bigtext.py:240
msgid "&Highlighter"
msgstr ""
#: src/plugins/logfileplugin.py:43
msgid "File not found"
msgstr ""
#: src/plugins/logfileplugin.py:27
#: src/plugins/logfileplugin.py:44
msgid "'{0}' is not a file or cannot be opened"
msgstr ""
@@ -184,155 +184,143 @@ msgstr ""
msgid "Open File"
msgstr ""
#: src/ui/bigtext/bigtext.py:171
#: src/ui/bigtext/bigtext.py:223
msgid "&Copy to Clipboard"
msgstr ""
#: src/ui/bigtext/bigtext.py:177
#: src/ui/bigtext/bigtext.py:229
msgid "Copy to &File"
msgstr ""
#: src/ui/bigtext/bigtext.py:182
#: src/ui/bigtext/bigtext.py:234
msgid "Select &All"
msgstr ""
#: src/ui/bigtext/bigtext.py:332
#: src/ui/bigtext/bigtext.py:396
msgid "data selection"
msgstr ""
#: src/ui/bigtext/bigtext.py:333
#: src/ui/bigtext/bigtext.py:397
msgid "You have selected <b>{0}</b> of data."
msgstr ""
#: src/ui/bigtext/bigtext.py:336
#: src/ui/bigtext/bigtext.py:401
msgid "Copy {0} to Clipboard"
msgstr ""
#: src/ui/bigtext/bigtext.py:338
#: src/ui/bigtext/bigtext.py:403
msgid "Write to File"
msgstr ""
#: src/ui/bigtext/bigtext.py:360
#: src/ui/bigtext/bigtext.py:425
msgid "Save File"
msgstr ""
#: src/ui/bigtext/highlightingdialog.py:23
#: src/ui/bigtext/newhighlightingdialog.py:20
msgid "Manage Highlighting"
msgstr ""
#: src/ui/bigtext/highlightingdialog.py:35
msgid "Add"
#: src/ui/bigtext/newhighlightingdialog.py:29
msgid "New"
msgstr ""
#: src/ui/bigtext/highlightingdialog.py:39
msgid "Update"
msgstr ""
#: src/ui/bigtext/highlightingdialog.py:43
#: src/ui/bigtext/newhighlightingdialog.py:33
msgid "Remove"
msgstr ""
#: src/ui/bigtext/highlightingdialog.py:47
#: src/ui/bigtext/newhighlightingdialog.py:37
msgid "Up"
msgstr ""
#: src/ui/bigtext/highlightingdialog.py:51
#: src/ui/bigtext/newhighlightingdialog.py:41
msgid "Down"
msgstr ""
#: src/ui/bigtext/highlightingdialog.py:59
msgid "Query:"
msgstr ""
#: src/ui/bigtext/highlightingdialog.py:63
msgid "Ignore Case"
msgstr ""
#: src/ui/bigtext/highlightingdialog.py:68
msgid "Regular Expression"
msgstr ""
#: src/ui/bigtext/highlightingdialog.py:73
#: src/ui/bigtext/newhighlightingdialog.py:143
msgid "Hit Background:"
msgstr ""
#: src/ui/bigtext/highlightingdialog.py:78
#: src/ui/bigtext/newhighlightingdialog.py:145
msgid "Hit Background"
msgstr ""
#: src/ui/bigtext/newhighlightingdialog.py:150
msgid "Ignore Case"
msgstr ""
#: src/ui/bigtext/newhighlightingdialog.py:156
msgid "Line Background:"
msgstr ""
#: src/ui/bigtext/highlightingdialog.py:142
msgid "unsaved changes"
#: src/ui/bigtext/newhighlightingdialog.py:158
msgid "Line Background"
msgstr ""
#: src/ui/bigtext/highlightingdialog.py:143
msgid "You have unsaved changes."
#: src/ui/bigtext/newhighlightingdialog.py:163
msgid "Regular Expression"
msgstr ""
#: src/ui/colorbutton.py:18
#: src/ui/colorbutton.py:20
msgid "Strawberry Cream"
msgstr ""
#: src/ui/colorbutton.py:19
#: src/ui/colorbutton.py:21
msgid "Pale Crimson"
msgstr ""
#: src/ui/colorbutton.py:21
#: src/ui/colorbutton.py:23
msgid "Broken Buttercup"
msgstr ""
#: src/ui/colorbutton.py:22
#: src/ui/colorbutton.py:24
msgid "Passion Fruit Sugar"
msgstr ""
#: src/ui/colorbutton.py:24
#: src/ui/colorbutton.py:26
msgid "Sunrise Yellow"
msgstr ""
#: src/ui/colorbutton.py:25
#: src/ui/colorbutton.py:27
msgid "Magical Mustard"
msgstr ""
#: src/ui/colorbutton.py:27
#: src/ui/colorbutton.py:29
msgid "Trendy Green"
msgstr ""
#: src/ui/colorbutton.py:28
#: src/ui/colorbutton.py:30
msgid "Garden Of Sweden"
msgstr ""
#: src/ui/colorbutton.py:30
#: src/ui/colorbutton.py:32
msgid "Light Sky Blue"
msgstr ""
#: src/ui/colorbutton.py:31
#: src/ui/colorbutton.py:33
msgid "True Blue"
msgstr ""
#: src/ui/colorbutton.py:33
#: src/ui/colorbutton.py:35
msgid "Fairy Topia"
msgstr ""
#: src/ui/colorbutton.py:34
#: src/ui/colorbutton.py:36
msgid "Magenta Bachiego"
msgstr ""
#: src/ui/colorbutton.py:36
#: src/ui/colorbutton.py:38
msgid "Breeze of Mist"
msgstr ""
#: src/ui/colorbutton.py:37
#: src/ui/colorbutton.py:39
msgid "Light Grey"
msgstr ""
#: src/ui/colorbutton.py:38
#: src/ui/colorbutton.py:40
msgid "Grey"
msgstr ""
#: src/ui/colorbutton.py:44
#: src/ui/colorbutton.py:46
msgid "transparent"
msgstr ""
#: src/ui/colorbutton.py:51
msgid "custom"
msgstr ""

View File

@@ -12,7 +12,6 @@ from src.plugins.domain.menucontribution import MenuContribution, sort_menu_cont
from src.plugins.domain.raction import RAction
from src.plugins.domain.rmenu import RMenu
from src.settings.settingsstore import SettingsStore
from src.ui.bigtext.highlightingdialog import HighlightingDialog
from src.ui.tabs import Tabs
from src.util.urlutils import url_is_file
@@ -50,7 +49,6 @@ class MainWindow(QMainWindow):
menu_bar = QMenuBar()
menu_contributions: [MenuContribution] = PluginRegistry.execute_flat_map("get_menu_contributions")
menu_contributions.append(MenuContribution("settings", action=self._action_highlighter()))
menu_contributions.append(MenuContribution("settings", action=self._action_highlight_search_terms()))
menu_contributions.append(MenuContribution("settings", action=self._action_new_tab()))
@@ -91,13 +89,6 @@ class MainWindow(QMainWindow):
action = raction.to_qaction(qmenu)
qmenu.addAction(action)
def _action_highlighter(self):
manage = RAction(
_("&Old Highlighter"),
action=lambda: HighlightingDialog(self.settings).exec()
)
return manage
def _action_highlight_search_terms(self):
highlight_search_terms = RAction(_("Highlight &Searches"))
highlight_search_terms.set_checkable(True)

View File

@@ -13,9 +13,9 @@ from src.ui.ScaledScrollBar import ScaledScrollBar
from src.ui.bigtext.highlight_regex import HighlightRegex
from src.ui.bigtext.highlight_selection import HighlightSelection
from src.ui.bigtext.highlighted_range import HighlightedRange
from src.ui.bigtext.highlightingdialog import HighlightingDialog
from src.ui.bigtext.line import Line
from src.ui.bigtext.logFileModel import LogFileModel
from src.ui.bigtext.newhighlightingdialog import NewHighlightingDialog
from src.ui.icon import Icon
from src.ui.rangeslider import RangeSlider
from src.util.conversion import humanbytes
@@ -239,7 +239,7 @@ class InnerBigText(QWidget):
manage_highlighting = QAction(
_("&Highlighter"),
self,
triggered=lambda: HighlightingDialog(self.model.settings).exec())
triggered=lambda: NewHighlightingDialog(self.model.settings).exec())
manage_highlighting.setShortcut("CTRL+H")
menu.addAction(manage_highlighting)

View File

@@ -1,201 +0,0 @@
from PySide6.QtWidgets import QDialog, QLineEdit, QLabel, QGridLayout, QCheckBox, QListWidget, QListWidgetItem, \
QPushButton, QDialogButtonBox, QMessageBox, QSizePolicy
from src.ui.bigtext.highlight_regex import HighlightRegex
from src.ui.bigtext.highlighting import Highlighting
from src.ui.colorbutton import ColorButton
from src.ui.hbox import HBox
from src.settings.settings import Settings
from src.i18n import _
from src.ui.icon import Icon
class PayloadItem(QListWidgetItem):
def __init__(self, text: str, payload=None):
super(PayloadItem, self).__init__(text)
self.payload = payload
class HighlightingDialog(QDialog):
def __init__(self, settings: Settings):
super(HighlightingDialog, self).__init__()
self.setWindowTitle(_("Manage Highlighting"))
self.setModal(True)
self._settings = settings
form_grid = QGridLayout(self)
self.layout = form_grid
row = 0
self.list = QListWidget(self)
form_grid.addWidget(self.list, row, 0, 1, 2)
row = row + 1
self.btn_add = QPushButton(Icon.fromTheme("list-add"), _("Add"))
self.btn_add.setSizePolicy(QSizePolicy(QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Fixed))
self.btn_add.pressed.connect(self._add)
self.btn_update = QPushButton(Icon.fromTheme("stock_edit"), _("Update"))
self.btn_update.setSizePolicy(QSizePolicy(QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Fixed))
self.btn_update.pressed.connect(self._update)
self.btn_delete = QPushButton(Icon.fromTheme("list-remove"), _("Remove"))
self.btn_delete.setSizePolicy(QSizePolicy(QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Fixed))
self.btn_delete.pressed.connect(self._delete)
self.btn_move_up = QPushButton(Icon.fromTheme("go-up"), _("Up"))
self.btn_move_up.setSizePolicy(QSizePolicy(QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Fixed))
self.btn_move_up.pressed.connect(self._move_up)
self.btn_move_down = QPushButton(Icon.fromTheme("go-down"), _("Down"))
self.btn_move_down.setSizePolicy(QSizePolicy(QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Fixed))
self.btn_move_down.pressed.connect(self._move_down)
button_box = HBox(self.btn_update, self.btn_add, self.btn_delete, self.btn_move_up, self.btn_move_down)
form_grid.addWidget(button_box, row, 0, 1, 2)
row = row + 1
self.query = QLineEdit(self)
form_grid.addWidget(QLabel(_("Query:")), row, 0)
form_grid.addWidget(self.query, row, 1)
row = row + 1
self.ignore_case = QCheckBox(_("Ignore Case"))
self.ignore_case.setChecked(True)
form_grid.addWidget(self.ignore_case, row, 0, 1, 2)
row = row + 1
self.is_regex = QCheckBox(_("Regular Expression"))
self.is_regex.setChecked(True)
form_grid.addWidget(self.is_regex, row, 0, 1, 2)
row = row + 1
form_grid.addWidget(QLabel(_("Hit Background:")), row, 0)
self.hit_background_color = ColorButton("ccb400")
form_grid.addWidget(self.hit_background_color, row, 1)
row = row + 1
form_grid.addWidget(QLabel(_("Line Background:")), row, 0)
self.line_background_color = ColorButton("fff080")
form_grid.addWidget(self.line_background_color, row, 1)
row = row + 1
self.buttons = QDialogButtonBox()
self.buttons.setStandardButtons(QDialogButtonBox.StandardButton.Cancel | QDialogButtonBox.StandardButton.Ok)
self.buttons.accepted.connect(self._save)
self.buttons.rejected.connect(self.close)
form_grid.addWidget(self.buttons, row, 0, 1, 2)
self._load_existing_hightlighters()
self.list.setCurrentItem(None)
self._selection_changed()
self.list.itemSelectionChanged.connect(self._selection_changed)
def _add(self):
highlighter = HighlightRegex(
self.query.text(),
self.ignore_case.isChecked(),
self.is_regex.isChecked(),
self.hit_background_color.color,
self.line_background_color.color
)
item = PayloadItem(self.query.text(), highlighter)
item.setBackground(highlighter.hit_background_brush())
self.list.addItem(item)
self.list.setCurrentItem(item)
def _update(self):
item: PayloadItem = self.list.currentItem()
highlighter: HighlightRegex = item.payload
highlighter.query = self.query.text()
highlighter.ignore_case = self.ignore_case.isChecked()
highlighter.is_regex = self.is_regex.isChecked()
highlighter.hit_background_color = self.hit_background_color.color
highlighter.line_background_color = self.line_background_color.color
item.setText(self.query.text())
item.setBackground(highlighter.hit_background_brush())
def _delete(self):
index = self.list.selectedIndexes()[0]
selected_index = index.row()
self.list.takeItem(selected_index)
def _move_up(self):
index = self.list.currentIndex()
selected_index = index.row()
item = self.list.takeItem(selected_index)
self.list.insertItem(selected_index - 1, item)
self.list.setCurrentIndex(index.siblingAtRow(selected_index - 1))
def _move_down(self):
index = self.list.selectedIndexes()[0]
selected_index = index.row()
item = self.list.takeItem(selected_index)
self.list.insertItem(selected_index + 1, item)
self.list.setCurrentIndex(index.sibling(selected_index + 1, 0))
def _save(self):
if self._is_dirty():
unsaved = QMessageBox(QMessageBox.Icon.Question, _("unsaved changes"),
_("You have unsaved changes."))
unsaved.setStandardButtons(QMessageBox.Cancel | QMessageBox.StandardButton.Discard)
result = unsaved.exec()
if result == QMessageBox.StandardButton.Cancel:
return
highlighters = []
for index in range(0, self.list.count()):
item: PayloadItem = self.list.item(index)
highlighters.append(item.payload)
Highlighting.write_config(self._settings, highlighters)
self.close()
def _selection_changed(self):
if len(self.list.selectedIndexes()) == 0:
self.btn_update.setDisabled(True)
self.btn_delete.setDisabled(True)
self.btn_move_up.setDisabled(True)
self.btn_move_down.setDisabled(True)
if len(self.list.selectedIndexes()) == 1:
selected_index = self.list.selectedIndexes()[0].row()
self.btn_update.setDisabled(False)
self.btn_delete.setDisabled(False)
self.btn_move_up.setDisabled(selected_index == 0)
self.btn_move_down.setDisabled(selected_index + 1 >= self.list.count())
item: PayloadItem = self.list.item(selected_index)
highlighter: HighlightRegex = item.payload
self.query.setText(highlighter.query)
self.ignore_case.setChecked(highlighter.ignore_case)
self.is_regex.setChecked(highlighter.is_regex)
self.hit_background_color.set_color(highlighter.hit_background_color)
self.line_background_color.set_color(highlighter.line_background_color)
def _is_dirty(self):
if len(self.list.selectedIndexes()) == 0:
dirty = False
if len(self.list.selectedIndexes()) == 1:
item: PayloadItem = self.list.currentItem()
highlighter: HighlightRegex = item.payload
dirty = self.query.text() != highlighter.query \
or self.ignore_case.isChecked() != highlighter.ignore_case \
or self.is_regex.isChecked() != highlighter.is_regex \
or self.hit_background_color.color != highlighter.hit_background_color \
or self.line_background_color.color != highlighter.line_background_color
else:
dirty = False
return dirty
def _load_existing_hightlighters(self):
highlighters: [HighlightRegex] = Highlighting.read_config(self._settings)
first_item = None
for highlighter in highlighters:
item = PayloadItem(str(highlighter.query))
item.payload = highlighter
item.setBackground(highlighter.hit_background_brush())
self.list.addItem(item)
if not first_item:
first_item = item

View File

@@ -19,7 +19,7 @@ class NewHighlightingDialog(QDialog):
super(NewHighlightingDialog, self).__init__()
self.setWindowTitle(_("Manage Highlighting"))
self.setModal(True)
self.setMinimumWidth(700)
self.setMinimumWidth(720)
self.setMinimumHeight(600)
self._settings = settings
@@ -117,7 +117,8 @@ class NewHighlightingDialog(QDialog):
self.list.setCurrentItem(item)
def _new_highlighter(self):
highlight_regex = HighlightRegex("", ignore_case=True, is_regex=True, hit_background_color="ccb400")
highlight_regex = HighlightRegex("", ignore_case=True, is_regex=True, hit_background_color="ccb400",
line_background_color="fff080")
self._add_highlight_regex_to_list(highlight_regex, select=True)

View File

@@ -50,7 +50,7 @@ class ColorButton(QWidget):
if color == color_name or color == color_value:
self.color_drop_down.setCurrentIndex(self.color_drop_down.count() - 1)
self.btn_color_picker = QPushButton(QIcon.fromTheme("color-picker"), _(""))
self.btn_color_picker = QPushButton(QIcon.fromTheme("color-picker"), "")
self.layout.addWidget(self.btn_color_picker)
self.btn_color_picker.pressed.connect(self._update_color)
self.btn_color_picker.setSizePolicy(QSizePolicy(QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Fixed))