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