From 9ac508f979040f441ab6c0e47448bbf49360f37e Mon Sep 17 00:00:00 2001 From: Aleksei Kanash Date: Thu, 31 May 2012 13:40:21 +0300 Subject: [PATCH] WebTools palette hides after switching mode from Internet to any other. --- src/board/UBBoardPaletteManager.cpp | 9 +++++++++ src/board/UBBoardPaletteManager.h | 4 ++++ src/web/UBWebController.cpp | 2 +- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/board/UBBoardPaletteManager.cpp b/src/board/UBBoardPaletteManager.cpp index 2173de6b..ca124809 100644 --- a/src/board/UBBoardPaletteManager.cpp +++ b/src/board/UBBoardPaletteManager.cpp @@ -29,6 +29,7 @@ #include "gui/UBKeyboardPalette.h" #include "gui/UBToolWidget.h" #include "gui/UBZoomPalette.h" +#include "gui/UBWebToolsPalette.h" #include "gui/UBActionPalette.h" #include "gui/UBFavoriteToolPalette.h" #include "gui/UBDockTeacherGuideWidget.h" @@ -73,6 +74,7 @@ UBBoardPaletteManager::UBBoardPaletteManager(QWidget* container, UBBoardControll , mRightPalette(NULL) , mBackgroundsPalette(0) , mToolsPalette(0) + , mWebToolsCurrentPalette(0) , mAddItemPalette(0) , mErasePalette(NULL) , mPagePalette(NULL) @@ -683,6 +685,8 @@ void UBBoardPaletteManager::changeMode(eUBDockPaletteWidgetMode newMode, bool is if( !isInit ) containerResized(); + if (mWebToolsCurrentPalette) + mWebToolsCurrentPalette->hide(); } break; @@ -723,6 +727,9 @@ void UBBoardPaletteManager::changeMode(eUBDockPaletteWidgetMode newMode, bool is if( !isInit ) UBApplication::applicationController->uninotesController()->TransparentWidgetResized(); + + if (mWebToolsCurrentPalette) + mWebToolsCurrentPalette->hide(); } break; @@ -764,6 +771,8 @@ void UBBoardPaletteManager::changeMode(eUBDockPaletteWidgetMode newMode, bool is else mKeyboardPalette->setParent(UBApplication::documentController->controlView()); } + if (mWebToolsCurrentPalette) + mWebToolsCurrentPalette->hide(); } break; diff --git a/src/board/UBBoardPaletteManager.h b/src/board/UBBoardPaletteManager.h index 86ef4355..cdb02870 100644 --- a/src/board/UBBoardPaletteManager.h +++ b/src/board/UBBoardPaletteManager.h @@ -30,6 +30,7 @@ #include "gui/UBFeaturesWidget.h" +class UBWebToolsPalette; class UBStylusPalette; class UBClockPalette; class UBPageNumberPalette; @@ -66,6 +67,9 @@ class UBBoardPaletteManager : public QObject UBKeyboardPalette *mKeyboardPalette; + void setCurrentWebToolsPalette(UBWebToolsPalette *palette) {mWebToolsCurrentPalette = palette;} + UBWebToolsPalette* mWebToolsCurrentPalette; + void processPalettersWidget(UBDockPalette *paletter, eUBDockPaletteWidgetMode mode); void changeMode(eUBDockPaletteWidgetMode newMode, bool isInit = false); void startDownloads(); diff --git a/src/web/UBWebController.cpp b/src/web/UBWebController.cpp index 2e975868..96a11de7 100644 --- a/src/web/UBWebController.cpp +++ b/src/web/UBWebController.cpp @@ -424,7 +424,7 @@ void UBWebController::setupPalettes() if(!(*mToolsCurrentPalette)) { (*mToolsCurrentPalette) = new UBWebToolsPalette(UBApplication::mainWindow, false); - + UBApplication::boardController->paletteManager()->setCurrentWebToolsPalette(*mToolsCurrentPalette); #ifndef Q_WS_WIN if (UBPlatformUtils::hasVirtualKeyboard() && UBApplication::boardController->paletteManager()->mKeyboardPalette) connect(UBApplication::boardController->paletteManager()->mKeyboardPalette, SIGNAL(closed()),