cleanup
This commit is contained in:
20
main.py
20
main.py
@@ -11,7 +11,6 @@ import sys
|
||||
import urlutils
|
||||
from aboutdialog import AboutDialog
|
||||
from ravenui import RavenUI
|
||||
from settings import Settings
|
||||
from settingsstore import SettingsStore
|
||||
from tabs import Tabs
|
||||
from urlutils import url_is_file
|
||||
@@ -38,20 +37,12 @@ class MainWindow(QMainWindow):
|
||||
self.tabs.create_tab("/home/andi/ws/ravenlog/example.log")
|
||||
self.tabs.create_tab("/var/log/syslog")
|
||||
|
||||
self._menu_recent_files = QMenu(self.tr("Open &Recent"), self)
|
||||
|
||||
self.setCentralWidget(self.tabs)
|
||||
# self.main_tool_bar = self.create_main_tool_bar()
|
||||
# self.addToolBar(self.main_tool_bar)
|
||||
self.setStatusBar(QStatusBar(self))
|
||||
self.setMenuBar(self.create_menu_bar())
|
||||
|
||||
def create_main_tool_bar(self):
|
||||
result = QToolBar("main toolbar")
|
||||
return result
|
||||
|
||||
def update_font_size(self, font_size):
|
||||
self.settings.font_size(int(font_size))
|
||||
self.tabs.update()
|
||||
|
||||
def create_menu_bar(self) -> QMenuBar:
|
||||
menu_bar = QMenuBar()
|
||||
|
||||
@@ -69,7 +60,6 @@ class MainWindow(QMainWindow):
|
||||
close_action = QAction(self.tr("E&xit", "menu item to close the application"), self)
|
||||
close_action.triggered.connect(self.destruct)
|
||||
|
||||
self._menu_recent_files = QMenu(self.tr("Open &Recent"), self)
|
||||
self._update_recent_files_menu()
|
||||
|
||||
file_menu.addAction(open_file)
|
||||
@@ -81,7 +71,7 @@ class MainWindow(QMainWindow):
|
||||
help_menu = QMenu(self.tr("&Help", "name of the help menu"), self)
|
||||
|
||||
about_action = QAction(self.tr("&About"), self)
|
||||
about_action.triggered.connect(self._open_about_dialog)
|
||||
about_action.triggered.connect(lambda: AboutDialog().exec())
|
||||
help_menu.addAction(about_action)
|
||||
|
||||
return help_menu
|
||||
@@ -94,10 +84,6 @@ class MainWindow(QMainWindow):
|
||||
action.triggered.connect(lambda x, f=file: self._open_file(f))
|
||||
self._menu_recent_files.addAction(action)
|
||||
|
||||
def _open_about_dialog(self):
|
||||
dialog = AboutDialog()
|
||||
dialog.exec()
|
||||
|
||||
def _open_file_dialog(self) -> None:
|
||||
current_file = self.tabs.current_file()
|
||||
directory = os.path.dirname(current_file) if current_file else ''
|
||||
|
||||
Reference in New Issue
Block a user