35 from python_qt_binding
import loadUi
36 from python_qt_binding.QtCore
import qWarning
37 from python_qt_binding.QtWidgets
import QDialog, QLabel
38 from rospkg.rospack
import RosPack
40 from .checkbox_group
import CheckBoxGroup
41 from .exclusive_options_group
import ExclusiveOptionGroup
45 """Simple dialog that can show multiple settings groups and returns their combined results."""
47 def __init__(self, title='Options', description=None):
48 super(SimpleSettingsDialog, self).
__init__()
49 self.setObjectName(
'SimpleSettingsDialog')
52 ui_file = os.path.join(
53 rp.get_path(
'qt_gui_py_common'),
'resource',
'simple_settings_dialog.ui')
56 self.setWindowTitle(title)
59 if description
is not None:
63 self.group_area.layout().addWidget(QLabel(text))
66 """Add an ExclusiveOptionGroup."""
70 """Add a CheckBoxGroup."""
74 """Add a settings group, which is any widget with a get_settings method."""
75 if not hasattr(settings_group,
'get_settings'):
77 'add_settings_group(): this settings group has no get_settings method to collect the settings!')
79 self.group_area.layout().addWidget(settings_group)
82 """Return the combined settings from all settings groups as a list."""
83 if self.exec_() == QDialog.Accepted:
86 if hasattr(settings_group,
'get_settings'):
87 results.append(settings_group.get_settings())