Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tooltips #42

Merged
merged 3 commits into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions meggie/configuration.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"id": "meggie",
"tabs": [
{"id": "preprocessing",
"name": "Preprocessing",
Expand Down
13 changes: 11 additions & 2 deletions meggie/mainwindow/dynamic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"] = ""
Expand Down Expand Up @@ -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
)
Expand All @@ -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
)
Expand Down Expand Up @@ -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()
Expand Down
Loading