diff --git a/source/carla_database.py b/source/carla_database.py index ab2f9e0a1..08b030568 100755 --- a/source/carla_database.py +++ b/source/carla_database.py @@ -315,16 +315,16 @@ def checkPluginAU(filename, tool): return runCarlaDiscovery(PLUGIN_AU, "AU", filename, tool) def checkPluginCSOUND(filename, tool): - return runCarlaDiscovery(PLUGIN_CSOUND, "CSOUND", filename, tool) + return runCarlaDiscovery(PLUGIN_FILE_CSOUND, "CSOUND", filename, tool) def checkPluginGIG(filename, tool): - return runCarlaDiscovery(PLUGIN_GIG, "GIG", filename, tool) + return runCarlaDiscovery(PLUGIN_FILE_GIG, "GIG", filename, tool) def checkPluginSF2(filename, tool): - return runCarlaDiscovery(PLUGIN_SF2, "SF2", filename, tool) + return runCarlaDiscovery(PLUGIN_FILE_SF2, "SF2", filename, tool) def checkPluginSFZ(filename, tool): - return runCarlaDiscovery(PLUGIN_SFZ, "SFZ", filename, tool) + return runCarlaDiscovery(PLUGIN_FILE_SFZ, "SFZ", filename, tool) # ------------------------------------------------------------------------------------------------------------ # Separate Thread for Plugin Search diff --git a/source/carla_host.py b/source/carla_host.py index 8bce9b2c7..f3d55282a 100644 --- a/source/carla_host.py +++ b/source/carla_host.py @@ -719,26 +719,27 @@ class HostWindow(QMainWindow): @pyqtSlot() def slot_fileOpen(self): fileFilter = self.tr("Carla Project File (*.carxp)") - filenameTry = QFileDialog.getOpenFileName(self, self.tr("Open Carla Project File"), self.fSavedSettings[CARLA_KEY_MAIN_PROJECT_FOLDER], filter=fileFilter)[0] + filenameTry = QFileDialog.getOpenFileName(self, self.tr("Open Carla Project File"), self.fSavedSettings[CARLA_KEY_MAIN_PROJECT_FOLDER], filter=fileFilter) if not filenameTry: return + filename = filenameTry if isinstance(filenameTry, str) else filenameTry[0] newFile = True if self.fContainer.getPluginCount() > 0: ask = QMessageBox.question(self, self.tr("Question"), self.tr("There are some plugins loaded, do you want to remove them now?"), QMessageBox.Yes | QMessageBox.No, QMessageBox.No) - newFile = ask == QMessageBox.Yes + newFile = (ask == QMessageBox.Yes) if newFile: self.fContainer.removeAllPlugins() - self.fProjectFilename = filenameTry + self.fProjectFilename = filename self.setProperWindowTitle() self.loadProjectNow() else: filenameOld = self.fProjectFilename - self.fProjectFilename = filenameTry + self.fProjectFilename = filename self.loadProjectNow() self.fProjectFilename = filenameOld @@ -748,16 +749,17 @@ class HostWindow(QMainWindow): return self.saveProjectNow() fileFilter = self.tr("Carla Project File (*.carxp)") - filenameTry = QFileDialog.getSaveFileName(self, self.tr("Save Carla Project File"), self.fSavedSettings[CARLA_KEY_MAIN_PROJECT_FOLDER], filter=fileFilter)[0] + filenameTry = QFileDialog.getSaveFileName(self, self.tr("Save Carla Project File"), self.fSavedSettings[CARLA_KEY_MAIN_PROJECT_FOLDER], filter=fileFilter) if not filenameTry: return + filename = filenameTry if isinstance(filenameTry, str) else filenameTry[0] - if not filenameTry.endswith(".carxp"): - filenameTry += ".carxp" + if not filename.endswith(".carxp"): + filename += ".carxp" - if self.fProjectFilename != filenameTry: - self.fProjectFilename = filenameTry + if self.fProjectFilename != filename: + self.fProjectFilename = filename self.setProperWindowTitle() self.saveProjectNow()