Add GUI help button back by jeylau · Pull Request #2507 · DeepLabCut/DeepLabCut

17 changes: 17 additions & 0 deletions deeplabcut/gui/tabs/analyze_videos.py

Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,23 @@ def _set_page(self):
self.main_layout.addWidget(self.analyze_videos_btn, alignment=Qt.AlignRight)
self.main_layout.addWidget(self.edit_config_file_btn, alignment=Qt.AlignRight)

self.help_button = QtWidgets.QPushButton("Help")
self.help_button.clicked.connect(self.show_help_dialog)
self.main_layout.addWidget(self.help_button, alignment=Qt.AlignLeft)

def show_help_dialog(self):
dialog = QtWidgets.QDialog(self)
layout = QtWidgets.QVBoxLayout()
label = QtWidgets.QLabel(deeplabcut.analyze_videos.__doc__, self)
scroll = QtWidgets.QScrollArea()
scroll.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOn)
scroll.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
scroll.setWidgetResizable(True)
scroll.setWidget(label)
layout.addWidget(scroll)
dialog.setLayout(layout)
dialog.exec_()

def _generate_layout_single_animal(self, layout):
# Dynamic bodypart cropping
self.crop_bodyparts = QtWidgets.QCheckBox("Dynamically crop bodyparts")
Expand Down

21 changes: 21 additions & 0 deletions deeplabcut/gui/tabs/create_training_dataset.py

Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,27 @@ def __init__(self, root, parent, h1_description):

self.main_layout.addWidget(self.ok_button, alignment=Qt.AlignRight)

self.help_button = QtWidgets.QPushButton("Help")
self.help_button.clicked.connect(self.show_help_dialog)
self.main_layout.addWidget(self.help_button, alignment=Qt.AlignLeft)

def show_help_dialog(self):
dialog = QtWidgets.QDialog(self)
layout = QtWidgets.QVBoxLayout()
if self.root.is_multianimal:
func = deeplabcut.create_multianimaltraining_dataset
else:
func = deeplabcut.create_training_dataset
label = QtWidgets.QLabel(func.__doc__, self)
scroll = QtWidgets.QScrollArea()
scroll.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOn)
scroll.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
scroll.setWidgetResizable(True)
scroll.setWidget(label)
layout.addWidget(scroll)
dialog.setLayout(layout)
dialog.exec_()

def _generate_layout_attributes(self, layout):
layout.setColumnMinimumWidth(3, 300)

Expand Down

17 changes: 17 additions & 0 deletions deeplabcut/gui/tabs/create_videos.py

Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,23 @@ def _set_page(self):
self.run_button.clicked.connect(self.create_videos)
self.main_layout.addWidget(self.run_button, alignment=Qt.AlignRight)

self.help_button = QtWidgets.QPushButton("Help")
self.help_button.clicked.connect(self.show_help_dialog)
self.main_layout.addWidget(self.help_button, alignment=Qt.AlignLeft)

def show_help_dialog(self):
dialog = QtWidgets.QDialog(self)
layout = QtWidgets.QVBoxLayout()
label = QtWidgets.QLabel(deeplabcut.create_labeled_video.__doc__, self)
scroll = QtWidgets.QScrollArea()
scroll.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOn)
scroll.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
scroll.setWidgetResizable(True)
scroll.setWidget(label)
layout.addWidget(scroll)
dialog.setLayout(layout)
dialog.exec_()

def _generate_layout_multianimal(self, layout):
tmp_text = QtWidgets.QLabel("Color keypoints by:")
self.color_by_widget = QtWidgets.QComboBox()
Expand Down

17 changes: 17 additions & 0 deletions deeplabcut/gui/tabs/evaluate_network.py

Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,23 @@ def _set_page(self):
self.main_layout.addWidget(self.ev_nw_button, alignment=Qt.AlignRight)
self.main_layout.addWidget(self.opt_button, alignment=Qt.AlignRight)

self.help_button = QtWidgets.QPushButton("Help")
self.help_button.clicked.connect(self.show_help_dialog)
self.main_layout.addWidget(self.help_button, alignment=Qt.AlignLeft)

def show_help_dialog(self):
dialog = QtWidgets.QDialog(self)
layout = QtWidgets.QVBoxLayout()
label = QtWidgets.QLabel(deeplabcut.evaluate_network.__doc__, self)
scroll = QtWidgets.QScrollArea()
scroll.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOn)
scroll.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
scroll.setWidgetResizable(True)
scroll.setWidget(label)
layout.addWidget(scroll)
dialog.setLayout(layout)
dialog.exec_()

def _generate_layout_attributes(self, layout):
opt_text = QtWidgets.QLabel("Shuffle")
self.shuffle = ShuffleSpinBox(root=self.root, parent=self)
Expand Down

17 changes: 17 additions & 0 deletions deeplabcut/gui/tabs/extract_frames.py

Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,23 @@ def _set_page(self):
self.ok_button.clicked.connect(self.extract_frames)
self.main_layout.addWidget(self.ok_button, alignment=Qt.AlignRight)

