developped and improved Sankore-473 and sankore-597

preferencesAboutTextFull
Claudio Valerio 13 years ago
parent 4b9e6c77b3
commit 2b8c26028c
  1. 12
      resources/forms/mainWindow.ui
  2. 58
      resources/images/erasePalette/eraseBackground.svg
  3. 1
      resources/sankore.qrc
  4. 9
      src/board/UBBoardController.cpp
  5. 1
      src/board/UBBoardController.h
  6. 4
      src/board/UBBoardPaletteManager.cpp
  7. 3
      src/core/UBApplication.cpp
  8. 4
      src/core/UBPersistenceManager.cpp
  9. 11
      src/domain/UBGraphicsScene.cpp
  10. 1
      src/domain/UBGraphicsScene.h
  11. 1
      src/gui/UBTeacherGuideWidgetsTools.cpp

@ -1665,6 +1665,18 @@
<string>Interact with items</string> <string>Interact with items</string>
</property> </property>
</action> </action>
<action name="actionEraseBackground">
<property name="icon">
<iconset resource="../sankore.qrc">
<normaloff>:/images/erasePalette/eraseBackground.svg</normaloff>:/images/erasePalette/eraseBackground.svg</iconset>
</property>
<property name="text">
<string>Erase Background</string>
</property>
<property name="toolTip">
<string>Remove the backgound</string>
</property>
</action>
</widget> </widget>
<resources> <resources>
<include location="../sankore.qrc"/> <include location="../sankore.qrc"/>

