Short cut for new editor tab
Create a short cut in the main window for activating a new editor tab (like the editor symbol in the tool bar)
This commit is contained in:
parent
83ad5d9cef
commit
49c49be68a
@ -2,8 +2,8 @@ import os
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
from PyQt5 import QtCore
|
from PyQt5 import QtCore
|
||||||
from PyQt5.QtGui import QIcon, QPixmap
|
from PyQt5.QtGui import QIcon, QPixmap, QKeySequence
|
||||||
from PyQt5.QtWidgets import QMainWindow, QAction, QToolBar, QMessageBox, QMenu, QFileDialog
|
from PyQt5.QtWidgets import QMainWindow, QAction, QToolBar, QMessageBox, QMenu, QFileDialog, QShortcut
|
||||||
from PyQt5.QtCore import Qt, pyqtSlot
|
from PyQt5.QtCore import Qt, pyqtSlot
|
||||||
|
|
||||||
import pygadmin
|
import pygadmin
|
||||||
@ -114,6 +114,11 @@ class MainWindow(QMainWindow):
|
|||||||
# Ensure the right deletion order for closing the application and prevent a warning with QTimer and QThread.
|
# Ensure the right deletion order for closing the application and prevent a warning with QTimer and QThread.
|
||||||
self.setAttribute(QtCore.Qt.WA_DeleteOnClose)
|
self.setAttribute(QtCore.Qt.WA_DeleteOnClose)
|
||||||
|
|
||||||
|
# Define a short cut for getting a new editor tab.
|
||||||
|
self.new_editor_tab_short_cut = QShortcut(QKeySequence("Ctrl+N"), self)
|
||||||
|
# Connect the function for activating a new editor tab with the short cut.
|
||||||
|
self.new_editor_tab_short_cut.activated.connect(self.activate_new_editor_tab)
|
||||||
|
|
||||||
# Load the initial data/server nodes in the tree widget.
|
# Load the initial data/server nodes in the tree widget.
|
||||||
self.dock_widget.tree.init_data()
|
self.dock_widget.tree.init_data()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user