fix exporting and importing from file
This commit is contained in:
@@ -4,6 +4,7 @@ from PySide6.QtWidgets import QLabel, QMainWindow
|
||||
from sqlalchemy import Engine
|
||||
from kontor_schema import KontorDB
|
||||
|
||||
from .comic_window import ComicWindow
|
||||
from .progress import ProgressUpdate
|
||||
from .dialogs import ExportKontorDialog, ImportKontorDialog
|
||||
from .model_config import KontorModelConfig
|
||||
@@ -34,6 +35,8 @@ class MainWindow(QMainWindow):
|
||||
self.filter = {}
|
||||
self.kontor_db = KontorDB(engine, log)
|
||||
self.log = log
|
||||
|
||||
self.comic_window = ComicWindow(self)
|
||||
self.central_widget = QWidget()
|
||||
parent_layout = QVBoxLayout()
|
||||
self.central_widget.setLayout(parent_layout)
|
||||
@@ -52,6 +55,8 @@ class MainWindow(QMainWindow):
|
||||
self.newAction = QAction("&New", self)
|
||||
self.aboutAction = QAction("&Über...", self)
|
||||
self.aboutAction.triggered.connect(self.about)
|
||||
self.showComicWindow = QAction("Show/Hide &Comic Window", self)
|
||||
self.showComicWindow.triggered.connect(self.show_comic_window)
|
||||
self.importAction = QAction(self.import_icon, "&Import", self)
|
||||
self.importAction.triggered.connect(self.import_from_file)
|
||||
self.exportAction = QAction(self.export_icon, "&Export", self)
|
||||
@@ -80,6 +85,7 @@ class MainWindow(QMainWindow):
|
||||
kontor_menu.addAction(self.importAction)
|
||||
kontor_menu.addAction(self.exportAction)
|
||||
comic_menu = QMenu("&Comic")
|
||||
comic_menu.addAction(self.showComicWindow)
|
||||
tysc_menu = QMenu("&TradeYourSportCards")
|
||||
media_file_menu = QMenu("&MediaFile")
|
||||
media_file_menu.addAction(self.updateTitleAction)
|
||||
@@ -110,12 +116,18 @@ class MainWindow(QMainWindow):
|
||||
def about(self):
|
||||
QMessageBox.about(self.central_widget, "Über Kontor", f"Python: 3.11\nKontor: 0.1.0")
|
||||
|
||||
def show_comic_window(self):
|
||||
if self.comic_window.isHidden():
|
||||
self.comic_window.show()
|
||||
else:
|
||||
self.comic_window.hide()
|
||||
|
||||
def import_from_file(self):
|
||||
import_dlg = ImportKontorDialog(self)
|
||||
if import_dlg.exec():
|
||||
print(f"import DB from file {import_dlg.file_name}")
|
||||
else:
|
||||
print("no nothing for import")
|
||||
print("do nothing for import")
|
||||
pass
|
||||
|
||||
def export_to_file(self):
|
||||
|
||||
Reference in New Issue
Block a user