@ -0,0 +1,58 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In -->
<!DOCTYPE svg [
<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
]>
<svg version="1.2" baseProfile="tiny"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
x="0px" y="0px" width="128px" height="128px" viewBox="-7.587 -21.627 128 128" overflow="visible" xml:space="preserve">
<defs>
</defs>
<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="55.8784" y1="11.0928" x2="55.8784" y2="58.3739">
<stop offset="0" style="stop-color:#FCFCFC"/>
<stop offset="1" style="stop-color:#DCDCDC"/>
</linearGradient>
<path fill="url(#SVGID_1_)" d="M47.254,29.812c15.881,0.814,41.542,8.928,61.864,32.165V13.994c0-6.261-5.094-11.354-11.357-11.354
H13.993C7.733,2.64,2.64,7.734,2.64,13.994v27.544C17.206,34.21,32.229,29.042,47.254,29.812z"/>
<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="49.7065" y1="34.9453" x2="49.7065" y2="82.9507">
<stop offset="0" style="stop-color:#FCFCFC"/>
<stop offset="1" style="stop-color:#DCDCDC"/>
</linearGradient>
<path fill="url(#SVGID_2_)" d="M2.64,50.422v19.419c0,6.26,5.094,11.356,11.354,11.356h82.781
C82.723,68.016,51.243,45.693,2.64,50.422z"/>
<path fill="#FFFFFF" d="M5.28,40.236V13.995c0-4.805,3.908-8.715,8.715-8.715H97.76c4.807,0,8.717,3.91,8.717,8.715v45.077
c1.801,1.904,3.561,3.928,5.281,6.059V13.995C111.758,6.279,105.479,0,97.76,0H13.995C6.278,0,0,6.279,0,13.995v28.896
C1.753,41.976,3.514,41.088,5.28,40.236z"/>
<path fill="#FFFFFF" d="M93.854,78.558H13.995c-4.805,0-8.715-3.91-8.715-8.719V50.195C3.543,50.332,1.782,50.504,0,50.711v19.128
c0,7.721,6.278,13.998,13.995,13.998H97.76c0.551,0,1.092-0.04,1.625-0.103C97.844,82.182,96.002,80.43,93.854,78.558z"/>
<path fill="#B0B9C4" d="M3.521,41.098V13.995c0-5.776,4.698-10.475,10.475-10.475H97.76c5.777,0,10.477,4.7,10.479,10.475V61
c1.191,1.326,2.365,2.701,3.52,4.131V13.995C111.758,6.279,105.479,0,97.76,0H13.995C6.278,0,0,6.279,0,13.995v28.896
C1.171,42.28,2.344,41.682,3.521,41.098z"/>
<path fill="#B0B9C4" d="M95.825,80.318h-81.83c-5.776,0-10.475-4.702-10.475-10.479V50.347C2.356,50.453,1.184,50.573,0,50.711
v19.128c0,7.721,6.278,13.998,13.995,13.998H97.76c0.551,0,1.092-0.04,1.625-0.103C98.338,82.68,97.151,81.533,95.825,80.318z"/>
<path fill="#FFFFFF" d="M62.442,59.005H56.76v-2.218c-0.219-0.078-0.438-0.156-0.659-0.234v2.452H40.04v-6.86
c-0.221-0.044-0.438-0.09-0.66-0.133v6.993H22.44v-9.052c-0.221-0.012-0.438-0.027-0.66-0.038v9.09H9.68v0.66H21.78v18.26h0.66
v-18.26H39.38v18.26h0.66v-18.26h16.061v18.26h0.659v-18.26h7.221C63.473,59.442,62.959,59.223,62.442,59.005z"/>
<path fill="#FFFFFF" d="M90.86,76.037v1.888h0.658v-1.349C91.301,76.396,91.083,76.217,90.86,76.037z"/>
<path fill="#FFFFFF" d="M21.78,33.54c0.22-0.07,0.44-0.135,0.66-0.204v-7.991H39.38v4.593c0.22-0.018,0.44-0.038,0.66-0.053v-4.54
h16.061v5.557c0.219,0.041,0.438,0.082,0.659,0.125v-5.682H73.7v10.901c0.221,0.092,0.439,0.188,0.66,0.283V25.345h16.5v16.94
h-5.262c0.369,0.221,0.736,0.433,1.105,0.66h4.156v2.726c0.221,0.151,0.439,0.296,0.658,0.449v-3.175h11.662v-0.66H91.518v-16.94
h11.662v-0.66H91.518V7.745H90.86v16.94h-16.5V7.745H73.7v16.94H56.76V7.745h-0.659v16.94H40.04V7.745h-0.66v16.94H22.44V7.745
h-0.66v16.94H9.68v0.66H21.78V33.54z"/>
<path fill="#FFFFFF" d="M73.7,64.463v13.462h0.66V64.832C74.141,64.709,73.922,64.585,73.7,64.463z"/>
<image width="48" height="39" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADEAAAAoCAYAAABXRRJPAAAACXBIWXMAAAsSAAALEgHS3X78AAAA
GXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQVJREFUeNrU2DEOwyAMBdAQlow9
Qu9/qh4hI2NlyUg0wiWAY/y/ZCGxPdleHDb7vLhyTq7hhAWAt4AYxsTFAMrBfwcXJXlESAAVTHQC
mMIEZ4Bayl2p7k1wDpBAP5gIBBBHLQIBJEzaAQGPLrY1gHbiQ29AB2h1YilAA7EcMItwAZhBuAGM
IlwBRhDuAL0Il4AehFvAXYRrwB2Ee0ALAQH4h4ABSAgoAGUXEDCAGgIOcB0nyzFSA5QIWEBGQAOk
xYYCUOhkk4rK5xAYQEZsDDj5PZQhjwJKxFZgNLvyOKCGuHZlBmMCkBAaGDNACzGKMQXcRfRgzAG9
iBZmCUArSy7hZb4CDAA3l4ZOlZxXfQAAAABJRU5ErkJggg==" transform="matrix(1 0 0 1 63.3794 58.4092)">
</image>
<polygon fill="#FFA6E0" points="92.106,73.745 92.106,83.985 110.586,64.945 92.106,57.024 87.926,57.024 78.034,66.296 "/>
<polygon fill="#24ABFF" points="93.352,82.618 93.938,73.673 78.034,66.296 67.465,76.386 63.506,86.578 80.667,95.525 "/>
<path fill="#7ACCFF" d="M63.506,86.578l0.006-0.015l3.953-10.178c0,0,12.32,6.016,14.227,7.188c0,0,0.441,0.365,0.367,0.732
c-0.395,1.963-1.393,11.22-1.393,11.22L63.506,86.578z"/>
<polygon fill="#2096E0" points="80.667,95.525 82.133,83.793 93.352,73.306 93.352,82.618 "/>
<polygon fill="#FFD6F1" points="87.926,57.024 102.885,63.845 110.586,64.945 92.106,57.024 "/>
<polygon fill="#ED82C8" points="93.352,82.618 93.278,73.38 103.032,64.065 110.586,64.945 "/>
</svg>

After

Width:  |  Height:  |  Size: 4.7 KiB

@ -173,6 +173,7 @@
<file>images/erasePalette/eraseAll.svg</file> <file>images/erasePalette/eraseAll.svg</file>
<file>images/erasePalette/eraseItem.svg</file> <file>images/erasePalette/eraseItem.svg</file>
<file>images/erasePalette/eraseAnnotation.svg</file> <file>images/erasePalette/eraseAnnotation.svg</file>
<file>images/erasePalette/eraseBackground.svg</file>
<file>images/cursors/eraser.png</file> <file>images/cursors/eraser.png</file>
<file>images/cursors/laser.png</file> <file>images/cursors/laser.png</file>
<file>images/cursors/marker.png</file> <file>images/cursors/marker.png</file>

