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. 158
      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. 9
      src/gui/UBKeyboardPalette.h
  23. 70
      src/web/UBTrapFlashController.cpp
  24. 35
      src/web/UBWebController.cpp
  25. 14
      src/web/UBWebController.h

@ -7,6 +7,15 @@
html, body, #content { height:100%; }
body { margin:0; padding:0; overflow:hidden; }
</style>
<script type="text/javascript">
window.onload = function(){
if (window.widget) {
window.widget.onremove = function(){
document.getElementById("content").innerHTML = "";
}
}
}
</script>
</head>
<body>
<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 <QString>
#include <QStack>
#include <QDomDocument>
#include <QHash>
class UBDocumentProxy;
class UBGraphicsScene;
class QSvgGenerator;
class UBGraphicsSvgItem;
class UBGraphicsPixmapItem;
class UBGraphicsItemDelegate;
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
{
@ -49,10 +65,11 @@ private:
};
public:
UBCFFSubsetReader(UBDocumentProxy *proxy, QByteArray &content);
UBCFFSubsetReader(UBDocumentProxy *proxy, QFile *content);
QXmlStreamReader mReader;
UBDocumentProxy *mProxy;
QString pwdContent;
bool parse();
@ -65,6 +82,41 @@ private:
QPointF mViewBoxCenter;
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
int PopState();
void PushState(int state);
@ -92,12 +144,16 @@ private:
bool createNewScene();
bool persistCurrentScene();
QStack<int> stateStack;
int currentState;
//helper methods
bool getCurElementTransorm(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);
QTransform transformFromString(const QString trString);
bool getViewBoxDimenstions(const QString& viewBox);

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

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