self.help_button = QtWidgets.QPushButton("Help")
self.help_button.clicked.connect(self.show_help_dialog)
self.main_layout.addWidget(self.help_button, alignment=Qt.AlignLeft)

def show_help_dialog(self):
dialog = QtWidgets.QDialog(self)
layout = QtWidgets.QVBoxLayout()
label = QtWidgets.QLabel(extract_frames.__doc__, self)
scroll = QtWidgets.QScrollArea()
scroll.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOn)
scroll.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
scroll.setWidgetResizable(True)
scroll.setWidget(label)
layout.addWidget(scroll)
dialog.setLayout(layout)
dialog.exec_()

def _generate_layout_attributes(self, layout):
layout.setColumnMinimumWidth(1, 300)
# Extraction method
Expand Down

17 changes: 17 additions & 0 deletions deeplabcut/gui/tabs/extract_outlier_frames.py

Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,23 @@ def _set_page(self):
self.main_layout.addWidget(self.label_outliers_button, alignment=Qt.AlignRight)
self.main_layout.addWidget(self.merge_data_button, alignment=Qt.AlignRight)

self.help_button = QtWidgets.QPushButton("Help")
self.help_button.clicked.connect(self.show_help_dialog)
self.main_layout.addWidget(self.help_button, alignment=Qt.AlignLeft)

def show_help_dialog(self):
dialog = QtWidgets.QDialog(self)
layout = QtWidgets.QVBoxLayout()
label = QtWidgets.QLabel(deeplabcut.extract_outlier_frames.__doc__, self)
scroll = QtWidgets.QScrollArea()
scroll.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOn)
scroll.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
scroll.setWidgetResizable(True)
scroll.setWidget(label)
layout.addWidget(scroll)
dialog.setLayout(layout)
dialog.exec_()

def _generate_layout_attributes(self, layout):
# Shuffle
opt_text = QtWidgets.QLabel("Shuffle")
Expand Down

17 changes: 17 additions & 0 deletions deeplabcut/gui/tabs/refine_tracklets.py

Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,23 @@ def _set_page(self):
self.main_layout.addWidget(self.filter_tracks_button, alignment=Qt.AlignRight)
self.main_layout.addWidget(self.merge_button, alignment=Qt.AlignRight)

self.help_button = QtWidgets.QPushButton("Help")
self.help_button.clicked.connect(self.show_help_dialog)
self.main_layout.addWidget(self.help_button, alignment=Qt.AlignLeft)

def show_help_dialog(self):
dialog = QtWidgets.QDialog(self)
layout = QtWidgets.QVBoxLayout()
label = QtWidgets.QLabel(deeplabcut.stitch_tracklets.__doc__, self)
scroll = QtWidgets.QScrollArea()
scroll.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOn)
scroll.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
scroll.setWidgetResizable(True)
scroll.setWidget(label)
layout.addWidget(scroll)
dialog.setLayout(layout)
dialog.exec_()

def _generate_layout_attributes(self, layout):
# Shuffle
shuffle_text = QtWidgets.QLabel("Shuffle")
Expand Down

17 changes: 17 additions & 0 deletions deeplabcut/gui/tabs/train_network.py

Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,23 @@ def _set_page(self):
self.main_layout.addWidget(self.edit_posecfg_btn, alignment=Qt.AlignRight)
self.main_layout.addWidget(self.ok_button, alignment=Qt.AlignRight)

self.help_button = QtWidgets.QPushButton("Help")
self.help_button.clicked.connect(self.show_help_dialog)
self.main_layout.addWidget(self.help_button, alignment=Qt.AlignLeft)

def show_help_dialog(self):
dialog = QtWidgets.QDialog(self)
layout = QtWidgets.QVBoxLayout()
label = QtWidgets.QLabel(deeplabcut.train_network.__doc__, self)
scroll = QtWidgets.QScrollArea()
scroll.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOn)
scroll.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
scroll.setWidgetResizable(True)
scroll.setWidget(label)
layout.addWidget(scroll)
dialog.setLayout(layout)
dialog.exec_()

def _generate_layout_attributes(self, layout):
# Shuffle
shuffle_label = QtWidgets.QLabel("Shuffle")
Expand Down

17 changes: 17 additions & 0 deletions deeplabcut/gui/tabs/unsupervised_id_tracking.py

Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,23 @@ def _set_page(self):

self.main_layout.addWidget(self.run_transformer_button, alignment=Qt.AlignRight)

self.help_button = QtWidgets.QPushButton("Help")
self.help_button.clicked.connect(self.show_help_dialog)
self.main_layout.addWidget(self.help_button, alignment=Qt.AlignLeft)

def show_help_dialog(self):
dialog = QtWidgets.QDialog(self)
layout = QtWidgets.QVBoxLayout()
label = QtWidgets.QLabel(deeplabcut.transformer_reID.__doc__, self)
scroll = QtWidgets.QScrollArea()
scroll.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOn)
scroll.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
scroll.setWidgetResizable(True)
scroll.setWidget(label)
layout.addWidget(scroll)
dialog.setLayout(layout)
dialog.exec_()

def _generate_layout_attributes(self, layout):
# Shuffle
shuffle_label = QtWidgets.QLabel("Shuffle")
Expand Down