mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2024-12-26 16:01:36 +08:00
40 lines
1.1 KiB
C++
40 lines
1.1 KiB
C++
|
#include "perspectiveactions.h"
|
||
|
#include "dockindock.h"
|
||
|
#include "perspectives.h"
|
||
|
|
||
|
#include <QMenu>
|
||
|
|
||
|
using namespace QtAdsUtl;
|
||
|
|
||
|
//////////////////////////////
|
||
|
// LoadPerspectiveAction
|
||
|
//////////////////////////////
|
||
|
LoadPerspectiveAction::LoadPerspectiveAction( QMenu* parent, const QString& name, QtAdsUtl::DockInDockWidget& dockManager ) :
|
||
|
QAction( name, parent ),
|
||
|
name( name ),
|
||
|
dockManager( dockManager )
|
||
|
{
|
||
|
connect( this, SIGNAL(triggered()), this, SLOT(load()) );
|
||
|
}
|
||
|
|
||
|
void LoadPerspectiveAction::load()
|
||
|
{
|
||
|
dockManager.getPerspectivesManager()->openPerspective( name, dockManager );
|
||
|
}
|
||
|
|
||
|
//////////////////////////////
|
||
|
// RemovePerspectiveAction
|
||
|
//////////////////////////////
|
||
|
RemovePerspectiveAction::RemovePerspectiveAction( QMenu* parent, const QString& name, QtAdsUtl::DockInDockWidget& dockManager ) :
|
||
|
QAction( name, parent ),
|
||
|
name( name ),
|
||
|
dockManager( dockManager )
|
||
|
{
|
||
|
connect( this, SIGNAL(triggered()), this, SLOT(remove()) );
|
||
|
}
|
||
|
|
||
|
void RemovePerspectiveAction::remove()
|
||
|
{
|
||
|
dockManager.getPerspectivesManager()->removePerspective( name );
|
||
|
}
|