--- a/Preferences/ViewProfileDialog.py Mon Mar 25 18:27:06 2013 +0100 +++ b/Preferences/ViewProfileDialog.py Wed Mar 27 13:23:59 2013 +0100 @@ -17,17 +17,15 @@ """ Class implementing a dialog to configure the various view profiles. """ - def __init__(self, layout, profiles, separateShell, separateBrowser, parent=None): + def __init__(self, layout, editVisibilities, debugVisibilities, parent=None): """ Constructor @param layout type of the window layout (string) - @param profiles dictionary of tuples containing the visibility - of the windows for the various profiles - @param separateShell flag indicating that the Python shell - is a separate window (boolean) - @param separateBrowser flag indicating that the file browser - is a separate window (boolean) + @param editVisibilities list of flags giving the visibilities + of the various parts for the 'edit' view profile (list of boolean) + @param debugVisibilities list of flags giving the visibilities + of the various parts for the 'debug' view profile (list of boolean) @param parent parent widget of this dialog (QWidget) """ super().__init__(parent) @@ -41,40 +39,36 @@ raise ValueError("Illegal layout given ({0}).".format(self.__layout)) self.ui.setupUi(self) - self.profiles = profiles - if self.__layout in ["Toolboxes", "Sidebars"]: # set the edit profile - profile = self.profiles["edit"][5] - self.ui.epltCheckBox.setChecked(profile[0]) - self.ui.ephtCheckBox.setChecked(profile[1]) - self.ui.eprtCheckBox.setChecked(profile[2]) + self.ui.epltCheckBox.setChecked(editVisibilities[0]) + self.ui.ephtCheckBox.setChecked(editVisibilities[1]) + self.ui.eprtCheckBox.setChecked(editVisibilities[2]) # set the debug profile - profile = self.profiles["debug"][5] - self.ui.dpltCheckBox.setChecked(profile[0]) - self.ui.dphtCheckBox.setChecked(profile[1]) - self.ui.dprtCheckBox.setChecked(profile[2]) + self.ui.dpltCheckBox.setChecked(debugVisibilities[0]) + self.ui.dphtCheckBox.setChecked(debugVisibilities[1]) + self.ui.dprtCheckBox.setChecked(debugVisibilities[2]) - def getProfiles(self): + def getVisibilities(self): """ - Public method to retrieve the configured profiles. + Public method to retrieve the visibilities configuration. - @return dictionary of tuples containing the visibility - of the windows for the various profiles + @return tuple of two lists giving the visibilities of the + various parts ( two lists of boolean) """ if self.__layout in ["Toolboxes", "Sidebars"]: - # get the edit profile - self.profiles["edit"][5] = [ - self.ui.epltCheckBox.isChecked(), - self.ui.ephtCheckBox.isChecked(), - self.ui.eprtCheckBox.isChecked(), - ] - # get the debug profile - self.profiles["debug"][5] = [ - self.ui.dpltCheckBox.isChecked(), - self.ui.dphtCheckBox.isChecked(), - self.ui.dprtCheckBox.isChecked(), - ] - - return self.profiles + return ( + # edit profile + [ + self.ui.epltCheckBox.isChecked(), + self.ui.ephtCheckBox.isChecked(), + self.ui.eprtCheckBox.isChecked(), + ], + # debug profile + [ + self.ui.dpltCheckBox.isChecked(), + self.ui.dphtCheckBox.isChecked(), + self.ui.dprtCheckBox.isChecked(), + ] + )