Skip to content

Commit 67cf84d

Browse files
committed
Add WIP warning for FGUI converter tool
1 parent 0ff3e93 commit 67cf84d

4 files changed

Lines changed: 18 additions & 4 deletions

File tree

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,3 @@ thumbnails
180180

181181
# version files for pyinstaller build
182182
versionfile_*.txt
183-
184-
run_cli.py
185-
run_gui.py

src/preppipe_gui_pyside6/mainwindow.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@
1212
from .guiassets import *
1313

1414
class MainWindow(QMainWindow, MainWindowInterface):
15+
wip_feature_warned : set[type[QWidget]]
1516
def __init__(self):
1617
super(MainWindow, self).__init__()
1718
self.ui = Ui_MainWindow()
1819
self.ui.setupUi(self)
20+
self.wip_feature_warned = set()
1921
if ico_path := GUIAssetLoader.try_get_asset_path("preppipe.ico"):
2022
self.setWindowIcon(QIcon(ico_path))
2123
self.updateTextForLanguage()
@@ -43,6 +45,16 @@ def __init__(self):
4345
zh_cn="打开文档",
4446
zh_hk="打開文檔",
4547
)
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+
)
4658
def updateTextForLanguage(self):
4759
self.setWindowTitle(Translatable.tr_program_name.get())
4860
self.ui.menuFunctionality.setTitle(self._tr_functionality.get())
@@ -84,6 +96,9 @@ def requestOpen(self, info : ToolWidgetInfo) -> None:
8496
widget.setData()
8597
self.ui.tabWidget.addTab(widget, info.name.get() if isinstance(info.name, Translatable) else info.name)
8698
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())
87102
return
88103

89104
def handleLanguageChange(self) -> None:

src/preppipe_gui_pyside6/toolwidgetinterface.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class ToolWidgetInfo:
2222
icon_path : str | None = None
2323
tooltip : Translatable | None = None
2424
uniquelevel : ToolWidgetUniqueLevel = ToolWidgetUniqueLevel.SINGLE_INSTANCE_WITH_DIFFERENT_DATA
25+
is_wip_feature : bool = False # 是否是尚未开发完成的功能,是的话首次点开时会告警
2526

2627
class ToolWidgetInterface(TranslatableWidgetInterface):
2728
# 在主界面的树状结构中展示的工具的基类

src/preppipe_gui_pyside6/toolwidgets/fguiconverter.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ def getToolInfo(cls, **kwargs) -> ToolWidgetInfo:
103103
idstr="fguiconverter",
104104
name="UI资源转换",
105105
widget=cls,
106+
is_wip_feature=True,
106107
)
107108

108109

@@ -273,7 +274,7 @@ def generateRenpyUi(self):
273274
print("Ren'Py Project base dictionary does not exsit.")
274275
QMessageBox.critical(self, self._tr_unable_to_transform.get(), self._tr_output_required.get())
275276
return
276-
277+
277278
curRow = self.ui.listWidget.currentRow()
278279
if curRow >= 0:
279280
#item = self.ui.listWidget.takeItem(curRow)

0 commit comments

Comments
 (0)