Commit 3ad8a106 authored by shibakaneki's avatar shibakaneki

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

parents 8c43e67f 2480a33b
...@@ -126,7 +126,7 @@ macx { ...@@ -126,7 +126,7 @@ macx {
Foundation \ Foundation \
-lcrypto -lcrypto
CONFIG(release, debug|release):CONFIG += x86 CONFIG(release, debug|release):CONFIG += x86 ppc
# [03-02-2011] We must use the 32bit version for the moment # [03-02-2011] We must use the 32bit version for the moment
# because the Quicktime components used by this application # because the Quicktime components used by this application
......
...@@ -19,7 +19,7 @@ make clean ...@@ -19,7 +19,7 @@ make clean
rm -rf build/linux/release/ rm -rf build/linux/release/
rm -rf install rm -rf install
QT_PATH="/usr/local/Trolltech/Qt-4.7.0" QT_PATH="/usr/local/Trolltech/Qt-4.7.3"
PLUGINS_PATH="$QT_PATH/plugins" PLUGINS_PATH="$QT_PATH/plugins"
QMAKE_PATH="$QT_PATH/bin/qmake" QMAKE_PATH="$QT_PATH/bin/qmake"
......
<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns="http://www.w3.org/ns/widgets"
xmlns:ub="http://uniboard.mnemis.com/widgets"
id="http://uniboard.mnemis.com/widgets/webbrowser"
version="1.1"
width="700"
height="400"
ub:resizable="false">
<name>Choisir</name>
<author href="http://www.getuniboard.com"
email="info@mnemis.com">Mnemis SA</author>
<description>Choisir widget</description>
<content src="index.html"/>
</widget>
This diff is collapsed.
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="css/basic.css"/>
<script type="text/javascript" src="scripts/jquery-1.6.2.min.js"></script>
<script src="scripts/jquery.disable.text.select.js" type="text/javascript"></script>
<script type="text/javascript" src="scripts/blackYellow.js"></script>
<script type="text/javascript">
$(document).ready(function(){
init();
});
</script>
</head>
<body>
</body>
</html>
/**
* .disableTextSelect - Disable Text Select Plugin
*
* Version: 1.1
* Updated: 2007-11-28
*
* Used to stop users from selecting text
*
* Copyright (c) 2007 James Dempster (letssurf@gmail.com, http://www.jdempster.com/category/jquery/disabletextselect/)
*
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
**/
/**
* Requirements:
* - jQuery (John Resig, http://www.jquery.com/)
**/
(function($) {
if ($.browser.mozilla) {
$.fn.disableTextSelect = function() {
return this.each(function() {
$(this).css({
'MozUserSelect' : 'none'
});
});
};
$.fn.enableTextSelect = function() {
return this.each(function() {
$(this).css({
'MozUserSelect' : ''
});
});
};
} else if ($.browser.msie) {
$.fn.disableTextSelect = function() {
return this.each(function() {
$(this).bind('selectstart.disableTextSelect', function() {
return false;
});
});
};
$.fn.enableTextSelect = function() {
return this.each(function() {
$(this).unbind('selectstart.disableTextSelect');
});
};
} else {
$.fn.disableTextSelect = function() {
return this.each(function() {
$(this).bind('mousedown.disableTextSelect', function() {
return false;
});
});
};
$.fn.enableTextSelect = function() {
return this.each(function() {
$(this).unbind('mousedown.disableTextSelect');
});
};
}
})(jQuery);
\ No newline at end of file
...@@ -166,6 +166,15 @@ ...@@ -166,6 +166,15 @@
return(parseInt(cssvalue.replace("px", ""))); return(parseInt(cssvalue.replace("px", "")));
}; };
if (window.widget) {
window.widget.onremove = function(){
//$("#show-inputfield-button").trigger("click");
$("#embeded-content")
.empty();
//.oembed($("#textbox").val());
}
}
initialize(); initialize();
}); });
</script> </script>
......
...@@ -56,6 +56,7 @@ UBDocumentPublisher::UBDocumentPublisher(UBDocumentProxy* pDocument, QObject *pa ...@@ -56,6 +56,7 @@ UBDocumentPublisher::UBDocumentPublisher(UBDocumentProxy* pDocument, QObject *pa
, bLoginCookieSet(false) , bLoginCookieSet(false)
{ {
//NOOP //NOOP
init();
} }
...@@ -555,8 +556,8 @@ void UBDocumentPublisher::init() ...@@ -555,8 +556,8 @@ void UBDocumentPublisher::init()
mDocInfos.title = ""; mDocInfos.title = "";
mDocInfos.description = ""; mDocInfos.description = "";
mpNetworkMgr = new QNetworkAccessManager(this);
mpCookieJar = new QNetworkCookieJar(); mpCookieJar = new QNetworkCookieJar();
mpNetworkMgr = new QNetworkAccessManager(this);
connect(mpNetworkMgr, SIGNAL(finished(QNetworkReply*)), this, SLOT(onFinished(QNetworkReply*))); connect(mpNetworkMgr, SIGNAL(finished(QNetworkReply*)), this, SLOT(onFinished(QNetworkReply*)));
} }
......
...@@ -532,10 +532,10 @@ UBBoardView::mouseMoveEvent (QMouseEvent *event) ...@@ -532,10 +532,10 @@ UBBoardView::mouseMoveEvent (QMouseEvent *event)
void void
UBBoardView::mouseReleaseEvent (QMouseEvent *event) UBBoardView::mouseReleaseEvent (QMouseEvent *event)
{ {
UBStylusTool::Enum currentTool = (UBStylusTool::Enum)UBDrawingController::drawingController ()->stylusTool (); UBStylusTool::Enum currentTool = (UBStylusTool::Enum)UBDrawingController::drawingController ()->stylusTool ();
scene ()->setToolCursor (currentTool); scene ()->setToolCursor (currentTool);
setToolCursor (currentTool); setToolCursor (currentTool);
// first propagate device release to the scene // first propagate device release to the scene
if (scene ()) if (scene ())
......
...@@ -315,7 +315,6 @@ void UBDrawingController::penToolSelected(bool checked) ...@@ -315,7 +315,6 @@ void UBDrawingController::penToolSelected(bool checked)
} }
} }
void UBDrawingController::eraserToolSelected(bool checked) void UBDrawingController::eraserToolSelected(bool checked)
{ {
if (checked) if (checked)
......
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
#include "UBDesktopEraserPalette.h" #include "UBDesktopEraserPalette.h"
#include "gui/UBKeyboardPalette.h" #include "gui/UBKeyboardPalette.h"
#include "gui/UBResources.h"
#include "core/memcheck.h" #include "core/memcheck.h"
...@@ -585,24 +586,26 @@ void UBDesktopAnnotationController::penActionReleased() ...@@ -585,24 +586,26 @@ void UBDesktopAnnotationController::penActionReleased()
mPendingPenButtonPressed = false; mPendingPenButtonPressed = false;
} }
UBApplication::mainWindow->actionPen->setChecked(true); UBApplication::mainWindow->actionPen->setChecked(true);
switchCursor(UBStylusTool::Pen);
} }
/** /**
* \brief Handles the marker action pressed event * \brief Handles the eraser action pressed event
*/ */
void UBDesktopAnnotationController::markerActionPressed() void UBDesktopAnnotationController::eraserActionPressed()
{ {
mbArrowClicked = false; mbArrowClicked = false;
mDesktopPenPalette->hide(); mDesktopPenPalette->hide();
mDesktopEraserPalette->hide(); mDesktopMarkerPalette->hide();
UBDrawingController::drawingController()->setStylusTool(UBStylusTool::Marker); UBDrawingController::drawingController()->setStylusTool(UBStylusTool::Eraser);
mMarkerHoldTimer = QTime::currentTime(); mEraserHoldTimer = QTime::currentTime();
mPendingMarkerButtonPressed = true; mPendingEraserButtonPressed = true;
// Check if the mouse cursor is on the little arrow // Check if the mouse cursor is on the little arrow
QPoint cursorPos = QCursor::pos(); QPoint cursorPos = QCursor::pos();
QPoint palettePos = mDesktopPalette->pos(); QPoint palettePos = mDesktopPalette->pos();
QPoint buttonPos = mDesktopPalette->buttonPos(UBApplication::mainWindow->actionMarker); QPoint buttonPos = mDesktopPalette->buttonPos(UBApplication::mainWindow->actionEraser);
int iX = cursorPos.x() - (palettePos.x() + buttonPos.x()); // x position of the cursor in the palette int iX = cursorPos.x() - (palettePos.x() + buttonPos.x()); // x position of the cursor in the palette
int iY = cursorPos.y() - (palettePos.y() + buttonPos.y()); // y position of the cursor in the palette int iY = cursorPos.y() - (palettePos.y() + buttonPos.y()); // y position of the cursor in the palette
...@@ -610,52 +613,55 @@ void UBDesktopAnnotationController::markerActionPressed() ...@@ -610,52 +613,55 @@ void UBDesktopAnnotationController::markerActionPressed()
if(iX >= 37 && iX <= 44 && iY >= 37 && iY <= 44) if(iX >= 37 && iX <= 44 && iY >= 37 && iY <= 44)
{ {
mbArrowClicked = true; mbArrowClicked = true;
markerActionReleased(); eraserActionReleased();
} }
else else
{ {
mHoldTimerMarker.start(PROPERTY_PALETTE_TIMER); mHoldTimerEraser.start(PROPERTY_PALETTE_TIMER);
} }
} }
/** /**
* \brief Handles the marker action released event * \brief Handles the eraser action released event
*/ */
void UBDesktopAnnotationController::markerActionReleased() void UBDesktopAnnotationController::eraserActionReleased()
{ {
qDebug() << "markerActionReleased()"; qDebug() << "eraserActionReleased()";
mHoldTimerMarker.stop(); mHoldTimerEraser.stop();
if(mPendingMarkerButtonPressed) if(mPendingEraserButtonPressed)
{ {
if(mbArrowClicked || mMarkerHoldTimer.msecsTo(QTime::currentTime()) > PROPERTY_PALETTE_TIMER - 100) if(mbArrowClicked || mEraserHoldTimer.msecsTo(QTime::currentTime()) > PROPERTY_PALETTE_TIMER - 100)
{ {
togglePropertyPalette(mDesktopMarkerPalette); togglePropertyPalette(mDesktopEraserPalette);
} }
else else
{ {
UBApplication::mainWindow->actionMarker->trigger(); UBApplication::mainWindow->actionEraser->trigger();
} }
mPendingMarkerButtonPressed = false; mPendingEraserButtonPressed = false;
} }
UBApplication::mainWindow->actionMarker->setChecked(true); UBApplication::mainWindow->actionEraser->setChecked(true);
switchCursor(UBStylusTool::Eraser);
} }
/** /**
* \brief Handles the eraser action pressed event * \brief Handles the marker action pressed event
*/ */
void UBDesktopAnnotationController::eraserActionPressed() void UBDesktopAnnotationController::markerActionPressed()
{ {
mbArrowClicked = false; mbArrowClicked = false;
mDesktopPenPalette->hide(); mDesktopPenPalette->hide();
mDesktopMarkerPalette->hide(); mDesktopEraserPalette->hide();
UBDrawingController::drawingController()->setStylusTool(UBStylusTool::Eraser); UBDrawingController::drawingController()->setStylusTool(UBStylusTool::Marker);
mEraserHoldTimer = QTime::currentTime(); mMarkerHoldTimer = QTime::currentTime();
mPendingEraserButtonPressed = true; mPendingMarkerButtonPressed = true;
// Check if the mouse cursor is on the little arrow // Check if the mouse cursor is on the little arrow
QPoint cursorPos = QCursor::pos(); QPoint cursorPos = QCursor::pos();
QPoint palettePos = mDesktopPalette->pos(); QPoint palettePos = mDesktopPalette->pos();
QPoint buttonPos = mDesktopPalette->buttonPos(UBApplication::mainWindow->actionEraser); QPoint buttonPos = mDesktopPalette->buttonPos(UBApplication::mainWindow->actionMarker);
int iX = cursorPos.x() - (palettePos.x() + buttonPos.x()); // x position of the cursor in the palette int iX = cursorPos.x() - (palettePos.x() + buttonPos.x()); // x position of the cursor in the palette
int iY = cursorPos.y() - (palettePos.y() + buttonPos.y()); // y position of the cursor in the palette int iY = cursorPos.y() - (palettePos.y() + buttonPos.y()); // y position of the cursor in the palette
...@@ -663,38 +669,63 @@ void UBDesktopAnnotationController::eraserActionPressed() ...@@ -663,38 +669,63 @@ void UBDesktopAnnotationController::eraserActionPressed()
if(iX >= 37 && iX <= 44 && iY >= 37 && iY <= 44) if(iX >= 37 && iX <= 44 && iY >= 37 && iY <= 44)
{ {
mbArrowClicked = true; mbArrowClicked = true;
eraserActionReleased(); markerActionReleased();
} }
else else
{ {
mHoldTimerEraser.start(PROPERTY_PALETTE_TIMER); mHoldTimerMarker.start(PROPERTY_PALETTE_TIMER);
} }
} }
/** /**
* \brief Handles the eraser action released event * \brief Handles the marker action released event
*/ */
void UBDesktopAnnotationController::eraserActionReleased() void UBDesktopAnnotationController::markerActionReleased()
{ {
qDebug() << "eraserActionReleased()"; qDebug() << "markerActionReleased()";
mHoldTimerEraser.stop(); mHoldTimerMarker.stop();
if(mPendingEraserButtonPressed) if(mPendingMarkerButtonPressed)
{ {
if(mbArrowClicked || mEraserHoldTimer.msecsTo(QTime::currentTime()) > PROPERTY_PALETTE_TIMER - 100) if(mbArrowClicked || mMarkerHoldTimer.msecsTo(QTime::currentTime()) > PROPERTY_PALETTE_TIMER - 100)
{ {
togglePropertyPalette(mDesktopEraserPalette); togglePropertyPalette(mDesktopMarkerPalette);
} }
else else
{ {
UBApplication::mainWindow->actionEraser->trigger(); UBApplication::mainWindow->actionMarker->trigger();
} }
mPendingEraserButtonPressed = false; mPendingMarkerButtonPressed = false;
} }
UBApplication::mainWindow->actionEraser->setChecked(true); UBApplication::mainWindow->actionMarker->setChecked(true);
switchCursor(UBStylusTool::Marker);
}
void UBDesktopAnnotationController::selectorActionPressed()
{
}
void UBDesktopAnnotationController::selectorActionReleased()
{
switchCursor(UBStylusTool::Selector);
}
void UBDesktopAnnotationController::pointerActionPressed()
{
}
void UBDesktopAnnotationController::pointerActionReleased()
{
switchCursor(UBStylusTool::Pointer);
} }
/** /**
* \brief Toggle the given palette visiblity * \brief Toggle the given palette visibility
* @param palette as the given palette * @param palette as the given palette
*/ */
void UBDesktopAnnotationController::togglePropertyPalette(UBActionPalette *palette) void UBDesktopAnnotationController::togglePropertyPalette(UBActionPalette *palette)
...@@ -717,11 +748,34 @@ void UBDesktopAnnotationController::togglePropertyPalette(UBActionPalette *palet ...@@ -717,11 +748,34 @@ void UBDesktopAnnotationController::togglePropertyPalette(UBActionPalette *palet
} }
} }
void UBDesktopAnnotationController::switchCursor(const int tool)
{
// enum Enum
// {
// Pen = 0,
// Eraser,
// Marker,
// Selector,
// Hand,
// ZoomIn,
// ZoomOut,
// Pointer,
// Line,
// Text,
// Capture
// };
mTransparentDrawingScene->setToolCursor(tool);
mTransparentDrawingView->setToolCursor(tool);
}
/** /**
* \brief Reconnect the pressed & released signals of the property palettes * \brief Reconnect the pressed & released signals of the property palettes
*/ */
void UBDesktopAnnotationController::onDesktopPaletteMaximized() void UBDesktopAnnotationController::onDesktopPaletteMaximized()
{ {
// Pen // Pen
UBActionPaletteButton* pPenButton = mDesktopPalette->getButtonFromAction(UBApplication::mainWindow->actionPen); UBActionPaletteButton* pPenButton = mDesktopPalette->getButtonFromAction(UBApplication::mainWindow->actionPen);
if(NULL != pPenButton) if(NULL != pPenButton)
...@@ -730,6 +784,14 @@ void UBDesktopAnnotationController::onDesktopPaletteMaximized() ...@@ -730,6 +784,14 @@ void UBDesktopAnnotationController::onDesktopPaletteMaximized()
connect(pPenButton, SIGNAL(released()), this, SLOT(penActionReleased())); connect(pPenButton, SIGNAL(released()), this, SLOT(penActionReleased()));
} }
// Eraser
UBActionPaletteButton* pEraserButton = mDesktopPalette->getButtonFromAction(UBApplication::mainWindow->actionEraser);
if(NULL != pEraserButton)
{
connect(pEraserButton, SIGNAL(pressed()), this, SLOT(eraserActionPressed()));
connect(pEraserButton, SIGNAL(released()), this, SLOT(eraserActionReleased()));
}
// Marker // Marker
UBActionPaletteButton* pMarkerButton = mDesktopPalette->getButtonFromAction(UBApplication::mainWindow->actionMarker); UBActionPaletteButton* pMarkerButton = mDesktopPalette->getButtonFromAction(UBApplication::mainWindow->actionMarker);
if(NULL != pMarkerButton) if(NULL != pMarkerButton)
...@@ -738,13 +800,32 @@ void UBDesktopAnnotationController::onDesktopPaletteMaximized() ...@@ -738,13 +800,32 @@ void UBDesktopAnnotationController::onDesktopPaletteMaximized()
connect(pMarkerButton, SIGNAL(released()), this, SLOT(markerActionReleased())); connect(pMarkerButton, SIGNAL(released()), this, SLOT(markerActionReleased()));
} }
// Eraser // Pointer
UBActionPaletteButton* pEraserButton = mDesktopPalette->getButtonFromAction(UBApplication::mainWindow->actionEraser); UBActionPaletteButton* pSelectorButton = mDesktopPalette->getButtonFromAction(UBApplication::mainWindow->actionSelector);
if(NULL != pEraserButton) if(NULL != pSelectorButton)
{ {
connect(pEraserButton, SIGNAL(pressed()), this, SLOT(eraserActionPressed())); connect(pSelectorButton, SIGNAL(pressed()), this, SLOT(selectorActionPressed()));
connect(pEraserButton, SIGNAL(released()), this, SLOT(eraserActionReleased())); connect(pSelectorButton, SIGNAL(released()), this, SLOT(selectorActionReleased()));
} }
// Pointer
UBActionPaletteButton* pPointerButton = mDesktopPalette->getButtonFromAction(UBApplication::mainWindow->actionPointer);
if(NULL != pPointerButton)
{
connect(pPointerButton, SIGNAL(pressed()), this, SLOT(pointerActionPressed()));
connect(pPointerButton, SIGNAL(released()), this, SLOT(pointerActionReleased()));
}
// enum Enum
// {
// Hand,
// ZoomIn,
// ZoomOut,
// Line,
// Text,
// Capture
// };
} }
/** /**
......
...@@ -98,6 +98,12 @@ class UBDesktopAnnotationController : public QObject ...@@ -98,6 +98,12 @@ class UBDesktopAnnotationController : public QObject
void penActionReleased(); void penActionReleased();
void markerActionReleased(); void markerActionReleased();
void eraserActionReleased(); void eraserActionReleased();
void selectorActionPressed();
void selectorActionReleased();
void pointerActionPressed();
void pointerActionReleased();
void switchCursor(int tool);
void onDesktopPaletteMaximized(); void onDesktopPaletteMaximized();
void onDesktopPaletteMinimize(); void onDesktopPaletteMinimize();
void onTransparentWidgetResized(); void onTransparentWidgetResized();
......
...@@ -106,7 +106,6 @@ void UBGraphicsDelegateFrame::setAntiScale(qreal pAntiScale) ...@@ -106,7 +106,6 @@ void UBGraphicsDelegateFrame::setAntiScale(qreal pAntiScale)
mRightResizeGripSvgItem->setTransform(tr); mRightResizeGripSvgItem->setTransform(tr);
mTopResizeGripSvgItem->setTransform(tr); mTopResizeGripSvgItem->setTransform(tr);
mRotateButton->setTransform(tr); mRotateButton->setTransform(tr);
} }
...@@ -541,7 +540,6 @@ QGraphicsItem* UBGraphicsDelegateFrame::delegated() ...@@ -541,7 +540,6 @@ QGraphicsItem* UBGraphicsDelegateFrame::delegated()
return mDelegate->delegated(); return mDelegate->delegated();
} }
UBGraphicsDelegateFrame::FrameTool UBGraphicsDelegateFrame::toolFromPos(QPointF pos) UBGraphicsDelegateFrame::FrameTool UBGraphicsDelegateFrame::toolFromPos(QPointF pos)
{ {
if(mDelegate->isLocked()) if(mDelegate->isLocked())
......
...@@ -17,8 +17,6 @@ ...@@ -17,8 +17,6 @@
#define UBGRAPHICSDELEGATEFRAME_H_ #define UBGRAPHICSDELEGATEFRAME_H_
#include <QtGui> #include <QtGui>
#include "core/UB.h" #include "core/UB.h"
class QGraphicsSceneMouseEvent; class QGraphicsSceneMouseEvent;
......
...@@ -267,6 +267,7 @@ void UBGraphicsItemDelegate::positionHandles() ...@@ -267,6 +267,7 @@ void UBGraphicsItemDelegate::positionHandles()
void UBGraphicsItemDelegate::remove(bool canUndo) void UBGraphicsItemDelegate::remove(bool canUndo)
{ {
QGraphicsScene* scene = mDelegated->scene(); QGraphicsScene* scene = mDelegated->scene();
if (scene) if (scene)
{ {
foreach(DelegateButton* button, mButtons) foreach(DelegateButton* button, mButtons)
......
...@@ -41,7 +41,7 @@ class UBGraphicsProxyWidget: public QGraphicsProxyWidget, public UBItem, public ...@@ -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:
...@@ -52,8 +52,6 @@ class UBGraphicsProxyWidget: public QGraphicsProxyWidget, public UBItem, public ...@@ -52,8 +52,6 @@ class UBGraphicsProxyWidget: public QGraphicsProxyWidget, public UBItem, public
virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value); virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value);
UBGraphicsItemDelegate* mDelegate; UBGraphicsItemDelegate* mDelegate;
}; };
#endif /* UBGRAPHICSPROXYWIDGET_H_ */ #endif /* UBGRAPHICSPROXYWIDGET_H_ */
...@@ -453,7 +453,16 @@ void UBGraphicsScene::DisposeMagnifierQWidgets() ...@@ -453,7 +453,16 @@ void UBGraphicsScene::DisposeMagnifierQWidgets()
magniferDisplayViewWidget = NULL; magniferDisplayViewWidget = NULL;
} }
UBApplication::app()->restoreOverrideCursor(); // some time have crash here on access to app (when call from destructor when close sankore app)
// so i just add try/catch section here
try
{
UBApplication::app()->restoreOverrideCursor();
}
catch (...)
{
}
} }
void UBGraphicsScene::moveTo(const QPointF &pPoint) void UBGraphicsScene::moveTo(const QPointF &pPoint)
......
...@@ -246,7 +246,6 @@ void UBGraphicsWidgetItem::removeScript() ...@@ -246,7 +246,6 @@ void UBGraphicsWidgetItem::removeScript()
} }
} }
UBGraphicsAppleWidgetItem::UBGraphicsAppleWidgetItem(const QUrl& pWidgetUrl, QGraphicsItem *parent) UBGraphicsAppleWidgetItem::UBGraphicsAppleWidgetItem(const QUrl& pWidgetUrl, QGraphicsItem *parent)
: UBGraphicsWidgetItem(parent) : UBGraphicsWidgetItem(parent)
{ {
......
...@@ -31,6 +31,13 @@ UBMainWindow::UBMainWindow(QWidget *parent, Qt::WindowFlags flags) ...@@ -31,6 +31,13 @@ UBMainWindow::UBMainWindow(QWidget *parent, Qt::WindowFlags flags)
{ {
Ui::MainWindow::setupUi(this); Ui::MainWindow::setupUi(this);
//Setting tooltip colors staticly, since they look not quite well on different color themes
QPalette toolTipPalette;
toolTipPalette.setColor(QPalette::ToolTipBase, QColor("#FFFFDC"));
toolTipPalette.setColor(QPalette::ToolTipText, Qt::black);
QToolTip::setPalette(toolTipPalette);
QWidget* centralWidget = new QWidget(this); QWidget* centralWidget = new QWidget(this);
mStackedLayout = new QStackedLayout(centralWidget); mStackedLayout = new QStackedLayout(centralWidget);
setCentralWidget(centralWidget); setCentralWidget(centralWidget);
......
...@@ -73,12 +73,50 @@ void UBTrapFlashController::showTrapFlash() ...@@ -73,12 +73,50 @@ void UBTrapFlashController::showTrapFlash()
, viewHeight); , viewHeight);
connect(mTrapFlashUi->flashCombobox, SIGNAL(currentIndexChanged(int)), this, SLOT(selectFlash(int))); 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->createWidgetButton, SIGNAL(clicked(bool)), this, SLOT(createWidget())); connect(mTrapFlashUi->createWidgetButton, SIGNAL(clicked(bool)), this, SLOT(createWidget()));
} }
mTrapFlashDialog->show(); 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_Edited(const QString &newText)
{
}
void UBTrapFlashController::hideTrapFlash() void UBTrapFlashController::hideTrapFlash()
{ {
...@@ -281,15 +319,15 @@ QString UBTrapFlashController::generateFullPageHtml(const QString& pDirPath, boo ...@@ -281,15 +319,15 @@ QString UBTrapFlashController::generateFullPageHtml(const QString& pDirPath, boo
QString htmlContentString; QString htmlContentString;
htmlContentString += "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n"; htmlContentString += "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\r\n";
htmlContentString += "<html>\n"; htmlContentString += "<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n";
htmlContentString += "<head>\n"; htmlContentString += " <head>\r\n";
htmlContentString += " <meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\">\n"; htmlContentString += " <meta http-equiv=\"refresh\" content=\"0; " + mCurrentWebFrame->url().toString() + "\">\r\n";
htmlContentString += "</head>\n"; htmlContentString += " </head>\r\n";
htmlContentString += " <frameset cols=\"100%\">\n"; htmlContentString += " <body>\r\n";
htmlContentString += " <frame src=\"" + mCurrentWebFrame->url().toString() + "\"/>\n"; htmlContentString += " Redirect to target...\r\n";
htmlContentString += " </frameset>\n"; htmlContentString += " </body>\r\n";
htmlContentString += "</html>\n"; htmlContentString += "</html>\r\n";
if (!pGenerateFile) if (!pGenerateFile)
{ {
......
...@@ -37,6 +37,9 @@ class UBTrapFlashController : public QObject ...@@ -37,6 +37,9 @@ class UBTrapFlashController : public QObject
public slots: public slots:
void updateTrapFlashFromPage(QWebFrame* pCurrentWebFrame); void updateTrapFlashFromPage(QWebFrame* pCurrentWebFrame);
void text_Changed(const QString &);
void text_Edited(const QString &);
private slots: private slots:
void selectFlash(int pFlashIndex); void selectFlash(int pFlashIndex);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment