mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
MainWindow: Add minimal info tab.
This commit is contained in:
1 parent
a18fd29795
commit
3e085dd7c6
6 files changed
+403
-3
No files matched your search
+30
-3
@@ -34,7 +34,7 @@ from PyQt5.QtCore import (
|
||||
from PyQt5.QtWidgets import (
|
||||
QMainWindow, QApplication, QAction,
|
||||
QFileDialog, QShortcut, QMenu, QToolBar,
|
||||
QMessageBox, QProgressDialog,
|
||||
QMessageBox, QProgressDialog, QTabWidget,
|
||||
)
|
||||
from PyQt5.uic import loadUi
|
||||
|
||||
@@ -44,6 +44,8 @@ from View.DummyWindow import DummyWindow
|
||||
|
||||
from View.Translate import MainTranslate
|
||||
|
||||
from View.MainWindowTabInfo import WidgetInfo
|
||||
|
||||
from View.Configure.Window import ConfigureWindow
|
||||
from View.Study.Window import NewStudyWindow
|
||||
from View.About.Window import AboutWindow
|
||||
@@ -143,6 +145,7 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
|
||||
self
|
||||
)
|
||||
|
||||
self.setup_tab()
|
||||
self.setup_sc()
|
||||
self.setup_connection()
|
||||
self.default_style()
|
||||
@@ -167,6 +170,21 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
|
||||
title += "Pamhyr2"
|
||||
self.setWindowTitle(title)
|
||||
|
||||
def setup_tab(self):
|
||||
self.setup_tab_info()
|
||||
|
||||
def setup_tab_info(self):
|
||||
tab_widget = self.findChild(QTabWidget, "tabWidget")
|
||||
|
||||
self._tab_widget_info = WidgetInfo(
|
||||
study=self._study, parent=self
|
||||
)
|
||||
|
||||
tab_widget.addTab(
|
||||
self._tab_widget_info,
|
||||
self._trad["tab_info_name"]
|
||||
)
|
||||
|
||||
def enable_actions(self, action: str, enable: bool):
|
||||
"""Enable of disable an action componant
|
||||
|
||||
@@ -348,6 +366,8 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
|
||||
logger.debug(f"Propagation keys: {self._propagation_keys}")
|
||||
|
||||
def _do_propagate_update(self):
|
||||
self.update()
|
||||
|
||||
keys = self._propagation_keys.copy()
|
||||
self._init_propagation_keys()
|
||||
|
||||
@@ -361,6 +381,12 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
|
||||
for _, window in self.sub_win_list:
|
||||
window._propagated_update(key=key)
|
||||
|
||||
def update(self):
|
||||
self.set_title()
|
||||
|
||||
self._tab_widget_info.study = self._study
|
||||
self._tab_widget_info.update()
|
||||
|
||||
#########
|
||||
# MODEL #
|
||||
#########
|
||||
@@ -372,14 +398,15 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
|
||||
self._study = model
|
||||
self.update_enable_action()
|
||||
self.conf.set_last_study(self._study.filename)
|
||||
self.set_title()
|
||||
|
||||
self.update()
|
||||
|
||||
def close_model(self):
|
||||
self._study = None
|
||||
self.update_enable_action()
|
||||
self.conf.set_close_correctly()
|
||||
self.set_title()
|
||||
|
||||
self.update()
|
||||
self._close_sub_window()
|
||||
|
||||
def update_enable_action(self):
|
||||
|
||||
Reference in new issue
Block a user