diff --git a/statapp/main_window.py b/statapp/main_window.py index 6daa193..f3ff833 100644 --- a/statapp/main_window.py +++ b/statapp/main_window.py @@ -120,18 +120,6 @@ class MainWindow(QMainWindow): msgBox.setStandardButtons(buttons) msgBox.setDefaultButton(defaultButton) - if msgBox.button(QMessageBox.Yes) is not None: - msgBox.button(QMessageBox.Yes).setText("Да") - - if msgBox.button(QMessageBox.No) is not None: - msgBox.button(QMessageBox.No).setText("Нет") - - if msgBox.button(QMessageBox.Ok) is not None: - msgBox.button(QMessageBox.Ok).setText("Ок") - - if msgBox.button(QMessageBox.Cancel) is not None: - msgBox.button(QMessageBox.Cancel).setText("Отмена") - return msgBox def closeEvent(self, event): diff --git a/statapp/models/fileslc_model.py b/statapp/models/fileslc_model.py index da0988b..cc25980 100644 --- a/statapp/models/fileslc_model.py +++ b/statapp/models/fileslc_model.py @@ -8,7 +8,7 @@ class FileSLCModel: self.file_name = None def saveFile(self, data): - if self.file_name is None: + if not self.file_name: self.file_name, _ = QFileDialog.getSaveFileName(None, "Сохранить файл", "", "Text Files (*.txt);;CSV Files (*.csv)") if self.file_name: np.savetxt(self.file_name, data, delimiter=",") @@ -17,7 +17,7 @@ class FileSLCModel: def loadFile(self): self.file_name, _ = QFileDialog.getOpenFileName(None, "Загрузить файл", "", "Files (*.txt;*.csv)") - if self.file_name: + if not self.file_name: try: content = np.genfromtxt(self.file_name, delimiter=',', invalid_raise=True) except ValueError as e: