1515 QWidget ,
1616)
1717
18- from ..Constants .packaging_constants import *
18+ from ..Constants .packaging_constants import PyinstallerArgs
1919from .arguments_browser import ArgumentsBrowser
2020from .dialog_widgets import IconFileDlg , ScriptFileDlg
2121
@@ -28,9 +28,9 @@ class CenterWidget(QWidget):
2828 # 自定义信号
2929 option_selected = QtCore .Signal (tuple ) # 用户通过界面控件选择选项后发射此信号
3030
31- def __init__ (self , parent : QMainWindow = None ) -> None :
31+ def __init__ (self , parent : QMainWindow ) -> None :
3232 """
33- :param parent: 父控件对象,应为主窗口
33+ :param parent: 父控件对象,应为主程序
3434 """
3535
3636 super (CenterWidget , self ).__init__ (parent )
@@ -166,11 +166,21 @@ def icon_file_selected(file_path: str) -> None:
166166
167167 self .option_selected .emit ((PyinstallerArgs .icon_path , file_path ))
168168
169+ @QtCore .Slot ()
170+ def run_packaging () -> None :
171+ """
172+ “运行打包”按钮的槽函数 \n
173+ """
174+
175+ self .parent ().packager .run_packaging_process ()
176+ self .parent ().subprocess_dlg .show ()
177+
169178 # 连接信号与槽
170179 self .script_browse_btn .clicked .connect (self .script_file_dlg .open ) # type: ignore
171180 self .script_file_dlg .fileSelected .connect (script_file_selected ) # type: ignore
172181 self .project_name_le .editingFinished .connect (project_name_selected ) # type: ignore
173182 self .fd_group .idClicked .connect (one_fd_selected ) # type: ignore
183+ self .run_packaging_btn .clicked .connect (run_packaging ) # type: ignore
174184
175185 if self .parent ().running_platform in ("Windows" , "macOS" ):
176186 self .icon_browse_btn .clicked .connect (self .icon_file_dlg .open ) # type: ignore
0 commit comments