@ -80,7 +80,6 @@ UBBoardPaletteManager::UBBoardPaletteManager(QWidget* container, UBBoardControll
, mpPageNavigWidget(NULL)
, mpLibWidget(NULL)
, mpCachePropWidget(NULL)
// , mDesktopRightPalette(NULL)
, mpTeacherBarWidget(NULL)
, mpDesktopLibWidget(NULL)
{
@ -225,15 +224,38 @@ void UBBoardPaletteManager::setupDockPaletteWidgets()
void UBBoardPaletteManager::slot_changeMainMode(UBApplicationController::MainMode mainMode)
{
// Board = 0, Internet, Document, Tutorial, ParaschoolEditor, WebDocument
switch( mainMode )
{
case UBApplicationController::Board:
// call changeMode only when switch NOT from desktop mode
if(!UBApplication::applicationController->isShowingDesktop())
changeMode(eUBDockPaletteWidget_BOARD);
case UBApplicationController::Board:
{
// call changeMode only when switch NOT from desktop mode
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;
default:
{
if (UBPlatformUtils::hasVirtualKeyboard() && mKeyboardPalette != NULL)
mKeyboardPalette->hide();
}
break;
}
}
@ -260,25 +282,25 @@ void UBBoardPaletteManager::slot_changeDesktopMode(bool isDesktop)
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())
{
mKeyboardPalette = UBKeyboardPalette::create(0);
mKeyboardPalette = new UBKeyboardPalette(0);
#ifndef Q_WS_WIN
connect(mKeyboardPalette, SIGNAL(closed()), mKeyboardPalette, SLOT(onDeactivated()));
#endif
#ifndef Q_WS_MAC
mKeyboardPalette->setParent(mContainer);
// mKeyboardPalette->setParent(mContainer);
#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);
QList<QAction*> backgroundsActions;
@ -488,7 +510,7 @@ void UBBoardPaletteManager::connectPalettes()
}
bool isFirstResized = true;
void UBBoardPaletteManager::containerResized()
{
int innerMargin = UBSettings::boardMargin;
@ -498,25 +520,39 @@ void UBBoardPaletteManager::containerResized()
int userTop = innerMargin;
int userHeight = mContainer->height() - (2 * innerMargin);
mStylusPalette->move(userLeft, userTop);
mStylusPalette->adjustSizeAndPosition();
mStylusPalette->initPosition();
if(mStylusPalette)
{
mStylusPalette->move(userLeft, userTop);
mStylusPalette->adjustSizeAndPosition();
mStylusPalette->initPosition();
}
mZoomPalette->move(userLeft + userWidth - mZoomPalette->width()
, userTop + userHeight /*- mPageNumberPalette->height()*/ - innerMargin - mZoomPalette->height());
mZoomPalette->adjustSizeAndPosition();
if(mZoomPalette)
{
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,
userTop + userHeight - mKeyboardPalette->height());
mKeyboardPalette->adjustSizeAndPosition();
isFirstResized = false;
mKeyboardPalette->move(userLeft + (userWidth - mKeyboardPalette->width())/2,
userTop + (userHeight - mKeyboardPalette->height())/2);
mKeyboardPalette->adjustSizeAndPosition();
}
mLeftPalette->resize(mLeftPalette->width()-1, mContainer->height());
mRightPalette->resize(mRightPalette->width()-1, mContainer->height());
mLeftPalette->resize(mLeftPalette->width(), mContainer->height());
mRightPalette->resize(mRightPalette->width(), mContainer->height());
if(mLeftPalette)
{
mLeftPalette->resize(mLeftPalette->width()-1, 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());
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);
mRightPalette->setVisible(true);
@ -701,6 +749,22 @@ void UBBoardPaletteManager::changeMode(eUBDockPaletteWidgetMode newMode, bool is
{
mLeftPalette->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);
mRightPalette->setVisible(true);
@ -710,12 +774,46 @@ void UBBoardPaletteManager::changeMode(eUBDockPaletteWidgetMode newMode, bool is
}
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:
{
mLeftPalette->setVisible(false);
mRightPalette->setVisible(false);
mLeftPalette->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;
}

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

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

@ -52,7 +52,7 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent)
, mTransparentDrawingView(0)
, mTransparentDrawingScene(0)
, mDesktopPalette(NULL)
, mKeyboardPalette(0)
// , mKeyboardPalette(0)
, mDesktopPenPalette(NULL)
, mDesktopMarkerPalette(NULL)
, mDesktopEraserPalette(NULL)
@ -64,7 +64,7 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent)
, mPendingMarkerButtonPressed(false)
, mPendingEraserButtonPressed(false)
, mbArrowClicked(false)
, mBoardStylusTool(UBStylusTool::Pen)
, mBoardStylusTool(UBStylusTool::Selector /*UBStylusTool::Pen*/)
, mDesktopStylusTool(UBStylusTool::Selector)
{
@ -97,16 +97,21 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent)
if (UBPlatformUtils::hasVirtualKeyboard())
{
#ifdef Q_WS_X11
mKeyboardPalette = UBKeyboardPalette::create(0);
connect(mTransparentDrawingView, SIGNAL(hidden()), mKeyboardPalette, SLOT(hide()));
connect(mTransparentDrawingView, SIGNAL(shown()), this, SLOT(showKeyboard()));
// mKeyboardPalette = UBKeyboardPalette::create(0);
// connect(mTransparentDrawingView, SIGNAL(hidden()), mKeyboardPalette, SLOT(hide()));
// connect(mTransparentDrawingView, SIGNAL(shown()), this, SLOT(showKeyboard()));
#else
mKeyboardPalette = UBKeyboardPalette::create(mTransparentDrawingView);
mKeyboardPalette->setParent(mTransparentDrawingView);
// mKeyboardPalette = UBKeyboardPalette::create(mTransparentDrawingView);
// mKeyboardPalette->setParent(mTransparentDrawingView);
#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
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()));
#endif
}
@ -117,7 +122,7 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent)
connect(mDesktopPalette, SIGNAL(screenClick()), this, SLOT(screenCapture()));
connect(mDesktopPalette, SIGNAL(maximized()), this, SLOT(onDesktopPaletteMaximized()));
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()));
@ -164,31 +169,32 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent)
onDesktopPaletteMaximized();
}
void UBDesktopAnnotationController::showKeyboard(bool show)
{
#ifdef Q_WS_X11
if (!mTransparentDrawingView->isVisible())
return;
#endif
if(mKeyboardPalette)
{
if(show)
UBDrawingController::drawingController()->setStylusTool(UBStylusTool::Selector);
mKeyboardPalette->setVisible(show);
#ifdef Q_WS_X11
updateMask(true);
#endif
}
}
void UBDesktopAnnotationController::showKeyboard()
{
if (UBApplication::mainWindow->actionVirtualKeyboard->isChecked())
mKeyboardPalette->show();
}
// void UBDesktopAnnotationController::showKeyboard(bool show)
// {
// #ifdef Q_WS_X11
// if (!mTransparentDrawingView->isVisible())
// return;
// #endif
//
// if(mKeyboardPalette)
// {
// if(show)
// UBDrawingController::drawingController()->setStylusTool(UBStylusTool::Selector);
// mKeyboardPalette->setVisible(show);
//
// #ifdef Q_WS_X11
// updateMask(true);
// #endif
//
// }
//
// }
// void UBDesktopAnnotationController::showKeyboard()
// {
// if (UBApplication::mainWindow->actionVirtualKeyboard->isChecked())
// mKeyboardPalette->show();
// }
UBDesktopAnnotationController::~UBDesktopAnnotationController()
{
@ -366,12 +372,12 @@ void UBDesktopAnnotationController::close()
void UBDesktopAnnotationController::stylusToolChanged(int tool)
{
UBStylusTool::Enum eTool = (UBStylusTool::Enum)tool;
if(eTool != UBStylusTool::Selector && eTool != UBStylusTool::Text)
{
if(mKeyboardPalette->m_isVisible)
UBApplication::mainWindow->actionVirtualKeyboard->activate(QAction::Trigger);
}
// UBStylusTool::Enum eTool = (UBStylusTool::Enum)tool;
// if(eTool != UBStylusTool::Selector && eTool != UBStylusTool::Text)
// {
// if(mKeyboardPalette->m_isVisible)
// UBApplication::mainWindow->actionVirtualKeyboard->activate(QAction::Trigger);
// }
updateBackground();
}
@ -910,9 +916,10 @@ void UBDesktopAnnotationController::updateMask(bool bTransparent)
{
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

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

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

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

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

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

@ -27,6 +27,9 @@
UBKeyboardPalette::UBKeyboardPalette(QWidget *parent)
: UBActionPalette(Qt::TopRightCorner, parent)
{
// setWindowFlags(/*Qt::CustomizeWindowHint|*/Qt::WindowStaysOnTopHint|Qt::FramelessWindowHint);
setCustomCloseProcessing(true);
setCustomPosition(true);
setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
@ -56,57 +59,25 @@ UBKeyboardPalette::UBKeyboardPalette(QWidget *parent)
setContentsMargins( 22, 22, 22, 22 );
connect(this, SIGNAL(keyboardActivated(bool)), this, SLOT(onActivated(bool)));
init();
}
QList<UBKeyboardPalette*> UBKeyboardPalette::instances;
UBKeyboardPalette* UBKeyboardPalette::create(QWidget *parent)
//QList<UBKeyboardPalette*> UBKeyboardPalette::instances;
void UBKeyboardPalette::init()
{
//------------------------------//
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);
//------------------------------//
m_isVisible = false;
setVisible(false);
UBKeyboardPalette* instance = new UBKeyboardPalette(parent);
instance->setKeyButtonSize(UBSettings::settings()->boardKeyboardPaletteKeyBtnSize->get().toString());
setKeyButtonSize(UBSettings::settings()->boardKeyboardPaletteKeyBtnSize->get().toString());
instance->m_isVisible = firstKeyboard ? firstKeyboard->m_isVisible : false;
instance->setVisible(instance->m_isVisible);
if( firstKeyboard )
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, )
}
connect(this, SIGNAL(keyboardActivated(bool)), this, SLOT(onActivated(bool)));
connect(UBSettings::settings()->boardKeyboardPaletteKeyBtnSize, SIGNAL(changed(QVariant)), this, SLOT(keyboardPaletteButtonSizeChanged(QVariant)));
connect(UBApplication::mainWindow->actionVirtualKeyboard, SIGNAL(triggered(bool)), this, SLOT(showKeyboard(bool)));
connect(this, SIGNAL(closed()), this, SLOT(hideKeyboard()));
//------------------------------//
return instance;
UBPlatformUtils::setWindowNonActivableFlag(this, true);
}
void UBKeyboardPalette::showKeyboard(bool show)

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

