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

preferencesAboutTextFull
shibakaneki 13 years ago
commit 1ce0b53985
  1. 9
      resources/etc/npapi-wrapper.application.x-shockwave-flash.swf.htm
  2. 6619
      resources/library/userImage/Backgrounds/2009_calendar_EU.svg
  3. 5811
      resources/library/userImage/Backgrounds/2009_calendar_US.svg
  4. 5576
      resources/library/userImage/Backgrounds/calendar_2011.svg
  5. 5116
      resources/library/userImage/Backgrounds/calendar_2012.svg
  6. 5114
      resources/library/userImage/Backgrounds/calendrier_2011.svg
  7. 5116
      resources/library/userImage/Backgrounds/calendrier_2012.svg
  8. 924
      src/adaptors/UBCFFSubsetAdaptor.cpp
  9. 58
      src/adaptors/UBCFFSubsetAdaptor.h
  10. 4
      src/adaptors/UBImportCFF.cpp
  11. 2
      src/board/UBBoardController.cpp
  12. 156
      src/board/UBBoardPaletteManager.cpp
  13. 1
      src/board/UBLibraryController.cpp
  14. 7
      src/core/UBApplicationController.cpp
  15. 93
      src/desktop/UBDesktopAnnotationController.cpp
  16. 8
      src/desktop/UBDesktopAnnotationController.h
  17. 18
      src/document/UBDocumentController.cpp
  18. 6
      src/document/UBDocumentController.h
  19. 2
      src/domain/UBGraphicsProxyWidget.h
  20. 2
      src/domain/UBGraphicsWidgetItemDelegate.cpp
  21. 57
      src/gui/UBKeyboardPalette.cpp
  22. 7
      src/gui/UBKeyboardPalette.h
  23. 35
      src/web/UBWebController.cpp
  24. 14
      src/web/UBWebController.h

@ -7,6 +7,15 @@
html, body, #content { height:100%; } html, body, #content { height:100%; }
body { margin:0; padding:0; overflow:hidden; } body { margin:0; padding:0; overflow:hidden; }
</style> </style>
<script type="text/javascript">
window.onload = function(){
if (window.widget) {
window.widget.onremove = function(){
document.getElementById("content").innerHTML = "";
}
}
}
</script>
</head> </head>
<body> <body>
<div id="content"> <div id="content">

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 543 KiB

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 486 KiB

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 167 KiB

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 167 KiB

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 166 KiB

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 167 KiB

File diff suppressed because it is too large Load Diff

@ -19,12 +19,28 @@
#include <QtXml> #include <QtXml>
#include <QString> #include <QString>
#include <QStack> #include <QStack>
#include <QDomDocument>
#include <QHash>
class UBDocumentProxy; class UBDocumentProxy;
class UBGraphicsScene; class UBGraphicsScene;
class QSvgGenerator; class QSvgGenerator;
class UBGraphicsSvgItem; class UBGraphicsSvgItem;
class UBGraphicsPixmapItem;
class UBGraphicsItemDelegate;
class QTransform; class QTransform;
class QPainter;
struct IwbExt {
IwbExt() {;}
IwbExt(QDomNode element) : element(element), extAttr(*(new QVector<QDomNode>())) {;}
QDomNode group;
QDomNode element;
QVector<QDomNode> extAttr;
QHash<QString, QString> textAttributes;
operator bool() const {return !group.isNull() || !element.isNull();}
};
class UBCFFSubsetAdaptor class UBCFFSubsetAdaptor
{ {
@ -49,10 +65,11 @@ private:
}; };
public: public:
UBCFFSubsetReader(UBDocumentProxy *proxy, QByteArray &content); UBCFFSubsetReader(UBDocumentProxy *proxy, QFile *content);
QXmlStreamReader mReader; QXmlStreamReader mReader;
UBDocumentProxy *mProxy; UBDocumentProxy *mProxy;
QString pwdContent;
bool parse(); bool parse();
@ -65,6 +82,41 @@ private:
QPointF mViewBoxCenter; QPointF mViewBoxCenter;
QSize mSize; QSize mSize;
private:
// to kill
QDomDocument mDOMdoc;
QDomNode mCurrentDOMElement;
QHash<QString, IwbExt> iwbExtProperties;
QHash<QString, UBGraphicsItemDelegate*> persistedItems;
bool hashElements();
void addExtentionsToHash(QDomElement *parent, QDomElement *topGroup);
void hashSvg(QDomNode *parent, QString prefix = "");
void hashSiblingIwbElements(QDomElement *parent, QDomElement *topGroup = 0);
inline void parseSvgSectionAttr(const QDomElement &);
bool parseSvgPage(const QDomElement &parent);
bool parseSvgPageset(const QDomElement &parent);
bool parseSvgElement(const QDomElement &parent);
inline bool parseSvgRect(const QDomElement &element);
inline bool parseSvgEllipse(const QDomElement &element);
inline bool parseSvgPolygon(const QDomElement &element);
inline bool parseSvgPolyline(const QDomElement &element);
inline bool parseSvgText(const QDomElement &element);
inline bool parseSvgTextarea(const QDomElement &element);
inline bool parseSvgImage(const QDomElement &element);
// inline bool parseSvgTSpan(const QDomElement)
bool parseIwbGroup(QDomNode *element);
inline void hashSceneItem(QDomNode *element, UBGraphicsItemDelegate *item);
// to kill
void parseTextAttributes(const QDomElement &element, qreal &fontSize, QColor &fontColor,
QString &fontFamily, QString &fontStretch, bool &italic,
int &fontWeight, int &textAlign, QTransform &fontTransform);
//methods to store current xml parse state //methods to store current xml parse state
int PopState(); int PopState();
void PushState(int state); void PushState(int state);
@ -92,12 +144,16 @@ private:
bool createNewScene(); bool createNewScene();
bool persistCurrentScene(); bool persistCurrentScene();
QStack<int> stateStack; QStack<int> stateStack;
int currentState; int currentState;
//helper methods //helper methods
bool getCurElementTransorm(QTransform &transform); bool getCurElementTransorm(QTransform &transform);
void repositionSvgItem(UBGraphicsSvgItem *item, qreal width, qreal height, qreal x, qreal y, bool useTransform, QTransform &transform); void repositionSvgItem(UBGraphicsSvgItem *item, qreal width, qreal height, qreal x, qreal y, bool useTransform, QTransform &transform);
void repositionPixmapItem(UBGraphicsPixmapItem *item, qreal width, qreal height, qreal x, qreal y
, bool useTransform, QTransform &transform);
QColor colorFromString(const QString& clrString); QColor colorFromString(const QString& clrString);
QTransform transformFromString(const QString trString); QTransform transformFromString(const QString trString);
bool getViewBoxDimenstions(const QString& viewBox); bool getViewBoxDimenstions(const QString& viewBox);

