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