Merge branch 'master' of github.com:Sankore/Sankore-3.1

Conflicts:
	src/gui/UBTeacherBarWidget.cpp
	src/gui/UBTeacherBarWidget.h
preferencesAboutTextFull
shibakaneki 13 years ago
commit 6a109355c0
  1. 1
      src/adaptors/UBSvgSubsetAdaptor.cpp
  2. 1
      src/board/UBBoardController.cpp
  3. 1
      src/board/UBBoardController.h
  4. 121
      src/board/UBBoardPaletteManager.cpp
  5. 16
      src/board/UBBoardPaletteManager.h
  6. 2
      src/board/UBBoardView.cpp
  7. 16
      src/core/UBApplicationController.cpp
  8. 89
      src/core/UBPersistenceManager.cpp
  9. 19
      src/core/UBPersistenceManager.h
  10. 40
      src/desktop/UBDesktopAnnotationController.cpp
  11. 3
      src/desktop/UBDesktopAnnotationController.h
  12. 2
      src/domain/UBGraphicsScene.cpp
  13. 2
      src/gui/UBDockPalette.h
  14. 13
      src/gui/UBDockPaletteWidget.cpp
  15. 20
      src/gui/UBDockPaletteWidget.h
  16. 7
      src/gui/UBDocumentNavigator.cpp
  17. 37
      src/gui/UBTeacherBarWidget.cpp
  18. 1
      src/gui/UBTeacherBarWidget.h

@ -2415,7 +2415,6 @@ UBGraphicsCurtainItem* UBSvgSubsetAdaptor::UBSvgSubsetReader::curtainItemFromSvg
QRectF rect = curtainItem->rect(); QRectF rect = curtainItem->rect();
rect.setWidth(svgWidth.toString().toFloat()); rect.setWidth(svgWidth.toString().toFloat());
rect.setHeight(svgHeight.toString().toFloat()); rect.setHeight(svgHeight.toString().toFloat());
rect.translate(-rect.center());
curtainItem->setRect(rect); curtainItem->setRect(rect);

@ -1981,3 +1981,4 @@ void UBBoardController::notifyPageChanged()
} }

@ -263,7 +263,6 @@ class UBBoardController : public QObject
void pageChanged(); void pageChanged();
void setDocOnPageNavigator(UBDocumentProxy* doc); void setDocOnPageNavigator(UBDocumentProxy* doc);
void documentReorganized(int index); void documentReorganized(int index);
void pageWillChange(int page, int nextPage);
protected: protected:

@ -38,6 +38,9 @@
#include "web/browser/WBTabWidget.h" #include "web/browser/WBTabWidget.h"
#include "web/browser/WBWebView.h" #include "web/browser/WBWebView.h"
#include "desktop/UBDesktopAnnotationController.h"
#include "network/UBNetworkAccessManager.h" #include "network/UBNetworkAccessManager.h"
#include "network/UBServerXMLHttpRequest.h" #include "network/UBServerXMLHttpRequest.h"
@ -76,7 +79,7 @@ UBBoardPaletteManager::UBBoardPaletteManager(QWidget* container, UBBoardControll
, mpPageNavigWidget(NULL) , mpPageNavigWidget(NULL)
, mpLibWidget(NULL) , mpLibWidget(NULL)
, mpCachePropWidget(NULL) , mpCachePropWidget(NULL)
, mDesktopRightPalette(NULL) // , mDesktopRightPalette(NULL)
, mpTeacherBarWidget(NULL) , mpTeacherBarWidget(NULL)
, mpDesktopLibWidget(NULL) , mpDesktopLibWidget(NULL)
{ {
@ -131,11 +134,11 @@ UBBoardPaletteManager::~UBBoardPaletteManager()
delete mpDesktopLibWidget; delete mpDesktopLibWidget;
mpDesktopLibWidget = NULL; mpDesktopLibWidget = NULL;
} }
if(NULL != mDesktopRightPalette) // if(NULL != mDesktopRightPalette)
{ // {
delete mDesktopRightPalette; // delete mDesktopRightPalette;
mDesktopRightPalette = NULL; // mDesktopRightPalette = NULL;
} // }
} }
void UBBoardPaletteManager::initPalettesPosAtStartup() void UBBoardPaletteManager::initPalettesPosAtStartup()
@ -153,34 +156,65 @@ void UBBoardPaletteManager::setupLayout()
*/ */
void UBBoardPaletteManager::setupDockPaletteWidgets() void UBBoardPaletteManager::setupDockPaletteWidgets()
{ {
//------------------------------------------------//
// Create the widgets for the dock palettes
mpPageNavigWidget = new UBPageNavigationWidget();
mpPageNavigWidget->registerMode(eUBDockPaletteWidget_BOARD);
connect(this, SIGNAL(signal_changeMode(eUBDockPaletteWidgetMode)), mpPageNavigWidget, SLOT(slot_changeMode(eUBDockPaletteWidgetMode)));
mpLibWidget = new UBLibWidget();
mpLibWidget ->registerMode(eUBDockPaletteWidget_BOARD);
mpLibWidget ->registerMode(eUBDockPaletteWidget_DESKTOP);
connect(this, SIGNAL(signal_changeMode(eUBDockPaletteWidgetMode)), mpLibWidget, SLOT(slot_changeMode(eUBDockPaletteWidgetMode)));
// mpCachePropWidget = new UBCachePropertiesWidget();
// mpCachePropWidget->registerMode(eUBDockPaletteWidget_BOARD);
// connect(this, SIGNAL(signal_changeMode(eUBDockPaletteWidgetMode)), mpCachePropWidget, SLOT(slot_changeMode(eUBDockPaletteWidgetMode)));
// mpTeacherBarWidget = new UBTeacherBarWidget();
// mpTeacherBarWidget->registerMode(eUBDockPaletteWidget_BOARD);
// connect(this, SIGNAL(signal_changeMode(eUBDockPaletteWidgetMode)), mpTeacherBarWidget, SLOT(slot_changeMode(eUBDockPaletteWidgetMode)));
//------------------------------------------------//
// Add the dock palettes
mLeftPalette = new UBLeftPalette(mContainer);
// LEFT palette widgets // LEFT palette widgets
mLeftPalette->registerWidget(mpPageNavigWidget); mLeftPalette->registerWidget(mpPageNavigWidget);
mLeftPalette->addTabWidget(mpPageNavigWidget); mLeftPalette->addTabWidget(mpPageNavigWidget);
mLeftPalette->connectSignals(); mLeftPalette->connectSignals();
//------------------------------------------------//
mRightPalette = new UBRightPalette(mContainer);
// RIGHT palette widgets // RIGHT palette widgets
mRightPalette->registerWidget(mpLibWidget); mRightPalette->registerWidget(mpLibWidget);
mRightPalette->registerWidget(mpCachePropWidget);
mRightPalette->addTabWidget(mpLibWidget); mRightPalette->addTabWidget(mpLibWidget);
mRightPalette->registerWidget(mpTeacherBarWidget); // // ???
mRightPalette->addTabWidget(mpTeacherBarWidget); // mRightPalette->registerWidget(mpCachePropWidget);
// mRightPalette->addTabWidget(mpCachePropWidget);
// // ???
// mRightPalette->registerWidget(mpTeacherBarWidget);
// mRightPalette->addTabWidget(mpTeacherBarWidget);
mRightPalette->connectSignals(); mRightPalette->connectSignals();
//------------------------------------------------//
mLeftPalette->showTabWidget(0); mLeftPalette->showTabWidget(0);
mRightPalette->showTabWidget(0); mRightPalette->showTabWidget(0);
//------------------------------------------------//
} }
void UBBoardPaletteManager::setupPalettes() void UBBoardPaletteManager::setupPalettes()
{ {
// Add the dock palettes
mLeftPalette = new UBLeftPalette(mContainer);
mRightPalette = new UBRightPalette(mContainer);
// Create the widgets for the dock palettes
mpPageNavigWidget = new UBPageNavigationWidget();
mpLibWidget = new UBLibWidget();
mpCachePropWidget = new UBCachePropertiesWidget();
mpTeacherBarWidget = new UBTeacherBarWidget();
setupDockPaletteWidgets(); setupDockPaletteWidgets();
@ -435,6 +469,8 @@ void UBBoardPaletteManager::containerResized()
mKeyboardPalette->adjustSizeAndPosition(); mKeyboardPalette->adjustSizeAndPosition();
} }
mLeftPalette->resize(mLeftPalette->width()-1, mContainer->height());
mRightPalette->resize(mRightPalette->width()-1, mContainer->height());
mLeftPalette->resize(mLeftPalette->width(), mContainer->height()); mLeftPalette->resize(mLeftPalette->width(), mContainer->height());
mRightPalette->resize(mRightPalette->width(), mContainer->height()); mRightPalette->resize(mRightPalette->width(), mContainer->height());
} }
@ -569,6 +605,53 @@ void UBBoardPaletteManager::addItem(const QUrl& pUrl)
} }
void UBBoardPaletteManager::changeMode(eUBDockPaletteWidgetMode newMode)
{
switch( newMode )
{
case eUBDockPaletteWidget_BOARD:
{
mLeftPalette->setParent(UBApplication::boardController->controlContainer());
mRightPalette->setParent(UBApplication::boardController->controlContainer());
mLeftPalette->setVisible(true);
mRightPalette->setVisible(true);
containerResized();
}
break;
case eUBDockPaletteWidget_DESKTOP:
{
mLeftPalette->setParent((QWidget*)UBApplication::applicationController->uninotesController()->drawingView());
mRightPalette->setParent((QWidget*)UBApplication::applicationController->uninotesController()->drawingView());
mLeftPalette->setVisible(false);
mRightPalette->setVisible(true);
UBApplication::applicationController->uninotesController()->TransparentWidgetResized();
}
break;
default:
{
mLeftPalette->setVisible(false);
mRightPalette->setVisible(false);
mLeftPalette->setParent(0);
mRightPalette->setParent(0);
}
break;
}
emit signal_changeMode(newMode);
}
/*
void UBBoardPaletteManager::slot_changeMode(eUBDockPaletteWidgetMode newMode)
{
emit signal_changeMode(newMode);
}
*/
void UBBoardPaletteManager::addItem(const QPixmap& pPixmap, const QPointF& pos, qreal scaleFactor, const QUrl& sourceUrl) void UBBoardPaletteManager::addItem(const QPixmap& pPixmap, const QPointF& pos, qreal scaleFactor, const QUrl& sourceUrl)
{ {
@ -719,6 +802,7 @@ void UBBoardPaletteManager::changeStylusPaletteOrientation(QVariant var)
mStylusPalette->setVisible(bVisible); // always show stylus palette at startup mStylusPalette->setVisible(bVisible); // always show stylus palette at startup
} }
/*
UBRightPalette* UBBoardPaletteManager::createDesktopRightPalette(QWidget* parent) UBRightPalette* UBBoardPaletteManager::createDesktopRightPalette(QWidget* parent)
{ {
mpDesktopLibWidget = new UBLibWidget(); mpDesktopLibWidget = new UBLibWidget();
@ -729,6 +813,7 @@ UBRightPalette* UBBoardPaletteManager::createDesktopRightPalette(QWidget* parent
return mDesktopRightPalette; return mDesktopRightPalette;
} }
*/
void UBBoardPaletteManager::connectToDocumentController() void UBBoardPaletteManager::connectToDocumentController()
{ {

@ -48,16 +48,20 @@ class UBBoardPaletteManager : public QObject
void setupLayout(); void setupLayout();
UBLeftPalette* leftPalette(){return mLeftPalette;} UBLeftPalette* leftPalette(){return mLeftPalette;}
UBRightPalette* rightPalette(){return mRightPalette;}
void showVirtualKeyboard(bool show = true); void showVirtualKeyboard(bool show = true);
void initPalettesPosAtStartup(); void initPalettesPosAtStartup();
void connectToDocumentController(); void connectToDocumentController();
void refreshPalettes(); void refreshPalettes();
UBKeyboardPalette *mKeyboardPalette; UBKeyboardPalette *mKeyboardPalette;
UBRightPalette* createDesktopRightPalette(QWidget* parent); // UBRightPalette* createDesktopRightPalette(QWidget* parent);
void changeMode(eUBDockPaletteWidgetMode newMode);
signals: signals:
void connectToDocController(); void connectToDocController();
void signal_changeMode(eUBDockPaletteWidgetMode newMode);
public slots: public slots:
@ -66,6 +70,8 @@ class UBBoardPaletteManager : public QObject
void addItem(const QUrl& pUrl); void addItem(const QUrl& pUrl);
void addItem(const QPixmap& pPixmap, const QPointF& p = QPointF(0.0, 0.0), qreal scale = 1.0, const QUrl& sourceUrl = QUrl()); void addItem(const QPixmap& pPixmap, const QPointF& p = QPointF(0.0, 0.0), qreal scale = 1.0, const QUrl& sourceUrl = QUrl());
// void slot_changeMode(eUBDockPaletteWidgetMode newMode);
private: private:
void setupPalettes(); void setupPalettes();
@ -85,10 +91,10 @@ class UBBoardPaletteManager : public QObject
/** The right dock palette */ /** The right dock palette */
UBRightPalette* mRightPalette; UBRightPalette* mRightPalette;
// HACK: here we duplicate the right palette for the desktop mode // // HACK: here we duplicate the right palette for the desktop mode
// we MUST refactor the architecture in order to use only one // // we MUST refactor the architecture in order to use only one
// right palette! // // right palette!
UBRightPalette* mDesktopRightPalette; // UBRightPalette* mDesktopRightPalette;
UBActionPalette *mBackgroundsPalette; UBActionPalette *mBackgroundsPalette;
UBActionPalette *mToolsPalette; UBActionPalette *mToolsPalette;

@ -660,8 +660,8 @@ UBBoardView::wheelEvent (QWheelEvent *wheelEvent)
QBool isSlectedAndMouseHower = itemsList.contains(selItem); QBool isSlectedAndMouseHower = itemsList.contains(selItem);
if(isSlectedAndMouseHower) if(isSlectedAndMouseHower)
{ {
wheelEvent->accept();
QGraphicsView::wheelEvent(wheelEvent); QGraphicsView::wheelEvent(wheelEvent);
wheelEvent->accept();
} }
} }

@ -336,6 +336,7 @@ void UBApplicationController::showBoard()
mMainWindow->boardToolBar->show(); mMainWindow->boardToolBar->show();
mMainMode = Board; mMainMode = Board;
UBApplication::boardController->paletteManager()->changeMode(eUBDockPaletteWidget_BOARD);
adaptToolBar(); adaptToolBar();
@ -352,6 +353,8 @@ void UBApplicationController::showBoard()
mUninoteController->hideWindow(); mUninoteController->hideWindow();
mMainWindow->show(); mMainWindow->show();
// UBApplication::boardController->paletteManager()->changeMode(eUBDockPaletteWidget_BOARD);
emit mainModeChanged(Board); emit mainModeChanged(Board);
} }
@ -365,6 +368,8 @@ void UBApplicationController::showInternet()
UBApplication::boardController->hide(); UBApplication::boardController->hide();
} }
UBApplication::boardController->paletteManager()->changeMode(eUBDockPaletteWidget_WEB);
if (UBSettings::settings()->webUseExternalBrowser->get().toBool()) if (UBSettings::settings()->webUseExternalBrowser->get().toBool())
{ {
showDesktop(true); showDesktop(true);
@ -384,8 +389,10 @@ void UBApplicationController::showInternet()
mUninoteController->hideWindow(); mUninoteController->hideWindow();
emit mainModeChanged(Internet); emit mainModeChanged(Internet);
} }
UBApplication::webController->show(UBWebController::WebBrowser);
// UBApplication::boardController->paletteManager()->changeMode(eUBDockPaletteWidget_WEB);
UBApplication::webController->show(UBWebController::WebBrowser);
} }
@ -397,6 +404,7 @@ void UBApplicationController::showDocument()
mMainWindow->documentToolBar->show(); mMainWindow->documentToolBar->show();
mMainMode = Document; mMainMode = Document;
UBApplication::boardController->paletteManager()->changeMode(eUBDockPaletteWidget_DOCUMENT);
adaptToolBar(); adaptToolBar();
@ -418,6 +426,8 @@ void UBApplicationController::showDocument()
mUninoteController->hideWindow(); mUninoteController->hideWindow();
// UBApplication::boardController->paletteManager()->changeMode(eUBDockPaletteWidget_DOCUMENT);
emit mainModeChanged(Document); emit mainModeChanged(Document);
} }
@ -429,6 +439,8 @@ void UBApplicationController::showDesktop(bool dontSwitchFrontProcess)
UBApplication::boardController->hide(); UBApplication::boardController->hide();
mMainWindow->hide(); mMainWindow->hide();
UBApplication::boardController->paletteManager()->changeMode(eUBDockPaletteWidget_DESKTOP);
mUninoteController->showWindow(); mUninoteController->showWindow();
if (mMirror) if (mMirror)
@ -444,6 +456,8 @@ void UBApplicationController::showDesktop(bool dontSwitchFrontProcess)
UBPlatformUtils::bringPreviousProcessToFront(); UBPlatformUtils::bringPreviousProcessToFront();
} }
// UBApplication::boardController->paletteManager()->changeMode(eUBDockPaletteWidget_DESKTOP);
UBDrawingController::drawingController()->setStylusTool(UBStylusTool::Selector); UBDrawingController::drawingController()->setStylusTool(UBStylusTool::Selector);
} }

@ -592,6 +592,7 @@ UBGraphicsScene* UBPersistenceManager::loadDocumentScene(UBDocumentProxy* proxy,
{ {
if (mSceneCache.contains(proxy, sceneIndex)) if (mSceneCache.contains(proxy, sceneIndex))
{ {
//qDebug() << "scene" << sceneIndex << "retrieved from cache ...";
return mSceneCache.value(proxy, sceneIndex); return mSceneCache.value(proxy, sceneIndex);
} }
else else
@ -617,6 +618,8 @@ void UBPersistenceManager::persistDocumentScene(UBDocumentProxy* pDocumentProxy,
QDir dir(pDocumentProxy->persistencePath()); QDir dir(pDocumentProxy->persistencePath());
dir.mkpath(pDocumentProxy->persistencePath()); dir.mkpath(pDocumentProxy->persistencePath());
qDebug() << "saving page" << pSceneIndex + 1 << pDocumentProxy->persistencePath();
if (pDocumentProxy->isModified()) if (pDocumentProxy->isModified())
UBMetadataDcSubsetAdaptor::persist(pDocumentProxy); UBMetadataDcSubsetAdaptor::persist(pDocumentProxy);
@ -635,92 +638,6 @@ void UBPersistenceManager::persistDocumentScene(UBDocumentProxy* pDocumentProxy,
} }
void UBPersistenceManager::persistTeacherBar(UBDocumentProxy* pDocumentProxy, int page, sTeacherBarInfos infos)
{
if(NULL != pDocumentProxy)
{
QFile f(pDocumentProxy->persistencePath() + UBFileSystemUtils::digitFileFormat("/page%1.svg", page + 1));
if(f.exists())
{
if(f.open(QIODevice::ReadOnly))
{
QDomDocument domDoc;
if(domDoc.setContent(f.readAll()))
{
f.close();
if(f.open(QIODevice::WriteOnly))
{
QDomElement rootElem = domDoc.documentElement();
QDomNode teacherBarNode = domDoc.namedItem("teacherBar");
if(teacherBarNode.isNull())
{
// Create the element
QDomElement teacherElem = domDoc.createElement("teacherBar");
rootElem.appendChild(teacherElem);
teacherBarNode = teacherElem;
}
// Set the <teacherBar> element values
QDomElement teacherBarElem = teacherBarNode.toElement();
teacherBarElem.setAttribute("title", infos.title);
teacherBarElem.setAttribute("phasis", infos.phasis);
teacherBarElem.setAttribute("duration", infos.Duration);
teacherBarElem.setAttribute("equipment", infos.material);
teacherBarElem.setAttribute("activity", infos.activity);
teacherBarElem.setAttribute("action1Teacher", infos.action1Master);
teacherBarElem.setAttribute("action1Student", infos.action1Student);
teacherBarElem.setAttribute("action2Teacher", infos.action2Master);
teacherBarElem.setAttribute("action2Student", infos.action2Student);
teacherBarElem.setAttribute("action3Teacher", infos.action3Master);
teacherBarElem.setAttribute("action3Student", infos.action3Student);
// Save the file
f.write(domDoc.toString().toAscii());
f.close();
}
}
f.close();
}
}
}
}
sTeacherBarInfos UBPersistenceManager::getTeacherBarInfos(UBDocumentProxy* pDocumentProxy, int page)
{
sTeacherBarInfos infos;
if(NULL != pDocumentProxy)
{
QFile f(pDocumentProxy->persistencePath() + UBFileSystemUtils::digitFileFormat("/page%1.svg", page + 1));
if(f.exists())
{
if(f.open(QIODevice::ReadWrite))
{
QDomDocument domDoc;
if(domDoc.setContent(f.readAll()))
{
QDomElement rootElem = domDoc.documentElement();
QDomNode teacherBarNode = rootElem.namedItem("teacherBar");
infos.title = teacherBarNode.toElement().attributeNode("title").value();
infos.phasis = teacherBarNode.toElement().attributeNode("phasis").value().toInt();
infos.Duration = teacherBarNode.toElement().attributeNode("duration").value().toInt();
infos.material = teacherBarNode.toElement().attributeNode("equipment").value();
infos.activity = teacherBarNode.toElement().attributeNode("activity").value().toInt();
infos.action1Master = teacherBarNode.toElement().attributeNode("action1Teacher").value();
infos.action1Student = teacherBarNode.toElement().attributeNode("action1Student").value();
infos.action2Master = teacherBarNode.toElement().attributeNode("action2Teacher").value();
infos.action2Student = teacherBarNode.toElement().attributeNode("action2Student").value();
infos.action3Master = teacherBarNode.toElement().attributeNode("action3Teacher").value();
infos.action3Student = teacherBarNode.toElement().attributeNode("action3Student").value();
}
f.close();
}
}
}
return infos;
}
UBDocumentProxy* UBPersistenceManager::persistDocumentMetadata(UBDocumentProxy* pDocumentProxy) UBDocumentProxy* UBPersistenceManager::persistDocumentMetadata(UBDocumentProxy* pDocumentProxy)
{ {

@ -20,21 +20,6 @@
#include "UBSceneCache.h" #include "UBSceneCache.h"
struct sTeacherBarInfos
{
QString title;
int phasis;
int Duration;
QString material;
int activity;
QString action1Master;
QString action1Student;
QString action2Master;
QString action2Student;
QString action3Master;
QString action3Student;
};
class UBDocument; class UBDocument;
class UBDocumentProxy; class UBDocumentProxy;
class UBGraphicsScene; class UBGraphicsScene;
@ -75,10 +60,6 @@ class UBPersistenceManager : public QObject
virtual void persistDocumentScene(UBDocumentProxy* pDocumentProxy, virtual void persistDocumentScene(UBDocumentProxy* pDocumentProxy,
UBGraphicsScene* pScene, const int pSceneIndex); UBGraphicsScene* pScene, const int pSceneIndex);
virtual void persistTeacherBar(UBDocumentProxy* pDocumentProxy, int page, sTeacherBarInfos infos);
sTeacherBarInfos getTeacherBarInfos(UBDocumentProxy* pDocumentProxy, int page);
virtual UBGraphicsScene* createDocumentSceneAt(UBDocumentProxy* pDocumentProxy, int index); virtual UBGraphicsScene* createDocumentSceneAt(UBDocumentProxy* pDocumentProxy, int index);
virtual void insertDocumentSceneAt(UBDocumentProxy* pDocumentProxy, UBGraphicsScene* scene, int index); virtual void insertDocumentSceneAt(UBDocumentProxy* pDocumentProxy, UBGraphicsScene* scene, int index);

@ -56,7 +56,7 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent)
, mDesktopPenPalette(NULL) , mDesktopPenPalette(NULL)
, mDesktopMarkerPalette(NULL) , mDesktopMarkerPalette(NULL)
, mDesktopEraserPalette(NULL) , mDesktopEraserPalette(NULL)
, mRightPalette(NULL) // , mRightPalette(NULL)
, mWindowPositionInitialized(0) , mWindowPositionInitialized(0)
, mIsFullyTransparent(false) , mIsFullyTransparent(false)
, mDesktopToolsPalettePositioned(false) , mDesktopToolsPalettePositioned(false)
@ -89,7 +89,7 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent)
mTransparentDrawingScene = new UBGraphicsScene(0); mTransparentDrawingScene = new UBGraphicsScene(0);
mTransparentDrawingView->setScene(mTransparentDrawingScene); mTransparentDrawingView->setScene(mTransparentDrawingScene);
mRightPalette = UBApplication::boardController->paletteManager()->createDesktopRightPalette(mTransparentDrawingView); // mRightPalette = UBApplication::boardController->paletteManager()->createDesktopRightPalette(mTransparentDrawingView);
//mRightPalette = new UBRightPalette(mTransparentDrawingView); //mRightPalette = new UBRightPalette(mTransparentDrawingView);
mDesktopPalette = new UBDesktopPalette(mTransparentDrawingView); mDesktopPalette = new UBDesktopPalette(mTransparentDrawingView);
@ -158,7 +158,8 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent)
#ifdef Q_WS_X11 #ifdef Q_WS_X11
connect(mDesktopPalette, SIGNAL(moving()), this, SLOT(refreshMask())); connect(mDesktopPalette, SIGNAL(moving()), this, SLOT(refreshMask()));
connect(mRightPalette, SIGNAL(resized()), this, SLOT(refreshMask())); // connect(mRightPalette, SIGNAL(resized()), this, SLOT(refreshMask()));
connect(UBApplication::boardController->paletteManager()->rightPalette(), SIGNAL(resized()), this, SLOT(refreshMask()));
#endif #endif
onDesktopPaletteMaximized(); onDesktopPaletteMaximized();
} }
@ -859,12 +860,34 @@ void UBDesktopAnnotationController::onDesktopPaletteMinimize()
} }
} }
void UBDesktopAnnotationController::TransparentWidgetResized()
{
/*
int rW = UBApplication::boardController->paletteManager()->rightPalette()->width();
int rH_ = UBApplication::boardController->paletteManager()->rightPalette()->height();
int rH = mTransparentDrawingView->height();
UBApplication::boardController->paletteManager()->rightPalette()->resize(rW+1, rH);
// UBApplication::boardController->paletteManager()->rightPalette()->resize(500, 500);
*/
onTransparentWidgetResized();
}
/** /**
* \brief Resize the library palette. * \brief Resize the library palette.
*/ */
void UBDesktopAnnotationController::onTransparentWidgetResized() void UBDesktopAnnotationController::onTransparentWidgetResized()
{ {
mRightPalette->resize(mRightPalette->width(), mTransparentDrawingView->height()); int rW = UBApplication::boardController->paletteManager()->rightPalette()->width();
int rH_ = UBApplication::boardController->paletteManager()->rightPalette()->height();
int rH = mTransparentDrawingView->height();
UBApplication::boardController->paletteManager()->rightPalette()->resize(rW+1, rH);
UBApplication::boardController->paletteManager()->rightPalette()->resize(rW, rH);
// mRightPalette->resize(mRightPalette->width(), mTransparentDrawingView->height());
} }
void UBDesktopAnnotationController::updateMask(bool bTransparent) void UBDesktopAnnotationController::updateMask(bool bTransparent)
@ -891,10 +914,15 @@ void UBDesktopAnnotationController::updateMask(bool bTransparent)
{ {
p.drawRect(mKeyboardPalette->geometry().x(), mKeyboardPalette->geometry().y(), mKeyboardPalette->width(), mKeyboardPalette->height()); p.drawRect(mKeyboardPalette->geometry().x(), mKeyboardPalette->geometry().y(), mKeyboardPalette->width(), mKeyboardPalette->height());
} }
if(mRightPalette->isVisible())
// UBApplication::boardController->paletteManager()->mDesktopRightPalette
if(UBApplication::boardController->paletteManager()->rightPalette()->isVisible())
{ {
qDebug() << ">>>>>> Drawing the mask for the right palette"; qDebug() << ">>>>>> Drawing the mask for the right palette";
p.drawRect(mRightPalette->geometry().x(), mRightPalette->geometry().y(), mRightPalette->width(), mRightPalette->height()); p.drawRect(UBApplication::boardController->paletteManager()->rightPalette()->geometry().x(),
UBApplication::boardController->paletteManager()->rightPalette()->geometry().y(),
UBApplication::boardController->paletteManager()->rightPalette()->width(),
UBApplication::boardController->paletteManager()->rightPalette()->height());
} }
p.end(); p.end();

@ -55,6 +55,9 @@ class UBDesktopAnnotationController : public QObject
UBDesktopPalette *desktopPalette(); UBDesktopPalette *desktopPalette();
UBBoardView *drawingView(); UBBoardView *drawingView();
void TransparentWidgetResized();
public slots: public slots:
void screenLayoutChanged(); void screenLayoutChanged();

@ -1171,7 +1171,7 @@ void UBGraphicsScene::addGraphicsWidget(UBGraphicsWidgetItem* graphicsWidget, co
if (graphicsWidget->widgetWebView()->canBeContent()) if (graphicsWidget->widgetWebView()->canBeContent())
{ {
graphicsWidget->widgetWebView()->loadMainHtml(); // graphicsWidget->widgetWebView()->loadMainHtml();
graphicsWidget->setSelected(true); graphicsWidget->setSelected(true);
UBGraphicsItemUndoCommand* uc = new UBGraphicsItemUndoCommand(this, 0, graphicsWidget); UBGraphicsItemUndoCommand* uc = new UBGraphicsItemUndoCommand(this, 0, graphicsWidget);

@ -123,6 +123,8 @@ protected:
/** The current widget */ /** The current widget */
QVector<UBDockPaletteWidget*> mRegisteredWidgets; QVector<UBDockPaletteWidget*> mRegisteredWidgets;
// QVector<UBDockPaletteWidget*> mVisibleWidgets; // ???
private slots: private slots:
void onToolbarPosUpdated(); void onToolbarPosUpdated();
void onResizeRequest(QResizeEvent* event); void onResizeRequest(QResizeEvent* event);

@ -24,3 +24,16 @@ QString UBDockPaletteWidget::name()
{ {
return mName; return mName;
} }
void UBDockPaletteWidget::registerMode(eUBDockPaletteWidgetMode mode)
{
if(!mRegisteredModes.contains(mode))
mRegisteredModes.append(mode);
}
void UBDockPaletteWidget::slot_changeMode(eUBDockPaletteWidgetMode newMode)
{
this->setVisible(mRegisteredModes.contains(newMode));
}

@ -5,8 +5,17 @@
#include <QPixmap> #include <QPixmap>
#include <QString> #include <QString>
typedef enum
{
eUBDockPaletteWidget_BOARD,
eUBDockPaletteWidget_WEB,
eUBDockPaletteWidget_DOCUMENT,
eUBDockPaletteWidget_DESKTOP,
} eUBDockPaletteWidgetMode;
class UBDockPaletteWidget : public QWidget class UBDockPaletteWidget : public QWidget
{ {
Q_OBJECT Q_OBJECT
public: public:
UBDockPaletteWidget(QWidget* parent=0, const char* name="UBDockPaletteWidget"); UBDockPaletteWidget(QWidget* parent=0, const char* name="UBDockPaletteWidget");
@ -16,10 +25,21 @@ public:
QPixmap iconToLeft(); QPixmap iconToLeft();
QString name(); QString name();
void registerMode(eUBDockPaletteWidgetMode mode);
/* The current widget available mode list */
QVector<eUBDockPaletteWidgetMode> mRegisteredModes;
signals: signals:
void hideTab(const QString& widgetName); void hideTab(const QString& widgetName);
void showTab(const QString& widgetName); void showTab(const QString& widgetName);
public slots:
void slot_changeMode(eUBDockPaletteWidgetMode newMode);
protected: protected:
QPixmap mIconToRight; // arrow like this: > QPixmap mIconToRight; // arrow like this: >
QPixmap mIconToLeft; // arrow like this: < QPixmap mIconToLeft; // arrow like this: <

@ -141,13 +141,8 @@ void UBDocumentNavigator::updateSpecificThumbnail(int iPage)
{ {
// Save the current state of the scene // Save the current state of the scene
pScene->setModified(true); pScene->setModified(true);
UBSvgSubsetAdaptor::persistScene(mCrntDoc,pScene, iPage);
if(UBApplication::boardController)
{
UBApplication::boardController->persistCurrentScene();
}
// Now, update the thumbnail
UBThumbnailAdaptor::persistScene(mCrntDoc->persistencePath(), pScene, iPage); UBThumbnailAdaptor::persistScene(mCrntDoc->persistencePath(), pScene, iPage);
// Load it // Load it

@ -242,50 +242,14 @@ void UBTeacherBarWidget::populateCombos()
QStringList qslPhasis; QStringList qslPhasis;
qslPhasis << tr("") << tr("I discover") << tr("I experiment") << tr("I train myself") << tr("I play") << tr("I memorize"); qslPhasis << tr("") << tr("I discover") << tr("I experiment") << tr("I train myself") << tr("I play") << tr("I memorize");
mpPhasis->insertItems(0, qslPhasis); mpPhasis->insertItems(0, qslPhasis);
mpPhasis->setCurrentIndex(0);
QStringList qslDuration; QStringList qslDuration;
qslDuration << tr("") << tr("Short") << tr("Middle") << tr("Long"); qslDuration << tr("") << tr("Short") << tr("Middle") << tr("Long");
mpDuration->insertItems(0, qslDuration); mpDuration->insertItems(0, qslDuration);
mpDuration->setCurrentIndex(0);
QStringList qslActivity; QStringList qslActivity;
qslActivity << tr("") << tr("Alone") << tr("By Group") << tr("All together"); qslActivity << tr("") << tr("Alone") << tr("By Group") << tr("All together");
mpActivity->insertItems(0, qslActivity); mpActivity->insertItems(0, qslActivity);
mpActivity->setCurrentIndex(0);
}
void UBTeacherBarWidget::saveContent()
{
sTeacherBarInfos infos;
infos.title = mpTitle->text();
infos.phasis = mpPhasis->currentIndex();
infos.Duration = mpDuration->currentIndex();
infos.material = mpEquipment->text();
infos.activity = mpActivity->currentIndex();
infos.action1Master = mpAction1->teacherText();
infos.action1Student = mpAction1->studentText();
infos.action2Master = mpAction2->teacherText();
infos.action2Student = mpAction2->studentText();
infos.action3Master = mpAction3->teacherText();
infos.action3Student = mpAction3->studentText();
UBPersistenceManager::persistenceManager()->persistTeacherBar(UBApplication::boardController->activeDocument(), UBApplication::boardController->activeSceneIndex(), infos);
}
void UBTeacherBarWidget::loadContent()
{
sTeacherBarInfos nextInfos = UBPersistenceManager::persistenceManager()->getTeacherBarInfos(UBApplication::boardController->activeDocument(), UBApplication::boardController->activeSceneIndex());
mpTitle->setText(nextInfos.title);
mpPhasis->setCurrentIndex(nextInfos.phasis);
mpDuration->setCurrentIndex(nextInfos.Duration);
mpEquipment->setText(nextInfos.material);
mpActivity->setCurrentIndex(nextInfos.activity);
mpAction1->setTeacherText(nextInfos.action1Master);
mpAction1->setStudentText(nextInfos.action1Student);
mpAction2->setTeacherText(nextInfos.action2Master);
mpAction2->setStudentText(nextInfos.action2Student);
mpAction3->setTeacherText(nextInfos.action3Master);
mpAction3->setStudentText(nextInfos.action3Student);
} }
void UBTeacherBarWidget::onValueChanged() void UBTeacherBarWidget::onValueChanged()
@ -311,7 +275,6 @@ void UBTeacherBarWidget::onValueChanged()
mIconToRight = QPixmap(":images/teacher_close.png"); mIconToRight = QPixmap(":images/teacher_close.png");
} }
// TODO: refresh the icon
UBApplication::boardController->paletteManager()->refreshPalettes(); UBApplication::boardController->paletteManager()->refreshPalettes();
} }

@ -39,7 +39,6 @@ private:
class UBTeacherBarWidget : public UBDockPaletteWidget class UBTeacherBarWidget : public UBDockPaletteWidget
{ {
Q_OBJECT
public: public:
UBTeacherBarWidget(QWidget* parent=0, const char* name="UBTeacherBarWidget"); UBTeacherBarWidget(QWidget* parent=0, const char* name="UBTeacherBarWidget");
~UBTeacherBarWidget(); ~UBTeacherBarWidget();

Loading…
Cancel
Save