diff --git a/src/gui/ALCheckUpdateDialog.py b/src/gui/ALCheckUpdateDialog.py index 99494e1..17ba6a3 100644 --- a/src/gui/ALCheckUpdateDialog.py +++ b/src/gui/ALCheckUpdateDialog.py @@ -73,9 +73,9 @@ class ALCheckUpdateDialog(QDialog): ) TitleLabel.setTextFormat(Qt.TextFormat.RichText) TitleLabel.setText( - f"检测到最新版本: " - f"{self.__current_version}" - f" > " + f"检测到新版本: " + f"{self.__current_version} " + f"> " f"{self.__latest_version}" ) layout.addWidget(TitleLabel) @@ -83,8 +83,7 @@ class ALCheckUpdateDialog(QDialog): InfoLabel.setTextFormat(Qt.TextFormat.RichText) InfoLabel.setWordWrap(True) InfoLabel.setText( - f"发布版本: {self.__tag_name}
" - f"发布页面: {self.__html_url}" + f"最新版本: {self.__tag_name}
" ) InfoLabel.setOpenExternalLinks(True) layout.addWidget(InfoLabel) @@ -94,14 +93,26 @@ class ALCheckUpdateDialog(QDialog): "前往 GitHub", QDialogButtonBox.ButtonRole.AcceptRole ) + self.__btn_github.setMinimumWidth(100) + self.__btn_github.setMaximumWidth(100) + self.__btn_github.setMinimumHeight(25) + self.__btn_github.setMaximumHeight(25) self.__btn_download = self.__button_box.addButton( "官网下载", QDialogButtonBox.ButtonRole.ActionRole ) + self.__btn_download.setMinimumWidth(80) + self.__btn_download.setMaximumWidth(80) + self.__btn_download.setMinimumHeight(25) + self.__btn_download.setMaximumHeight(25) self.__btn_cancel = self.__button_box.addButton( "取消", QDialogButtonBox.ButtonRole.RejectRole ) + self.__btn_cancel.setMinimumWidth(80) + self.__btn_cancel.setMaximumWidth(80) + self.__btn_cancel.setMinimumHeight(25) + self.__btn_cancel.setMaximumHeight(25) layout.addWidget(self.__button_box) def buildUpToDateUi( @@ -117,7 +128,9 @@ class ALCheckUpdateDialog(QDialog): TitleLabel.setText(f"已是最新版本 !") layout.addWidget(TitleLabel) InfoLabel = QLabel() - InfoLabel.setText(f"当前版本: {self.__current_version}") + InfoLabel.setText( + f"当前版本: {self.__current_version}
" + ) layout.addWidget(InfoLabel) layout.addStretch() self.__button_box = QDialogButtonBox() @@ -125,6 +138,10 @@ class ALCheckUpdateDialog(QDialog): "确定", QDialogButtonBox.ButtonRole.AcceptRole ) + self.__btn_close.setMinimumWidth(80) + self.__btn_close.setMaximumWidth(80) + self.__btn_close.setMinimumHeight(25) + self.__btn_close.setMaximumHeight(25) layout.addWidget(self.__button_box) def connectSignals( diff --git a/src/gui/ALSettingsWidget.py b/src/gui/ALSettingsWidget.py index 60cee65..b3db6bd 100644 --- a/src/gui/ALSettingsWidget.py +++ b/src/gui/ALSettingsWidget.py @@ -116,6 +116,8 @@ class ALSettingsWidget(CenterOnParentMixin, QWidget, Ui_ALSettingsWidget): event: QCloseEvent ): + if hasattr(self, '__bulletin_test_worker') and self.__bulletin_test_worker is not None: + self.__bulletin_test_worker.wait(3000) self.settingsWidgetIsClosed.emit() super().closeEvent(event) @@ -485,25 +487,26 @@ class ALSettingsWidget(CenterOnParentMixin, QWidget, Ui_ALSettingsWidget): self, api_url, {"date": "", "time": "", "range_hour": "1"} ) self.__bulletin_test_worker.fetchWorkerIsFinished.connect( - self.onBulletinTestFetched + self.onBulletinTestIsFinished ) self.__bulletin_test_worker.fetchWorkerFinishedWithError.connect( - self.onBulletinTestError + self.onBulletinTestFinishedWithError ) self.__bulletin_test_worker.start() @Slot(dict) - def onBulletinTestFetched( + def onBulletinTestIsFinished( self, data: dict ): self.__bulletin_test_worker.fetchWorkerIsFinished.disconnect( - self.onBulletinTestFetched + self.onBulletinTestIsFinished ) self.__bulletin_test_worker.fetchWorkerFinishedWithError.disconnect( - self.onBulletinTestError + self.onBulletinTestFinishedWithError ) + self.__bulletin_test_worker.wait(3000) self.__bulletin_test_worker.deleteLater() self.__bulletin_test_worker = None elapsed_ms = (time.monotonic() - self.__bulletin_test_t0) * 1000 @@ -515,17 +518,18 @@ class ALSettingsWidget(CenterOnParentMixin, QWidget, Ui_ALSettingsWidget): QTimer.singleShot(3000, self, self.clearBulletinTestStatus) @Slot(str) - def onBulletinTestError( + def onBulletinTestFinishedWithError( self, error_message: str ): self.__bulletin_test_worker.fetchWorkerIsFinished.disconnect( - self.onBulletinTestFetched + self.onBulletinTestIsFinished ) self.__bulletin_test_worker.fetchWorkerFinishedWithError.disconnect( - self.onBulletinTestError + self.onBulletinTestFinishedWithError ) + self.__bulletin_test_worker.wait(3000) self.__bulletin_test_worker.deleteLater() self.__bulletin_test_worker = None self.BulletinTestStatusLabel.setText(f"连接失败:{error_message}")