diff --git a/meggie/configuration.json b/meggie/configuration.json index a416d87b..706c6efd 100644 --- a/meggie/configuration.json +++ b/meggie/configuration.json @@ -1,4 +1,5 @@ { + "id": "meggie", "tabs": [ {"id": "preprocessing", "name": "Preprocessing", diff --git a/meggie/mainwindow/dynamic.py b/meggie/mainwindow/dynamic.py index b954dbcc..bd1bf9df 100644 --- a/meggie/mainwindow/dynamic.py +++ b/meggie/mainwindow/dynamic.py @@ -51,13 +51,16 @@ def find_all_package_specs(): continue with open(config_path, "r") as f: config = json.load(f) - if config: + if config and config.get("id"): package_specs[source] = config # add possibly missing fields for package_spec in package_specs.values(): if "name" not in package_spec: - package_spec["name"] = "" + package_spec["name"] = package_spec["id"] + + if "description" not in package_spec: + package_spec["description"] = package_spec.get("name", "") if "author" not in package_spec: package_spec["author"] = "" @@ -282,11 +285,13 @@ def __init__(self, parent): action_spec = self.action_specs[action_name][2] title = action_spec["name"] + description = action_spec.get("description", "") pushButtonInputActionElement = QtWidgets.QPushButton( self.groupBoxInputActions ) pushButtonInputActionElement.setText(title) + pushButtonInputActionElement.setToolTip(description) self.gridLayoutInputActions.addWidget( pushButtonInputActionElement, idx, 0, 1, 1 ) @@ -310,11 +315,13 @@ def __init__(self, parent): action_spec = self.action_specs[action_name][2] title = action_spec["name"] + description = action_spec.get("description", "") pushButtonOutputActionElement = QtWidgets.QPushButton( self.groupBoxOutputActions ) pushButtonOutputActionElement.setText(title) + pushButtonOutputActionElement.setToolTip(description) self.gridLayoutOutputActions.addWidget( pushButtonOutputActionElement, idx, 0, 1, 1 ) @@ -458,10 +465,12 @@ def connect_to_handler(button, name): def handler_wrapper(checked): experiment = self.parent.experiment if not experiment: + messagebox(self, "You need to open an experiment first.") return subject = experiment.active_subject if not subject: + messagebox(self, "You need to activate a subject first.") return data = self._get_data()