|
|
|
@ -347,14 +347,15 @@ void UBBoardPaletteManager::pagePaletteButtonReleased() |
|
|
|
|
{ |
|
|
|
|
if( mPageButtonPressedTime.msecsTo(QTime::currentTime()) > 900) |
|
|
|
|
{ |
|
|
|
|
// The palette is reinstanciate because the duplication depends on the current scene
|
|
|
|
|
// The palette is reinstanciated because the duplication depends on the current scene
|
|
|
|
|
delete(mPagePalette); |
|
|
|
|
mPagePalette = 0; |
|
|
|
|
QList<QAction*>pageActions; |
|
|
|
|
pageActions << UBApplication::mainWindow->actionNewPage; |
|
|
|
|
UBBoardController* boardController = UBApplication::boardController; |
|
|
|
|
if(UBApplication::documentController->pageCanBeDuplicated(UBDocumentContainer::pageFromSceneIndex(boardController->activeSceneIndex()))) |
|
|
|
|
if(UBApplication::documentController->pageCanBeDuplicated(UBDocumentContainer::pageFromSceneIndex(boardController->activeSceneIndex()))){ |
|
|
|
|
pageActions << UBApplication::mainWindow->actionDuplicatePage; |
|
|
|
|
} |
|
|
|
|
pageActions << UBApplication::mainWindow->actionImportPage; |
|
|
|
|
|
|
|
|
|
mPagePalette = new UBActionPalette(pageActions, Qt::Horizontal , mContainer); |
|
|
|
@ -362,8 +363,12 @@ void UBBoardPaletteManager::pagePaletteButtonReleased() |
|
|
|
|
mPagePalette->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); |
|
|
|
|
mPagePalette->groupActions(); |
|
|
|
|
mPagePalette->setClosable(true); |
|
|
|
|
mPagePalette->adjustSizeAndPosition(); |
|
|
|
|
|
|
|
|
|
// As we recreate the pagePalette every time, we must reconnect the slots
|
|
|
|
|
connect(UBApplication::mainWindow->actionNewPage, SIGNAL(triggered()), mPagePalette, SLOT(close())); |
|
|
|
|
connect(UBApplication::mainWindow->actionDuplicatePage, SIGNAL(triggered()), mPagePalette, SLOT(close())); |
|
|
|
|
connect(UBApplication::mainWindow->actionImportPage, SIGNAL(triggered()), mPagePalette, SLOT(close())); |
|
|
|
|
connect(mPagePalette, SIGNAL(closed()), this, SLOT(pagePaletteClosed())); |
|
|
|
|
|
|
|
|
|
togglePagePalette(true); |
|
|
|
|
} |
|
|
|
|