initial commit
This commit is contained in:
59
main.py
Normal file
59
main.py
Normal file
@@ -0,0 +1,59 @@
|
||||
from PyQt6.QtWidgets import *
|
||||
from PyQt6.QtCore import *
|
||||
from PyQt6.QtGui import *
|
||||
import sys
|
||||
|
||||
from bigtext import BigText
|
||||
from logFileModel import LogFileModel
|
||||
|
||||
|
||||
class MainWindow(QMainWindow):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(MainWindow, self).__init__(*args, **kwargs)
|
||||
|
||||
self.setWindowTitle("RavenLog")
|
||||
self.setGeometry(0, 0, 640, 480)
|
||||
self.setDockNestingEnabled(True)
|
||||
|
||||
self.setCentralWidget(self.create_tabs())
|
||||
self.addToolBar(QToolBar("main toolbar"))
|
||||
self.setStatusBar(QStatusBar(self))
|
||||
self.setMenuBar(self.create_menu_bar())
|
||||
|
||||
@staticmethod
|
||||
def create_tabs() -> QTabWidget:
|
||||
tabs = QTabWidget()
|
||||
tabs.setTabsClosable(True)
|
||||
|
||||
|
||||
#model = LogFileModel("/home/andi/ws/performanceDb/data/production/logs_2018-09-06_2018-09-06.csv")
|
||||
model = LogFileModel("/home/andi/ws/ravenlog/example.log")
|
||||
big_text = BigText(model)
|
||||
tabs.addTab(big_text, QIcon("icons/tables.png"), "tables")
|
||||
|
||||
return tabs
|
||||
|
||||
def create_menu_bar(self) -> QMenuBar:
|
||||
menu_bar = QMenuBar()
|
||||
|
||||
file_menu = QMenu("File", self)
|
||||
close_action = QAction("Close", self)
|
||||
close_action.triggered.connect(self.close)
|
||||
|
||||
file_menu.addAction(close_action)
|
||||
|
||||
menu_bar.addMenu(file_menu)
|
||||
|
||||
return menu_bar
|
||||
|
||||
def onMyToolBarButtonClick(self, s) -> None:
|
||||
print("click", s)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
app = QApplication(sys.argv)
|
||||
|
||||
window = MainWindow()
|
||||
window.show()
|
||||
|
||||
app.exec()
|
||||
Reference in New Issue
Block a user