|
12 | 12 | from .guiassets import * |
13 | 13 |
|
14 | 14 | class MainWindow(QMainWindow, MainWindowInterface): |
| 15 | + wip_feature_warned : set[type[QWidget]] |
15 | 16 | def __init__(self): |
16 | 17 | super(MainWindow, self).__init__() |
17 | 18 | self.ui = Ui_MainWindow() |
18 | 19 | self.ui.setupUi(self) |
| 20 | + self.wip_feature_warned = set() |
19 | 21 | if ico_path := GUIAssetLoader.try_get_asset_path("preppipe.ico"): |
20 | 22 | self.setWindowIcon(QIcon(ico_path)) |
21 | 23 | self.updateTextForLanguage() |
@@ -43,6 +45,16 @@ def __init__(self): |
43 | 45 | zh_cn="打开文档", |
44 | 46 | zh_hk="打開文檔", |
45 | 47 | ) |
| 48 | + _tr_wip_feature_title = TR_gui_mainwindow.tr("wip_feature_title", |
| 49 | + en="WIP Feature", |
| 50 | + zh_cn="特性未完成", |
| 51 | + zh_hk="特性未完成", |
| 52 | + ) |
| 53 | + _tr_wip_feature_details = TR_gui_mainwindow.tr("wip_feature_details", |
| 54 | + en="This feature is still under development. The current appearance and functionality is subject to change.", |
| 55 | + zh_cn="此功能仍在开发中。目前的外观和功能随时可能被修改。", |
| 56 | + zh_hk="此功能仍在開發中。目前的外觀和功能隨時可能被修改。", |
| 57 | + ) |
46 | 58 | def updateTextForLanguage(self): |
47 | 59 | self.setWindowTitle(Translatable.tr_program_name.get()) |
48 | 60 | self.ui.menuFunctionality.setTitle(self._tr_functionality.get()) |
@@ -84,6 +96,9 @@ def requestOpen(self, info : ToolWidgetInfo) -> None: |
84 | 96 | widget.setData() |
85 | 97 | self.ui.tabWidget.addTab(widget, info.name.get() if isinstance(info.name, Translatable) else info.name) |
86 | 98 | self.ui.tabWidget.setCurrentWidget(widget) |
| 99 | + if info.is_wip_feature and info.widget not in self.wip_feature_warned: |
| 100 | + self.wip_feature_warned.add(info.widget) |
| 101 | + QMessageBox.warning(self, self._tr_wip_feature_title.get(), self._tr_wip_feature_details.get()) |
87 | 102 | return |
88 | 103 |
|
89 | 104 | def handleLanguageChange(self) -> None: |
|
0 commit comments