Add Ctrl+H to open Settings tab, and let it be closed with Ctrl+X too

This commit is contained in:
Miguel Jacq 2022-03-29 11:27:04 +11:00
parent 08aac5d356
commit ad0a31053a
No known key found for this signature in database
GPG key ID: EEA4341C6D97A0B6
2 changed files with 5 additions and 0 deletions

View file

@ -119,6 +119,8 @@ class MainWindow(QtWidgets.QMainWindow):
)
)
)
sequence = QtGui.QKeySequence(QtCore.Qt.CTRL + QtCore.Qt.Key_H)
self.settings_button.setShortcut(sequence)
self.settings_button.setAccessibleName(strings._("gui_settings_window_title"))
self.settings_button.clicked.connect(self.open_settings)
self.settings_button.setStyleSheet(self.common.gui.css["settings_button"])

View file

@ -249,6 +249,9 @@ class TabWidget(QtWidgets.QTabWidget):
from_autoconnect=from_autoconnect,
)
settings_tab.close_this_tab.connect(self.close_settings_tab)
sequence = QtGui.QKeySequence(QtCore.Qt.CTRL + QtCore.Qt.Key_X)
close_shortcut = QtWidgets.QShortcut(sequence, settings_tab)
close_shortcut.activated.connect(self.close_settings_tab)
self.tor_settings_tab = settings_tab.tor_settings_tab
self.tor_settings_tab.tor_is_connected.connect(self.tor_is_connected)
self.tor_settings_tab.tor_is_disconnected.connect(self.tor_is_disconnected)