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, profiles, separateShell, separateBrowser, parent=None): |
22 def __init__(self, layout, editVisibilities, debugVisibilities, parent=None): |
23 """ |
23 """ |
24 Constructor |
24 Constructor |
25 |
25 |
26 @param layout type of the window layout (string) |
26 @param layout type of the window layout (string) |
27 @param profiles dictionary of tuples containing the visibility |
27 @param editVisibilities list of flags giving the visibilities |
28 of the windows for the various profiles |
28 of the various parts for the 'edit' view profile (list of boolean) |
29 @param separateShell flag indicating that the Python shell |
29 @param debugVisibilities list of flags giving the visibilities |
30 is a separate window (boolean) |
30 of the various parts for the 'debug' view profile (list of boolean) |
31 @param separateBrowser flag indicating that the file browser |
|
32 is a separate window (boolean) |
|
33 @param parent parent widget of this dialog (QWidget) |
31 @param parent parent widget of this dialog (QWidget) |
34 """ |
32 """ |
35 super(ViewProfileDialog, self).__init__(parent) |
33 super(ViewProfileDialog, self).__init__(parent) |
36 |
34 |
37 self.__layout = layout |
35 self.__layout = layout |
41 self.ui = Ui_ViewProfileSidebarsDialog() |
39 self.ui = Ui_ViewProfileSidebarsDialog() |
42 else: |
40 else: |
43 raise ValueError("Illegal layout given ({0}).".format(self.__layout)) |
41 raise ValueError("Illegal layout given ({0}).".format(self.__layout)) |
44 self.ui.setupUi(self) |
42 self.ui.setupUi(self) |
45 |
43 |
46 self.profiles = profiles |
|
47 |
|
48 if self.__layout in ["Toolboxes", "Sidebars"]: |
44 if self.__layout in ["Toolboxes", "Sidebars"]: |
49 # set the edit profile |
45 # set the edit profile |
50 profile = self.profiles["edit"][5] |
46 self.ui.epltCheckBox.setChecked(editVisibilities[0]) |
51 self.ui.epltCheckBox.setChecked(profile[0]) |
47 self.ui.ephtCheckBox.setChecked(editVisibilities[1]) |
52 self.ui.ephtCheckBox.setChecked(profile[1]) |
48 self.ui.eprtCheckBox.setChecked(editVisibilities[2]) |
53 self.ui.eprtCheckBox.setChecked(profile[2]) |
|
54 |
49 |
55 # set the debug profile |
50 # set the debug profile |
56 profile = self.profiles["debug"][5] |
51 self.ui.dpltCheckBox.setChecked(debugVisibilities[0]) |
57 self.ui.dpltCheckBox.setChecked(profile[0]) |
52 self.ui.dphtCheckBox.setChecked(debugVisibilities[1]) |
58 self.ui.dphtCheckBox.setChecked(profile[1]) |
53 self.ui.dprtCheckBox.setChecked(debugVisibilities[2]) |
59 self.ui.dprtCheckBox.setChecked(profile[2]) |
|
60 |
54 |
61 def getProfiles(self): |
55 def getVisibilities(self): |
62 """ |
56 """ |
63 Public method to retrieve the configured profiles. |
57 Public method to retrieve the visibilities configuration. |
64 |
58 |
65 @return dictionary of tuples containing the visibility |
59 @return tuple of two lists giving the visibilities of the |
66 of the windows for the various profiles |
60 various parts ( two lists of boolean) |
67 """ |
61 """ |
68 if self.__layout in ["Toolboxes", "Sidebars"]: |
62 if self.__layout in ["Toolboxes", "Sidebars"]: |
69 # get the edit profile |
63 return ( |
70 self.profiles["edit"][5] = [ |
64 # edit profile |
71 self.ui.epltCheckBox.isChecked(), |
65 [ |
72 self.ui.ephtCheckBox.isChecked(), |
66 self.ui.epltCheckBox.isChecked(), |
73 self.ui.eprtCheckBox.isChecked(), |
67 self.ui.ephtCheckBox.isChecked(), |
74 ] |
68 self.ui.eprtCheckBox.isChecked(), |
75 # get the debug profile |
69 ], |
76 self.profiles["debug"][5] = [ |
70 # debug profile |
77 self.ui.dpltCheckBox.isChecked(), |
71 [ |
78 self.ui.dphtCheckBox.isChecked(), |
72 self.ui.dpltCheckBox.isChecked(), |
79 self.ui.dprtCheckBox.isChecked(), |
73 self.ui.dphtCheckBox.isChecked(), |
80 ] |
74 self.ui.dprtCheckBox.isChecked(), |
81 |
75 ] |
82 return self.profiles |
76 ) |