17 |
17 |
18 class ViewProfileDialog(QDialog): |
18 class ViewProfileDialog(QDialog): |
19 """ |
19 """ |
20 Class implementing a dialog to configure the various view profiles. |
20 Class implementing a dialog to configure the various view profiles. |
21 """ |
21 """ |
22 def __init__(self, layout, editVisibilities, debugVisibilities, parent=None): |
22 def __init__(self, layout, editVisibilities, debugVisibilities, |
|
23 parent=None): |
23 """ |
24 """ |
24 Constructor |
25 Constructor |
25 |
26 |
26 @param layout type of the window layout (string) |
27 @param layout type of the window layout (string) |
27 @param editVisibilities list of flags giving the visibilities |
28 @param editVisibilities list of flags giving the visibilities |
28 of the various parts for the 'edit' view profile (list of boolean) |
29 of the various parts for the 'edit' view profile (list of boolean) |
29 @param debugVisibilities list of flags giving the visibilities |
30 @param debugVisibilities list of flags giving the visibilities |
30 of the various parts for the 'debug' view profile (list of boolean) |
31 of the various parts for the 'debug' view profile (list of boolean) |
31 @param parent parent widget of this dialog (QWidget) |
32 @param parent parent widget of this dialog (QWidget) |
|
33 @exception ValueError raised to indicate an invalid layout |
32 """ |
34 """ |
33 super(ViewProfileDialog, self).__init__(parent) |
35 super(ViewProfileDialog, self).__init__(parent) |
34 |
36 |
35 self.__layout = layout |
37 self.__layout = layout |
36 if self.__layout == "Toolboxes": |
38 if self.__layout == "Toolboxes": |
37 self.ui = Ui_ViewProfileToolboxesDialog() |
39 self.ui = Ui_ViewProfileToolboxesDialog() |
38 elif self.__layout == "Sidebars": |
40 elif self.__layout == "Sidebars": |
39 self.ui = Ui_ViewProfileSidebarsDialog() |
41 self.ui = Ui_ViewProfileSidebarsDialog() |
40 else: |
42 else: |
41 raise ValueError("Illegal layout given ({0}).".format(self.__layout)) |
43 raise ValueError( |
|
44 "Illegal layout given ({0}).".format(self.__layout)) |
42 self.ui.setupUi(self) |
45 self.ui.setupUi(self) |
43 |
46 |
44 if self.__layout in ["Toolboxes", "Sidebars"]: |
47 if self.__layout in ["Toolboxes", "Sidebars"]: |
45 # set the edit profile |
48 # set the edit profile |
46 self.ui.epltCheckBox.setChecked(editVisibilities[0]) |
49 self.ui.epltCheckBox.setChecked(editVisibilities[0]) |