Preferences/ConfigurationPages/MultiProjectPage.py

Wed, 30 Dec 2009 15:40:33 +0000

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Wed, 30 Dec 2009 15:40:33 +0000
changeset 7
c679fb30c8f3
parent 0
de9c2efb9d02
child 12
1d8dd9706f46
permissions
-rw-r--r--

Change code dealing with QVariant (and QSettings) to use the PyQt4 QVariant v2 API.

# -*- coding: utf-8 -*-

# Copyright (c) 2008 - 2009 Detlev Offenbach <detlev@die-offenbachs.de>
#

"""
Module implementing the Multi Project configuration page.
"""

from ConfigurationPageBase import ConfigurationPageBase
from Ui_MultiProjectPage import Ui_MultiProjectPage

import Preferences

class MultiProjectPage(ConfigurationPageBase, Ui_MultiProjectPage):
    """
    Class implementing the Multi Project configuration page.
    """
    def __init__(self):
        """
        Constructor
        """
        ConfigurationPageBase.__init__(self)
        self.setupUi(self)
        self.setObjectName("MultiProjectPage")
        
        # set initial values
        self.openMasterAutomaticallyCheckBox.setChecked(\
            Preferences.getMultiProject("OpenMasterAutomatically"))
        self.multiProjectTimestampCheckBox.setChecked(\
            Preferences.getMultiProject("XMLTimestamp"))
        self.multiProjectRecentSpinBox.setValue(
            Preferences.getMultiProject("RecentNumber"))
        
    def save(self):
        """
        Public slot to save the Project configuration.
        """
        Preferences.setMultiProject("OpenMasterAutomatically",
            self.openMasterAutomaticallyCheckBox.isChecked())
        Preferences.setMultiProject("XMLTimestamp",
            self.multiProjectTimestampCheckBox.isChecked())
        Preferences.setMultiProject("RecentNumber", 
            self.multiProjectRecentSpinBox.value())
    
def create(dlg):
    """
    Module function to create the configuration page.
    
    @param dlg reference to the configuration dialog
    """
    page = MultiProjectPage()
    return page

eric ide

mercurial