rename ravenlog to krowlog
There is a database named RavenDB. KrowLog starts with a K, which is a) distinctive and b) has an association to KDE.
This commit is contained in:
36
src/plugins/logfileplugin.py
Normal file
36
src/plugins/logfileplugin.py
Normal file
@@ -0,0 +1,36 @@
|
||||
import os.path
|
||||
from typing import Optional
|
||||
|
||||
from PySide6.QtWidgets import QMessageBox
|
||||
|
||||
from src.plugins.logfile.fulltabwidget import FullTabWidget
|
||||
from src.ui.bigtext.logFileModel import LogFileModel
|
||||
from src.pluginbase import PluginBase
|
||||
from src.plugins.krowlog.Tab import Tab
|
||||
from src.settings.settings import Settings
|
||||
|
||||
from src.i18n import _
|
||||
|
||||
|
||||
class LogFilePlugin(PluginBase):
|
||||
def __init__(self):
|
||||
super(LogFilePlugin, self).__init__()
|
||||
self.settings = None
|
||||
|
||||
def set_settings(self, settings: Settings):
|
||||
self.settings = settings
|
||||
|
||||
def create_tab(self, file: str) -> Optional[Tab]:
|
||||
if not os.path.isfile(file):
|
||||
message = QMessageBox(QMessageBox.Icon.Warning, _("File not found"),
|
||||
_("'{0}' is not a file or cannot be opened").format(file))
|
||||
message.exec()
|
||||
return None
|
||||
|
||||
realpath = os.path.realpath(file)
|
||||
filename = os.path.basename(realpath)
|
||||
|
||||
model = LogFileModel(file, self.settings)
|
||||
tab = FullTabWidget(model, unique_id=realpath, title=filename)
|
||||
|
||||
return tab
|
||||
Reference in New Issue
Block a user