Skip to content

Commit

Permalink
Fixed the ui shortcuts to not use | anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
ewerybody committed Nov 10, 2022
1 parent 84fd115 commit ee4d1ab
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
15 changes: 9 additions & 6 deletions ui/a2ui/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
a2ui - setup interface for an Autohotkey environment.
a2ui - Setup User Interface for an Autohotkey runtime.
"""
import os
import sys
Expand All @@ -20,8 +20,9 @@
RESTART_DELAY = 300
RUNTIME_WATCH_INTERVAL = 1000
DEFAULT_WIN_SIZE = (700, 480)
TITLE_ONLINE = 'Runtime is Live!'
TITLE_OFFLINE = 'Runtime is Offline!'
_TITLE_PREFIX = 'Runtime is'
TITLE_ONLINE = _TITLE_PREFIX + ' Live!'
TITLE_OFFLINE = _TITLE_PREFIX + ' Offline!'


class A2Window(QtWidgets.QMainWindow):
Expand Down Expand Up @@ -189,6 +190,8 @@ def _setup_actions(self):
self._make_url_action(self.ui.actionChat_on_Gitter, self.a2.urls.gitter, Icons.gitter)
self._make_url_action(self.ui.actionChat_on_Telegram, self.a2.urls.telegram, Icons.telegram)

self.ui.actionInspect_UI.triggered.connect(self._inspect_ui)

def _make_url_action(self, action: QtGui.QAction, url: str, icon: QtGui.QIcon):
action.setData(url)
action.setIcon(icon)
Expand All @@ -205,9 +208,9 @@ def _setup_shortcuts(self):

for keys, parent, func in (
(Qt.Key_Escape, self, self.escape),
(Qt.CTRL | Qt.Key_Enter, self, self.edit_submit),
(Qt.CTRL | Qt.Key_Return, self, self.edit_submit),
(Qt.CTRL | Qt.Key_S, self, self.edit_submit),
('Ctrl+Enter', self, self.edit_submit),
('Ctrl+Return', self, self.edit_submit),
('Ctrl+S', self, self.edit_submit),
(Qt.Key_Home, scroll_area, self.scroll_to_start),
(Qt.Key_End, scroll_area, self.scroll_to_end),
(Qt.Key_F1, self, self.module_view.help),
Expand Down
3 changes: 2 additions & 1 deletion ui/typings/a2qt/QtGui.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -7447,6 +7447,7 @@ class QSessionManager(QtCore.QObject):


class QShortcut(QtCore.QObject):
activated : QtCore.Signal = ...

@overload
def __init__(self, arg__1:QtGui.QKeySequence.StandardKey, arg__2:QtCore.QObject, arg__3:Callable, arg__4:QtCore.Qt.ShortcutContext=...) -> None: ...
Expand All @@ -7457,7 +7458,7 @@ class QShortcut(QtCore.QObject):
@overload
def __init__(self, key:Union[QtGui.QKeySequence, QtCore.QKeyCombination, QtGui.QKeySequence.StandardKey, str, int], parent:QtCore.QObject, member:Optional[bytes]=..., ambiguousMember:Optional[bytes]=..., context:QtCore.Qt.ShortcutContext=...) -> None: ...
@overload
def __init__(self, parent:QtCore.QObject) -> None: ...
def __init__(self, parent:QtCore.QObject | None) -> None: ...

def autoRepeat(self) -> bool: ...
def context(self) -> QtCore.Qt.ShortcutContext: ...
Expand Down

0 comments on commit ee4d1ab

Please sign in to comment.