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

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

"""
Module implementing the Refactoring configuration page.
"""

from ConfigurationPageBase import ConfigurationPageBase
from Ui_RefactoringPage import Ui_RefactoringPage

import Preferences

class RefactoringPage(ConfigurationPageBase, Ui_RefactoringPage):
    """
    Class implementing the Refactoring configuration page.
    """
    def __init__(self):
        """
        Constructor
        """
        ConfigurationPageBase.__init__(self)
        self.setupUi(self)
        self.setObjectName("RefactoringPage")
        
        # set initial values
        self.refactorLoggingCheckBox.setChecked(\
            Preferences.getRefactoring("Logging"))
        
    def save(self):
        """
        Public slot to save the Refactoring configuration.
        """
        Preferences.setRefactoring("Logging", 
            int(self.refactorLoggingCheckBox.isChecked()))
    
def create(dlg):
    """
    Module function to create the configuration page.
    
    @param dlg reference to the configuration dialog
    """
    page = RefactoringPage()
    return page
