From e27bc9b3a9e6e0d774bea3936173fd000848d6c2 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sat, 7 Feb 2015 04:27:02 +0000 Subject: [PATCH] Allow New,Open&SaveAs (Export) in carla plugin; Hide engine menu --- source/carla_host.py | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/source/carla_host.py b/source/carla_host.py index 0235662bb..6f8dc5bd1 100644 --- a/source/carla_host.py +++ b/source/carla_host.py @@ -149,12 +149,19 @@ class HostWindow(QMainWindow): # Set up GUI (engine stopped) if self.host.isPlugin: + self.ui.act_file_save.setVisible(False) + self.ui.act_file_save_as.setText(self.tr("Export as...")) self.ui.act_engine_start.setEnabled(False) + self.ui.act_engine_start.setVisible(False) + self.ui.act_engine_stop.setEnabled(False) + self.ui.act_engine_stop.setVisible(False) self.ui.menu_Engine.setEnabled(False) + self.ui.menu_Engine.setVisible(False) + self.ui.menu_Engine.menuAction().setVisible(False) else: self.ui.act_engine_start.setEnabled(True) - if self.fSessionManagerName: + if self.fSessionManagerName and not self.host.isPlugin: self.ui.act_file_new.setEnabled(False) self.ui.act_file_open.setEnabled(False) @@ -609,18 +616,16 @@ class HostWindow(QMainWindow): self.ui.act_canvas_show_external.blockSignals(False) if not self.host.isPlugin: - self.ui.act_engine_start.setEnabled(False) - self.ui.act_engine_stop.setEnabled(True) - canSave = (self.fProjectFilename and os.path.exists(self.fProjectFilename)) or not self.fSessionManagerName self.ui.act_file_save.setEnabled(canSave) - - if not self.fSessionManagerName: - self.ui.act_file_open.setEnabled(True) - self.ui.act_file_save_as.setEnabled(True) - + self.ui.act_engine_start.setEnabled(False) + self.ui.act_engine_stop.setEnabled(True) self.ui.panelTime.setEnabled(True) + if self.host.isPlugin or not self.fSessionManagerName: + self.ui.act_file_open.setEnabled(True) + self.ui.act_file_save_as.setEnabled(True) + self.startTimers() @pyqtSlot() @@ -635,16 +640,15 @@ class HostWindow(QMainWindow): self.ui.menu_Canvas.setEnabled(False) if not self.host.isPlugin: + self.ui.act_file_save.setEnabled(False) self.ui.act_engine_start.setEnabled(True) self.ui.act_engine_stop.setEnabled(False) - - if not self.fSessionManagerName: - self.ui.act_file_open.setEnabled(False) - self.ui.act_file_save.setEnabled(False) - self.ui.act_file_save_as.setEnabled(False) - self.ui.panelTime.setEnabled(False) + if self.host.isPlugin or not self.fSessionManagerName: + self.ui.act_file_open.setEnabled(False) + self.ui.act_file_save_as.setEnabled(False) + # -------------------------------------------------------------------------------------------------------- # Plugins