Plugins/VcsPlugins/vcsMercurial/ConfigurationPage/MercurialPage.py

Sun, 04 Sep 2011 18:02:38 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 04 Sep 2011 18:02:38 +0200
branch
5_1_x
changeset 1281
80a974cf4f14
parent 791
9ec2ac20e54e
child 945
8cd4d08fa9f6
child 1510
e75ecf2bd9dd
permissions
-rw-r--r--

Changed focus handling of the various diff dialogs.
(transplanted from 44512c4eb555276f41e8fd5a5179a8d3f84cc133)

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

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

"""
Module implementing the Mercurial configuration page.
"""

from PyQt4.QtCore import pyqtSlot

from QScintilla.MiniEditor import MiniEditor

from Preferences.ConfigurationPages.ConfigurationPageBase import ConfigurationPageBase
from .Ui_MercurialPage import Ui_MercurialPage

class MercurialPage(ConfigurationPageBase, Ui_MercurialPage):
    """
    Class implementing the Mercurial configuration page.
    """
    def __init__(self, plugin):
        """
        Constructor
        
        @param plugin reference to the plugin object
        """
        ConfigurationPageBase.__init__(self)
        self.setupUi(self)
        self.setObjectName("MercurialPage")
        
        self.__plugin = plugin
        
        # set initial values
        self.logSpinBox.setValue(self.__plugin.getPreferences("LogLimit"))
        self.commitSpinBox.setValue(self.__plugin.getPreferences("CommitMessages"))
        self.logBrowserCheckBox.setChecked(self.__plugin.getPreferences("UseLogBrowser"))
        self.pullUpdateCheckBox.setChecked(self.__plugin.getPreferences("PullUpdate"))
    
    def save(self):
        """
        Public slot to save the Mercurial configuration.
        """
        self.__plugin.setPreferences("LogLimit", self.logSpinBox.value())
        self.__plugin.setPreferences("CommitMessages", self.commitSpinBox.value())
        self.__plugin.setPreferences("UseLogBrowser", self.logBrowserCheckBox.isChecked())
        self.__plugin.setPreferences("PullUpdate", self.pullUpdateCheckBox.isChecked())
    
    @pyqtSlot()
    def on_configButton_clicked(self):
        """
        Private slot to edit the (per user) Mercurial config file.
        """
        cfgFile = self.__plugin.getConfigPath()
        editor = MiniEditor(cfgFile, "Properties", self)
        editor.show()

eric ide

mercurial