@ -73,49 +73,49 @@ void UBTrapFlashController::showTrapFlash()
, viewHeight);
connect(mTrapFlashUi->flashCombobox, SIGNAL(currentIndexChanged(int)), this, SLOT(selectFlash(int)));
connect(mTrapFlashUi->widgetNameLineEdit, SIGNAL(textChanged(const QString &)), this, SLOT(text_Changed(const QString &)));
connect(mTrapFlashUi->widgetNameLineEdit, SIGNAL(textEdited(const QString &)), this, SLOT(text_Edited(const QString &)));
connect(mTrapFlashUi->widgetNameLineEdit, SIGNAL(textChanged(const QString &)), this, SLOT(text_Changed(const QString &)));
connect(mTrapFlashUi->widgetNameLineEdit, SIGNAL(textEdited(const QString &)), this, SLOT(text_Edited(const QString &)));
connect(mTrapFlashUi->createWidgetButton, SIGNAL(clicked(bool)), this, SLOT(createWidget()));
}
mTrapFlashDialog->show();
}
void UBTrapFlashController::text_Changed(const QString &newText)
{
QString new_text = newText;
#ifdef Q_WS_WIN // Defined on Windows.
QString illegalCharList(" < > : \" / \\ | ? * ");
QRegExp regExp("[<>:\"/\\\\|?*]");
#endif
#ifdef Q_WS_QWS // Defined on Qt for Embedded Linux.
QString illegalCharList(" < > : \" / \\ | ? * ");
QRegExp regExp("[<>:\"/\\\\|?*]");
#endif
#ifdef Q_WS_MAC // Defined on Mac OS X.
QString illegalCharList(" < > : \" / \\ | ? * ");
QRegExp regExp("[<>:\"/\\\\|?*]");
#endif
#ifdef Q_WS_X11 // Defined on X11.
QString illegalCharList(" < > : \" / \\ | ? * ");
QRegExp regExp("[<>:\"/\\\\|?*]");
#endif
if(new_text.indexOf(regExp) > -1)
{
new_text.remove(regExp);
mTrapFlashUi->widgetNameLineEdit->setText(new_text);
QToolTip::showText(mTrapFlashUi->widgetNameLineEdit->mapToGlobal(QPoint()), "Application name can`t contain any of the following characters:\r\n"+illegalCharList);
}
void UBTrapFlashController::text_Changed(const QString &newText)
{
QString new_text = newText;
#ifdef Q_WS_WIN // Defined on Windows.
QString illegalCharList(" < > : \" / \\ | ? * ");
QRegExp regExp("[<>:\"/\\\\|?*]");
#endif
#ifdef Q_WS_QWS // Defined on Qt for Embedded Linux.
QString illegalCharList(" < > : \" / \\ | ? * ");
QRegExp regExp("[<>:\"/\\\\|?*]");
#endif
#ifdef Q_WS_MAC // Defined on Mac OS X.
QString illegalCharList(" < > : \" / \\ | ? * ");
QRegExp regExp("[<>:\"/\\\\|?*]");
#endif
#ifdef Q_WS_X11 // Defined on X11.
QString illegalCharList(" < > : \" / \\ | ? * ");
QRegExp regExp("[<>:\"/\\\\|?*]");
#endif
if(new_text.indexOf(regExp) > -1)
{
new_text.remove(regExp);
mTrapFlashUi->widgetNameLineEdit->setText(new_text);
QToolTip::showText(mTrapFlashUi->widgetNameLineEdit->mapToGlobal(QPoint()), "Application name can`t contain any of the following characters:\r\n"+illegalCharList);
}
}
void UBTrapFlashController::text_Edited(const QString &newText)
{
void UBTrapFlashController::text_Edited(const QString &newText)
{
}
void UBTrapFlashController::hideTrapFlash()

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

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

Loading…
Cancel
Save