30 @param parent parent widget of this dialog (QWidget) |
30 @param parent parent widget of this dialog (QWidget) |
31 @exception ValueError raised to indicate an invalid layout |
31 @exception ValueError raised to indicate an invalid layout |
32 """ |
32 """ |
33 super(ViewProfileDialog, self).__init__(parent) |
33 super(ViewProfileDialog, self).__init__(parent) |
34 |
34 |
|
35 if layout not in ("Toolboxes", "Sidebars"): |
|
36 raise ValueError( |
|
37 "Illegal layout given ({0}).".format(self.__layout)) |
|
38 |
35 self.__layout = layout |
39 self.__layout = layout |
36 if self.__layout == "Toolboxes": |
40 if self.__layout == "Toolboxes": |
37 self.ui = Ui_ViewProfileToolboxesDialog() |
41 self.ui = Ui_ViewProfileToolboxesDialog() |
38 elif self.__layout == "Sidebars": |
42 else: |
39 self.ui = Ui_ViewProfileSidebarsDialog() |
43 self.ui = Ui_ViewProfileSidebarsDialog() |
40 else: |
|
41 raise ValueError( |
|
42 "Illegal layout given ({0}).".format(self.__layout)) |
|
43 self.ui.setupUi(self) |
44 self.ui.setupUi(self) |
44 |
45 |
45 if self.__layout in ["Toolboxes", "Sidebars"]: |
46 if self.__layout in ["Toolboxes", "Sidebars"]: |
46 # set the edit profile |
47 # set the edit profile |
47 self.ui.epltCheckBox.setChecked(editVisibilities[0]) |
48 self.ui.epltCheckBox.setChecked(editVisibilities[0]) |