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