@ -47,8 +47,8 @@ UBImportCFF::~UBImportCFF()
QStringList UBImportCFF::supportedExtentions() QStringList UBImportCFF::supportedExtentions()
{ {
// return QStringList("iwb"); return QStringList("iwb");
return QStringList(); // return QStringList();
} }

@ -1708,7 +1708,7 @@ UBGraphicsAudioItem* UBBoardController::addAudio(const QUrl& pSourceUrl, bool st
QUuid uuid = QUuid::createUuid(); QUuid uuid = QUuid::createUuid();
QUrl concreteUrl = pSourceUrl; QUrl concreteUrl = pSourceUrl;
concreteUrl = QUrl(UBPersistenceManager::persistenceManager() concreteUrl = QUrl::fromLocalFile(mActiveDocument->persistencePath() + "/" + UBPersistenceManager::persistenceManager()
->addAudioFileToDocument(mActiveDocument, pSourceUrl.toLocalFile(), uuid)); ->addAudioFileToDocument(mActiveDocument, pSourceUrl.toLocalFile(), uuid));
UBGraphicsAudioItem* vi = mActiveScene->addAudio(concreteUrl, startPlay, pos); UBGraphicsAudioItem* vi = mActiveScene->addAudio(concreteUrl, startPlay, pos);

@ -80,7 +80,6 @@ UBBoardPaletteManager::UBBoardPaletteManager(QWidget* container, UBBoardControll
, mpPageNavigWidget(NULL) , mpPageNavigWidget(NULL)
, mpLibWidget(NULL) , mpLibWidget(NULL)
, mpCachePropWidget(NULL) , mpCachePropWidget(NULL)
// , mDesktopRightPalette(NULL)
, mpTeacherBarWidget(NULL) , mpTeacherBarWidget(NULL)
, mpDesktopLibWidget(NULL) , mpDesktopLibWidget(NULL)
{ {
@ -225,15 +224,38 @@ void UBBoardPaletteManager::setupDockPaletteWidgets()
void UBBoardPaletteManager::slot_changeMainMode(UBApplicationController::MainMode mainMode) void UBBoardPaletteManager::slot_changeMainMode(UBApplicationController::MainMode mainMode)
{ {
// Board = 0, Internet, Document, Tutorial, ParaschoolEditor, WebDocument
switch( mainMode ) switch( mainMode )
{ {
case UBApplicationController::Board: case UBApplicationController::Board:
// call changeMode only when switch NOT from desktop mode {
if(!UBApplication::applicationController->isShowingDesktop()) // call changeMode only when switch NOT from desktop mode
changeMode(eUBDockPaletteWidget_BOARD); if(!UBApplication::applicationController->isShowingDesktop())
changeMode(eUBDockPaletteWidget_BOARD);
}
break;
case UBApplicationController::Tutorial:
{
if (UBPlatformUtils::hasVirtualKeyboard() && mKeyboardPalette != NULL)
mKeyboardPalette->hide();
}
break;
case UBApplicationController::Internet:
changeMode(eUBDockPaletteWidget_WEB);
break;
case UBApplicationController::Document:
changeMode(eUBDockPaletteWidget_DOCUMENT);
break; break;
default: default:
{
if (UBPlatformUtils::hasVirtualKeyboard() && mKeyboardPalette != NULL)
mKeyboardPalette->hide();
}
break; break;
} }
} }
@ -260,25 +282,25 @@ void UBBoardPaletteManager::slot_changeDesktopMode(bool isDesktop)
void UBBoardPaletteManager::setupPalettes() void UBBoardPaletteManager::setupPalettes()
{ {
setupDockPaletteWidgets();
// Add the other palettes
mStylusPalette = new UBStylusPalette(mContainer, UBSettings::settings()->appToolBarOrientationVertical->get().toBool() ? Qt::Vertical : Qt::Horizontal);
connect(mStylusPalette, SIGNAL(stylusToolDoubleClicked(int)), UBApplication::boardController, SLOT(stylusToolDoubleClicked(int)));
mStylusPalette->show(); // always show stylus palette at startup
if (UBPlatformUtils::hasVirtualKeyboard()) if (UBPlatformUtils::hasVirtualKeyboard())
{ {
mKeyboardPalette = UBKeyboardPalette::create(0); mKeyboardPalette = new UBKeyboardPalette(0);
#ifndef Q_WS_WIN #ifndef Q_WS_WIN
connect(mKeyboardPalette, SIGNAL(closed()), mKeyboardPalette, SLOT(onDeactivated())); connect(mKeyboardPalette, SIGNAL(closed()), mKeyboardPalette, SLOT(onDeactivated()));
#endif #endif
#ifndef Q_WS_MAC #ifndef Q_WS_MAC
mKeyboardPalette->setParent(mContainer); // mKeyboardPalette->setParent(mContainer);
#endif #endif
} }
setupDockPaletteWidgets();
// Add the other palettes
mStylusPalette = new UBStylusPalette(mContainer, UBSettings::settings()->appToolBarOrientationVertical->get().toBool() ? Qt::Vertical : Qt::Horizontal);
connect(mStylusPalette, SIGNAL(stylusToolDoubleClicked(int)), UBApplication::boardController, SLOT(stylusToolDoubleClicked(int)));
mStylusPalette->show(); // always show stylus palette at startup
mZoomPalette = new UBZoomPalette(mContainer); mZoomPalette = new UBZoomPalette(mContainer);
QList<QAction*> backgroundsActions; QList<QAction*> backgroundsActions;
@ -488,7 +510,7 @@ void UBBoardPaletteManager::connectPalettes()
} }
bool isFirstResized = true;
void UBBoardPaletteManager::containerResized() void UBBoardPaletteManager::containerResized()
{ {
int innerMargin = UBSettings::boardMargin; int innerMargin = UBSettings::boardMargin;
@ -498,25 +520,39 @@ void UBBoardPaletteManager::containerResized()
int userTop = innerMargin; int userTop = innerMargin;
int userHeight = mContainer->height() - (2 * innerMargin); int userHeight = mContainer->height() - (2 * innerMargin);
mStylusPalette->move(userLeft, userTop); if(mStylusPalette)
mStylusPalette->adjustSizeAndPosition(); {
mStylusPalette->initPosition(); mStylusPalette->move(userLeft, userTop);
mStylusPalette->adjustSizeAndPosition();
mStylusPalette->initPosition();
}
mZoomPalette->move(userLeft + userWidth - mZoomPalette->width() if(mZoomPalette)
, userTop + userHeight /*- mPageNumberPalette->height()*/ - innerMargin - mZoomPalette->height()); {
mZoomPalette->adjustSizeAndPosition(); mZoomPalette->move(userLeft + userWidth - mZoomPalette->width()
, userTop + userHeight /*- mPageNumberPalette->height()*/ - innerMargin - mZoomPalette->height());
mZoomPalette->adjustSizeAndPosition();
}
if (mKeyboardPalette) if (isFirstResized && mKeyboardPalette && mKeyboardPalette->parent() == UBApplication::boardController->controlContainer())
{ {
mKeyboardPalette->move(userLeft + (userWidth - mKeyboardPalette->width())/2, isFirstResized = false;
userTop + userHeight - mKeyboardPalette->height()); mKeyboardPalette->move(userLeft + (userWidth - mKeyboardPalette->width())/2,
mKeyboardPalette->adjustSizeAndPosition(); userTop + (userHeight - mKeyboardPalette->height())/2);
mKeyboardPalette->adjustSizeAndPosition();
} }
mLeftPalette->resize(mLeftPalette->width()-1, mContainer->height()); if(mLeftPalette)
mRightPalette->resize(mRightPalette->width()-1, mContainer->height()); {
mLeftPalette->resize(mLeftPalette->width(), mContainer->height()); mLeftPalette->resize(mLeftPalette->width()-1, mContainer->height());
mRightPalette->resize(mRightPalette->width(), mContainer->height()); mLeftPalette->resize(mLeftPalette->width(), mContainer->height());
}
if(mRightPalette)
{
mRightPalette->resize(mRightPalette->width()-1, mContainer->height());
mRightPalette->resize(mRightPalette->width(), mContainer->height());
}
} }
@ -688,6 +724,18 @@ void UBBoardPaletteManager::changeMode(eUBDockPaletteWidgetMode newMode, bool is
{ {
mLeftPalette->setParent(UBApplication::boardController->controlContainer()); mLeftPalette->setParent(UBApplication::boardController->controlContainer());
mRightPalette->setParent(UBApplication::boardController->controlContainer()); mRightPalette->setParent(UBApplication::boardController->controlContainer());
if (UBPlatformUtils::hasVirtualKeyboard() && mKeyboardPalette != NULL)
{
if(mKeyboardPalette->m_isVisible)
{
mKeyboardPalette->hide();
mKeyboardPalette->setParent(UBApplication::boardController->controlContainer());
mKeyboardPalette->show();
}
else
mKeyboardPalette->setParent(UBApplication::boardController->controlContainer());
}
mLeftPalette->setVisible(true); mLeftPalette->setVisible(true);
mRightPalette->setVisible(true); mRightPalette->setVisible(true);
@ -701,6 +749,22 @@ void UBBoardPaletteManager::changeMode(eUBDockPaletteWidgetMode newMode, bool is
{ {
mLeftPalette->setParent((QWidget*)UBApplication::applicationController->uninotesController()->drawingView()); mLeftPalette->setParent((QWidget*)UBApplication::applicationController->uninotesController()->drawingView());
mRightPalette->setParent((QWidget*)UBApplication::applicationController->uninotesController()->drawingView()); mRightPalette->setParent((QWidget*)UBApplication::applicationController->uninotesController()->drawingView());
if (UBPlatformUtils::hasVirtualKeyboard() && mKeyboardPalette != NULL)
{
if(mKeyboardPalette->m_isVisible)
{
mKeyboardPalette->hide();
#ifndef Q_WS_X11
mKeyboardPalette->setParent((QWidget*)UBApplication::applicationController->uninotesController()->drawingView());
#else
mKeyboardPalette->setParent(0);
#endif
mKeyboardPalette->show();
}
else
mKeyboardPalette->setParent((QWidget*)UBApplication::applicationController->uninotesController()->drawingView());
}
mLeftPalette->setVisible(false); mLeftPalette->setVisible(false);
mRightPalette->setVisible(true); mRightPalette->setVisible(true);
@ -710,12 +774,46 @@ void UBBoardPaletteManager::changeMode(eUBDockPaletteWidgetMode newMode, bool is
} }
break; break;
case eUBDockPaletteWidget_WEB:
{
if (UBPlatformUtils::hasVirtualKeyboard() && mKeyboardPalette != NULL)
{
WBBrowserWindow* brWnd = UBApplication::webController->GetCurrentWebBrowser();
if(mKeyboardPalette->m_isVisible)
{
mKeyboardPalette->hide();
mKeyboardPalette->setParent(brWnd);
mKeyboardPalette->show();
}
else
mKeyboardPalette->setParent(brWnd);
}
}
break;
default: default:
{ {
mLeftPalette->setVisible(false); mLeftPalette->setVisible(false);
mRightPalette->setVisible(false); mRightPalette->setVisible(false);
mLeftPalette->setParent(0); mLeftPalette->setParent(0);
mRightPalette->setParent(0); mRightPalette->setParent(0);
if (UBPlatformUtils::hasVirtualKeyboard() && mKeyboardPalette != NULL)
{
if(mKeyboardPalette->m_isVisible)
{
mKeyboardPalette->hide();
mKeyboardPalette->setParent(0);
mKeyboardPalette->show();
}
else
mKeyboardPalette->setParent(0);
// mKeyboardPalette->update();
}
} }
break; break;
} }

@ -353,7 +353,6 @@ QList<UBLibElement*> UBLibraryController::listElementsInPath(const QString& pPat
UBLibElement *element = new UBLibElement(fileType, QUrl::fromLocalFile(fileInfo->absoluteFilePath()), itemName); UBLibElement *element = new UBLibElement(fileType, QUrl::fromLocalFile(fileInfo->absoluteFilePath()), itemName);
if (fileType == eUBLibElementType_Folder) { if (fileType == eUBLibElementType_Folder) {
// QImage* directoryImage = new QImage(":images/libpalette/folder.svg");
element->setThumbnail(QImage(":images/libpalette/folder.svg")); element->setThumbnail(QImage(":images/libpalette/folder.svg"));
} }
else if (fileType == eUBLibElementType_Item) { else if (fileType == eUBLibElementType_Item) {

@ -368,6 +368,8 @@ void UBApplicationController::showInternet()
if (UBSettings::settings()->webUseExternalBrowser->get().toBool()) if (UBSettings::settings()->webUseExternalBrowser->get().toBool())
{ {
showDesktop(true); showDesktop(true);
UBApplication::webController->show(UBWebController::WebBrowser);
// really no have emit mainModeChanged here ? potential problem with virtual keyboard ?
} }
else else
{ {
@ -382,10 +384,11 @@ void UBApplicationController::showInternet()
mMainWindow->show(); mMainWindow->show();
mUninoteController->hideWindow(); mUninoteController->hideWindow();
UBApplication::webController->show(UBWebController::WebBrowser);
emit mainModeChanged(Internet); emit mainModeChanged(Internet);
} }
UBApplication::webController->show(UBWebController::WebBrowser);
} }

@ -52,7 +52,7 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent)
, mTransparentDrawingView(0) , mTransparentDrawingView(0)
, mTransparentDrawingScene(0) , mTransparentDrawingScene(0)
, mDesktopPalette(NULL) , mDesktopPalette(NULL)
, mKeyboardPalette(0) // , mKeyboardPalette(0)
, mDesktopPenPalette(NULL) , mDesktopPenPalette(NULL)
, mDesktopMarkerPalette(NULL) , mDesktopMarkerPalette(NULL)
, mDesktopEraserPalette(NULL) , mDesktopEraserPalette(NULL)
@ -64,7 +64,7 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent)
, mPendingMarkerButtonPressed(false) , mPendingMarkerButtonPressed(false)
, mPendingEraserButtonPressed(false) , mPendingEraserButtonPressed(false)
, mbArrowClicked(false) , mbArrowClicked(false)
, mBoardStylusTool(UBStylusTool::Pen) , mBoardStylusTool(UBStylusTool::Selector /*UBStylusTool::Pen*/)
, mDesktopStylusTool(UBStylusTool::Selector) , mDesktopStylusTool(UBStylusTool::Selector)
{ {
@ -97,16 +97,21 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent)
if (UBPlatformUtils::hasVirtualKeyboard()) if (UBPlatformUtils::hasVirtualKeyboard())
{ {
#ifdef Q_WS_X11 #ifdef Q_WS_X11
mKeyboardPalette = UBKeyboardPalette::create(0); // mKeyboardPalette = UBKeyboardPalette::create(0);
connect(mTransparentDrawingView, SIGNAL(hidden()), mKeyboardPalette, SLOT(hide())); // connect(mTransparentDrawingView, SIGNAL(hidden()), mKeyboardPalette, SLOT(hide()));
connect(mTransparentDrawingView, SIGNAL(shown()), this, SLOT(showKeyboard())); // connect(mTransparentDrawingView, SIGNAL(shown()), this, SLOT(showKeyboard()));
#else #else
mKeyboardPalette = UBKeyboardPalette::create(mTransparentDrawingView); // mKeyboardPalette = UBKeyboardPalette::create(mTransparentDrawingView);
mKeyboardPalette->setParent(mTransparentDrawingView); // mKeyboardPalette->setParent(mTransparentDrawingView);
#endif #endif
connect(mKeyboardPalette, SIGNAL(keyboardActivated(bool)), mTransparentDrawingView, SLOT(virtualKeyboardActivated(bool))); connect( UBApplication::boardController->paletteManager()->mKeyboardPalette, SIGNAL(keyboardActivated(bool)),
mTransparentDrawingView, SLOT(virtualKeyboardActivated(bool)));
// connect(UBApplication::mainWindow->actionVirtualKeyboard, SIGNAL(triggered(bool)),
// mTransparentDrawingView, SLOT(virtualKeyboardActivated(bool)));
#ifdef Q_WS_X11 #ifdef Q_WS_X11
connect(mKeyboardPalette, SIGNAL(moved(QPoint)), this, SLOT(refreshMask())); connect(UBApplication::boardController->paletteManager()->mKeyboardPalette, SIGNAL(moved(QPoint)), this, SLOT(refreshMask()));
connect(mDesktopPalette,SIGNAL(refreshMask()), this, SLOT(refreshMask())); connect(mDesktopPalette,SIGNAL(refreshMask()), this, SLOT(refreshMask()));
#endif #endif
} }
@ -117,7 +122,7 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent)
connect(mDesktopPalette, SIGNAL(screenClick()), this, SLOT(screenCapture())); connect(mDesktopPalette, SIGNAL(screenClick()), this, SLOT(screenCapture()));
connect(mDesktopPalette, SIGNAL(maximized()), this, SLOT(onDesktopPaletteMaximized())); connect(mDesktopPalette, SIGNAL(maximized()), this, SLOT(onDesktopPaletteMaximized()));
connect(mDesktopPalette, SIGNAL(minimizeStart(eMinimizedLocation)), this, SLOT(onDesktopPaletteMinimize())); connect(mDesktopPalette, SIGNAL(minimizeStart(eMinimizedLocation)), this, SLOT(onDesktopPaletteMinimize()));
connect(UBApplication::mainWindow->actionVirtualKeyboard, SIGNAL(triggered(bool)), this, SLOT(showKeyboard(bool))); // connect(UBApplication::mainWindow->actionVirtualKeyboard, SIGNAL(triggered(bool)), this, SLOT(showKeyboard(bool)));
connect(mTransparentDrawingView, SIGNAL(resized(QResizeEvent*)), this, SLOT(onTransparentWidgetResized())); connect(mTransparentDrawingView, SIGNAL(resized(QResizeEvent*)), this, SLOT(onTransparentWidgetResized()));
@ -164,31 +169,32 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent)
onDesktopPaletteMaximized(); onDesktopPaletteMaximized();
} }
void UBDesktopAnnotationController::showKeyboard(bool show) // void UBDesktopAnnotationController::showKeyboard(bool show)
{ // {
#ifdef Q_WS_X11 // #ifdef Q_WS_X11
if (!mTransparentDrawingView->isVisible()) // if (!mTransparentDrawingView->isVisible())
return; // return;
#endif // #endif
//
if(mKeyboardPalette) // if(mKeyboardPalette)
{ // {
if(show) // if(show)
UBDrawingController::drawingController()->setStylusTool(UBStylusTool::Selector); // UBDrawingController::drawingController()->setStylusTool(UBStylusTool::Selector);
mKeyboardPalette->setVisible(show); // mKeyboardPalette->setVisible(show);
//
#ifdef Q_WS_X11 // #ifdef Q_WS_X11
updateMask(true); // updateMask(true);
#endif // #endif
//
} // }
//
} // }
void UBDesktopAnnotationController::showKeyboard()
{ // void UBDesktopAnnotationController::showKeyboard()
if (UBApplication::mainWindow->actionVirtualKeyboard->isChecked()) // {
mKeyboardPalette->show(); // if (UBApplication::mainWindow->actionVirtualKeyboard->isChecked())
} // mKeyboardPalette->show();
// }
UBDesktopAnnotationController::~UBDesktopAnnotationController() UBDesktopAnnotationController::~UBDesktopAnnotationController()
{ {
@ -366,12 +372,12 @@ void UBDesktopAnnotationController::close()
void UBDesktopAnnotationController::stylusToolChanged(int tool) void UBDesktopAnnotationController::stylusToolChanged(int tool)
{ {
UBStylusTool::Enum eTool = (UBStylusTool::Enum)tool; // UBStylusTool::Enum eTool = (UBStylusTool::Enum)tool;
if(eTool != UBStylusTool::Selector && eTool != UBStylusTool::Text) // if(eTool != UBStylusTool::Selector && eTool != UBStylusTool::Text)
{ // {
if(mKeyboardPalette->m_isVisible) // if(mKeyboardPalette->m_isVisible)
UBApplication::mainWindow->actionVirtualKeyboard->activate(QAction::Trigger); // UBApplication::mainWindow->actionVirtualKeyboard->activate(QAction::Trigger);
} // }
updateBackground(); updateBackground();
} }
@ -910,9 +916,10 @@ void UBDesktopAnnotationController::updateMask(bool bTransparent)
{ {
p.drawRect(mDesktopPalette->geometry().x(), mDesktopPalette->geometry().y(), mDesktopPalette->width(), mDesktopPalette->height()); p.drawRect(mDesktopPalette->geometry().x(), mDesktopPalette->geometry().y(), mDesktopPalette->width(), mDesktopPalette->height());
} }
if(mKeyboardPalette->isVisible()) if(UBApplication::boardController->paletteManager()->mKeyboardPalette->isVisible())
{ {
p.drawRect(mKeyboardPalette->geometry().x(), mKeyboardPalette->geometry().y(), mKeyboardPalette->width(), mKeyboardPalette->height()); p.drawRect(UBApplication::boardController->paletteManager()->mKeyboardPalette->geometry().x(), UBApplication::boardController->paletteManager()->mKeyboardPalette->geometry().y(),
UBApplication::boardController->paletteManager()->mKeyboardPalette->width(), UBApplication::boardController->paletteManager()->mKeyboardPalette->height());
} }
// UBApplication::boardController->paletteManager()->mDesktopRightPalette // UBApplication::boardController->paletteManager()->mDesktopRightPalette

@ -29,7 +29,7 @@ class UBDesktopPenPalette;
class UBDesktopMarkerPalette; class UBDesktopMarkerPalette;
class UBDesktopEraserPalette; class UBDesktopEraserPalette;
class UBActionPalette; class UBActionPalette;
class UBKeyboardPalette; //class UBKeyboardPalette;
class UBMainWindow; class UBMainWindow;
#define PROPERTY_PALETTE_TIMER 1000 #define PROPERTY_PALETTE_TIMER 1000
@ -72,8 +72,8 @@ class UBDesktopAnnotationController : public QObject
void stylusToolChanged(int tool); void stylusToolChanged(int tool);
void updateBackground(); void updateBackground();
void showKeyboard(bool show); // void showKeyboard(bool show);
void showKeyboard(); //X11 virtual keyboard working only needed // void showKeyboard(); //X11 virtual keyboard working only needed
signals: signals:
/** /**
@ -118,7 +118,7 @@ class UBDesktopAnnotationController : public QObject
void updateMask(bool bTransparent); void updateMask(bool bTransparent);
UBDesktopPalette *mDesktopPalette; UBDesktopPalette *mDesktopPalette;
UBKeyboardPalette *mKeyboardPalette; //UBKeyboardPalette *mKeyboardPalette;
UBDesktopPenPalette* mDesktopPenPalette; UBDesktopPenPalette* mDesktopPenPalette;
UBDesktopMarkerPalette* mDesktopMarkerPalette; UBDesktopMarkerPalette* mDesktopMarkerPalette;
UBDesktopEraserPalette* mDesktopEraserPalette; UBDesktopEraserPalette* mDesktopEraserPalette;

@ -38,7 +38,7 @@
#include "board/UBBoardPaletteManager.h" #include "board/UBBoardPaletteManager.h"
#include "board/UBDrawingController.h" #include "board/UBDrawingController.h"
#include "gui/UBKeyboardPalette.h" //#include "gui/UBKeyboardPalette.h"
#include "gui/UBThumbnailView.h" #include "gui/UBThumbnailView.h"
#include "gui/UBDocumentTreeWidget.h" #include "gui/UBDocumentTreeWidget.h"
@ -70,7 +70,7 @@ UBDocumentController::UBDocumentController(UBMainWindow* mainWindow)
, mToolsPalette(0) , mToolsPalette(0)
, mToolsPalettePositionned(false) , mToolsPalettePositionned(false)
, mTrashTi(0) , mTrashTi(0)
, mKeyboardPalette(0) // , mKeyboardPalette(0)
{ {
setupViews(); setupViews();
setupToolbar(); setupToolbar();
@ -444,12 +444,12 @@ void UBDocumentController::setupViews()
mMessageWindow = new UBMessageWindow(mDocumentUI->thumbnailWidget); mMessageWindow = new UBMessageWindow(mDocumentUI->thumbnailWidget);
mMessageWindow->hide(); mMessageWindow->hide();
if (UBPlatformUtils::hasVirtualKeyboard()) // if (UBPlatformUtils::hasVirtualKeyboard())
{ // {
mKeyboardPalette = UBKeyboardPalette::create(0); // mKeyboardPalette = UBKeyboardPalette::create(0);
mKeyboardPalette->setParent(controlView()); // mKeyboardPalette->setParent(controlView());
connect(mMainWindow->actionVirtualKeyboard, SIGNAL(triggered(bool)), this, SLOT(showKeyboard(bool))); // connect(mMainWindow->actionVirtualKeyboard, SIGNAL(triggered(bool)), this, SLOT(showKeyboard(bool)));
} // }
} }
} }
@ -467,6 +467,7 @@ void UBDocumentController::setupToolbar()
connect(mMainWindow->actionDocumentTools, SIGNAL(triggered()), this, SLOT(toggleDocumentToolsPalette())); connect(mMainWindow->actionDocumentTools, SIGNAL(triggered()), this, SLOT(toggleDocumentToolsPalette()));
} }
/*
void UBDocumentController::showKeyboard(bool show) void UBDocumentController::showKeyboard(bool show)
{ {
if(mKeyboardPalette) if(mKeyboardPalette)
@ -477,6 +478,7 @@ void UBDocumentController::showKeyboard(bool show)
} }
} }
*/
void UBDocumentController::setupPalettes() void UBDocumentController::setupPalettes()
{ {

@ -34,7 +34,7 @@ class UBDocumentGroupTreeItem;
class UBDocumentProxyTreeItem; class UBDocumentProxyTreeItem;
class UBMainWindow; class UBMainWindow;
class UBDocumentToolsPalette; class UBDocumentToolsPalette;
class UBKeyboardPalette; //class UBKeyboardPalette;
class UBDocumentController : public QObject class UBDocumentController : public QObject
{ {
@ -76,7 +76,7 @@ class UBDocumentController : public QObject
void paste(); void paste();
void focusChanged(QWidget *old, QWidget *current); void focusChanged(QWidget *old, QWidget *current);
void showKeyboard(bool show); // void showKeyboard(bool show);
protected: protected:
virtual void setupViews(); virtual void setupViews();
@ -112,7 +112,7 @@ class UBDocumentController : public QObject
UBDocumentGroupTreeItem* mTrashTi; UBDocumentGroupTreeItem* mTrashTi;
UBDocumentProxy* mCurrentDocument; UBDocumentProxy* mCurrentDocument;
UBKeyboardPalette *mKeyboardPalette; // UBKeyboardPalette *mKeyboardPalette;
private slots: private slots:

@ -41,7 +41,7 @@ class UBGraphicsProxyWidget: public QGraphicsProxyWidget, public UBItem, public
virtual void remove(); virtual void remove();
UBGraphicsItemDelegate* delegate (){ return mDelegate;}; UBGraphicsItemDelegate* delegate (){ return mDelegate;}
protected: protected:

@ -17,8 +17,6 @@
#include <QtSvg> #include <QtSvg>
#include "UBGraphicsWidgetItemDelegate.h" #include "UBGraphicsWidgetItemDelegate.h"
#include "UBGraphicsScene.h" #include "UBGraphicsScene.h"
#include "core/UBApplication.h" #include "core/UBApplication.h"

@ -27,6 +27,9 @@
UBKeyboardPalette::UBKeyboardPalette(QWidget *parent) UBKeyboardPalette::UBKeyboardPalette(QWidget *parent)
: UBActionPalette(Qt::TopRightCorner, parent) : UBActionPalette(Qt::TopRightCorner, parent)
{ {
// setWindowFlags(/*Qt::CustomizeWindowHint|*/Qt::WindowStaysOnTopHint|Qt::FramelessWindowHint);
setCustomCloseProcessing(true); setCustomCloseProcessing(true);
setCustomPosition(true); setCustomPosition(true);
setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
@ -56,57 +59,25 @@ UBKeyboardPalette::UBKeyboardPalette(QWidget *parent)
setContentsMargins( 22, 22, 22, 22 ); setContentsMargins( 22, 22, 22, 22 );
connect(this, SIGNAL(keyboardActivated(bool)), this, SLOT(onActivated(bool))); init();
} }
QList<UBKeyboardPalette*> UBKeyboardPalette::instances; //QList<UBKeyboardPalette*> UBKeyboardPalette::instances;
UBKeyboardPalette* UBKeyboardPalette::create(QWidget *parent) void UBKeyboardPalette::init()
{ {
//------------------------------// m_isVisible = false;
setVisible(false);
if (!UBPlatformUtils::hasVirtualKeyboard())
return NULL;
//------------------------------//
UBKeyboardPalette* firstKeyboard = NULL;
// if we already have keyboards inside, get it position and show/hide status, for new keyboard
if(instances.size() > 0)
firstKeyboard = instances.at(0);
//------------------------------//
UBKeyboardPalette* instance = new UBKeyboardPalette(parent); setKeyButtonSize(UBSettings::settings()->boardKeyboardPaletteKeyBtnSize->get().toString());
instance->setKeyButtonSize(UBSettings::settings()->boardKeyboardPaletteKeyBtnSize->get().toString());
instance->m_isVisible = firstKeyboard ? firstKeyboard->m_isVisible : false; connect(this, SIGNAL(keyboardActivated(bool)), this, SLOT(onActivated(bool)));
instance->setVisible(instance->m_isVisible); connect(UBSettings::settings()->boardKeyboardPaletteKeyBtnSize, SIGNAL(changed(QVariant)), this, SLOT(keyboardPaletteButtonSizeChanged(QVariant)));
connect(UBApplication::mainWindow->actionVirtualKeyboard, SIGNAL(triggered(bool)), this, SLOT(showKeyboard(bool)));
if( firstKeyboard ) connect(this, SIGNAL(closed()), this, SLOT(hideKeyboard()));
instance->move(firstKeyboard->m_pos);
connect(UBSettings::settings()->boardKeyboardPaletteKeyBtnSize, SIGNAL(changed(QVariant)), instance, SLOT(keyboardPaletteButtonSizeChanged(QVariant)));
connect(UBApplication::mainWindow->actionVirtualKeyboard, SIGNAL(triggered(bool)), instance, SLOT(showKeyboard(bool)));
// connect(instance, SIGNAL(moved(const QPoint&)), instance, SLOT(syncPosition(const QPoint&)));
connect(instance, SIGNAL(closed()), instance, SLOT(hideKeyboard()));
//------------------------------//
instances.append(instance);
foreach(UBKeyboardPalette* inst, instances)
{
connect(inst, SIGNAL(moved(const QPoint&)), instance, SLOT(syncPosition(const QPoint&)));
connect(instance, SIGNAL(moved(const QPoint&)), inst, SLOT(syncPosition(const QPoint&)));
connect(inst, SIGNAL(localeChanged(int)), instance, SLOT(syncLocale(int)));
connect(instance, SIGNAL(localeChanged(int)), inst, SLOT(syncLocale(int)));
// connect(instance, SIGNAL(closed()), inst, )
}
//------------------------------// //------------------------------//
return instance; UBPlatformUtils::setWindowNonActivableFlag(this, true);
} }
void UBKeyboardPalette::showKeyboard(bool show) void UBKeyboardPalette::showKeyboard(bool show)

@ -67,6 +67,7 @@ friend class UBCapsLockButton;
friend class UBLocaleButton; friend class UBLocaleButton;
public: public:
UBKeyboardPalette(QWidget *parent);
~UBKeyboardPalette(); ~UBKeyboardPalette();
BTNImages *currBtnImages; BTNImages *currBtnImages;
@ -77,8 +78,6 @@ public:
QString getKeyButtonSize() const {QString res; res.sprintf("%dx%d", btnWidth, btnHeight); return res;} QString getKeyButtonSize() const {QString res; res.sprintf("%dx%d", btnWidth, btnHeight); return res;}
void setKeyButtonSize(const QString& strSize); void setKeyButtonSize(const QString& strSize);
static UBKeyboardPalette* create(QWidget *parent);
static QList<UBKeyboardPalette*> instances;
bool m_isVisible; bool m_isVisible;
QPoint m_pos; QPoint m_pos;
@ -120,9 +119,9 @@ protected:
const QString* getLocaleName(); const QString* getLocaleName();
private: void init();
UBKeyboardPalette(QWidget *parent); private:
QRect originalRect; QRect originalRect;

@ -46,6 +46,7 @@
#include "domain/UBGraphicsScene.h" #include "domain/UBGraphicsScene.h"
#include "desktop/UBCustomCaptureWindow.h" #include "desktop/UBCustomCaptureWindow.h"
#include "board/UBBoardPaletteManager.h"
UBWebController::UBWebController(UBMainWindow* mainWindow) UBWebController::UBWebController(UBMainWindow* mainWindow)
@ -55,7 +56,7 @@ UBWebController::UBWebController(UBMainWindow* mainWindow)
, mBrowserWidget(0) , mBrowserWidget(0)
, mTrapFlashController(0) , mTrapFlashController(0)
, mToolsCurrentPalette(0) , mToolsCurrentPalette(0)
, mKeyboardCurrentPalette(0) // , mKeyboardCurrentPalette(0)
, mToolsPalettePositionned(false) , mToolsPalettePositionned(false)
, mDownloadViewIsVisible(false) , mDownloadViewIsVisible(false)
@ -113,7 +114,7 @@ void UBWebController::webBrowserInstance()
{ {
mCurrentWebBrowser = &mWebBrowserList[WebBrowser]; mCurrentWebBrowser = &mWebBrowserList[WebBrowser];
mToolsCurrentPalette = &mToolsPaletteList[WebBrowser]; mToolsCurrentPalette = &mToolsPaletteList[WebBrowser];
mKeyboardCurrentPalette = &mKeyboardPaletteList[WebBrowser]; // mKeyboardCurrentPalette = &mKeyboardPaletteList[WebBrowser];
mToolsPalettePositionned = mToolsPalettePositionnedList[WebBrowser]; mToolsPalettePositionned = mToolsPalettePositionnedList[WebBrowser];
if (!(*mCurrentWebBrowser)) if (!(*mCurrentWebBrowser))
{ {
@ -191,7 +192,7 @@ void UBWebController::tutorialWebInstance()
{ {
mCurrentWebBrowser = &mWebBrowserList[Tutorial]; mCurrentWebBrowser = &mWebBrowserList[Tutorial];
mToolsCurrentPalette = &mToolsPaletteList[Tutorial]; mToolsCurrentPalette = &mToolsPaletteList[Tutorial];
mKeyboardCurrentPalette = &mKeyboardPaletteList[Tutorial]; // mKeyboardCurrentPalette = &mKeyboardPaletteList[Tutorial];
mToolsPalettePositionned = &mToolsPalettePositionnedList[Tutorial]; mToolsPalettePositionned = &mToolsPalettePositionnedList[Tutorial];
if (!(*mCurrentWebBrowser)) if (!(*mCurrentWebBrowser))
{ {
@ -249,7 +250,7 @@ void UBWebController::paraschoolWebInstance()
else { else {
mCurrentWebBrowser = &mWebBrowserList[Paraschool]; mCurrentWebBrowser = &mWebBrowserList[Paraschool];
mToolsCurrentPalette = &mToolsPaletteList[Paraschool]; mToolsCurrentPalette = &mToolsPaletteList[Paraschool];
mKeyboardCurrentPalette = &mKeyboardPaletteList[Paraschool]; // mKeyboardCurrentPalette = &mKeyboardPaletteList[Paraschool];
mToolsPalettePositionned = &mToolsPalettePositionnedList[Paraschool]; mToolsPalettePositionned = &mToolsPalettePositionnedList[Paraschool];
if (!(*mCurrentWebBrowser)){ if (!(*mCurrentWebBrowser)){
(*mCurrentWebBrowser) = new WBBrowserWindow(mMainWindow->centralWidget(), mMainWindow, true); (*mCurrentWebBrowser) = new WBBrowserWindow(mMainWindow->centralWidget(), mMainWindow, true);
@ -391,10 +392,11 @@ void UBWebController::setupPalettes()
{ {
(*mToolsCurrentPalette) = new UBWebToolsPalette((*mCurrentWebBrowser),false); (*mToolsCurrentPalette) = new UBWebToolsPalette((*mCurrentWebBrowser),false);
(*mKeyboardCurrentPalette) = UBKeyboardPalette::create(*mCurrentWebBrowser); // (*mKeyboardCurrentPalette) = UBKeyboardPalette::create(*mCurrentWebBrowser);
#ifndef Q_WS_WIN #ifndef Q_WS_WIN
if (*mKeyboardCurrentPalette) if (UBPlatformUtils::hasVirtualKeyboard() && UBApplication::boardController->paletteManager()->mKeyboardPalette)
connect(*mKeyboardCurrentPalette, SIGNAL(closed()), *mKeyboardCurrentPalette, SLOT(onDeactivated())); connect(UBApplication::boardController->paletteManager()->mKeyboardPalette, SIGNAL(closed()),
UBApplication::boardController->paletteManager()->mKeyboardPalette, SLOT(onDeactivated()));
#endif #endif
connect(mMainWindow->actionWebTrapFlash, SIGNAL(triggered()), this, SLOT(trapFlash())); connect(mMainWindow->actionWebTrapFlash, SIGNAL(triggered()), this, SLOT(trapFlash()));
@ -411,7 +413,7 @@ void UBWebController::setupPalettes()
(*mToolsCurrentPalette)->hide(); (*mToolsCurrentPalette)->hide();
(*mToolsCurrentPalette)->adjustSizeAndPosition(); (*mToolsCurrentPalette)->adjustSizeAndPosition();
(*mKeyboardCurrentPalette)->adjustSizeAndPosition(); // (*mKeyboardCurrentPalette)->adjustSizeAndPosition();
if (controlView()){ if (controlView()){
int left = controlView()->width() - 20 - (*mToolsCurrentPalette)->width(); int left = controlView()->width() - 20 - (*mToolsCurrentPalette)->width();
@ -435,15 +437,14 @@ void UBWebController::toggleWebTrap(bool checked)
} }
} }
void UBWebController::showKeyboard(bool checked) // void UBWebController::showKeyboard(bool checked)
{ // {
if (mKeyboardCurrentPalette // if (mKeyboardCurrentPalette
&& (*mKeyboardCurrentPalette)) // && (*mKeyboardCurrentPalette))
{ // {
(*mKeyboardCurrentPalette)->setVisible(checked); // (*mKeyboardCurrentPalette)->setVisible(checked);
} // }
} // }
void UBWebController::toggleWebToolsPalette(bool checked) void UBWebController::toggleWebToolsPalette(bool checked)
{ {

@ -28,7 +28,7 @@ class UBMainWindow;
class UBWebToolsPalette; class UBWebToolsPalette;
class WBWebView; class WBWebView;
class UBServerXMLHttpRequest; class UBServerXMLHttpRequest;
class UBKeyboardPalette; //class UBKeyboardPalette;
class UBWebController : public QObject class UBWebController : public QObject
@ -58,6 +58,12 @@ class UBWebController : public QObject
void show(WebInstance type = UBWebController::WebBrowser); void show(WebInstance type = UBWebController::WebBrowser);
WBBrowserWindow* GetCurrentWebBrowser()
{
if( mCurrentWebBrowser != NULL ) return *mCurrentWebBrowser;
else return NULL;
};
protected: protected:
void setupPalettes(); void setupPalettes();
@ -101,8 +107,8 @@ class UBWebController : public QObject
UBTrapFlashController* mTrapFlashController; UBTrapFlashController* mTrapFlashController;
UBWebToolsPalette** mToolsCurrentPalette; UBWebToolsPalette** mToolsCurrentPalette;
UBWebToolsPalette* mToolsPaletteList[TotalNumberOfWebInstances]; UBWebToolsPalette* mToolsPaletteList[TotalNumberOfWebInstances];
UBKeyboardPalette** mKeyboardCurrentPalette; // UBKeyboardPalette** mKeyboardCurrentPalette;
UBKeyboardPalette* mKeyboardPaletteList[TotalNumberOfWebInstances]; // UBKeyboardPalette* mKeyboardPaletteList[TotalNumberOfWebInstances];
bool mToolsPalettePositionned; bool mToolsPalettePositionned;
bool mToolsPalettePositionnedList[TotalNumberOfWebInstances]; bool mToolsPalettePositionnedList[TotalNumberOfWebInstances];
@ -124,7 +130,7 @@ class UBWebController : public QObject
void toggleWebTrap(bool checked); void toggleWebTrap(bool checked);
void showKeyboard(bool checked); // void showKeyboard(bool checked);
signals: signals:
/** /**

Loading…
Cancel
Save