@ -376,6 +376,7 @@ void UBBoardController::connectToolbar()
connect(mMainWindow->actionClearPage, SIGNAL(triggered()), this, SLOT(clearScene())); connect(mMainWindow->actionClearPage, SIGNAL(triggered()), this, SLOT(clearScene()));
connect(mMainWindow->actionEraseItems, SIGNAL(triggered()), this, SLOT(clearSceneItems())); connect(mMainWindow->actionEraseItems, SIGNAL(triggered()), this, SLOT(clearSceneItems()));
connect(mMainWindow->actionEraseAnnotations, SIGNAL(triggered()), this, SLOT(clearSceneAnnotation())); connect(mMainWindow->actionEraseAnnotations, SIGNAL(triggered()), this, SLOT(clearSceneAnnotation()));
connect(mMainWindow->actionEraseBackground,SIGNAL(triggered()),this,SLOT(clearSceneBackground()));
connect(mMainWindow->actionUndo, SIGNAL(triggered()), UBApplication::undoStack, SLOT(undo())); connect(mMainWindow->actionUndo, SIGNAL(triggered()), UBApplication::undoStack, SLOT(undo()));
connect(mMainWindow->actionRedo, SIGNAL(triggered()), UBApplication::undoStack, SLOT(redo())); connect(mMainWindow->actionRedo, SIGNAL(triggered()), UBApplication::undoStack, SLOT(redo()));
@ -580,6 +581,14 @@ void UBBoardController::clearSceneAnnotation()
} }
} }
void UBBoardController::clearSceneBackground()
{
if (mActiveScene)
{
mActiveScene->clearBackground();
updateActionStates();
}
}
void UBBoardController::showDocumentsDialog() void UBBoardController::showDocumentsDialog()
{ {

@ -174,6 +174,7 @@ class UBBoardController : public QObject
void clearScene(); void clearScene();
void clearSceneItems(); void clearSceneItems();
void clearSceneAnnotation(); void clearSceneAnnotation();
void clearSceneBackground();
void zoomIn(QPointF scenePoint = QPointF(0,0)); void zoomIn(QPointF scenePoint = QPointF(0,0));
void zoomOut(QPointF scenePoint = QPointF(0,0)); void zoomOut(QPointF scenePoint = QPointF(0,0));
void zoomRestore(); void zoomRestore();

@ -66,6 +66,7 @@
UBBoardPaletteManager::UBBoardPaletteManager(QWidget* container, UBBoardController* pBoardController) UBBoardPaletteManager::UBBoardPaletteManager(QWidget* container, UBBoardController* pBoardController)
: QObject(container) : QObject(container)
, mKeyboardPalette(0) , mKeyboardPalette(0)
, mWebToolsCurrentPalette(0)
, mContainer(container) , mContainer(container)
, mBoardControler(pBoardController) , mBoardControler(pBoardController)
, mStylusPalette(0) , mStylusPalette(0)
@ -74,7 +75,6 @@ UBBoardPaletteManager::UBBoardPaletteManager(QWidget* container, UBBoardControll
, mRightPalette(NULL) , mRightPalette(NULL)
, mBackgroundsPalette(0) , mBackgroundsPalette(0)
, mToolsPalette(0) , mToolsPalette(0)
, mWebToolsCurrentPalette(0)
, mAddItemPalette(0) , mAddItemPalette(0)
, mErasePalette(NULL) , mErasePalette(NULL)
, mPagePalette(NULL) , mPagePalette(NULL)
@ -304,6 +304,7 @@ void UBBoardPaletteManager::setupPalettes()
eraseActions << UBApplication::mainWindow->actionEraseAnnotations; eraseActions << UBApplication::mainWindow->actionEraseAnnotations;
eraseActions << UBApplication::mainWindow->actionEraseItems; eraseActions << UBApplication::mainWindow->actionEraseItems;
eraseActions << UBApplication::mainWindow->actionClearPage; eraseActions << UBApplication::mainWindow->actionClearPage;
eraseActions << UBApplication::mainWindow->actionEraseBackground;
mErasePalette = new UBActionPalette(eraseActions, Qt::Horizontal , mContainer); mErasePalette = new UBActionPalette(eraseActions, Qt::Horizontal , mContainer);
mErasePalette->setButtonIconSize(QSize(128, 128)); mErasePalette->setButtonIconSize(QSize(128, 128));
@ -447,6 +448,7 @@ void UBBoardPaletteManager::connectPalettes()
connect(UBApplication::mainWindow->actionEraseItems, SIGNAL(triggered()), mErasePalette, SLOT(close())); connect(UBApplication::mainWindow->actionEraseItems, SIGNAL(triggered()), mErasePalette, SLOT(close()));
connect(UBApplication::mainWindow->actionEraseAnnotations, SIGNAL(triggered()), mErasePalette, SLOT(close())); connect(UBApplication::mainWindow->actionEraseAnnotations, SIGNAL(triggered()), mErasePalette, SLOT(close()));
connect(UBApplication::mainWindow->actionClearPage, SIGNAL(triggered()), mErasePalette, SLOT(close())); connect(UBApplication::mainWindow->actionClearPage, SIGNAL(triggered()), mErasePalette, SLOT(close()));
connect(UBApplication::mainWindow->actionEraseBackground,SIGNAL(triggered()),mErasePalette,SLOT(close()));
connect(mErasePalette, SIGNAL(closed()), this, SLOT(erasePaletteClosed())); connect(mErasePalette, SIGNAL(closed()), this, SLOT(erasePaletteClosed()));
foreach(QWidget *widget, UBApplication::mainWindow->actionErase->associatedWidgets()) foreach(QWidget *widget, UBApplication::mainWindow->actionErase->associatedWidgets())

@ -36,8 +36,6 @@
#include "UBIdleTimer.h" #include "UBIdleTimer.h"
#include "UBApplicationController.h" #include "UBApplicationController.h"
//#include "softwareupdate/UBSoftwareUpdateController.h"
#include "board/UBBoardController.h" #include "board/UBBoardController.h"
#include "board/UBDrawingController.h" #include "board/UBDrawingController.h"
#include "board/UBBoardView.h" #include "board/UBBoardView.h"
@ -203,7 +201,6 @@ UBApplication::~UBApplication()
staticMemoryCleaner = 0; staticMemoryCleaner = 0;
} }
void UBApplication::setupTranslator(QString forcedLanguage) void UBApplication::setupTranslator(QString forcedLanguage)
{ {
QStringList availablesTranslations = UBPlatformUtils::availableTranslations(); QStringList availablesTranslations = UBPlatformUtils::availableTranslations();

@ -849,9 +849,9 @@ QString UBPersistenceManager::addObjectToTeacherGuideDirectory(UBDocumentProxy*
{ {
QString path = pPath; QString path = pPath;
//windows //windows
path.replace("file:///",""); //path=path.replace("file:///","");
//others //others
path.replace("file://",""); path=path.replace("file://","");
QFileInfo fi(path); QFileInfo fi(path);
QString uuid = QUuid::createUuid(); QString uuid = QUuid::createUuid();

@ -1286,6 +1286,17 @@ void UBGraphicsScene::clearAnnotations()
setDocumentUpdated(); setDocumentUpdated();
} }
void UBGraphicsScene::clearBackground()
{
if(mBackgroundObject){
removeItem(mBackgroundObject);
mBackgroundObject = 0;
}
update(sceneRect());
setDocumentUpdated();
}
UBGraphicsPixmapItem* UBGraphicsScene::addPixmap(const QPixmap& pPixmap, const QPointF& pPos, qreal pScaleFactor, bool pUseAnimation) UBGraphicsPixmapItem* UBGraphicsScene::addPixmap(const QPixmap& pPixmap, const QPointF& pPos, qreal pScaleFactor, bool pUseAnimation)
{ {
UBGraphicsPixmapItem* pixmapItem = new UBGraphicsPixmapItem(); UBGraphicsPixmapItem* pixmapItem = new UBGraphicsPixmapItem();

@ -113,6 +113,7 @@ class UBGraphicsScene: public UBCoreGraphicsScene, public UBItem
void clearItemsAndAnnotations(); void clearItemsAndAnnotations();
void clearItems(); void clearItems();
void clearAnnotations(); void clearAnnotations();
void clearBackground();
bool inputDevicePress(const QPointF& scenePos, const qreal& pressure = 1.0); bool inputDevicePress(const QPointF& scenePos, const qreal& pressure = 1.0);
bool inputDeviceMove(const QPointF& scenePos, const qreal& pressure = 1.0); bool inputDeviceMove(const QPointF& scenePos, const qreal& pressure = 1.0);

@ -339,6 +339,7 @@ void UBTGMediaWidget::initializeWithDom(QDomElement element)
mIsInitializationMode = true; mIsInitializationMode = true;
setAcceptDrops(false); setAcceptDrops(false);
mMediaPath = UBApplication::boardController->activeDocument()->persistencePath() + "/" + element.attribute("relativePath"); mMediaPath = UBApplication::boardController->activeDocument()->persistencePath() + "/" + element.attribute("relativePath");
qDebug() << mMediaPath;
createWorkWidget(); createWorkWidget();
setFixedHeight(200); setFixedHeight(200);
mpTitle->setInitialText(element.attribute("title")); mpTitle->setInitialText(element.attribute("title"));

Loading…
Cancel
Save