|
1 # -*- coding: utf-8 -*- |
|
2 |
|
3 # Copyright (c) 2007 - 2009 Detlev Offenbach <detlev@die-offenbachs.de> |
|
4 # |
|
5 |
|
6 """ |
|
7 Module implementing the Subversion configuration page. |
|
8 """ |
|
9 |
|
10 from PyQt4.QtCore import pyqtSlot |
|
11 |
|
12 from QScintilla.MiniEditor import MiniEditor |
|
13 |
|
14 from Preferences.ConfigurationPages.ConfigurationPageBase import ConfigurationPageBase |
|
15 from Ui_SubversionPage import Ui_SubversionPage |
|
16 |
|
17 class SubversionPage(ConfigurationPageBase, Ui_SubversionPage): |
|
18 """ |
|
19 Class implementing the Subversion configuration page. |
|
20 """ |
|
21 def __init__(self, plugin): |
|
22 """ |
|
23 Constructor |
|
24 |
|
25 @param plugin reference to the plugin object |
|
26 """ |
|
27 ConfigurationPageBase.__init__(self) |
|
28 self.setupUi(self) |
|
29 self.setObjectName("SubversionPage") |
|
30 |
|
31 self.__plugin = plugin |
|
32 |
|
33 # set initial values |
|
34 self.logSpinBox.setValue(self.__plugin.getPreferences("LogLimit")) |
|
35 self.commitSpinBox.setValue(self.__plugin.getPreferences("CommitMessages")) |
|
36 |
|
37 def save(self): |
|
38 """ |
|
39 Public slot to save the Subversion configuration. |
|
40 """ |
|
41 self.__plugin.setPreferences("LogLimit", self.logSpinBox.value()) |
|
42 self.__plugin.setPreferences("CommitMessages", self.commitSpinBox.value()) |
|
43 |
|
44 @pyqtSlot() |
|
45 def on_configButton_clicked(self): |
|
46 """ |
|
47 Private slot to edit the Subversion config file. |
|
48 """ |
|
49 cfgFile = self.__plugin.getConfigPath() |
|
50 editor = MiniEditor(cfgFile, "Properties", self) |
|
51 editor.show() |
|
52 |
|
53 @pyqtSlot() |
|
54 def on_serversButton_clicked(self): |
|
55 """ |
|
56 Private slot to edit the Subversion servers file. |
|
57 """ |
|
58 serversFile = self.__plugin.getServersPath() |
|
59 editor = MiniEditor(serversFile, "Properties", self) |
|
60 editor.show() |