|
1 # -*- coding: utf-8 -*- |
|
2 |
|
3 # Copyright (c) 2006 - 2021 Detlev Offenbach <detlev@die-offenbachs.de> |
|
4 # |
|
5 |
|
6 """ |
|
7 Module implementing the Editor Mouse Click Handlers configuration page. |
|
8 """ |
|
9 |
|
10 from .ConfigurationPageBase import ConfigurationPageBase |
|
11 from .Ui_EditorMouseClickHandlerPage import Ui_EditorMouseClickHandlerPage |
|
12 |
|
13 import Preferences |
|
14 |
|
15 |
|
16 class EditorMouseClickHandlerPage(ConfigurationPageBase, |
|
17 Ui_EditorMouseClickHandlerPage): |
|
18 """ |
|
19 Class implementing the Editor Mouse Click Handlers configuration page. |
|
20 """ |
|
21 def __init__(self): |
|
22 """ |
|
23 Constructor |
|
24 """ |
|
25 super().__init__() |
|
26 self.setupUi(self) |
|
27 self.setObjectName("EditorMouseClickHandlerPage") |
|
28 |
|
29 # set initial values |
|
30 self.mcEnabledCheckBox.setChecked( |
|
31 Preferences.getEditor("MouseClickHandlersEnabled")) |
|
32 |
|
33 def save(self): |
|
34 """ |
|
35 Public slot to save the Editor Mouse Click Handlers configuration. |
|
36 """ |
|
37 Preferences.setEditor( |
|
38 "MouseClickHandlersEnabled", |
|
39 self.mcEnabledCheckBox.isChecked()) |
|
40 |
|
41 |
|
42 def create(dlg): |
|
43 """ |
|
44 Module function to create the configuration page. |
|
45 |
|
46 @param dlg reference to the configuration dialog |
|
47 @return reference to the instantiated page (ConfigurationPageBase) |
|
48 """ |
|
49 page = EditorMouseClickHandlerPage() |
|
50 return page |