Commit e0324211 authored by Claudio Valerio's avatar Claudio Valerio

fixed issue 882

parent 523d2852
......@@ -17,12 +17,16 @@
#include <QPainterPath>
#include "UBDockPalette.h"
#include "core/UBSettings.h"
#include "frameworks/UBPlatformUtils.h"
#include "core/UBSettings.h"
#include "core/UBApplication.h"
#include "core/UBPreferencesController.h"
#include "core/UBDownloadManager.h"
#include "board/UBBoardController.h"
#include "core/memcheck.h"
/**
......@@ -79,6 +83,8 @@ UBDockPalette::UBDockPalette(eUBDockPaletteType paletteType, QWidget *parent, co
onToolbarPosUpdated();
connect(UBSettings::settings()->appToolBarPositionedAtTop, SIGNAL(changed(QVariant)), this, SLOT(onToolbarPosUpdated()));
connect(UBDownloadManager::downloadManager(), SIGNAL(allDownloadsFinished()), this, SLOT(onAllDownloadsFinished()));
connect(UBApplication::boardController,SIGNAL(documentSet(UBDocumentProxy*)),this,SLOT(onDocumentSet(UBDocumentProxy*)));
}
/**
......@@ -98,6 +104,11 @@ UBDockPalette::~UBDockPalette()
}
}
void UBDockPalette::onDocumentSet(UBDocumentProxy* documentProxy)
{
Q_UNUSED(documentProxy);
}
/**
* \brief Get the current orientation
* @return the current orientation
......
......@@ -15,6 +15,8 @@
#ifndef UBDOCKPALETTE_H
#define UBDOCKPALETTE_H
class UBDocumentProxy;
#include <QWidget>
#include <QMouseEvent>
#include <QBrush>
......@@ -131,6 +133,7 @@ public slots:
void onShowTabWidget(UBDockPaletteWidget* widget);
void onHideTabWidget(UBDockPaletteWidget* widget);
void onAllDownloadsFinished();
virtual void onDocumentSet(UBDocumentProxy* documentProxy);
protected:
virtual int border();
......
......@@ -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
*/
......
......@@ -25,6 +25,9 @@ public:
bool switchMode(eUBDockPaletteWidgetMode mode);
public slots:
void onDocumentSet(UBDocumentProxy* documentProxy);
protected:
void updateMaxWidth();
void resizeEvent(QResizeEvent *event);
......
......@@ -1149,7 +1149,6 @@ void UBTeacherGuideWidget::onActiveSceneChanged()
mpPageZeroWidget->switchToMode(tUBTGZeroPageMode_EDITION);
setCurrentWidget(mpPageZeroWidget);
}
else{
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