diff --git a/DebugVarEdit.exe b/DebugVarEdit.exe index 5c82030..2f1d2d2 100644 Binary files a/DebugVarEdit.exe and b/DebugVarEdit.exe differ diff --git a/Src/setupVars_GUI.py b/Src/setupVars_GUI.py index d13404e..4275812 100644 --- a/Src/setupVars_GUI.py +++ b/Src/setupVars_GUI.py @@ -161,6 +161,9 @@ class VarEditor(QWidget): self.btn_add_vars = QPushButton("Add Variables") self.btn_add_vars.clicked.connect(self.__open_variable_selector) + # Кнопка открыть output-файл с выбором программы + btn_open_output = QPushButton("Открыть Output File...") + btn_open_output.clicked.connect(self.__open_output_file_with_program) # Таблица self.table = VariableTableWidget() # Основной layout @@ -173,6 +176,7 @@ class VarEditor(QWidget): layout.addWidget(self.btn_add_vars) layout.addLayout(source_output_layout) layout.addWidget(btn_save) + layout.addWidget(btn_open_output) self.setLayout(layout) @@ -564,6 +568,26 @@ class VarEditor(QWidget): except Exception as e: print(f"Ошибка при сохранении XML: {e}") + def __open_output_file_with_program(self): + output_path = self.get_output_path() + if not output_path: + QMessageBox.warning(self, "Ошибка", "Путь к output-файлу не задан.") + return + + output_file = os.path.join(output_path, "debug_vars.c") + if not os.path.isfile(output_file): + QMessageBox.warning(self, "Ошибка", f"Файл не найден:\n{output_file}") + return + + try: + # Открыть стандартное окно Windows "Открыть с помощью..." + subprocess.run([ + "rundll32.exe", + "shell32.dll,OpenAs_RunDLL", + output_file + ], shell=False) + except Exception as e: + QMessageBox.critical(self, "Ошибка", f"Не удалось открыть диалог 'Открыть с помощью':\n{e}")