PrEditor 0.1.0__py2.py3-none-any.whl → 0.1.0rc2__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of PrEditor might be problematic. Click here for more details.
- {PrEditor-0.1.0.dist-info → PrEditor-0.1.0rc2.dist-info}/METADATA +8 -8
- {PrEditor-0.1.0.dist-info → PrEditor-0.1.0rc2.dist-info}/RECORD +15 -19
- {PrEditor-0.1.0.dist-info → PrEditor-0.1.0rc2.dist-info}/WHEEL +1 -1
- preditor/__init__.py +2 -7
- preditor/cli.py +1 -1
- preditor/gui/group_tab_widget/__init__.py +5 -14
- preditor/gui/loggerwindow.py +29 -124
- preditor/gui/ui/loggerwindow.ui +0 -21
- preditor/gui/workbox_mixin.py +0 -34
- preditor/gui/workbox_text_edit.py +8 -3
- preditor/gui/workboxwidget.py +7 -2
- preditor/version.py +2 -2
- preditor/gui/fuzzy_search/__init__.py +0 -0
- preditor/gui/fuzzy_search/fuzzy_search.py +0 -93
- preditor/gui/group_tab_widget/grouped_tab_models.py +0 -108
- preditor/resource/img/restart.svg +0 -1
- {PrEditor-0.1.0.dist-info → PrEditor-0.1.0rc2.dist-info}/LICENSE +0 -0
- {PrEditor-0.1.0.dist-info → PrEditor-0.1.0rc2.dist-info}/entry_points.txt +0 -0
- {PrEditor-0.1.0.dist-info → PrEditor-0.1.0rc2.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: PrEditor
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.0rc2
|
|
4
4
|
Summary: A python REPL and Editor and console based on Qt.
|
|
5
5
|
Home-page: https://github.com/blurstudio/PrEditor.git
|
|
6
6
|
Author: Blur Studio
|
|
@@ -20,13 +20,13 @@ Requires-Python: !=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,>=2.7
|
|
|
20
20
|
Description-Content-Type: text/markdown
|
|
21
21
|
License-File: LICENSE
|
|
22
22
|
Requires-Dist: Qt.py
|
|
23
|
-
Requires-Dist: configparser >=4.0.2
|
|
24
|
-
Requires-Dist: future >=0.18.2
|
|
25
|
-
Requires-Dist: python-redmine >=2.1.1
|
|
26
|
-
Requires-Dist: signalslot >=0.1.2
|
|
27
|
-
Requires-Dist: importlib-metadata >=4.8.3 ; python_version >= "3.6"
|
|
23
|
+
Requires-Dist: configparser (>=4.0.2)
|
|
24
|
+
Requires-Dist: future (>=0.18.2)
|
|
25
|
+
Requires-Dist: python-redmine (>=2.1.1)
|
|
26
|
+
Requires-Dist: signalslot (>=0.1.2)
|
|
27
|
+
Requires-Dist: importlib-metadata (>=4.8.3) ; python_version >= "3.6"
|
|
28
28
|
Provides-Extra: cli
|
|
29
|
-
Requires-Dist: click >=7.1.2 ; extra == 'cli'
|
|
29
|
+
Requires-Dist: click (>=7.1.2) ; extra == 'cli'
|
|
30
30
|
Requires-Dist: click-default-group ; extra == 'cli'
|
|
31
31
|
Provides-Extra: dev
|
|
32
32
|
Requires-Dist: black ; extra == 'dev'
|
|
@@ -38,7 +38,7 @@ Requires-Dist: pep8-naming ; extra == 'dev'
|
|
|
38
38
|
Requires-Dist: pytest ; extra == 'dev'
|
|
39
39
|
Requires-Dist: tox ; extra == 'dev'
|
|
40
40
|
Provides-Extra: shortcut
|
|
41
|
-
Requires-Dist: casement >=0.1.0 ; (platform_system == "Windows") and extra == 'shortcut'
|
|
41
|
+
Requires-Dist: casement (>=0.1.0) ; (platform_system == "Windows") and extra == 'shortcut'
|
|
42
42
|
|
|
43
43
|
# PrEditor
|
|
44
44
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
preditor/__init__.py,sha256=
|
|
1
|
+
preditor/__init__.py,sha256=9EeqALlJ18tsP6kuvg8jk93dxRJp8WqFUHckxg6BVaQ,10323
|
|
2
2
|
preditor/__main__.py,sha256=boRVSmxX6eF8EkzbePtCZbzdcaPseqVae4RPPLp3U1A,449
|
|
3
3
|
preditor/about_module.py,sha256=KIvCxZrMLhm5TR6lYskM4Y9VctJ0QtSQD5Nu8Ip1CGY,5267
|
|
4
|
-
preditor/cli.py,sha256=
|
|
4
|
+
preditor/cli.py,sha256=xwW75wPHp-fjSQoZ5LXSvCJnQktt-LI5hfi07BhLvmg,5283
|
|
5
5
|
preditor/contexts.py,sha256=xxRbOFORsvlG___EuSiKuT1aiKJvnkFojFZFZE0HPNk,5147
|
|
6
6
|
preditor/debug.py,sha256=xcOslCByK7nSebh5DR6m-uC6uV9tuJBZu-JAAPBl8aA,9515
|
|
7
7
|
preditor/enum.py,sha256=snG5V259dH9SI1kwBqZeZdhat36F1iAmIjYErosnDUg,23489
|
|
@@ -11,7 +11,7 @@ preditor/plugins.py,sha256=W3DfdDEE5DtEXOXioEyIe4tuIVV1V-RLcV8LoZJWpWU,1916
|
|
|
11
11
|
preditor/prefs.py,sha256=BPtSsdv2yuiRpIaqEml9fxlVYKHNfqQ77hp5YIQRDBg,2172
|
|
12
12
|
preditor/settings.py,sha256=DV9_DbJorEnhdIvW15E7h7PswlQUsy0UlA8bXUYN0og,2206
|
|
13
13
|
preditor/streamhandler_helper.py,sha256=kiU6T9WqJ3JKTTKCa7IUU8brwK7zO5UUpEzLhEfKe44,1788
|
|
14
|
-
preditor/version.py,sha256=
|
|
14
|
+
preditor/version.py,sha256=Ff7DlJZp6xbq0kxOMwDY4PnhOQdzCeVT0lbvo05JvRo,150
|
|
15
15
|
preditor/weakref.py,sha256=b--KomFAHcMWr3DEAIN2j3XxRhjDWKw0WABXyn1nxDg,12177
|
|
16
16
|
preditor/cores/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
17
17
|
preditor/cores/core.py,sha256=ZXB4bts05DMQtc-dtkk81chIWNqYXImMuWCYuUHwLdA,2389
|
|
@@ -30,24 +30,21 @@ preditor/gui/editor_chooser.py,sha256=v82SPuxPgai3XiRWi9ypT0aRkbV6_IrbfBoAljM9pR
|
|
|
30
30
|
preditor/gui/errordialog.py,sha256=FZzSykNtqgTZ-CKEsLFXfcw_k8zwx7g_aMaHbpnq2xI,3110
|
|
31
31
|
preditor/gui/level_buttons.py,sha256=yPFIWKc0bgKLrP2XHyBqNuvvTnXZqGdtN_p27jSb1Og,11925
|
|
32
32
|
preditor/gui/logger_window_handler.py,sha256=VTNhaoFUnConE3NHj9KaDZlVoifix8xCbCuN5Ozjz0M,1482
|
|
33
|
-
preditor/gui/loggerwindow.py,sha256=
|
|
33
|
+
preditor/gui/loggerwindow.py,sha256=JM4PIEso1Sw4AtsIXzpvT52ALxVSsvbE4FXsEK3jnm8,42537
|
|
34
34
|
preditor/gui/newtabwidget.py,sha256=5aCWn9xAl5h1oZACqVuEsOAbzKTS2RegrLI41gROC8A,1971
|
|
35
35
|
preditor/gui/redmine_login_dialog.py,sha256=cMPBuecSZD5yjycNkMwHa1AbdwgGoyHvX8anIvWjEFo,1893
|
|
36
36
|
preditor/gui/set_text_editor_path_dialog.py,sha256=6mbHAXEVQhaWyg0N67f54aZpd5fp6puGWzeM0tPepiU,2251
|
|
37
37
|
preditor/gui/window.py,sha256=bZAEKQDM6V4aew1nlSTPyq_tG-_IoSvyXHcZxrdFMaE,6924
|
|
38
|
-
preditor/gui/workbox_mixin.py,sha256=
|
|
39
|
-
preditor/gui/workbox_text_edit.py,sha256=
|
|
40
|
-
preditor/gui/workboxwidget.py,sha256=
|
|
41
|
-
preditor/gui/
|
|
42
|
-
preditor/gui/fuzzy_search/fuzzy_search.py,sha256=6npanW6aLmG_ezdHmpsKN7p2zwck_Qq6YUy9duCNN8Q,3595
|
|
43
|
-
preditor/gui/group_tab_widget/__init__.py,sha256=KpQKkX_FyFQLy2UtBQcLoMuj0eRA7E_2-KXrTwPqA9k,12530
|
|
38
|
+
preditor/gui/workbox_mixin.py,sha256=8Lk7zxM4sl6__28LDOlDpqDKhooqDQba9ZYPsikEFds,11174
|
|
39
|
+
preditor/gui/workbox_text_edit.py,sha256=gc0QT--zX2Z3q-PAbod3eqjFDWQaoGQxWNygTfrEl5U,3890
|
|
40
|
+
preditor/gui/workboxwidget.py,sha256=JZzM3HUmtaEcXOq6-rNucP0WV4ZwUhqqZMwR18fnk-w,9208
|
|
41
|
+
preditor/gui/group_tab_widget/__init__.py,sha256=Jh3QeDbH7UhIELJAxZ7F7r6dc-pq4_82lmp03cej96g,12157
|
|
44
42
|
preditor/gui/group_tab_widget/grouped_tab_menu.py,sha256=lopd3mjHJIE_5xLdlZL0ghuBzsYo36vO1OZE6L6tqbI,1288
|
|
45
|
-
preditor/gui/group_tab_widget/grouped_tab_models.py,sha256=zlmbcv3JAC5BzjKpm4CM7Hobibm1T_3GjaPoWIQbXiQ,3970
|
|
46
43
|
preditor/gui/group_tab_widget/grouped_tab_widget.py,sha256=EwzYVqhJaBaYS9tdd4FXUl-PxjplWtOi7f0t99De_bw,2803
|
|
47
44
|
preditor/gui/group_tab_widget/one_tab_widget.py,sha256=PdZAXjmV9oTHakh8aFYRlLnfwcoT459vQWVKgpZZx4Y,1971
|
|
48
45
|
preditor/gui/ui/editor_chooser.ui,sha256=cYSVHK0A4-zst6JyDkrBZK9qcAontbhV4Mmnw5ps72E,2736
|
|
49
46
|
preditor/gui/ui/errordialog.ui,sha256=H1wJJVU1t7kbnYkzGtGa8SBVpKjesJG_0imdBkJaEUY,2034
|
|
50
|
-
preditor/gui/ui/loggerwindow.ui,sha256=
|
|
47
|
+
preditor/gui/ui/loggerwindow.ui,sha256=e2Y7kSyP__d1I8ixFNZLzrEdfAbfdC-TqPVUJ7Urr0U,28476
|
|
51
48
|
preditor/gui/ui/redmine_login_dialog.ui,sha256=PmGuJWvBcSDLya5UblFj5brwDH9VL2fJEveH-r5-nJ8,2911
|
|
52
49
|
preditor/gui/ui/set_text_editor_path_dialog.ui,sha256=QoSorDlyfUoNSrHQRP1Yrls5az4TyUsTQw_qYOe_Ljc,4004
|
|
53
50
|
preditor/resource/environment_variables.html,sha256=-uWicgOkour-sxtY-crrjMiLMyJzAzshwUXKqSm6TmI,3134
|
|
@@ -89,7 +86,6 @@ preditor/resource/img/preditor.ico,sha256=HjJbjJ3MYBmw5pFmkY2hEaomK-zPO7LJsOgGgA
|
|
|
89
86
|
preditor/resource/img/preditor.png,sha256=y-AdFUy_zDnkylDe8kX1BTfwZS_TIgmEBqrHhx_IhWE,32788
|
|
90
87
|
preditor/resource/img/preditor.psd,sha256=SZgadVDuDAzlUcg6ymlfAL7uw_JzLb1PsmkSAoSazv0,200136
|
|
91
88
|
preditor/resource/img/preditor.svg,sha256=MRsRxcZw3HSJ4ZRDA3XMLytJX34QPJVIAET4lG613KU,3804
|
|
92
|
-
preditor/resource/img/restart.svg,sha256=v3CFD1bROBch5n8vSQAzQqQc-bzvL_YwkD0JAhn4fuc,403
|
|
93
89
|
preditor/resource/img/skip-forward-outline.png,sha256=5PAOknMYBZcuzskG8OO_QGAjLvA8g9M08MgjTvxfDrM,475
|
|
94
90
|
preditor/resource/img/skip-next-outline.png,sha256=FUTDclE-U4nF5JhjvX-31QTwfv5pKgaX4UziY6UUioU,478
|
|
95
91
|
preditor/resource/img/skip-next.png,sha256=q9V896VWgwatGShqSL7Ebv8sia3Q2XwBv5Y4KaZA60o,446
|
|
@@ -141,9 +137,9 @@ preditor/stream/manager.py,sha256=NP4lf6hd5L_Ui-9Ws66gVEk6ZL8YqF7BxOzUsdrh3v0,28
|
|
|
141
137
|
preditor/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
142
138
|
preditor/utils/cute.py,sha256=LfF8gXMAkkQAdo4mm6J9aVkDLwWZbE6prQ0moDbtCys,1045
|
|
143
139
|
preditor/utils/stylesheets.py,sha256=EVWZNq3WnaRiyUPoYMKQo_dLEwbRyKu26b03I1JDA-s,1622
|
|
144
|
-
PrEditor-0.1.
|
|
145
|
-
PrEditor-0.1.
|
|
146
|
-
PrEditor-0.1.
|
|
147
|
-
PrEditor-0.1.
|
|
148
|
-
PrEditor-0.1.
|
|
149
|
-
PrEditor-0.1.
|
|
140
|
+
PrEditor-0.1.0rc2.dist-info/LICENSE,sha256=46mU2C5kSwOnkqkw9XQAJlhBL2JAf1_uCD8lVcXyMRg,7652
|
|
141
|
+
PrEditor-0.1.0rc2.dist-info/METADATA,sha256=w6CX92U_pkq-JVEWhGZKWkvaZQXXQqwaXPavac2G2Ac,9294
|
|
142
|
+
PrEditor-0.1.0rc2.dist-info/WHEEL,sha256=k3vXr0c0OitO0k9eCWBlI2yTYnpb_n_I2SGzrrfY7HY,110
|
|
143
|
+
PrEditor-0.1.0rc2.dist-info/entry_points.txt,sha256=mpe0HFD_oIEBNPTJNyUEbmMV6Ivrp4EuYyZ34C5d_PU,519
|
|
144
|
+
PrEditor-0.1.0rc2.dist-info/top_level.txt,sha256=iX1_mrUOky_BQr2oG0l_MbEUYF6idyjiWSzu9z3irIw,9
|
|
145
|
+
PrEditor-0.1.0rc2.dist-info/RECORD,,
|
preditor/__init__.py
CHANGED
|
@@ -113,7 +113,7 @@ def configure(name, parent_callback=None, excepthook=True, logging=True, streams
|
|
|
113
113
|
preditor.debug.BlurExcepthook.install()
|
|
114
114
|
|
|
115
115
|
|
|
116
|
-
def launch(run_workbox=False, app_id=None, name=None
|
|
116
|
+
def launch(run_workbox=False, app_id=None, name=None):
|
|
117
117
|
"""Launches the preditor gui creating the QApplication instance if not
|
|
118
118
|
already created.
|
|
119
119
|
|
|
@@ -125,9 +125,6 @@ def launch(run_workbox=False, app_id=None, name=None, standalone=False):
|
|
|
125
125
|
app_id (str, optional): Set the QApplication's applicationName to this
|
|
126
126
|
value. This is normally only used when launching a standalone
|
|
127
127
|
instance of the PrEditor gui.
|
|
128
|
-
standalone (bool, optional): Launch PrEditor in standalone mode. This
|
|
129
|
-
enables extra options that only make sense when it is running as
|
|
130
|
-
its own app, not inside of another app.
|
|
131
128
|
|
|
132
129
|
Returns:
|
|
133
130
|
preditor.gui.loggerwindow.LoggerWindow: The instance of the PrEditor
|
|
@@ -150,9 +147,7 @@ def launch(run_workbox=False, app_id=None, name=None, standalone=False):
|
|
|
150
147
|
|
|
151
148
|
# Check if we can actually run the PrEditor gui and setup Qt if required
|
|
152
149
|
app = App(name=app_id)
|
|
153
|
-
widget = LoggerWindow.instance(
|
|
154
|
-
run_workbox=run_workbox, name=name, standalone=standalone
|
|
155
|
-
)
|
|
150
|
+
widget = LoggerWindow.instance(run_workbox=run_workbox, name=name)
|
|
156
151
|
|
|
157
152
|
# Show the PrEditor instance and make sure it regains focus and visibility
|
|
158
153
|
widget.show()
|
preditor/cli.py
CHANGED
|
@@ -66,7 +66,7 @@ def launch(name, run_workbox):
|
|
|
66
66
|
parameter_source = click.get_current_context().get_parameter_source('name')
|
|
67
67
|
app_id = get_app_id(name, parameter_source == ParameterSource.DEFAULT)
|
|
68
68
|
|
|
69
|
-
preditor.launch(run_workbox=run_workbox, app_id=app_id, name=name
|
|
69
|
+
preditor.launch(run_workbox=run_workbox, app_id=app_id, name=name)
|
|
70
70
|
|
|
71
71
|
|
|
72
72
|
# shortcut
|
|
@@ -114,20 +114,11 @@ class GroupTabWidget(OneTabWidget):
|
|
|
114
114
|
return parent, editor
|
|
115
115
|
|
|
116
116
|
def all_widgets(self):
|
|
117
|
-
"""
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
for group_index in range(self.count()):
|
|
123
|
-
group_name = self.tabText(group_index)
|
|
124
|
-
|
|
125
|
-
tab_widget = self.widget(group_index)
|
|
126
|
-
for tab_index in range(tab_widget.count()):
|
|
127
|
-
tab_name = tab_widget.tabText(tab_index)
|
|
128
|
-
yield tab_widget.widget(
|
|
129
|
-
tab_index
|
|
130
|
-
), group_name, tab_name, group_index, tab_index
|
|
117
|
+
"""Returns every widget under every group."""
|
|
118
|
+
for i in range(self.count()):
|
|
119
|
+
tab_widget = self.widget(i)
|
|
120
|
+
for j in range(tab_widget.count()):
|
|
121
|
+
yield tab_widget.widget(j)
|
|
131
122
|
|
|
132
123
|
def close_current_tab(self):
|
|
133
124
|
"""Convenient method to close the currently open editor tab prompting
|
preditor/gui/loggerwindow.py
CHANGED
|
@@ -37,8 +37,6 @@ from .. import (
|
|
|
37
37
|
)
|
|
38
38
|
from ..delayable_engine import DelayableEngine
|
|
39
39
|
from ..gui import Dialog, Window, loadUi
|
|
40
|
-
from ..gui.fuzzy_search.fuzzy_search import FuzzySearch
|
|
41
|
-
from ..gui.group_tab_widget.grouped_tab_models import GroupTabListItemModel
|
|
42
40
|
from ..logging_config import LoggingConfig
|
|
43
41
|
from ..utils import stylesheets
|
|
44
42
|
from .completer import CompleterMode
|
|
@@ -57,7 +55,7 @@ class LoggerWindow(Window):
|
|
|
57
55
|
_instance = None
|
|
58
56
|
styleSheetChanged = Signal(str)
|
|
59
57
|
|
|
60
|
-
def __init__(self, parent, name=None, run_workbox=False
|
|
58
|
+
def __init__(self, parent, name=None, run_workbox=False):
|
|
61
59
|
super(LoggerWindow, self).__init__(parent=parent)
|
|
62
60
|
self.name = name if name else DEFAULT_CORE_NAME
|
|
63
61
|
self.aboutToClearPathsEnabled = False
|
|
@@ -110,7 +108,6 @@ class LoggerWindow(Window):
|
|
|
110
108
|
self._stds = None
|
|
111
109
|
self.uiLogToFileClearACT.setVisible(False)
|
|
112
110
|
|
|
113
|
-
self.uiRestartACT.triggered.connect(self.restartLogger)
|
|
114
111
|
self.uiCloseLoggerACT.triggered.connect(self.closeLogger)
|
|
115
112
|
|
|
116
113
|
self.uiRunAllACT.triggered.connect(self.execAll)
|
|
@@ -182,8 +179,6 @@ class LoggerWindow(Window):
|
|
|
182
179
|
self.uiGroup8ACT.triggered.connect(partial(self.gotoGroupByIndex, 8))
|
|
183
180
|
self.uiGroupLastACT.triggered.connect(partial(self.gotoGroupByIndex, -1))
|
|
184
181
|
|
|
185
|
-
self.uiFocusNameACT.triggered.connect(self.show_focus_name)
|
|
186
|
-
|
|
187
182
|
self.uiCommentToggleACT.triggered.connect(self.comment_toggle)
|
|
188
183
|
|
|
189
184
|
self.uiSpellCheckEnabledACT.toggled.connect(self.setSpellCheckEnabled)
|
|
@@ -223,7 +218,6 @@ class LoggerWindow(Window):
|
|
|
223
218
|
QIcon(resourcePath('img/content-save.png'))
|
|
224
219
|
)
|
|
225
220
|
self.uiAboutPreditorACT.setIcon(QIcon(resourcePath('img/information.png')))
|
|
226
|
-
self.uiRestartACT.setIcon(QIcon(resourcePath('img/restart.svg')))
|
|
227
221
|
self.uiCloseLoggerACT.setIcon(QIcon(resourcePath('img/close-thick.png')))
|
|
228
222
|
|
|
229
223
|
# Make action shortcuts available anywhere in the Logger
|
|
@@ -273,10 +267,6 @@ class LoggerWindow(Window):
|
|
|
273
267
|
|
|
274
268
|
self.setup_run_workbox()
|
|
275
269
|
|
|
276
|
-
if not standalone:
|
|
277
|
-
# This action only is valid when running in standalone mode
|
|
278
|
-
self.uiRestartACT.setVisible(False)
|
|
279
|
-
|
|
280
270
|
# Run the current workbox after the LoggerWindow is shown.
|
|
281
271
|
if run_workbox:
|
|
282
272
|
# By using two singleShot timers, we can show and draw the LoggerWindow,
|
|
@@ -315,61 +305,7 @@ class LoggerWindow(Window):
|
|
|
315
305
|
return self.uiWorkboxTAB.current_groups_widget()
|
|
316
306
|
|
|
317
307
|
@classmethod
|
|
318
|
-
def
|
|
319
|
-
"""Returns the name for a given workbox.
|
|
320
|
-
The name is the group tab text and the workbox tab text joined by a `/`"""
|
|
321
|
-
ret = []
|
|
322
|
-
logger = cls.instance()
|
|
323
|
-
index = logger.uiWorkboxTAB.currentIndex()
|
|
324
|
-
ret.append(logger.uiWorkboxTAB.tabText(index))
|
|
325
|
-
group_widget = logger.uiWorkboxTAB.currentWidget()
|
|
326
|
-
index = group_widget.currentIndex()
|
|
327
|
-
ret.append(group_widget.tabText(index))
|
|
328
|
-
return "/".join(ret)
|
|
329
|
-
|
|
330
|
-
@classmethod
|
|
331
|
-
def workbox_for_name(cls, name, show=False, visible=False):
|
|
332
|
-
"""Used to find a workbox for a given name. It accepts a string matching
|
|
333
|
-
the "{group}/{workbox}" format, or if True, the current workbox.
|
|
334
|
-
|
|
335
|
-
Args:
|
|
336
|
-
name(str, boolean): Used to define which workbox to run.
|
|
337
|
-
show (bool, optional): If a workbox is found, call `__show__` on it
|
|
338
|
-
to ensure that it is initialized and its text is loaded.
|
|
339
|
-
visible (bool, optional): Make the this workbox visible if found.
|
|
340
|
-
"""
|
|
341
|
-
logger = cls.instance()
|
|
342
|
-
|
|
343
|
-
workbox = None
|
|
344
|
-
|
|
345
|
-
# If name is True, run the current workbox
|
|
346
|
-
if isinstance(name, bool):
|
|
347
|
-
if name:
|
|
348
|
-
workbox = logger.current_workbox()
|
|
349
|
-
|
|
350
|
-
# If name is a string, find first tab with that name
|
|
351
|
-
elif isinstance(name, six.string_types):
|
|
352
|
-
split = name.split('/', 1)
|
|
353
|
-
if len(split) < 2:
|
|
354
|
-
return None
|
|
355
|
-
group, editor = split
|
|
356
|
-
group_index = logger.uiWorkboxTAB.index_for_text(group)
|
|
357
|
-
if group_index != -1:
|
|
358
|
-
tab_widget = logger.uiWorkboxTAB.widget(group_index)
|
|
359
|
-
index = tab_widget.index_for_text(editor)
|
|
360
|
-
if index != -1:
|
|
361
|
-
workbox = tab_widget.widget(index)
|
|
362
|
-
if visible:
|
|
363
|
-
tab_widget.setCurrentIndex(index)
|
|
364
|
-
logger.uiWorkboxTAB.setCurrentIndex(group_index)
|
|
365
|
-
|
|
366
|
-
if show and workbox:
|
|
367
|
-
workbox.__show__()
|
|
368
|
-
|
|
369
|
-
return workbox
|
|
370
|
-
|
|
371
|
-
@classmethod
|
|
372
|
-
def run_workbox(cls, name):
|
|
308
|
+
def run_workbox(cls, indicator):
|
|
373
309
|
"""This is a function which will be added to __main__, and therefore
|
|
374
310
|
available to PythonLogger users. It will accept a string matching the
|
|
375
311
|
"{group}/{workbox}" format, or a boolean that will run the current tab
|
|
@@ -377,7 +313,7 @@ class LoggerWindow(Window):
|
|
|
377
313
|
current workbox on launch.
|
|
378
314
|
|
|
379
315
|
Args:
|
|
380
|
-
|
|
316
|
+
indicator(str, boolean): Used to define which workbox to run.
|
|
381
317
|
|
|
382
318
|
Raises:
|
|
383
319
|
Exception: "Cannot call current workbox."
|
|
@@ -387,12 +323,30 @@ class LoggerWindow(Window):
|
|
|
387
323
|
run_workbox('some/stuff.py')
|
|
388
324
|
(from command line): blurdev launch Python_Logger --run_workbox
|
|
389
325
|
"""
|
|
390
|
-
|
|
326
|
+
logger = cls.instance()
|
|
327
|
+
|
|
328
|
+
# Determine the workbox widget
|
|
329
|
+
workbox = None
|
|
330
|
+
|
|
331
|
+
# If indicator is True, run the current workbox
|
|
332
|
+
if isinstance(indicator, bool):
|
|
333
|
+
if indicator:
|
|
334
|
+
workbox = logger.current_workbox()
|
|
335
|
+
|
|
336
|
+
# If indicator is a string, find first tab with that name
|
|
337
|
+
elif isinstance(indicator, six.string_types):
|
|
338
|
+
group, editor = indicator.split('/', 1)
|
|
339
|
+
index = logger.uiWorkboxTAB.index_for_text(group)
|
|
340
|
+
if index != -1:
|
|
341
|
+
tab_widget = logger.uiWorkboxTAB.widget(index)
|
|
342
|
+
index = tab_widget.index_for_text(editor)
|
|
343
|
+
if index != -1:
|
|
344
|
+
workbox = tab_widget.widget(index)
|
|
391
345
|
|
|
392
346
|
if workbox is not None:
|
|
393
|
-
# if
|
|
347
|
+
# if indicator is True, its ok to run the workbox, this option
|
|
394
348
|
# is passed by the cli to run the current tab
|
|
395
|
-
if workbox.hasFocus() and
|
|
349
|
+
if workbox.hasFocus() and indicator is not True:
|
|
396
350
|
raise Exception("Cannot call current workbox.")
|
|
397
351
|
else:
|
|
398
352
|
# Make sure the workbox text is loaded as it likely has not
|
|
@@ -612,10 +566,6 @@ class LoggerWindow(Window):
|
|
|
612
566
|
if self.uiConsoleTOOLBAR.isFloating():
|
|
613
567
|
self.uiConsoleTOOLBAR.hide()
|
|
614
568
|
|
|
615
|
-
# Handle any cleanup each workbox tab may need to do before closing
|
|
616
|
-
for editor, _, _, _, _ in self.uiWorkboxTAB.all_widgets():
|
|
617
|
-
editor.__close__()
|
|
618
|
-
|
|
619
569
|
def closeLogger(self):
|
|
620
570
|
self.close()
|
|
621
571
|
|
|
@@ -714,28 +664,6 @@ class LoggerWindow(Window):
|
|
|
714
664
|
with open(filename, 'w') as fp:
|
|
715
665
|
json.dump(pref, fp, indent=4)
|
|
716
666
|
|
|
717
|
-
def restartLogger(self):
|
|
718
|
-
"""Closes this PrEditor instance and starts a new process with the same
|
|
719
|
-
cli arguments.
|
|
720
|
-
|
|
721
|
-
Note: This only works if PrEditor is running in standalone mode. It doesn't
|
|
722
|
-
quit the QApplication or other host process. It simply closes this instance
|
|
723
|
-
of PrEditor, saving its preferences, which should allow Qt to exit if no
|
|
724
|
-
other windows are open.
|
|
725
|
-
"""
|
|
726
|
-
self.close()
|
|
727
|
-
|
|
728
|
-
# Get the current command and launch it as a new process. This handles
|
|
729
|
-
# use of the preditor/preditor executable launchers.
|
|
730
|
-
cmd = sys.argv[0]
|
|
731
|
-
args = sys.argv[1:]
|
|
732
|
-
|
|
733
|
-
if os.path.basename(cmd) == "__main__.py":
|
|
734
|
-
# Handles using `python -m preditor` style launch.
|
|
735
|
-
cmd = sys.executable
|
|
736
|
-
args = ["-m", "preditor"] + args
|
|
737
|
-
QtCore.QProcess.startDetached(cmd, args)
|
|
738
|
-
|
|
739
667
|
def restorePrefs(self):
|
|
740
668
|
pref = self.load_prefs()
|
|
741
669
|
|
|
@@ -827,7 +755,7 @@ class LoggerWindow(Window):
|
|
|
827
755
|
|
|
828
756
|
def setAutoCompleteEnabled(self, state):
|
|
829
757
|
self.uiConsoleTXT.completer().setEnabled(state)
|
|
830
|
-
for workbox
|
|
758
|
+
for workbox in self.uiWorkboxTAB.all_widgets():
|
|
831
759
|
workbox.__set_auto_complete_enabled__(state)
|
|
832
760
|
|
|
833
761
|
def setSpellCheckEnabled(self, state):
|
|
@@ -1023,30 +951,14 @@ class LoggerWindow(Window):
|
|
|
1023
951
|
def show_workbox_options(self):
|
|
1024
952
|
self.uiWorkboxSTACK.setCurrentIndex(WorkboxPages.Options)
|
|
1025
953
|
|
|
1026
|
-
@Slot()
|
|
1027
|
-
def show_focus_name(self):
|
|
1028
|
-
model = GroupTabListItemModel(manager=self.uiWorkboxTAB)
|
|
1029
|
-
model.process()
|
|
1030
|
-
|
|
1031
|
-
def update_tab(index):
|
|
1032
|
-
group, tab = model.workbox_indexes_from_model_index(index)
|
|
1033
|
-
if group is not None:
|
|
1034
|
-
self.uiWorkboxTAB.set_current_groups_from_index(group, tab)
|
|
1035
|
-
|
|
1036
|
-
w = FuzzySearch(model, parent=self)
|
|
1037
|
-
w.selected.connect(update_tab)
|
|
1038
|
-
w.canceled.connect(update_tab)
|
|
1039
|
-
w.highlighted.connect(update_tab)
|
|
1040
|
-
w.popup()
|
|
1041
|
-
|
|
1042
954
|
def updateCopyIndentsAsSpaces(self):
|
|
1043
|
-
for workbox
|
|
955
|
+
for workbox in self.uiWorkboxTAB.all_widgets():
|
|
1044
956
|
workbox.__set_copy_indents_as_spaces__(
|
|
1045
957
|
self.uiCopyTabsToSpacesACT.isChecked()
|
|
1046
958
|
)
|
|
1047
959
|
|
|
1048
960
|
def updateIndentationsUseTabs(self):
|
|
1049
|
-
for workbox
|
|
961
|
+
for workbox in self.uiWorkboxTAB.all_widgets():
|
|
1050
962
|
workbox.__set_indentations_use_tabs__(
|
|
1051
963
|
self.uiIndentationsTabsACT.isChecked()
|
|
1052
964
|
)
|
|
@@ -1125,9 +1037,7 @@ class LoggerWindow(Window):
|
|
|
1125
1037
|
group_tab.setCurrentIndex(index)
|
|
1126
1038
|
|
|
1127
1039
|
@staticmethod
|
|
1128
|
-
def instance(
|
|
1129
|
-
parent=None, name=None, run_workbox=False, create=True, standalone=False
|
|
1130
|
-
):
|
|
1040
|
+
def instance(parent=None, name=None, run_workbox=False, create=True):
|
|
1131
1041
|
"""Returns the existing instance of the PrEditor gui creating it on first call.
|
|
1132
1042
|
|
|
1133
1043
|
Args:
|
|
@@ -1136,9 +1046,6 @@ class LoggerWindow(Window):
|
|
|
1136
1046
|
run_workbox (bool, optional): If the instance hasn't been created yet, this
|
|
1137
1047
|
will execute the active workbox's code once fully initialized.
|
|
1138
1048
|
create (bool, optional): Returns None if the instance has not been created.
|
|
1139
|
-
standalone (bool, optional): Launch PrEditor in standalone mode. This
|
|
1140
|
-
enables extra options that only make sense when it is running as
|
|
1141
|
-
its own app, not inside of another app.
|
|
1142
1049
|
|
|
1143
1050
|
Returns:
|
|
1144
1051
|
Returns a fully initialized instance of the PrEditor gui. If called more
|
|
@@ -1151,9 +1058,7 @@ class LoggerWindow(Window):
|
|
|
1151
1058
|
return None
|
|
1152
1059
|
|
|
1153
1060
|
# create the logger instance
|
|
1154
|
-
inst = LoggerWindow(
|
|
1155
|
-
parent, name=name, run_workbox=run_workbox, standalone=standalone
|
|
1156
|
-
)
|
|
1061
|
+
inst = LoggerWindow(parent, name=name, run_workbox=run_workbox)
|
|
1157
1062
|
|
|
1158
1063
|
# RV has a Unique window structure. It makes more sense to not parent a
|
|
1159
1064
|
# singleton window than to parent it to a specific top level window.
|
preditor/gui/ui/loggerwindow.ui
CHANGED
|
@@ -110,7 +110,6 @@
|
|
|
110
110
|
<addaction name="uiCloseWorkboxACT"/>
|
|
111
111
|
<addaction name="separator"/>
|
|
112
112
|
<addaction name="uiSaveConsoleSettingsACT"/>
|
|
113
|
-
<addaction name="uiRestartACT"/>
|
|
114
113
|
<addaction name="uiCloseLoggerACT"/>
|
|
115
114
|
</widget>
|
|
116
115
|
<widget class="QMenu" name="uiHelpMENU">
|
|
@@ -322,7 +321,6 @@
|
|
|
322
321
|
<addaction name="separator"/>
|
|
323
322
|
<addaction name="menuFocus_to_Group"/>
|
|
324
323
|
<addaction name="menuFocus_to_Tab"/>
|
|
325
|
-
<addaction name="uiFocusNameACT"/>
|
|
326
324
|
</widget>
|
|
327
325
|
<addaction name="uiScriptingMENU"/>
|
|
328
326
|
<addaction name="menuEdit"/>
|
|
@@ -932,25 +930,6 @@ at the indicated line in the specified text editor.
|
|
|
932
930
|
<string>Backup</string>
|
|
933
931
|
</property>
|
|
934
932
|
</action>
|
|
935
|
-
<action name="uiFocusNameACT">
|
|
936
|
-
<property name="text">
|
|
937
|
-
<string>Focus To Name</string>
|
|
938
|
-
</property>
|
|
939
|
-
<property name="shortcut">
|
|
940
|
-
<string>Ctrl+P</string>
|
|
941
|
-
</property>
|
|
942
|
-
</action>
|
|
943
|
-
<action name="uiRestartACT">
|
|
944
|
-
<property name="text">
|
|
945
|
-
<string>Restart PrEditor</string>
|
|
946
|
-
</property>
|
|
947
|
-
<property name="toolTip">
|
|
948
|
-
<string>Closes PrEditor and launches a new process with the same cli arguments.</string>
|
|
949
|
-
</property>
|
|
950
|
-
<property name="shortcut">
|
|
951
|
-
<string>Ctrl+Alt+Shift+R</string>
|
|
952
|
-
</property>
|
|
953
|
-
</action>
|
|
954
933
|
</widget>
|
|
955
934
|
<customwidgets>
|
|
956
935
|
<customwidget>
|
preditor/gui/workbox_mixin.py
CHANGED
|
@@ -4,7 +4,6 @@ import os
|
|
|
4
4
|
import tempfile
|
|
5
5
|
import textwrap
|
|
6
6
|
|
|
7
|
-
from Qt.QtCore import Qt
|
|
8
7
|
from Qt.QtWidgets import QStackedWidget
|
|
9
8
|
|
|
10
9
|
from ..prefs import prefs_path
|
|
@@ -33,9 +32,6 @@ class WorkboxMixin(object):
|
|
|
33
32
|
def __clear__(self):
|
|
34
33
|
raise NotImplementedError("Mixin method not overridden.")
|
|
35
34
|
|
|
36
|
-
def __close__(self):
|
|
37
|
-
"""Called just before the LoggerWindow is closed to allow for workbox cleanup"""
|
|
38
|
-
|
|
39
35
|
def __comment_toggle__(self):
|
|
40
36
|
raise NotImplementedError("Mixin method not overridden.")
|
|
41
37
|
|
|
@@ -325,33 +321,3 @@ class WorkboxMixin(object):
|
|
|
325
321
|
elif self._tempfile:
|
|
326
322
|
txt = self.__open_file__(self.__tempfile__())
|
|
327
323
|
self.__set_text__(txt)
|
|
328
|
-
|
|
329
|
-
def process_shortcut(self, event, run=True):
|
|
330
|
-
"""Check for workbox shortcuts and optionally call them.
|
|
331
|
-
|
|
332
|
-
Args:
|
|
333
|
-
event (QEvent): The keyPressEvent to process.
|
|
334
|
-
run (bool, optional): Run the expected action if possible.
|
|
335
|
-
|
|
336
|
-
Returns:
|
|
337
|
-
str or False: Returns False if the key press was not handled, indicating
|
|
338
|
-
that the subclass needs to handle it(or call super). If a known
|
|
339
|
-
shortcut was detected, a string indicating the action is returned
|
|
340
|
-
after running the action if enabled and supported.
|
|
341
|
-
|
|
342
|
-
Known actions:
|
|
343
|
-
__exec_selected__: If the user pressed Shift + Return or pressed the
|
|
344
|
-
number pad enter key calling `__exec_selected__`.
|
|
345
|
-
"""
|
|
346
|
-
if event.key() == Qt.Key_Enter or (
|
|
347
|
-
event.key() == Qt.Key_Return and event.modifiers() == Qt.ShiftModifier
|
|
348
|
-
):
|
|
349
|
-
# Number pad enter, or Shift + Return pressed, execute selected
|
|
350
|
-
if run:
|
|
351
|
-
self.__exec_selected__()
|
|
352
|
-
|
|
353
|
-
if self.window().uiAutoPromptACT.isChecked():
|
|
354
|
-
self.__console__().startInputLine()
|
|
355
|
-
return '__exec_selected__'
|
|
356
|
-
|
|
357
|
-
return False
|
|
@@ -2,6 +2,7 @@ from __future__ import absolute_import
|
|
|
2
2
|
|
|
3
3
|
import logging
|
|
4
4
|
|
|
5
|
+
from Qt.QtCore import Qt
|
|
5
6
|
from Qt.QtGui import QFont, QFontMetrics, QTextCursor
|
|
6
7
|
from Qt.QtWidgets import QTextEdit
|
|
7
8
|
|
|
@@ -86,7 +87,7 @@ class WorkboxTextEdit(WorkboxMixin, QTextEdit):
|
|
|
86
87
|
# TODO: Implement custom tab widths
|
|
87
88
|
return 4
|
|
88
89
|
|
|
89
|
-
def __text__(self
|
|
90
|
+
def __text__(self):
|
|
90
91
|
return self.toPlainText()
|
|
91
92
|
|
|
92
93
|
def __set_text__(self, text):
|
|
@@ -111,7 +112,11 @@ class WorkboxTextEdit(WorkboxMixin, QTextEdit):
|
|
|
111
112
|
return self.textCursor().selection().toPlainText()
|
|
112
113
|
|
|
113
114
|
def keyPressEvent(self, event):
|
|
114
|
-
|
|
115
|
-
|
|
115
|
+
# If number pad enter key or Shift and keyboard return key
|
|
116
|
+
# are used run selected text.
|
|
117
|
+
if event.key() == Qt.Key_Enter or (
|
|
118
|
+
event.key() == Qt.Key_Return and event.modifiers() == Qt.ShiftModifier
|
|
119
|
+
):
|
|
120
|
+
self.__exec_selected__()
|
|
116
121
|
else:
|
|
117
122
|
super(WorkboxTextEdit, self).keyPressEvent(event)
|
preditor/gui/workboxwidget.py
CHANGED
|
@@ -197,8 +197,13 @@ class WorkboxWidget(WorkboxMixin, DocumentEditor):
|
|
|
197
197
|
if self._software == 'softimage':
|
|
198
198
|
DocumentEditor.keyPressEvent(self, event)
|
|
199
199
|
else:
|
|
200
|
-
if
|
|
201
|
-
|
|
200
|
+
if event.key() == Qt.Key_Enter or (
|
|
201
|
+
event.key() == Qt.Key_Return and event.modifiers() == Qt.ShiftModifier
|
|
202
|
+
):
|
|
203
|
+
self.__exec_selected__()
|
|
204
|
+
|
|
205
|
+
if self.window().uiAutoPromptACT.isChecked():
|
|
206
|
+
self.__console__().startInputLine()
|
|
202
207
|
else:
|
|
203
208
|
DocumentEditor.keyPressEvent(self, event)
|
|
204
209
|
|
preditor/version.py
CHANGED
|
File without changes
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
from __future__ import absolute_import
|
|
2
|
-
|
|
3
|
-
from functools import partial
|
|
4
|
-
|
|
5
|
-
from Qt.QtCore import QModelIndex, QPoint, Qt, Signal
|
|
6
|
-
from Qt.QtWidgets import QFrame, QLineEdit, QListView, QShortcut, QVBoxLayout
|
|
7
|
-
|
|
8
|
-
from ..group_tab_widget.grouped_tab_models import GroupTabFuzzyFilterProxyModel
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
class FuzzySearch(QFrame):
|
|
12
|
-
canceled = Signal("QModelIndex")
|
|
13
|
-
"""Passes the original QModelIndex for the tab that was selected when the
|
|
14
|
-
widget was first shown. This lets you reset back to the orignal state."""
|
|
15
|
-
highlighted = Signal("QModelIndex")
|
|
16
|
-
"""Emitted when the user navitages to the given index, but hasn't selected."""
|
|
17
|
-
selected = Signal("QModelIndex")
|
|
18
|
-
"""Emitted when the user selects a item."""
|
|
19
|
-
|
|
20
|
-
def __init__(self, model, parent=None, **kwargs):
|
|
21
|
-
super(FuzzySearch, self).__init__(parent=parent, **kwargs)
|
|
22
|
-
self.y_offset = 100
|
|
23
|
-
self.setMinimumSize(400, 200)
|
|
24
|
-
self.uiCloseSCT = QShortcut(
|
|
25
|
-
Qt.Key_Escape, self, context=Qt.WidgetWithChildrenShortcut
|
|
26
|
-
)
|
|
27
|
-
self.uiCloseSCT.activated.connect(self._canceled)
|
|
28
|
-
|
|
29
|
-
self.uiUpSCT = QShortcut(Qt.Key_Up, self, context=Qt.WidgetWithChildrenShortcut)
|
|
30
|
-
self.uiUpSCT.activated.connect(partial(self.increment_selection, -1))
|
|
31
|
-
self.uiDownSCT = QShortcut(
|
|
32
|
-
Qt.Key_Down, self, context=Qt.WidgetWithChildrenShortcut
|
|
33
|
-
)
|
|
34
|
-
self.uiDownSCT.activated.connect(partial(self.increment_selection, 1))
|
|
35
|
-
|
|
36
|
-
lyt = QVBoxLayout(self)
|
|
37
|
-
self.uiLineEDIT = QLineEdit(parent=self)
|
|
38
|
-
self.uiLineEDIT.textChanged.connect(self.update_completer)
|
|
39
|
-
self.uiLineEDIT.returnPressed.connect(self.activated)
|
|
40
|
-
lyt.addWidget(self.uiLineEDIT)
|
|
41
|
-
self.uiResultsLIST = QListView(self)
|
|
42
|
-
self.uiResultsLIST.activated.connect(self.activated)
|
|
43
|
-
self.proxy_model = GroupTabFuzzyFilterProxyModel(self)
|
|
44
|
-
self.proxy_model.setSourceModel(model)
|
|
45
|
-
self.uiResultsLIST.setModel(self.proxy_model)
|
|
46
|
-
lyt.addWidget(self.uiResultsLIST)
|
|
47
|
-
|
|
48
|
-
self.original_model_index = model.original_model_index
|
|
49
|
-
|
|
50
|
-
def activated(self):
|
|
51
|
-
current = self.uiResultsLIST.currentIndex()
|
|
52
|
-
self.selected.emit(current)
|
|
53
|
-
self.hide()
|
|
54
|
-
|
|
55
|
-
def increment_selection(self, direction):
|
|
56
|
-
current = self.uiResultsLIST.currentIndex()
|
|
57
|
-
col = 0
|
|
58
|
-
row = 0
|
|
59
|
-
if current.isValid():
|
|
60
|
-
col = current.column()
|
|
61
|
-
row = current.row() + direction
|
|
62
|
-
new = self.uiResultsLIST.model().index(row, col)
|
|
63
|
-
self.uiResultsLIST.setCurrentIndex(new)
|
|
64
|
-
self.highlighted.emit(new)
|
|
65
|
-
|
|
66
|
-
def update_completer(self, wildcard):
|
|
67
|
-
if wildcard:
|
|
68
|
-
if not self.uiResultsLIST.currentIndex().isValid():
|
|
69
|
-
new = self.uiResultsLIST.model().index(0, 0)
|
|
70
|
-
self.uiResultsLIST.setCurrentIndex(new)
|
|
71
|
-
else:
|
|
72
|
-
self.uiResultsLIST.clearSelection()
|
|
73
|
-
self.uiResultsLIST.setCurrentIndex(QModelIndex())
|
|
74
|
-
self.proxy_model.setFuzzySearch(wildcard)
|
|
75
|
-
self.highlighted.emit(self.uiResultsLIST.currentIndex())
|
|
76
|
-
|
|
77
|
-
def _canceled(self):
|
|
78
|
-
# Restore the original tab as the user didn't choose the new tab
|
|
79
|
-
self.canceled.emit(self.original_model_index)
|
|
80
|
-
self.hide()
|
|
81
|
-
|
|
82
|
-
def reposition(self):
|
|
83
|
-
pgeo = self.parent().geometry()
|
|
84
|
-
geo = self.geometry()
|
|
85
|
-
center = QPoint(pgeo.width() // 2, 0)
|
|
86
|
-
geo.moveCenter(center)
|
|
87
|
-
geo.setY(self.y_offset)
|
|
88
|
-
self.setGeometry(geo)
|
|
89
|
-
|
|
90
|
-
def popup(self):
|
|
91
|
-
self.show()
|
|
92
|
-
self.reposition()
|
|
93
|
-
self.uiLineEDIT.setFocus(Qt.PopupFocusReason)
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
from __future__ import absolute_import
|
|
2
|
-
|
|
3
|
-
import re
|
|
4
|
-
|
|
5
|
-
from Qt.QtCore import QSortFilterProxyModel, Qt
|
|
6
|
-
from Qt.QtGui import QStandardItem, QStandardItemModel
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class GroupTabItemModel(QStandardItemModel):
|
|
10
|
-
GroupIndexRole = Qt.UserRole + 1
|
|
11
|
-
TabIndexRole = GroupIndexRole + 1
|
|
12
|
-
|
|
13
|
-
def __init__(self, manager, *args, **kwargs):
|
|
14
|
-
super(GroupTabItemModel, self).__init__(*args, **kwargs)
|
|
15
|
-
self.manager = manager
|
|
16
|
-
|
|
17
|
-
def workbox_indexes_from_model_index(self, index):
|
|
18
|
-
"""Returns the group_index and tab_index for the provided QModelIndex"""
|
|
19
|
-
return (
|
|
20
|
-
index.data(self.GroupIndexRole),
|
|
21
|
-
index.data(self.TabIndexRole),
|
|
22
|
-
)
|
|
23
|
-
|
|
24
|
-
def pathFromIndex(self, index):
|
|
25
|
-
parts = [""]
|
|
26
|
-
while index.isValid():
|
|
27
|
-
parts.append(self.data(index, Qt.DisplayRole))
|
|
28
|
-
index = index.parent()
|
|
29
|
-
if len(parts) == 1:
|
|
30
|
-
return ""
|
|
31
|
-
return "/".join([x for x in parts[::-1] if x])
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
class GroupTabTreeItemModel(GroupTabItemModel):
|
|
35
|
-
def process(self):
|
|
36
|
-
root = self.invisibleRootItem()
|
|
37
|
-
current_group = self.manager.currentIndex()
|
|
38
|
-
current_tab = self.manager.currentWidget().currentIndex()
|
|
39
|
-
|
|
40
|
-
prev_group = -1
|
|
41
|
-
all_widgets = self.manager.all_widgets()
|
|
42
|
-
for _, group_name, tab_name, group_index, tab_index in all_widgets:
|
|
43
|
-
if prev_group != group_index:
|
|
44
|
-
group_item = QStandardItem(group_name)
|
|
45
|
-
group_item.setData(group_index, self.GroupIndexRole)
|
|
46
|
-
root.appendRow(group_item)
|
|
47
|
-
prev_group = group_index
|
|
48
|
-
|
|
49
|
-
tab_item = QStandardItem(tab_name)
|
|
50
|
-
tab_item.setData(group_index, self.GroupIndexRole)
|
|
51
|
-
tab_item.setData(tab_index, self.TabIndexRole)
|
|
52
|
-
group_item.appendRow(tab_item)
|
|
53
|
-
if group_index == current_group and tab_index == current_tab:
|
|
54
|
-
self.original_model_index = self.indexFromItem(tab_item)
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
class GroupTabListItemModel(GroupTabItemModel):
|
|
58
|
-
def flags(self, index):
|
|
59
|
-
return Qt.ItemIsEnabled | Qt.ItemIsSelectable
|
|
60
|
-
|
|
61
|
-
def process(self):
|
|
62
|
-
root = self.invisibleRootItem()
|
|
63
|
-
current_group = self.manager.currentIndex()
|
|
64
|
-
current_tab = self.manager.currentWidget().currentIndex()
|
|
65
|
-
|
|
66
|
-
all_widgets = self.manager.all_widgets()
|
|
67
|
-
for _, group_name, tab_name, group_index, tab_index in all_widgets:
|
|
68
|
-
tab_item = QStandardItem('/'.join((group_name, tab_name)))
|
|
69
|
-
tab_item.setData(group_index, self.GroupIndexRole)
|
|
70
|
-
tab_item.setData(tab_index, self.TabIndexRole)
|
|
71
|
-
root.appendRow(tab_item)
|
|
72
|
-
if group_index == current_group and tab_index == current_tab:
|
|
73
|
-
self.original_model_index = self.indexFromItem(tab_item)
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
class GroupTabFuzzyFilterProxyModel(QSortFilterProxyModel):
|
|
77
|
-
"""Implements a fuzzy search filter proxy model."""
|
|
78
|
-
|
|
79
|
-
def __init__(self, parent=None):
|
|
80
|
-
super(GroupTabFuzzyFilterProxyModel, self).__init__(parent=parent)
|
|
81
|
-
self._fuzzy_regex = None
|
|
82
|
-
|
|
83
|
-
def setFuzzySearch(self, search):
|
|
84
|
-
search = '.*'.join(search)
|
|
85
|
-
# search = '.*{}.*'.format(search)
|
|
86
|
-
self._fuzzy_regex = re.compile(search, re.I)
|
|
87
|
-
self.invalidateFilter()
|
|
88
|
-
|
|
89
|
-
def filterAcceptsRow(self, sourceRow, sourceParent):
|
|
90
|
-
if self.filterKeyColumn() == 0 and self._fuzzy_regex:
|
|
91
|
-
|
|
92
|
-
index = self.sourceModel().index(sourceRow, 0, sourceParent)
|
|
93
|
-
data = self.sourceModel().data(index)
|
|
94
|
-
ret = bool(self._fuzzy_regex.search(data))
|
|
95
|
-
return ret
|
|
96
|
-
|
|
97
|
-
return super(GroupTabFuzzyFilterProxyModel, self).filterAcceptsRow(
|
|
98
|
-
sourceRow, sourceParent
|
|
99
|
-
)
|
|
100
|
-
|
|
101
|
-
def pathFromIndex(self, index):
|
|
102
|
-
parts = [""]
|
|
103
|
-
while index.isValid():
|
|
104
|
-
parts.append(self.data(index, Qt.DisplayRole))
|
|
105
|
-
index = index.parent()
|
|
106
|
-
if len(parts) == 1:
|
|
107
|
-
return ""
|
|
108
|
-
return "/".join([x for x in parts[::-1] if x])
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12,4C14.1,4 16.1,4.8 17.6,6.3C20.7,9.4 20.7,14.5 17.6,17.6C15.8,19.5 13.3,20.2 10.9,19.9L11.4,17.9C13.1,18.1 14.9,17.5 16.2,16.2C18.5,13.9 18.5,10.1 16.2,7.7C15.1,6.6 13.5,6 12,6V10.6L7,5.6L12,0.6V4M6.3,17.6C3.7,15 3.3,11 5.1,7.9L6.6,9.4C5.5,11.6 5.9,14.4 7.8,16.2C8.3,16.7 8.9,17.1 9.6,17.4L9,19.4C8,19 7.1,18.4 6.3,17.6Z" /></svg>
|
|
File without changes
|
|
File without changes
|
|
File without changes
|