Commit e0324211 authored by Claudio Valerio's avatar Claudio Valerio

fixed issue 882

parent 523d2852
...@@ -17,12 +17,16 @@ ...@@ -17,12 +17,16 @@
#include <QPainterPath> #include <QPainterPath>
#include "UBDockPalette.h" #include "UBDockPalette.h"
#include "core/UBSettings.h"
#include "frameworks/UBPlatformUtils.h" #include "frameworks/UBPlatformUtils.h"
#include "core/UBSettings.h"
#include "core/UBApplication.h" #include "core/UBApplication.h"
#include "core/UBPreferencesController.h" #include "core/UBPreferencesController.h"
#include "core/UBDownloadManager.h" #include "core/UBDownloadManager.h"
#include "board/UBBoardController.h"
#include "core/memcheck.h" #include "core/memcheck.h"
/** /**
...@@ -79,6 +83,8 @@ UBDockPalette::UBDockPalette(eUBDockPaletteType paletteType, QWidget *parent, co ...@@ -79,6 +83,8 @@ UBDockPalette::UBDockPalette(eUBDockPaletteType paletteType, QWidget *parent, co
onToolbarPosUpdated(); onToolbarPosUpdated();
connect(UBSettings::settings()->appToolBarPositionedAtTop, SIGNAL(changed(QVariant)), this, SLOT(onToolbarPosUpdated())); connect(UBSettings::settings()->appToolBarPositionedAtTop, SIGNAL(changed(QVariant)), this, SLOT(onToolbarPosUpdated()));
connect(UBDownloadManager::downloadManager(), SIGNAL(allDownloadsFinished()), this, SLOT(onAllDownloadsFinished())); connect(UBDownloadManager::downloadManager(), SIGNAL(allDownloadsFinished()), this, SLOT(onAllDownloadsFinished()));
connect(UBApplication::boardController,SIGNAL(documentSet(UBDocumentProxy*)),this,SLOT(onDocumentSet(UBDocumentProxy*)));
} }
/** /**
...@@ -98,6 +104,11 @@ UBDockPalette::~UBDockPalette() ...@@ -98,6 +104,11 @@ UBDockPalette::~UBDockPalette()
} }
} }
void UBDockPalette::onDocumentSet(UBDocumentProxy* documentProxy)
{
Q_UNUSED(documentProxy);
}
/** /**
* \brief Get the current orientation * \brief Get the current orientation
* @return the current orientation * @return the current orientation
......
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
#ifndef UBDOCKPALETTE_H #ifndef UBDOCKPALETTE_H
#define UBDOCKPALETTE_H #define UBDOCKPALETTE_H
class UBDocumentProxy;
#include <QWidget> #include <QWidget>
#include <QMouseEvent> #include <QMouseEvent>
#include <QBrush> #include <QBrush>
...@@ -131,6 +133,7 @@ public slots: ...@@ -131,6 +133,7 @@ public slots:
void onShowTabWidget(UBDockPaletteWidget* widget); void onShowTabWidget(UBDockPaletteWidget* widget);
void onHideTabWidget(UBDockPaletteWidget* widget); void onHideTabWidget(UBDockPaletteWidget* widget);
void onAllDownloadsFinished(); void onAllDownloadsFinished();
virtual void onDocumentSet(UBDocumentProxy* documentProxy);
protected: protected:
virtual int border(); virtual int border();
......
...@@ -51,6 +51,14 @@ UBLeftPalette::~UBLeftPalette() ...@@ -51,6 +51,14 @@ UBLeftPalette::~UBLeftPalette()
} }
void UBLeftPalette::onDocumentSet(UBDocumentProxy* documentProxy)
{
//This is necessary to force the teacher guide to be showed in priority each time a document is set
if(documentProxy && UBSettings::settings()->teacherGuidePageZeroActivated->get().toBool())
mLastOpenedTabForMode.insert(eUBDockPaletteWidget_BOARD, 1);
}
/** /**
* \brief Update the maximum width * \brief Update the maximum width
*/ */
......
...@@ -25,6 +25,9 @@ public: ...@@ -25,6 +25,9 @@ public:
bool switchMode(eUBDockPaletteWidgetMode mode); bool switchMode(eUBDockPaletteWidgetMode mode);
public slots:
void onDocumentSet(UBDocumentProxy* documentProxy);
protected: protected:
void updateMaxWidth(); void updateMaxWidth();
void resizeEvent(QResizeEvent *event); void resizeEvent(QResizeEvent *event);
......
...@@ -1149,7 +1149,6 @@ void UBTeacherGuideWidget::onActiveSceneChanged() ...@@ -1149,7 +1149,6 @@ void UBTeacherGuideWidget::onActiveSceneChanged()
mpPageZeroWidget->switchToMode(tUBTGZeroPageMode_EDITION); mpPageZeroWidget->switchToMode(tUBTGZeroPageMode_EDITION);
setCurrentWidget(mpPageZeroWidget); setCurrentWidget(mpPageZeroWidget);
} }
else{ else{
if(mpEditionWidget->isModified()){ if(mpEditionWidget->isModified()){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment