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

preferencesAboutTextFull
bmagnin 12 years ago
commit c739f52dbd
  1. 8
      plugins/cffadaptor/src/UBCFFAdaptor.cpp
  2. 2
      plugins/cffadaptor/src/UBCFFConstants.h
  3. 6
      src/core/UBApplication.cpp
  4. 9
      src/core/UBApplicationController.cpp
  5. 3
      src/core/UBApplicationController.h
  6. 49
      src/desktop/UBDesktopAnnotationController.cpp
  7. 4
      src/desktop/UBDesktopAnnotationController.h
  8. 48
      src/desktop/UBDesktopEraserPalette.cpp
  9. 29
      src/desktop/UBDesktopEraserPalette.h
  10. 61
      src/desktop/UBDesktopMarkerPalette.cpp
  11. 29
      src/desktop/UBDesktopMarkerPalette.h
  12. 25
      src/desktop/UBDesktopPalette.cpp
  13. 10
      src/desktop/UBDesktopPalette.h
  14. 103
      src/desktop/UBDesktopPenPalette.cpp
  15. 170
      src/desktop/UBDesktopPropertyPalette.cpp
  16. 38
      src/desktop/UBDesktopPropertyPalette.h
  17. 8
      src/desktop/desktop.pri
  18. 8
      src/domain/UBGraphicsItemUndoCommand.cpp
  19. 16
      src/gui/UBFloatingPalette.cpp
  20. 4
      src/gui/UBFloatingPalette.h
  21. 2
      src/gui/UBPropertyPalette.cpp
  22. 2
      src/gui/UBPropertyPalette.h

@ -1085,7 +1085,9 @@ bool UBCFFAdaptor::UBToCFFConverter::setContentFromUBZ(const QDomElement &ubzEle
if (bRet) if (bRet)
{ {
svgElement.setAttribute(aSVGHref, sDstContentFolder+"/"+sDstFileName); svgElement.setAttribute(aSVGHref, sDstContentFolder+"/"+sDstFileName);
svgElement.setAttribute(aSVGRequiredExtension, svgRequiredExtensionPrefix+convertExtention(fileExtention)); // NOT by standard! Enable it later!
// validator http://validator.imsglobal.org/iwb/index.jsp?validate=package
//svgElement.setAttribute(aSVGRequiredExtension, svgRequiredExtensionPrefix+convertExtention(fileExtention));
} }
} }
else else
@ -1112,7 +1114,9 @@ bool UBCFFAdaptor::UBToCFFConverter::setContentFromUBZ(const QDomElement &ubzEle
if (bRet) if (bRet)
{ {
svgElement.setAttribute(aSVGHref, sDstContentFolder+"/"+sDstFileName); svgElement.setAttribute(aSVGHref, sDstContentFolder+"/"+sDstFileName);
svgElement.setAttribute(aSVGRequiredExtension, svgRequiredExtensionPrefix+fePng); // NOT by standard! Enable it later!
// validator http://validator.imsglobal.org/iwb/index.jsp?validate=package
//svgElement.setAttribute(aSVGRequiredExtension, svgRequiredExtensionPrefix+fePng);
} }
} }
}else }else

@ -106,7 +106,7 @@ const QString ubNS = "http://uniboard.mnemis.com/document";
const QString svgUBZNS = "http://www.imsglobal.org/xsd/iwb_v1p0"; const QString svgUBZNS = "http://www.imsglobal.org/xsd/iwb_v1p0";
const QString svgIWBNS = "http://www.w3.org/2000/svg"; const QString svgIWBNS = "http://www.w3.org/2000/svg";
const QString xlinkNS = "http://www.w3.org/1999/xlink"; const QString xlinkNS = "http://www.w3.org/1999/xlink";
const QString iwbNS = "http://www.becta.org.uk/iwb"; const QString iwbNS = "http://www.imsglobal.org/xsd/iwb_v1p0";
const QString xsiNS = "http://www.w3.org/2001/XMLSchema-instance"; const QString xsiNS = "http://www.w3.org/2001/XMLSchema-instance";
const QString xsiShemaLocation = "\ const QString xsiShemaLocation = "\
http://www.imsglobal.org/xsd/iwb_v1p0 \ http://www.imsglobal.org/xsd/iwb_v1p0 \

@ -315,7 +315,11 @@ int UBApplication::exec(const QString& pFileToImport)
UBDrawingController::drawingController()->setStylusTool((int)UBStylusTool::Pen); UBDrawingController::drawingController()->setStylusTool((int)UBStylusTool::Pen);
applicationController = new UBApplicationController(boardController->controlView(), boardController->displayView(), mainWindow, staticMemoryCleaner); applicationController = new UBApplicationController(boardController->controlView(),
boardController->displayView(),
mainWindow,
staticMemoryCleaner,
boardController->paletteManager()->rightPalette());
connect(applicationController, SIGNAL(mainModeChanged(UBApplicationController::MainMode)), connect(applicationController, SIGNAL(mainModeChanged(UBApplicationController::MainMode)),

@ -59,8 +59,11 @@
#include "core/memcheck.h" #include "core/memcheck.h"
UBApplicationController::UBApplicationController(UBBoardView *pControlView, UBBoardView *pDisplayView, UBApplicationController::UBApplicationController(UBBoardView *pControlView,
UBMainWindow* pMainWindow, QObject* parent) UBBoardView *pDisplayView,
UBMainWindow* pMainWindow,
QObject* parent,
UBRightPalette* rightPalette)
: QObject(parent) : QObject(parent)
, mMainWindow(pMainWindow) , mMainWindow(pMainWindow)
, mControlView(pControlView) , mControlView(pControlView)
@ -75,7 +78,7 @@ UBApplicationController::UBApplicationController(UBBoardView *pControlView, UBBo
{ {
mDisplayManager = new UBDisplayManager(this); mDisplayManager = new UBDisplayManager(this);
mUninoteController = new UBDesktopAnnotationController(this); mUninoteController = new UBDesktopAnnotationController(this, rightPalette);
connect(mDisplayManager, SIGNAL(screenLayoutChanged()), this, SLOT(screenLayoutChanged())); connect(mDisplayManager, SIGNAL(screenLayoutChanged()), this, SLOT(screenLayoutChanged()));
connect(mDisplayManager, SIGNAL(screenLayoutChanged()), mUninoteController, SLOT(screenLayoutChanged())); connect(mDisplayManager, SIGNAL(screenLayoutChanged()), mUninoteController, SLOT(screenLayoutChanged()));

@ -31,6 +31,7 @@ class UBSoftwareUpdate;
class QNetworkAccessManager; class QNetworkAccessManager;
class QNetworkReply; class QNetworkReply;
class QHttp; class QHttp;
class UBRightPalette;
class UBApplicationController : public QObject class UBApplicationController : public QObject
@ -39,7 +40,7 @@ class UBApplicationController : public QObject
public: public:
UBApplicationController(UBBoardView *pControlView, UBBoardView *pDisplayView, UBMainWindow *pMainWindow, QObject* parent = 0); UBApplicationController(UBBoardView *pControlView, UBBoardView *pDisplayView, UBMainWindow *pMainWindow, QObject* parent, UBRightPalette* rightPalette);
virtual ~UBApplicationController(); virtual ~UBApplicationController();
int initialHScroll() { return mInitialHScroll; } int initialHScroll() { return mInitialHScroll; }

@ -38,16 +38,14 @@
#include "UBCustomCaptureWindow.h" #include "UBCustomCaptureWindow.h"
#include "UBWindowCapture.h" #include "UBWindowCapture.h"
#include "UBDesktopPalette.h" #include "UBDesktopPalette.h"
#include "UBDesktopPenPalette.h" #include "UBDesktopPropertyPalette.h"
#include "UBDesktopMarkerPalette.h"
#include "UBDesktopEraserPalette.h"
#include "gui/UBKeyboardPalette.h" #include "gui/UBKeyboardPalette.h"
#include "gui/UBResources.h" #include "gui/UBResources.h"
#include "core/memcheck.h" #include "core/memcheck.h"
UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent) UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent, UBRightPalette* rightPalette)
: QObject(parent) : QObject(parent)
, mTransparentDrawingView(0) , mTransparentDrawingView(0)
, mTransparentDrawingScene(0) , mTransparentDrawingScene(0)
@ -55,6 +53,7 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent)
, mDesktopPenPalette(NULL) , mDesktopPenPalette(NULL)
, mDesktopMarkerPalette(NULL) , mDesktopMarkerPalette(NULL)
, mDesktopEraserPalette(NULL) , mDesktopEraserPalette(NULL)
, mRightPalette(rightPalette)
, mWindowPositionInitialized(0) , mWindowPositionInitialized(0)
, mIsFullyTransparent(false) , mIsFullyTransparent(false)
, mDesktopToolsPalettePositioned(false) , mDesktopToolsPalettePositioned(false)
@ -86,7 +85,9 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent)
mTransparentDrawingView->setScene(mTransparentDrawingScene); mTransparentDrawingView->setScene(mTransparentDrawingScene);
mTransparentDrawingScene->setDrawingMode(true); mTransparentDrawingScene->setDrawingMode(true);
mDesktopPalette = new UBDesktopPalette(NULL); // FIX #633: The palette must be 'floating' in order to stay on top of the library palette mDesktopPalette = new UBDesktopPalette(mTransparentDrawingView, rightPalette);
// This was not fix, parent reverted
// FIX #633: The palette must be 'floating' in order to stay on top of the library palette
if (UBPlatformUtils::hasVirtualKeyboard()) if (UBPlatformUtils::hasVirtualKeyboard())
{ {
@ -119,13 +120,13 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent)
connect(UBDrawingController::drawingController(), SIGNAL(stylusToolChanged(int)), this, SLOT(stylusToolChanged(int))); connect(UBDrawingController::drawingController(), SIGNAL(stylusToolChanged(int)), this, SLOT(stylusToolChanged(int)));
// Add the desktop associated palettes // Add the desktop associated palettes
mDesktopPenPalette = new UBDesktopPenPalette(NULL); // FIX #633: The palette must be 'floating' in order to stay on top of the library palette mDesktopPenPalette = new UBDesktopPenPalette(mTransparentDrawingView, rightPalette);
connect(mDesktopPalette, SIGNAL(maximized()), mDesktopPenPalette, SLOT(onParentMaximized())); connect(mDesktopPalette, SIGNAL(maximized()), mDesktopPenPalette, SLOT(onParentMaximized()));
connect(mDesktopPalette, SIGNAL(minimizeStart(eMinimizedLocation)), mDesktopPenPalette, SLOT(onParentMinimized())); connect(mDesktopPalette, SIGNAL(minimizeStart(eMinimizedLocation)), mDesktopPenPalette, SLOT(onParentMinimized()));
mDesktopMarkerPalette = new UBDesktopMarkerPalette(NULL); // FIX #633: The palette must be 'floating' in order to stay on top of the library palette mDesktopMarkerPalette = new UBDesktopMarkerPalette(mTransparentDrawingView, rightPalette);
mDesktopEraserPalette = new UBDesktopEraserPalette(NULL); // FIX #633: The palette must be 'floating' in order to stay on top of the library palette mDesktopEraserPalette = new UBDesktopEraserPalette(mTransparentDrawingView, rightPalette);
mDesktopPalette->setBackgroundBrush(UBSettings::settings()->opaquePaletteColor); mDesktopPalette->setBackgroundBrush(UBSettings::settings()->opaquePaletteColor);
mDesktopPenPalette->setBackgroundBrush(UBSettings::settings()->opaquePaletteColor); mDesktopPenPalette->setBackgroundBrush(UBSettings::settings()->opaquePaletteColor);
@ -156,39 +157,15 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent)
onDesktopPaletteMaximized(); onDesktopPaletteMaximized();
// FIX #633: Ensure that these palettes stay on top of the other elements // FIX #633: Ensure that these palettes stay on top of the other elements
mDesktopEraserPalette->raise(); //mDesktopEraserPalette->raise();
mDesktopMarkerPalette->raise(); //mDesktopMarkerPalette->raise();
mDesktopPenPalette->raise(); //mDesktopPenPalette->raise();
mDesktopPalette->raise();
} }
UBDesktopAnnotationController::~UBDesktopAnnotationController() UBDesktopAnnotationController::~UBDesktopAnnotationController()
{ {
delete mTransparentDrawingScene; delete mTransparentDrawingScene;
delete mTransparentDrawingView; delete mTransparentDrawingView;
/*
if(NULL != mDesktopPenPalette)
{
delete mDesktopPalette;
mDesktopPenPalette = NULL;
}
if(NULL != mDesktopMarkerPalette)
{
delete mDesktopMarkerPalette;
mDesktopMarkerPalette = NULL;
}
if(NULL != mDesktopEraserPalette)
{
delete mDesktopEraserPalette;
mDesktopEraserPalette = NULL;
}
if(NULL != mRightPalette)
{
delete mRightPalette;
mRightPalette = NULL;
}
*/
} }
@ -255,7 +232,7 @@ void UBDesktopAnnotationController::setAssociatedPalettePosition(UBActionPalette
} }
// First determine if the palette must be shown on the left or on the right // First determine if the palette must be shown on the left or on the right
if(desktopPalettePos.x() <= (mTransparentDrawingView->width() - (palette->width() + mDesktopPalette->width() + 20))) // we take a small margin of 20 pixels if(desktopPalettePos.x() <= (mTransparentDrawingView->width() - (palette->width() + mDesktopPalette->width() + mRightPalette->width() + 20))) // we take a small margin of 20 pixels
{ {
// Display it on the right // Display it on the right
desktopPalettePos += QPoint(mDesktopPalette->width(), yPen); desktopPalettePos += QPoint(mDesktopPalette->width(), yPen);

@ -29,8 +29,8 @@ class UBDesktopPenPalette;
class UBDesktopMarkerPalette; class UBDesktopMarkerPalette;
class UBDesktopEraserPalette; class UBDesktopEraserPalette;
class UBActionPalette; class UBActionPalette;
//class UBKeyboardPalette;
class UBMainWindow; class UBMainWindow;
class UBRightPalette;
#define PROPERTY_PALETTE_TIMER 1000 #define PROPERTY_PALETTE_TIMER 1000
@ -47,7 +47,7 @@ class UBDesktopAnnotationController : public QObject
Q_OBJECT; Q_OBJECT;
public: public:
UBDesktopAnnotationController(QObject *parent = 0); UBDesktopAnnotationController(QObject *parent, UBRightPalette* rightPalette);
virtual ~UBDesktopAnnotationController(); virtual ~UBDesktopAnnotationController();
void showWindow(); void showWindow();
void hideWindow(); void hideWindow();

@ -1,48 +0,0 @@
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "UBDesktopEraserPalette.h"
#include "core/UBApplication.h"
#include "core/UBSettings.h"
#include "board/UBBoardController.h"
#include "board/UBDrawingController.h"
#include "gui/UBMainWindow.h"
#include "gui/UBToolbarButtonGroup.h"
#include "core/memcheck.h"
UBDesktopEraserPalette::UBDesktopEraserPalette(QWidget *parent)
: UBPropertyPalette(Qt::Horizontal, parent)
{
// Setup eraser width choice widget
QList<QAction *> eraserWidthActions;
eraserWidthActions.append(UBApplication::mainWindow->actionEraserSmall);
eraserWidthActions.append(UBApplication::mainWindow->actionEraserMedium);
eraserWidthActions.append(UBApplication::mainWindow->actionEraserLarge);
UBToolbarButtonGroup *eraserWidthChoice = new UBToolbarButtonGroup(UBApplication::mainWindow->boardToolBar, eraserWidthActions);
connect(eraserWidthChoice, SIGNAL(activated(int)), UBDrawingController::drawingController(), SLOT(setEraserWidthIndex(int)));
connect(eraserWidthChoice, SIGNAL(activated(int)), this, SLOT(close()));
connect(UBApplication::mainWindow->actionEraseDesktopAnnotations, SIGNAL(triggered()), this, SLOT(close()));
eraserWidthChoice->displayText(false);
eraserWidthChoice->setCurrentIndex(UBSettings::settings()->eraserWidthIndex());
layout()->addWidget(eraserWidthChoice);
addAction(UBApplication::mainWindow->actionEraseDesktopAnnotations);
}

@ -1,29 +0,0 @@
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef UBDESKTOPERASERPALETTE_H
#define UBDESKTOPERASERPALETTE_H
#include <QtGui>
#include "gui/UBPropertyPalette.h"
class UBDesktopEraserPalette : public UBPropertyPalette
{
public:
UBDesktopEraserPalette(QWidget *parent = 0);
virtual ~UBDesktopEraserPalette(){}
};
#endif // UBDESKTOPERASERPALETTE_H

@ -1,61 +0,0 @@
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "UBDesktopMarkerPalette.h"
#include "core/UBApplication.h"
#include "board/UBBoardController.h"
#include "board/UBDrawingController.h"
#include "gui/UBMainWindow.h"
#include "gui/UBToolbarButtonGroup.h"
#include "core/memcheck.h"
UBDesktopMarkerPalette::UBDesktopMarkerPalette(QWidget *parent)
: UBPropertyPalette(Qt::Horizontal, parent)
{
// Setup color choice widget
QList<QAction *> colorActions;
colorActions.append(UBApplication::mainWindow->actionColor0);
colorActions.append(UBApplication::mainWindow->actionColor1);
colorActions.append(UBApplication::mainWindow->actionColor2);
colorActions.append(UBApplication::mainWindow->actionColor3);
UBToolbarButtonGroup *colorChoice = new UBToolbarButtonGroup(UBApplication::mainWindow->boardToolBar, colorActions);
colorChoice->displayText(false);
//connect(colorChoice, SIGNAL(activated(int)), this, SLOT(UBApplication::boardController->setColorIndex(int)));
connect(UBDrawingController::drawingController(), SIGNAL(colorIndexChanged(int)), colorChoice, SLOT(setCurrentIndex(int)));
connect(UBDrawingController::drawingController(), SIGNAL(colorIndexChanged(int)), this, SLOT(close()));
connect(UBDrawingController::drawingController(), SIGNAL(colorPaletteChanged()), colorChoice, SLOT(colorPaletteChanged()));
connect(UBDrawingController::drawingController(), SIGNAL(colorPaletteChanged()), this, SLOT(close()));
layout()->addWidget(colorChoice);
// Setup line width choice widget
QList<QAction *> lineWidthActions;
lineWidthActions.append(UBApplication::mainWindow->actionLineSmall);
lineWidthActions.append(UBApplication::mainWindow->actionLineMedium);
lineWidthActions.append(UBApplication::mainWindow->actionLineLarge);
UBToolbarButtonGroup *lineWidthChoice = new UBToolbarButtonGroup(UBApplication::mainWindow->boardToolBar, lineWidthActions);
lineWidthChoice->displayText(false);
connect(lineWidthChoice, SIGNAL(activated(int)), UBDrawingController::drawingController(), SLOT(setLineWidthIndex(int)));
connect(lineWidthChoice, SIGNAL(activated(int)), this, SLOT(close()));
connect(UBDrawingController::drawingController(), SIGNAL(lineWidthIndexChanged(int)), lineWidthChoice, SLOT(setCurrentIndex(int)));
connect(UBDrawingController::drawingController(), SIGNAL(lineWidthIndexChanged(int)), this, SLOT(close()));
layout()->addWidget(lineWidthChoice);
}

@ -1,29 +0,0 @@
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef UBDESKTOPMARKERPALETTE_H
#define UBDESKTOPMARKERPALETTE_H
#include <QtGui>
#include "gui/UBPropertyPalette.h"
class UBDesktopMarkerPalette : public UBPropertyPalette
{
public:
UBDesktopMarkerPalette(QWidget *parent = 0);
virtual ~UBDesktopMarkerPalette(){}
};
#endif // UBDESKTOPMARKERPALETTE_H

@ -21,8 +21,9 @@
#include "core/memcheck.h" #include "core/memcheck.h"
UBDesktopPalette::UBDesktopPalette(QWidget *parent) UBDesktopPalette::UBDesktopPalette(QWidget *parent, UBRightPalette* _rightPalette)
: UBActionPalette(Qt::TopLeftCorner, parent) : UBActionPalette(Qt::TopLeftCorner, parent)
, rightPalette(_rightPalette)
, mShowHideAction(0) , mShowHideAction(0)
, mDisplaySelectAction(0) , mDisplaySelectAction(0)
{ {
@ -72,6 +73,8 @@ UBDesktopPalette::UBDesktopPalette(QWidget *parent)
connect(this, SIGNAL(maximizeStart()), this, SLOT(maximizeMe())); connect(this, SIGNAL(maximizeStart()), this, SLOT(maximizeMe()));
connect(this, SIGNAL(minimizeStart(eMinimizedLocation)), this, SLOT(minimizeMe(eMinimizedLocation))); connect(this, SIGNAL(minimizeStart(eMinimizedLocation)), this, SLOT(minimizeMe(eMinimizedLocation)));
setMinimizePermission(true); setMinimizePermission(true);
connect(rightPalette, SIGNAL(resized()), this, SLOT(parentResized()));
} }
@ -109,6 +112,9 @@ void UBDesktopPalette::updateShowHideState(bool pShowEnabled)
mShowHideAction->setToolTip(tr("Show Board on Secondary Screen")); mShowHideAction->setToolTip(tr("Show Board on Secondary Screen"));
else else
mShowHideAction->setToolTip(tr("Show Desktop on Secondary Screen")); mShowHideAction->setToolTip(tr("Show Desktop on Secondary Screen"));
if (pShowEnabled)
raise();
} }
@ -217,3 +223,20 @@ QPoint UBDesktopPalette::buttonPos(QAction *action)
return p; return p;
} }
int UBDesktopPalette::getParentRightOffset()
{
return rightPalette->width();
}
void UBDesktopPalette::parentResized()
{
QPoint p = pos();
if (minimizedLocation() == eMinimizedLocation_Right)
{
p.setX(parentWidget()->width() - getParentRightOffset() -width());
}
moveInsideParent(p);
}

@ -12,6 +12,7 @@
#include <QHideEvent> #include <QHideEvent>
#include "gui/UBActionPalette.h" #include "gui/UBActionPalette.h"
#include "gui/UBRightPalette.h"
/** /**
* The uninotes window. This window is controlled by UBUninotesWindowController. * The uninotes window. This window is controlled by UBUninotesWindowController.
@ -21,7 +22,7 @@ class UBDesktopPalette : public UBActionPalette
Q_OBJECT; Q_OBJECT;
public: public:
UBDesktopPalette(QWidget *parent = 0); UBDesktopPalette(QWidget *parent, UBRightPalette* rightPalette);
virtual ~UBDesktopPalette(); virtual ~UBDesktopPalette();
void disappearForCapture(); void disappearForCapture();
@ -41,17 +42,19 @@ class UBDesktopPalette : public UBActionPalette
public slots: public slots:
void showHideClick(bool checked); void showHideClick(bool checked);
void updateShowHideState(bool pShowEnabled); void updateShowHideState(bool pShowEnabled);
void setShowHideButtonVisible(bool visible); void setShowHideButtonVisible(bool visible);
void setDisplaySelectButtonVisible(bool show); void setDisplaySelectButtonVisible(bool show);
void minimizeMe(eMinimizedLocation location); void minimizeMe(eMinimizedLocation location);
void maximizeMe(); void maximizeMe();
void parentResized();
protected: protected:
void showEvent(QShowEvent *event); void showEvent(QShowEvent *event);
void hideEvent(QHideEvent *event); void hideEvent(QHideEvent *event);
virtual int getParentRightOffset();
private: private:
QAction *mShowHideAction; QAction *mShowHideAction;
QAction *mDisplaySelectAction; QAction *mDisplaySelectAction;
@ -60,6 +63,9 @@ protected:
QAction *mActionCustomSelect; QAction *mActionCustomSelect;
QAction* mActionTest; QAction* mActionTest;
UBRightPalette* rightPalette;
signals: signals:
void stylusToolChanged(int tool); void stylusToolChanged(int tool);

@ -1,103 +0,0 @@
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "UBDesktopPenPalette.h"
#include "core/UBApplication.h"
#include "board/UBBoardController.h"
#include "board/UBDrawingController.h"
#include "gui/UBMainWindow.h"
#include "gui/UBToolbarButtonGroup.h"
#include "core/memcheck.h"
UBDesktopPenPalette::UBDesktopPenPalette(QWidget *parent)
: UBPropertyPalette(Qt::Horizontal, parent)
{
// Setup color choice widget
QList<QAction *> colorActions;
colorActions.append(UBApplication::mainWindow->actionColor0);
colorActions.append(UBApplication::mainWindow->actionColor1);
colorActions.append(UBApplication::mainWindow->actionColor2);
colorActions.append(UBApplication::mainWindow->actionColor3);
UBToolbarButtonGroup *colorChoice =
new UBToolbarButtonGroup(UBApplication::mainWindow->boardToolBar, colorActions);
colorChoice->displayText(false);
//connect(colorChoice, SIGNAL(activated(int)), this, SLOT(UBApplication::boardController->setColorIndex(int)));
connect(UBDrawingController::drawingController(), SIGNAL(colorIndexChanged(int)), colorChoice, SLOT(setCurrentIndex(int)));
connect(UBDrawingController::drawingController(), SIGNAL(colorIndexChanged(int)), this, SLOT(close()));
connect(UBDrawingController::drawingController(), SIGNAL(colorPaletteChanged()), colorChoice, SLOT(colorPaletteChanged()));
connect(UBDrawingController::drawingController(), SIGNAL(colorPaletteChanged()), this, SLOT(close()));
layout()->addWidget(colorChoice);
// Setup line width choice widget
QList<QAction *> lineWidthActions;
lineWidthActions.append(UBApplication::mainWindow->actionLineSmall);
lineWidthActions.append(UBApplication::mainWindow->actionLineMedium);
lineWidthActions.append(UBApplication::mainWindow->actionLineLarge);
UBToolbarButtonGroup *lineWidthChoice =
new UBToolbarButtonGroup(UBApplication::mainWindow->boardToolBar, lineWidthActions);
lineWidthChoice->displayText(false);
connect(lineWidthChoice, SIGNAL(activated(int)), UBDrawingController::drawingController(), SLOT(setLineWidthIndex(int)));
connect(lineWidthChoice, SIGNAL(activated(int)), this, SLOT(close()));
connect(UBDrawingController::drawingController(), SIGNAL(lineWidthIndexChanged(int)), lineWidthChoice, SLOT(setCurrentIndex(int)));
connect(UBDrawingController::drawingController(), SIGNAL(lineWidthIndexChanged(int)), this, SLOT(close()));
onParentMaximized();
layout()->addWidget(lineWidthChoice);
}
void UBDesktopPenPalette::onButtonReleased()
{
qDebug() << "Pen palette released!";
// trigger the related action
// Close the palette
close();
}
/**
* \brief Disconnect the released event of the buttons
*/
void UBDesktopPenPalette::onParentMinimized()
{
for(int i = 0; i < mButtons.size(); i++)
{
disconnect(mButtons.at(i), SIGNAL(released()), this, SLOT(onButtonReleased()));
}
}
/**
* \brief Connect the released event of the buttons
*/
void UBDesktopPenPalette::onParentMaximized()
{
for(int i = 0; i < mButtons.size(); i++)
{
connect(mButtons.at(i), SIGNAL(released()), this, SLOT(onButtonReleased()));
}
}
void UBDesktopPenPalette::resizeEvent(QResizeEvent *)
{
qDebug("pen palette resized!");
}

@ -0,0 +1,170 @@
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "UBDesktopPropertyPalette.h"
#include "core/UBApplication.h"
#include "board/UBBoardController.h"
#include "board/UBDrawingController.h"
#include "gui/UBMainWindow.h"
#include "gui/UBToolbarButtonGroup.h"
#include "gui/UBRightPalette.h"
#include "core/memcheck.h"
UBDesktopPropertyPalette::UBDesktopPropertyPalette(QWidget *parent, UBRightPalette* _rightPalette)
:UBPropertyPalette(Qt::Horizontal, parent)
,rightPalette(_rightPalette)
{}
int UBDesktopPropertyPalette::getParentRightOffset()
{
return rightPalette->width();
}
UBDesktopPenPalette::UBDesktopPenPalette(QWidget *parent, UBRightPalette* rightPalette)
: UBDesktopPropertyPalette(parent, rightPalette)
{
// Setup color choice widget
QList<QAction *> colorActions;
colorActions.append(UBApplication::mainWindow->actionColor0);
colorActions.append(UBApplication::mainWindow->actionColor1);
colorActions.append(UBApplication::mainWindow->actionColor2);
colorActions.append(UBApplication::mainWindow->actionColor3);
UBToolbarButtonGroup *colorChoice =
new UBToolbarButtonGroup(UBApplication::mainWindow->boardToolBar, colorActions);
colorChoice->displayText(false);
//connect(colorChoice, SIGNAL(activated(int)), this, SLOT(UBApplication::boardController->setColorIndex(int)));
connect(UBDrawingController::drawingController(), SIGNAL(colorIndexChanged(int)), colorChoice, SLOT(setCurrentIndex(int)));
connect(UBDrawingController::drawingController(), SIGNAL(colorIndexChanged(int)), this, SLOT(close()));
connect(UBDrawingController::drawingController(), SIGNAL(colorPaletteChanged()), colorChoice, SLOT(colorPaletteChanged()));
connect(UBDrawingController::drawingController(), SIGNAL(colorPaletteChanged()), this, SLOT(close()));
layout()->addWidget(colorChoice);
// Setup line width choice widget
QList<QAction *> lineWidthActions;
lineWidthActions.append(UBApplication::mainWindow->actionLineSmall);
lineWidthActions.append(UBApplication::mainWindow->actionLineMedium);
lineWidthActions.append(UBApplication::mainWindow->actionLineLarge);
UBToolbarButtonGroup *lineWidthChoice =
new UBToolbarButtonGroup(UBApplication::mainWindow->boardToolBar, lineWidthActions);
lineWidthChoice->displayText(false);
connect(lineWidthChoice, SIGNAL(activated(int)), UBDrawingController::drawingController(), SLOT(setLineWidthIndex(int)));
connect(lineWidthChoice, SIGNAL(activated(int)), this, SLOT(close()));
connect(UBDrawingController::drawingController(), SIGNAL(lineWidthIndexChanged(int)), lineWidthChoice, SLOT(setCurrentIndex(int)));
connect(UBDrawingController::drawingController(), SIGNAL(lineWidthIndexChanged(int)), this, SLOT(close()));
onParentMaximized();
layout()->addWidget(lineWidthChoice);
}
void UBDesktopPenPalette::onButtonReleased()
{
close();
}
/**
* \brief Disconnect the released event of the buttons
*/
void UBDesktopPenPalette::onParentMinimized()
{
for(int i = 0; i < mButtons.size(); i++)
{
disconnect(mButtons.at(i), SIGNAL(released()), this, SLOT(onButtonReleased()));
}
}
/**
* \brief Connect the released event of the buttons
*/
void UBDesktopPenPalette::onParentMaximized()
{
for(int i = 0; i < mButtons.size(); i++)
{
connect(mButtons.at(i), SIGNAL(released()), this, SLOT(onButtonReleased()));
}
}
UBDesktopEraserPalette::UBDesktopEraserPalette(QWidget *parent, UBRightPalette* rightPalette)
: UBDesktopPropertyPalette(parent, rightPalette)
{
// Setup eraser width choice widget
QList<QAction *> eraserWidthActions;
eraserWidthActions.append(UBApplication::mainWindow->actionEraserSmall);
eraserWidthActions.append(UBApplication::mainWindow->actionEraserMedium);
eraserWidthActions.append(UBApplication::mainWindow->actionEraserLarge);
UBToolbarButtonGroup *eraserWidthChoice = new UBToolbarButtonGroup(UBApplication::mainWindow->boardToolBar, eraserWidthActions);
connect(eraserWidthChoice, SIGNAL(activated(int)), UBDrawingController::drawingController(), SLOT(setEraserWidthIndex(int)));
connect(eraserWidthChoice, SIGNAL(activated(int)), this, SLOT(close()));
connect(UBApplication::mainWindow->actionEraseDesktopAnnotations, SIGNAL(triggered()), this, SLOT(close()));
eraserWidthChoice->displayText(false);
eraserWidthChoice->setCurrentIndex(UBSettings::settings()->eraserWidthIndex());
layout()->addWidget(eraserWidthChoice);
addAction(UBApplication::mainWindow->actionEraseDesktopAnnotations);
}
UBDesktopMarkerPalette::UBDesktopMarkerPalette(QWidget *parent, UBRightPalette* rightPalette)
: UBDesktopPropertyPalette(parent, rightPalette)
{
// Setup color choice widget
QList<QAction *> colorActions;
colorActions.append(UBApplication::mainWindow->actionColor0);
colorActions.append(UBApplication::mainWindow->actionColor1);
colorActions.append(UBApplication::mainWindow->actionColor2);
colorActions.append(UBApplication::mainWindow->actionColor3);
UBToolbarButtonGroup *colorChoice = new UBToolbarButtonGroup(UBApplication::mainWindow->boardToolBar, colorActions);
colorChoice->displayText(false);
//connect(colorChoice, SIGNAL(activated(int)), this, SLOT(UBApplication::boardController->setColorIndex(int)));
connect(UBDrawingController::drawingController(), SIGNAL(colorIndexChanged(int)), colorChoice, SLOT(setCurrentIndex(int)));
connect(UBDrawingController::drawingController(), SIGNAL(colorIndexChanged(int)), this, SLOT(close()));
connect(UBDrawingController::drawingController(), SIGNAL(colorPaletteChanged()), colorChoice, SLOT(colorPaletteChanged()));
connect(UBDrawingController::drawingController(), SIGNAL(colorPaletteChanged()), this, SLOT(close()));
layout()->addWidget(colorChoice);
// Setup line width choice widget
QList<QAction *> lineWidthActions;
lineWidthActions.append(UBApplication::mainWindow->actionLineSmall);
lineWidthActions.append(UBApplication::mainWindow->actionLineMedium);
lineWidthActions.append(UBApplication::mainWindow->actionLineLarge);
UBToolbarButtonGroup *lineWidthChoice = new UBToolbarButtonGroup(UBApplication::mainWindow->boardToolBar, lineWidthActions);
lineWidthChoice->displayText(false);
connect(lineWidthChoice, SIGNAL(activated(int)), UBDrawingController::drawingController(), SLOT(setLineWidthIndex(int)));
connect(lineWidthChoice, SIGNAL(activated(int)), this, SLOT(close()));
connect(UBDrawingController::drawingController(), SIGNAL(lineWidthIndexChanged(int)), lineWidthChoice, SLOT(setCurrentIndex(int)));
connect(UBDrawingController::drawingController(), SIGNAL(lineWidthIndexChanged(int)), this, SLOT(close()));
layout()->addWidget(lineWidthChoice);
}

@ -20,22 +20,48 @@
#include "gui/UBPropertyPalette.h" #include "gui/UBPropertyPalette.h"
class UBDesktopPenPalette : public UBPropertyPalette class UBRightPalette;
class UBDesktopPropertyPalette : public UBPropertyPalette
{ {
Q_OBJECT Q_OBJECT
public: public:
UBDesktopPenPalette(QWidget *parent = 0); UBDesktopPropertyPalette(QWidget *parent, UBRightPalette* _rightPalette);
virtual ~UBDesktopPenPalette(){} private:
UBRightPalette* rightPalette;
protected:
virtual int getParentRightOffset();
};
class UBDesktopPenPalette : public UBDesktopPropertyPalette
{
Q_OBJECT
public:
UBDesktopPenPalette(QWidget *parent, UBRightPalette* rightPalette);
virtual ~UBDesktopPenPalette(){}
public slots: public slots:
void onParentMinimized(); void onParentMinimized();
void onParentMaximized(); void onParentMaximized();
protected:
void resizeEvent(QResizeEvent *);
private slots: private slots:
void onButtonReleased(); void onButtonReleased();
};
class UBDesktopEraserPalette : public UBDesktopPropertyPalette
{
public:
UBDesktopEraserPalette(QWidget *parent, UBRightPalette* rightPalette);
virtual ~UBDesktopEraserPalette(){}
}; };
class UBDesktopMarkerPalette : public UBDesktopPropertyPalette
{
public:
UBDesktopMarkerPalette(QWidget *parent, UBRightPalette* rightPalette);
virtual ~UBDesktopMarkerPalette(){}
};
#endif // UBDESKTOPPENPALETTE_H #endif // UBDESKTOPPENPALETTE_H

@ -2,16 +2,12 @@ HEADERS += src/desktop/UBDesktopPalette.h \
src/desktop/UBDesktopAnnotationController.h \ src/desktop/UBDesktopAnnotationController.h \
src/desktop/UBCustomCaptureWindow.h \ src/desktop/UBCustomCaptureWindow.h \
src/desktop/UBWindowCapture.h \ src/desktop/UBWindowCapture.h \
src/desktop/UBDesktopPenPalette.h \ src/desktop/UBDesktopPropertyPalette.h
src/desktop/UBDesktopMarkerPalette.h \
src/desktop/UBDesktopEraserPalette.h
SOURCES += src/desktop/UBDesktopPalette.cpp \ SOURCES += src/desktop/UBDesktopPalette.cpp \
src/desktop/UBDesktopAnnotationController.cpp \ src/desktop/UBDesktopAnnotationController.cpp \
src/desktop/UBCustomCaptureWindow.cpp \ src/desktop/UBCustomCaptureWindow.cpp \
src/desktop/UBDesktopPenPalette.cpp \ src/desktop/UBDesktopPropertyPalette.cpp
src/desktop/UBDesktopMarkerPalette.cpp \
src/desktop/UBDesktopEraserPalette.cpp
win32 { win32 {
HEADERS += src/desktop/UBWindowCaptureDelegate_win.h HEADERS += src/desktop/UBWindowCaptureDelegate_win.h

@ -112,8 +112,8 @@ void UBGraphicsItemUndoCommand::undo()
} }
QMapIterator<UBGraphicsGroupContainerItem*, QUuid> curMapElement(mExcludedFromGroup); QMapIterator<UBGraphicsGroupContainerItem*, QUuid> curMapElement(mExcludedFromGroup);
UBGraphicsGroupContainerItem *nextGroup = 0; UBGraphicsGroupContainerItem *nextGroup = NULL;
UBGraphicsGroupContainerItem *previousGroupItem; UBGraphicsGroupContainerItem *previousGroupItem = NULL;
bool groupChanged = false; bool groupChanged = false;
while (curMapElement.hasNext()) { while (curMapElement.hasNext()) {
@ -157,8 +157,8 @@ void UBGraphicsItemUndoCommand::redo()
} }
QMapIterator<UBGraphicsGroupContainerItem*, QUuid> curMapElement(mExcludedFromGroup); QMapIterator<UBGraphicsGroupContainerItem*, QUuid> curMapElement(mExcludedFromGroup);
UBGraphicsGroupContainerItem *nextGroup = 0; UBGraphicsGroupContainerItem *nextGroup = NULL;
UBGraphicsGroupContainerItem *previousGroupItem; UBGraphicsGroupContainerItem *previousGroupItem = NULL;
bool groupChanged = false; bool groupChanged = false;
while (curMapElement.hasNext()) { while (curMapElement.hasNext()) {

@ -129,6 +129,11 @@ void UBFloatingPalette::mouseReleaseEvent(QMouseEvent *event)
} }
} }
int UBFloatingPalette::getParentRightOffset()
{
return 0;
}
void UBFloatingPalette::moveInsideParent(const QPoint &position) void UBFloatingPalette::moveInsideParent(const QPoint &position)
{ {
QWidget *parent = parentWidget(); QWidget *parent = parentWidget();
@ -136,7 +141,7 @@ void UBFloatingPalette::moveInsideParent(const QPoint &position)
if (parent) if (parent)
{ {
int margin = UBSettings::boardMargin - border(); int margin = UBSettings::boardMargin - border();
qreal newX = qMax(margin, qMin(parent->width() - width() - margin, position.x())); qreal newX = qMax(margin, qMin(parent->width() - getParentRightOffset() - width() - margin, position.x()));
qreal newY = qMax(margin, qMin(parent->height() - height() - margin, position.y())); qreal newY = qMax(margin, qMin(parent->height() - height() - margin, position.y()));
if (!mCustomPosition && !mIsMoving) if (!mCustomPosition && !mIsMoving)
@ -147,7 +152,7 @@ void UBFloatingPalette::moveInsideParent(const QPoint &position)
} }
else else
{ {
newX = qMax(margin, parent->width() - width() - margin); newX = qMax(margin, parent->width() - getParentRightOffset() - width() - margin);
} }
} }
move(newX, newY); move(newX, newY);
@ -260,7 +265,6 @@ void UBFloatingPalette::minimizePalette(const QPoint& pos)
return; return;
} }
QSize parentSize = parentWidget()->size();
if(mMinimizedLocation == eMinimizedLocation_None) if(mMinimizedLocation == eMinimizedLocation_None)
{ {
// Verify if we have to minimize this palette // Verify if we have to minimize this palette
@ -272,7 +276,7 @@ void UBFloatingPalette::minimizePalette(const QPoint& pos)
// { // {
// mMinimizedLocation = eMinimizedLocation_Top; // mMinimizedLocation = eMinimizedLocation_Top;
// } // }
else if(pos.x() == parentSize.width() - width() - 5) else if(pos.x() == parentWidget()->width() - getParentRightOffset() - width() - 5)
{ {
mMinimizedLocation = eMinimizedLocation_Right; mMinimizedLocation = eMinimizedLocation_Right;
} }
@ -292,8 +296,8 @@ void UBFloatingPalette::minimizePalette(const QPoint& pos)
// Restore the palette // Restore the palette
if(pos.x() > 5 && if(pos.x() > 5 &&
pos.y() > 5 && pos.y() > 5 &&
pos.x() < parentSize.width() - width() - 5 && pos.x() < parentWidget()->width() - getParentRightOffset() - width() - 5 &&
pos.y() < parentSize.height() - height() - 5) pos.y() < parentWidget()->size().height() - height() - 5)
{ {
mMinimizedLocation = eMinimizedLocation_None; mMinimizedLocation = eMinimizedLocation_None;
emit maximizeStart(); emit maximizeStart();

@ -63,6 +63,10 @@ class UBFloatingPalette : public QWidget
bool mCustomPosition; bool mCustomPosition;
bool mIsMoving; bool mIsMoving;
virtual int getParentRightOffset();
eMinimizedLocation minimizedLocation(){return mMinimizedLocation;}
private: private:
void removeAllAssociatedPalette(); void removeAllAssociatedPalette();
void minimizePalette(const QPoint& pos); void minimizePalette(const QPoint& pos);

@ -25,7 +25,6 @@ UBPropertyPalette::UBPropertyPalette(QWidget *parent, const char *name):UBAction
{ {
setObjectName(name); setObjectName(name);
mbGrip = false; mbGrip = false;
setMaximumHeight(MAX_HEIGHT);
} }
/** /**
@ -36,7 +35,6 @@ UBPropertyPalette::UBPropertyPalette(QWidget *parent, const char *name):UBAction
UBPropertyPalette::UBPropertyPalette(Qt::Orientation orientation, QWidget *parent):UBActionPalette(orientation, parent) UBPropertyPalette::UBPropertyPalette(Qt::Orientation orientation, QWidget *parent):UBActionPalette(orientation, parent)
{ {
mbGrip = false; mbGrip = false;
setMaximumHeight(MAX_HEIGHT);
} }
/** /**

@ -20,8 +20,6 @@
#include "UBActionPalette.h" #include "UBActionPalette.h"
#define MAX_HEIGHT 20
class UBPropertyPalette : public UBActionPalette class UBPropertyPalette : public UBActionPalette
{ {
Q_OBJECT Q_OBJECT

Loading…
Cancel
Save