mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2024-11-15 13:15:43 +08:00
b5b251dffb
* Update Python bindings * Add X11Extras to setup.py for Linux builds * Update Python Bindings * Update Python bindings * Update Python Bindings
25 lines
859 B
Python
25 lines
859 B
Python
from PyQt5.QtWidgets import QAction, QMenu
|
|
|
|
|
|
class LoadPerspectiveAction(QAction):
|
|
def __init__(self, parent: QMenu, name: str, dock_manager: 'DockInDockWidget'):
|
|
super().__init__(name, parent)
|
|
self.name = name
|
|
self.dock_manager = dock_manager
|
|
|
|
self.triggered.connect(self.load)
|
|
|
|
def load(self):
|
|
self.dock_manager.getPerspectivesManager().openPerspective(self.name, self.dock_manager)
|
|
|
|
|
|
class RemovePerspectiveAction(QAction):
|
|
def __init__(self, parent: QMenu, name: str, dock_manager: 'DockInDockWidget'):
|
|
super().__init__(name, parent)
|
|
self.name = name
|
|
self.dock_manager = dock_manager
|
|
|
|
self.triggered.connect(self.remove)
|
|
|
|
def remove(self):
|
|
self.dock_manager.getPerspectivesManager().removePerspective(self.name) |