(self)
| 903 | w.show() |
| 904 | |
| 905 | def saveRunScript(self): |
| 906 | try: |
| 907 | writeFile( |
| 908 | QFileDialog.getSaveFileName( |
| 909 | self, |
| 910 | self.tr("MCSL2 服务器 - 保存启动脚本"), |
| 911 | f"Run {self.serverConfig.serverName}.ps1", |
| 912 | "Powershell 脚本(*.ps1)", |
| 913 | )[0], |
| 914 | self.genRunScript(save=True), |
| 915 | ) |
| 916 | except FileNotFoundError: |
| 917 | InfoBar.warning( |
| 918 | self.tr("提示"), |
| 919 | self.tr("已取消保存启动脚本"), |
| 920 | orient=Qt.Horizontal, |
| 921 | isClosable=True, |
| 922 | position=InfoBarPosition.TOP, |
| 923 | duration=1500, |
| 924 | parent=self, |
| 925 | ) |
| 926 | |
| 927 | def initSafelyQuitController(self): |
| 928 | # 安全退出控件 |
nothing calls this directly
no test coverage detected