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 {
Foundation \
-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
# because the Quicktime components used by this application
......
......@@ -19,7 +19,7 @@ make clean
rm -rf build/linux/release/
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"
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 @@
return(parseInt(cssvalue.replace("px", "")));
};
if (window.widget) {
window.widget.onremove = function(){
//$("#show-inputfield-button").trigger("click");
$("#embeded-content")
.empty();
//.oembed($("#textbox").val());
}
}
initialize();
});
</script>
......
......@@ -56,6 +56,7 @@ UBDocumentPublisher::UBDocumentPublisher(UBDocumentProxy* pDocument, QObject *pa
, bLoginCookieSet(false)
{
//NOOP
init();
}
......@@ -555,8 +556,8 @@ void UBDocumentPublisher::init()
mDocInfos.title = "";
mDocInfos.description = "";
mpNetworkMgr = new QNetworkAccessManager(this);
mpCookieJar = new QNetworkCookieJar();
mpNetworkMgr = new QNetworkAccessManager(this);
connect(mpNetworkMgr, SIGNAL(finished(QNetworkReply*)), this, SLOT(onFinished(QNetworkReply*)));
}
......
......@@ -315,7 +315,6 @@ void UBDrawingController::penToolSelected(bool checked)
}
}
void UBDrawingController::eraserToolSelected(bool checked)
{
if (checked)
......
......@@ -43,6 +43,7 @@
#include "UBDesktopEraserPalette.h"
#include "gui/UBKeyboardPalette.h"
#include "gui/UBResources.h"
#include "core/memcheck.h"
......@@ -585,24 +586,26 @@ void UBDesktopAnnotationController::penActionReleased()
mPendingPenButtonPressed = false;
}
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;
mDesktopPenPalette->hide();
mDesktopEraserPalette->hide();
UBDrawingController::drawingController()->setStylusTool(UBStylusTool::Marker);
mMarkerHoldTimer = QTime::currentTime();
mPendingMarkerButtonPressed = true;
mDesktopMarkerPalette->hide();
UBDrawingController::drawingController()->setStylusTool(UBStylusTool::Eraser);
mEraserHoldTimer = QTime::currentTime();
mPendingEraserButtonPressed = true;
// Check if the mouse cursor is on the little arrow
QPoint cursorPos = QCursor::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 iY = cursorPos.y() - (palettePos.y() + buttonPos.y()); // y position of the cursor in the palette
......@@ -610,52 +613,55 @@ void UBDesktopAnnotationController::markerActionPressed()
if(iX >= 37 && iX <= 44 && iY >= 37 && iY <= 44)
{
mbArrowClicked = true;
markerActionReleased();
eraserActionReleased();
}
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()";
mHoldTimerMarker.stop();
if(mPendingMarkerButtonPressed)
qDebug() << "eraserActionReleased()";
mHoldTimerEraser.stop();
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
{
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;
mDesktopPenPalette->hide();
mDesktopMarkerPalette->hide();
UBDrawingController::drawingController()->setStylusTool(UBStylusTool::Eraser);
mEraserHoldTimer = QTime::currentTime();
mPendingEraserButtonPressed = true;
mDesktopEraserPalette->hide();
UBDrawingController::drawingController()->setStylusTool(UBStylusTool::Marker);
mMarkerHoldTimer = QTime::currentTime();
mPendingMarkerButtonPressed = true;
// Check if the mouse cursor is on the little arrow
QPoint cursorPos = QCursor::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 iY = cursorPos.y() - (palettePos.y() + buttonPos.y()); // y position of the cursor in the palette
......@@ -663,38 +669,63 @@ void UBDesktopAnnotationController::eraserActionPressed()
if(iX >= 37 && iX <= 44 && iY >= 37 && iY <= 44)
{
mbArrowClicked = true;
eraserActionReleased();
markerActionReleased();
}
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()";
mHoldTimerEraser.stop();
if(mPendingEraserButtonPressed)
qDebug() << "markerActionReleased()";
mHoldTimerMarker.stop();
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
{
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
*/
void UBDesktopAnnotationController::togglePropertyPalette(UBActionPalette *palette)
......@@ -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
*/
void UBDesktopAnnotationController::onDesktopPaletteMaximized()
{
// Pen
UBActionPaletteButton* pPenButton = mDesktopPalette->getButtonFromAction(UBApplication::mainWindow->actionPen);
if(NULL != pPenButton)
......@@ -730,6 +784,14 @@ void UBDesktopAnnotationController::onDesktopPaletteMaximized()
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
UBActionPaletteButton* pMarkerButton = mDesktopPalette->getButtonFromAction(UBApplication::mainWindow->actionMarker);
if(NULL != pMarkerButton)
......@@ -738,13 +800,32 @@ void UBDesktopAnnotationController::onDesktopPaletteMaximized()
connect(pMarkerButton, SIGNAL(released()), this, SLOT(markerActionReleased()));
}
// Eraser
UBActionPaletteButton* pEraserButton = mDesktopPalette->getButtonFromAction(UBApplication::mainWindow->actionEraser);
if(NULL != pEraserButton)
// Pointer
UBActionPaletteButton* pSelectorButton = mDesktopPalette->getButtonFromAction(UBApplication::mainWindow->actionSelector);
if(NULL != pSelectorButton)
{
connect(pEraserButton, SIGNAL(pressed()), this, SLOT(eraserActionPressed()));
connect(pEraserButton, SIGNAL(released()), this, SLOT(eraserActionReleased()));
connect(pSelectorButton, SIGNAL(pressed()), this, SLOT(selectorActionPressed()));
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
void penActionReleased();
void markerActionReleased();
void eraserActionReleased();
void selectorActionPressed();
void selectorActionReleased();
void pointerActionPressed();
void pointerActionReleased();
void switchCursor(int tool);
void onDesktopPaletteMaximized();
void onDesktopPaletteMinimize();
void onTransparentWidgetResized();
......
......@@ -106,7 +106,6 @@ void UBGraphicsDelegateFrame::setAntiScale(qreal pAntiScale)
mRightResizeGripSvgItem->setTransform(tr);
mTopResizeGripSvgItem->setTransform(tr);
mRotateButton->setTransform(tr);
}
......@@ -541,7 +540,6 @@ QGraphicsItem* UBGraphicsDelegateFrame::delegated()
return mDelegate->delegated();
}
UBGraphicsDelegateFrame::FrameTool UBGraphicsDelegateFrame::toolFromPos(QPointF pos)
{
if(mDelegate->isLocked())
......
......@@ -17,8 +17,6 @@
#define UBGRAPHICSDELEGATEFRAME_H_
#include <QtGui>
#include "core/UB.h"
class QGraphicsSceneMouseEvent;
......
......@@ -267,6 +267,7 @@ void UBGraphicsItemDelegate::positionHandles()
void UBGraphicsItemDelegate::remove(bool canUndo)
{
QGraphicsScene* scene = mDelegated->scene();
if (scene)
{
foreach(DelegateButton* button, mButtons)
......
......@@ -41,7 +41,7 @@ class UBGraphicsProxyWidget: public QGraphicsProxyWidget, public UBItem, public
virtual void remove();
UBGraphicsItemDelegate* delegate () { return mDelegate;};
UBGraphicsItemDelegate* delegate (){ return mDelegate;};
protected:
......@@ -52,8 +52,6 @@ class UBGraphicsProxyWidget: public QGraphicsProxyWidget, public UBItem, public
virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value);
UBGraphicsItemDelegate* mDelegate;
};
#endif /* UBGRAPHICSPROXYWIDGET_H_ */
......@@ -453,7 +453,16 @@ void UBGraphicsScene::DisposeMagnifierQWidgets()
magniferDisplayViewWidget = NULL;
}
// 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)
......
......@@ -246,7 +246,6 @@ void UBGraphicsWidgetItem::removeScript()
}
}
UBGraphicsAppleWidgetItem::UBGraphicsAppleWidgetItem(const QUrl& pWidgetUrl, QGraphicsItem *parent)
: UBGraphicsWidgetItem(parent)
{
......
......@@ -31,6 +31,13 @@ UBMainWindow::UBMainWindow(QWidget *parent, Qt::WindowFlags flags)
{
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);
mStackedLayout = new QStackedLayout(centralWidget);
setCentralWidget(centralWidget);
......
......@@ -73,12 +73,50 @@ 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->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_Edited(const QString &newText)
{
}
void UBTrapFlashController::hideTrapFlash()
{
......@@ -281,15 +319,15 @@ QString UBTrapFlashController::generateFullPageHtml(const QString& pDirPath, boo
QString htmlContentString;
htmlContentString += "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n";
htmlContentString += "<html>\n";
htmlContentString += "<head>\n";
htmlContentString += " <meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\">\n";
htmlContentString += "</head>\n";
htmlContentString += " <frameset cols=\"100%\">\n";
htmlContentString += " <frame src=\"" + mCurrentWebFrame->url().toString() + "\"/>\n";
htmlContentString += " </frameset>\n";
htmlContentString += "</html>\n";
htmlContentString += "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\r\n";
htmlContentString += "<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n";
htmlContentString += " <head>\r\n";
htmlContentString += " <meta http-equiv=\"refresh\" content=\"0; " + mCurrentWebFrame->url().toString() + "\">\r\n";
htmlContentString += " </head>\r\n";
htmlContentString += " <body>\r\n";
htmlContentString += " Redirect to target...\r\n";
htmlContentString += " </body>\r\n";
htmlContentString += "</html>\r\n";
if (!pGenerateFile)
{
......
......@@ -37,6 +37,9 @@ class UBTrapFlashController : public QObject
public slots:
void updateTrapFlashFromPage(QWebFrame* pCurrentWebFrame);
void text_Changed(const QString &);
void text_Edited(const QString &);
private slots:
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