Commit 5a8b650c authored by Anatoly Mihalchenko's avatar Anatoly Mihalchenko

Merge branch 'develop' into anatoly_dev

parents 1ce5763a 81c42f53
No preview for this file type
...@@ -11,7 +11,7 @@ CONFIG += debug_and_release \ ...@@ -11,7 +11,7 @@ CONFIG += debug_and_release \
VERSION_MAJ = 2 VERSION_MAJ = 2
VERSION_MIN = 00 VERSION_MIN = 00
VERSION_TYPE = b # a = alpha, b = beta, r = release, other => error VERSION_TYPE = b # a = alpha, b = beta, r = release, other => error
VERSION_PATCH = 05 VERSION_PATCH = 06
VERSION = "$${VERSION_MAJ}.$${VERSION_MIN}.$${VERSION_TYPE}.$${VERSION_PATCH}" VERSION = "$${VERSION_MAJ}.$${VERSION_MIN}.$${VERSION_TYPE}.$${VERSION_PATCH}"
VERSION = $$replace(VERSION, "\\.r", "") VERSION = $$replace(VERSION, "\\.r", "")
......
...@@ -218,7 +218,6 @@ ...@@ -218,7 +218,6 @@
return true; return true;
}); });
$("label[for*='checkAire']").text(sankoreLang[lang].draw); $("label[for*='checkAire']").text(sankoreLang[lang].draw);
$("label[for*='checkMaJ']").text(sankoreLang[lang].auto_update);
$("#menuOptions td").eq(0).html(sankoreLang[lang].widget); $("#menuOptions td").eq(0).html(sankoreLang[lang].widget);
$("#menuOptions h3").eq(0).text(sankoreLang[lang].widget_options); $("#menuOptions h3").eq(0).text(sankoreLang[lang].widget_options);
$("#menuOptions2D h3").eq(0).text(sankoreLang[lang].options + " 2D"); $("#menuOptions2D h3").eq(0).text(sankoreLang[lang].options + " 2D");
...@@ -1033,13 +1032,10 @@ ...@@ -1033,13 +1032,10 @@
<span class="gras">Control options:</span><br/> <span class="gras">Control options:</span><br/>
<input type="button" class="boutonSauvegarde" onclick="saveOptions()" value="Save"/><input type="button" class="boutonSauvegarde" onclick="loadOptions()" value="Load"/> <input class="boutonSauvegarde2" type="button" onclick="delOptions()" value="Delete"/><input class="boutonSauvegarde2" type="button" onclick="alertOptions()" value="Display"/><br/> <input type="button" class="boutonSauvegarde" onclick="saveOptions()" value="Save"/><input type="button" class="boutonSauvegarde" onclick="loadOptions()" value="Load"/> <input class="boutonSauvegarde2" type="button" onclick="delOptions()" value="Delete"/><input class="boutonSauvegarde2" type="button" onclick="alertOptions()" value="Display"/><br/>
<span class="texteSecondaire">Save a widget options in cookies or load an options from cookies or delete a registered options.</span> <span class="texteSecondaire">Save a widget options in cookies or load an options from cookies or delete a registered options.</span>
<br/><br/>
<label for="checkMaJ">Automatically update when a widget opening.</label> <input type="checkbox" id="checkMaJ" onclick="checkboxMaJ()"/>
<br/> <br/>
<div id="cacheCookies"><br/><br/><h1>Cookies are disabled. You cannot save an options...</h1></div> <div id="cacheCookies"><br/><br/><h1>Cookies are disabled. You cannot save an options...</h1></div>
<div id="cacheMaJ">You are using the last version of this widget.</div> <div id="cacheMaJ">You are using the last version of this widget.</div>
<input type="button" onclick='reset()' value="Reload widget" style="position:absolute; bottom:20px; width:140px; height:32px;"/> <input type="button" onclick='reset()' value="Reload widget" style="position:absolute; bottom:20px; width:140px; height:32px;"/>
<input type="button" onclick='miseAjour()' value="Updated" style="position:absolute; bottom:20px; left:160px; width:140px; height:32px;"/>
</div> </div>
<div class="barreBasMenu"><input type="button" onclick="cacherMenu(); actualiserGraph()" value="Check"/></div> <div class="barreBasMenu"><input type="button" onclick="cacherMenu(); actualiserGraph()" value="Check"/></div>
</div> </div>
......
body{ body{
margin-top:10px; margin: 0;
margin-left:10px;
font-family:Arial, Sans-serif; font-family:Arial, Sans-serif;
font-size:15px; font-size:15px;
color:#444; color:#444;
...@@ -104,7 +103,6 @@ body{ ...@@ -104,7 +103,6 @@ body{
} }
#embeded-content{ #embeded-content{
border:1px solid rgb(230,230,230);
position:relative; position:relative;
z-index:3; z-index:3;
float:left; float:left;
......
...@@ -143,7 +143,7 @@ ...@@ -143,7 +143,7 @@
top:($("#embeded-content").children(":first").height()-35)/2 top:($("#embeded-content").children(":first").height()-35)/2
}); });
adaptWidgetSize(5, 13); adaptWidgetSize(3, 0);
return false; return false;
}; };
......
...@@ -326,6 +326,15 @@ function init(){ ...@@ -326,6 +326,15 @@ function init(){
$(".closeItem").live("click", function(){ $(".closeItem").live("click", function(){
if(!shadowOver){ if(!shadowOver){
$(this).parent().remove(); $(this).parent().remove();
if($(".editContainer").size() > 0){
var prev = $(".editContainer:first");
if((prev.position().left == 54) && (prev.position().top != 60))
prev.css("top", "60px");
var prevBottom = prev.position().top + prev.height(),
prevLeft = prev.position().left;
if(prev.next().length)
recursionCall(prevBottom, prevLeft, prev.next());
}
} }
}); });
...@@ -339,8 +348,7 @@ function init(){ ...@@ -339,8 +348,7 @@ function init(){
}) })
function recursionCall(prevBottom, prevLeft, curr){ function recursionCall(prevBottom, prevLeft, curr){
var curTop = curr.position().top, var curHeight = curr.height(),
curHeight = curr.height(),
curLeft = curr.position().left; curLeft = curr.position().left;
if(prevLeft == curLeft){ if(prevLeft == curLeft){
if((prevBottom + 15 + curHeight) < ($(window).height() - 54)) if((prevBottom + 15 + curHeight) < ($(window).height() - 54))
...@@ -351,7 +359,7 @@ function init(){ ...@@ -351,7 +359,7 @@ function init(){
if((prevBottom + 15 + curHeight) < ($(window).height() - 54)) if((prevBottom + 15 + curHeight) < ($(window).height() - 54))
curr.css("top", prevBottom + 15 + "px").css("left", prevLeft + "px"); curr.css("top", prevBottom + 15 + "px").css("left", prevLeft + "px");
else else
curr.css("top", "60px"); curr.css("top", "60px").css("left", prevLeft + 255 + "px");
} }
prevBottom = curr.position().top + curr.height(), prevBottom = curr.position().top + curr.height(),
prevLeft = curr.position().left; prevLeft = curr.position().left;
...@@ -364,7 +372,20 @@ function init(){ ...@@ -364,7 +372,20 @@ function init(){
popupBack.css("left", ($(window).width() - 360)*50/$(window).width() + "%"); popupBack.css("left", ($(window).width() - 360)*50/$(window).width() + "%");
$(window).resize(function(){ $(window).resize(function(){
//$("#leftDiv,#rightDiv,#shadowDiv").css("height", $(window).height()); if($("#wgt_edit").hasClass("selected")){
if($(".editContainer").size() > 1){
var prev = $(".editContainer:first"),
prevBottom = prev.position().top + prev.height(),
prevLeft = prev.position().left;
recursionCall(prevBottom, prevLeft, prev.next());
}
} else {
var tmp_array = [];
$(".readyTask").each(function(){
tmp_array.push($(this));
});
orderItems(tmp_array);
}
popupBack.css("top", ($(window).height() - 138)*50/$(window).height() + "%"); popupBack.css("top", ($(window).height() - 138)*50/$(window).height() + "%");
popupBack.css("left", ($(window).width() - 360)*50/$(window).width() + "%"); popupBack.css("left", ($(window).width() - 360)*50/$(window).width() + "%");
}); });
......
...@@ -326,6 +326,15 @@ function init(){ ...@@ -326,6 +326,15 @@ function init(){
$(".closeItem").live("click", function(){ $(".closeItem").live("click", function(){
if(!shadowOver){ if(!shadowOver){
$(this).parent().remove(); $(this).parent().remove();
if($(".editContainer").size() > 0){
var prev = $(".editContainer:first");
if((prev.position().left == 54) && (prev.position().top != 60))
prev.css("top", "60px");
var prevBottom = prev.position().top + prev.height(),
prevLeft = prev.position().left;
if(prev.next().length)
recursionCall(prevBottom, prevLeft, prev.next());
}
} }
}); });
...@@ -339,8 +348,7 @@ function init(){ ...@@ -339,8 +348,7 @@ function init(){
}) })
function recursionCall(prevBottom, prevLeft, curr){ function recursionCall(prevBottom, prevLeft, curr){
var curTop = curr.position().top, var curHeight = curr.height(),
curHeight = curr.height(),
curLeft = curr.position().left; curLeft = curr.position().left;
if(prevLeft == curLeft){ if(prevLeft == curLeft){
if((prevBottom + 15 + curHeight) < ($(window).height() - 54)) if((prevBottom + 15 + curHeight) < ($(window).height() - 54))
...@@ -351,7 +359,7 @@ function init(){ ...@@ -351,7 +359,7 @@ function init(){
if((prevBottom + 15 + curHeight) < ($(window).height() - 54)) if((prevBottom + 15 + curHeight) < ($(window).height() - 54))
curr.css("top", prevBottom + 15 + "px").css("left", prevLeft + "px"); curr.css("top", prevBottom + 15 + "px").css("left", prevLeft + "px");
else else
curr.css("top", "60px"); curr.css("top", "60px").css("left", prevLeft + 255 + "px");
} }
prevBottom = curr.position().top + curr.height(), prevBottom = curr.position().top + curr.height(),
prevLeft = curr.position().left; prevLeft = curr.position().left;
...@@ -364,7 +372,20 @@ function init(){ ...@@ -364,7 +372,20 @@ function init(){
popupBack.css("left", ($(window).width() - 360)*50/$(window).width() + "%"); popupBack.css("left", ($(window).width() - 360)*50/$(window).width() + "%");
$(window).resize(function(){ $(window).resize(function(){
//$("#leftDiv,#rightDiv,#shadowDiv").css("height", $(window).height()); if($("#wgt_edit").hasClass("selected")){
if($(".editContainer").size() > 1){
var prev = $(".editContainer:first"),
prevBottom = prev.position().top + prev.height(),
prevLeft = prev.position().left;
recursionCall(prevBottom, prevLeft, prev.next());
}
} else {
var tmp_array = [];
$(".readyTask").each(function(){
tmp_array.push($(this));
});
orderItems(tmp_array);
}
popupBack.css("top", ($(window).height() - 138)*50/$(window).height() + "%"); popupBack.css("top", ($(window).height() - 138)*50/$(window).height() + "%");
popupBack.css("left", ($(window).width() - 360)*50/$(window).width() + "%"); popupBack.css("left", ($(window).width() - 360)*50/$(window).width() + "%");
}); });
......
...@@ -326,6 +326,15 @@ function init(){ ...@@ -326,6 +326,15 @@ function init(){
$(".closeItem").live("click", function(){ $(".closeItem").live("click", function(){
if(!shadowOver){ if(!shadowOver){
$(this).parent().remove(); $(this).parent().remove();
if($(".editContainer").size() > 0){
var prev = $(".editContainer:first");
if((prev.position().left == 54) && (prev.position().top != 60))
prev.css("top", "60px");
var prevBottom = prev.position().top + prev.height(),
prevLeft = prev.position().left;
if(prev.next().length)
recursionCall(prevBottom, prevLeft, prev.next());
}
} }
}); });
...@@ -339,8 +348,7 @@ function init(){ ...@@ -339,8 +348,7 @@ function init(){
}) })
function recursionCall(prevBottom, prevLeft, curr){ function recursionCall(prevBottom, prevLeft, curr){
var curTop = curr.position().top, var curHeight = curr.height(),
curHeight = curr.height(),
curLeft = curr.position().left; curLeft = curr.position().left;
if(prevLeft == curLeft){ if(prevLeft == curLeft){
if((prevBottom + 15 + curHeight) < ($(window).height() - 54)) if((prevBottom + 15 + curHeight) < ($(window).height() - 54))
...@@ -351,7 +359,7 @@ function init(){ ...@@ -351,7 +359,7 @@ function init(){
if((prevBottom + 15 + curHeight) < ($(window).height() - 54)) if((prevBottom + 15 + curHeight) < ($(window).height() - 54))
curr.css("top", prevBottom + 15 + "px").css("left", prevLeft + "px"); curr.css("top", prevBottom + 15 + "px").css("left", prevLeft + "px");
else else
curr.css("top", "60px"); curr.css("top", "60px").css("left", prevLeft + 255 + "px");
} }
prevBottom = curr.position().top + curr.height(), prevBottom = curr.position().top + curr.height(),
prevLeft = curr.position().left; prevLeft = curr.position().left;
...@@ -364,7 +372,20 @@ function init(){ ...@@ -364,7 +372,20 @@ function init(){
popupBack.css("left", ($(window).width() - 360)*50/$(window).width() + "%"); popupBack.css("left", ($(window).width() - 360)*50/$(window).width() + "%");
$(window).resize(function(){ $(window).resize(function(){
//$("#leftDiv,#rightDiv,#shadowDiv").css("height", $(window).height()); if($("#wgt_edit").hasClass("selected")){
if($(".editContainer").size() > 1){
var prev = $(".editContainer:first"),
prevBottom = prev.position().top + prev.height(),
prevLeft = prev.position().left;
recursionCall(prevBottom, prevLeft, prev.next());
}
} else {
var tmp_array = [];
$(".readyTask").each(function(){
tmp_array.push($(this));
});
orderItems(tmp_array);
}
popupBack.css("top", ($(window).height() - 138)*50/$(window).height() + "%"); popupBack.css("top", ($(window).height() - 138)*50/$(window).height() + "%");
popupBack.css("left", ($(window).width() - 360)*50/$(window).width() + "%"); popupBack.css("left", ($(window).width() - 360)*50/$(window).width() + "%");
}); });
......
...@@ -33,7 +33,6 @@ body{ ...@@ -33,7 +33,6 @@ body{
font: 28px tahoma; font: 28px tahoma;
text-align: center; text-align: center;
cursor: pointer; cursor: pointer;
text-transform: uppercase;
overflow: hidden; overflow: hidden;
} }
......
...@@ -710,9 +710,7 @@ void UBBoardPaletteManager::changeMode(eUBDockPaletteWidgetMode newMode, bool is ...@@ -710,9 +710,7 @@ void UBBoardPaletteManager::changeMode(eUBDockPaletteWidgetMode newMode, bool is
mLeftPalette->assignParent((QWidget*)UBApplication::applicationController->uninotesController()->drawingView()); mLeftPalette->assignParent((QWidget*)UBApplication::applicationController->uninotesController()->drawingView());
mRightPalette->assignParent((QWidget*)UBApplication::applicationController->uninotesController()->drawingView()); mRightPalette->assignParent((QWidget*)UBApplication::applicationController->uninotesController()->drawingView());
mStylusPalette->raise(); mStylusPalette->raise();
// Maybe threre is a reason to keep that functions but with them right palette in desktop mode is not interactable
// mRightPalette->lower();
// mLeftPalette->lower();
if (UBPlatformUtils::hasVirtualKeyboard() && mKeyboardPalette != NULL) if (UBPlatformUtils::hasVirtualKeyboard() && mKeyboardPalette != NULL)
{ {
......
...@@ -55,6 +55,8 @@ ...@@ -55,6 +55,8 @@
#include "document/UBDocumentProxy.h" #include "document/UBDocumentProxy.h"
#include "tools/UBGraphicsRuler.h"
#include "tools/UBGraphicsCurtainItem.h"
#include "tools/UBGraphicsCompass.h" #include "tools/UBGraphicsCompass.h"
#include "tools/UBGraphicsCache.h" #include "tools/UBGraphicsCache.h"
#include "tools/UBGraphicsTriangle.h" #include "tools/UBGraphicsTriangle.h"
...@@ -73,6 +75,7 @@ UBBoardView::UBBoardView (UBBoardController* pController, QWidget* pParent, bool ...@@ -73,6 +75,7 @@ UBBoardView::UBBoardView (UBBoardController* pController, QWidget* pParent, bool
, mIsDragInProgress(false) , mIsDragInProgress(false)
, mMultipleSelectionIsEnabled(false) , mMultipleSelectionIsEnabled(false)
, isControl(pIsControl) , isControl(pIsControl)
, mRubberBandInPlayMode(false) //enables rubberband with play tool
{ {
init (); init ();
...@@ -433,6 +436,15 @@ bool UBBoardView::itemHaveParentWithType(QGraphicsItem *item, int type) ...@@ -433,6 +436,15 @@ bool UBBoardView::itemHaveParentWithType(QGraphicsItem *item, int type)
return itemHaveParentWithType(item->parentItem(), type); return itemHaveParentWithType(item->parentItem(), type);
} }
bool UBBoardView::isUBItem(QGraphicsItem *item)
{
if ((UBGraphicsItemType::UserTypesCount > item->type()) && (item->type() > QGraphicsItem::UserType))
return true;
else
{
return false;
}
}
void UBBoardView::handleItemsSelection(QGraphicsItem *item) void UBBoardView::handleItemsSelection(QGraphicsItem *item)
{ {
...@@ -504,6 +516,13 @@ Here we determines cases when items should to get mouse press event at pressing ...@@ -504,6 +516,13 @@ Here we determines cases when items should to get mouse press event at pressing
switch(item->type()) switch(item->type())
{ {
case UBGraphicsProtractor::Type:
case UBGraphicsRuler::Type:
case UBGraphicsTriangle::Type:
case UBGraphicsCompass::Type:
case UBGraphicsCache::Type:
return true;
case UBGraphicsDelegateFrame::Type: case UBGraphicsDelegateFrame::Type:
case QGraphicsSvgItem::Type: case QGraphicsSvgItem::Type:
return true; return true;
...@@ -550,10 +569,7 @@ Here we determines cases when items should to get mouse press event at pressing ...@@ -550,10 +569,7 @@ Here we determines cases when items should to get mouse press event at pressing
break; break;
} }
if ((UBGraphicsItemType::UserTypesCount > item->type()) && (item->type() > QGraphicsItem::UserType)) return !isUBItem(item); // standard behavior of QGraphicsScene for not UB items. UB items should be managed upper.
return true;
else
return false;
} }
bool UBBoardView::itemShouldReceiveSuspendedMousePressEvent(QGraphicsItem *item) bool UBBoardView::itemShouldReceiveSuspendedMousePressEvent(QGraphicsItem *item)
...@@ -609,6 +625,7 @@ bool UBBoardView::itemShouldBeMoved(QGraphicsItem *item) ...@@ -609,6 +625,7 @@ bool UBBoardView::itemShouldBeMoved(QGraphicsItem *item)
switch(item->type()) switch(item->type())
{ {
case UBGraphicsCurtainItem::Type:
case UBGraphicsGroupContainerItem::Type: case UBGraphicsGroupContainerItem::Type:
return true; return true;
...@@ -1004,6 +1021,8 @@ UBBoardView::mouseMoveEvent (QMouseEvent *event) ...@@ -1004,6 +1021,8 @@ UBBoardView::mouseMoveEvent (QMouseEvent *event)
return; return;
} }
if (currentTool != UBStylusTool::Play || mRubberBandInPlayMode) {
if (!movingItem && (mMouseButtonIsPressed || mTabletStylusIsPressed) && mUBRubberBand && mUBRubberBand->isVisible()) { if (!movingItem && (mMouseButtonIsPressed || mTabletStylusIsPressed) && mUBRubberBand && mUBRubberBand->isVisible()) {
QRect bandRect(mMouseDownPos, event->pos()); QRect bandRect(mMouseDownPos, event->pos());
...@@ -1038,6 +1057,7 @@ UBBoardView::mouseMoveEvent (QMouseEvent *event) ...@@ -1038,6 +1057,7 @@ UBBoardView::mouseMoveEvent (QMouseEvent *event)
} }
} }
} }
}
handleItemMouseMove(event); handleItemMouseMove(event);
} }
...@@ -1102,7 +1122,8 @@ UBBoardView::mouseReleaseEvent (QMouseEvent *event) ...@@ -1102,7 +1122,8 @@ UBBoardView::mouseReleaseEvent (QMouseEvent *event)
} }
else else
{ {
if (QGraphicsSvgItem::Type != movingItem->type() && if (isUBItem(movingItem) &&
QGraphicsSvgItem::Type != movingItem->type() &&
UBGraphicsDelegateFrame::Type != movingItem->type() && UBGraphicsDelegateFrame::Type != movingItem->type() &&
UBToolWidget::Type != movingItem->type() && UBToolWidget::Type != movingItem->type() &&
UBGraphicsCache::Type != movingItem->type() && UBGraphicsCache::Type != movingItem->type() &&
......
...@@ -57,6 +57,7 @@ class UBBoardView : public QGraphicsView ...@@ -57,6 +57,7 @@ class UBBoardView : public QGraphicsView
protected: protected:
bool itemIsLocked(QGraphicsItem *item); bool itemIsLocked(QGraphicsItem *item);
bool isUBItem(QGraphicsItem *item); // we should to determine items who is not UB and use general scene behavior for them.
void handleItemsSelection(QGraphicsItem *item); void handleItemsSelection(QGraphicsItem *item);
bool itemShouldReceiveMousePressEvent(QGraphicsItem *item); bool itemShouldReceiveMousePressEvent(QGraphicsItem *item);
bool itemShouldReceiveSuspendedMousePressEvent(QGraphicsItem *item); bool itemShouldReceiveSuspendedMousePressEvent(QGraphicsItem *item);
...@@ -153,6 +154,7 @@ class UBBoardView : public QGraphicsView ...@@ -153,6 +154,7 @@ class UBBoardView : public QGraphicsView
bool mIsDragInProgress; bool mIsDragInProgress;
bool mMultipleSelectionIsEnabled; bool mMultipleSelectionIsEnabled;
bool isControl; bool isControl;
bool mRubberBandInPlayMode;
static bool hasSelectedParents(QGraphicsItem * item); static bool hasSelectedParents(QGraphicsItem * item);
......
This diff is collapsed.
...@@ -33,7 +33,7 @@ class UBFeaturesComputingThread : public QThread ...@@ -33,7 +33,7 @@ class UBFeaturesComputingThread : public QThread
public: public:
explicit UBFeaturesComputingThread(QObject *parent = 0); explicit UBFeaturesComputingThread(QObject *parent = 0);
virtual ~UBFeaturesComputingThread(); virtual ~UBFeaturesComputingThread();
void compute(const QList<QPair<QUrl, QString> > &pScanningData, QSet<QUrl> *pFavoritesSet); void compute(const QList<QPair<QUrl, UBFeature> > &pScanningData, QSet<QUrl> *pFavoritesSet);
protected: protected:
void run(); void run();
...@@ -51,16 +51,16 @@ public slots: ...@@ -51,16 +51,16 @@ public slots:
private: private:
void scanFS(const QUrl & currentPath, const QString & currVirtualPath, const QSet<QUrl> &pFavoriteSet); void scanFS(const QUrl & currentPath, const QString & currVirtualPath, const QSet<QUrl> &pFavoriteSet);
void scanAll(QList<QPair<QUrl, QString> > pScanningData, const QSet<QUrl> &pFavoriteSet); void scanAll(QList<QPair<QUrl, UBFeature> > pScanningData, const QSet<QUrl> &pFavoriteSet);
int featuresCount(const QUrl &pPath); int featuresCount(const QUrl &pPath);
int featuresCountAll(QList<QPair<QUrl, QString> > pScanningData); int featuresCountAll(QList<QPair<QUrl, UBFeature> > pScanningData);
private: private:
QMutex mMutex; QMutex mMutex;
QWaitCondition mWaitCondition; QWaitCondition mWaitCondition;
QUrl mScanningPath; QUrl mScanningPath;
QString mScanningVirtualPath; QString mScanningVirtualPath;
QList<QPair<QUrl, QString> > mScanningData; QList<QPair<QUrl, UBFeature> > mScanningData;
QSet<QUrl> mFavoriteSet; QSet<QUrl> mFavoriteSet;
bool restart; bool restart;
bool abort; bool abort;
...@@ -94,6 +94,7 @@ public: ...@@ -94,6 +94,7 @@ public:
// UBFeature(); // UBFeature();
virtual ~UBFeature(); virtual ~UBFeature();
QString getName() const { return mName; } QString getName() const { return mName; }
QString getDisplayName() const {return mDisplayName;}
QImage getThumbnail() const {return mThumbnail;} QImage getThumbnail() const {return mThumbnail;}
QString getVirtualPath() const { return virtualDir; } QString getVirtualPath() const { return virtualDir; }
//QString getPath() const { return mPath; }; //QString getPath() const { return mPath; };
...@@ -112,11 +113,17 @@ public: ...@@ -112,11 +113,17 @@ public:
const QMap<QString,QString> & getMetadata() const { return metadata; } const QMap<QString,QString> & getMetadata() const { return metadata; }
void setMetadata( const QMap<QString,QString> &data ) { metadata = data; } void setMetadata( const QMap<QString,QString> &data ) { metadata = data; }
private:
QString getNameFromVirtualPath(const QString &pVirtPath);
QString getVirtualDirFromVirtualPath(const QString &pVirtPath);
private: private:
QString virtualDir; QString virtualDir;
QString virtualPath; QString virtualPath;
QImage mThumbnail; QImage mThumbnail;
QString mName; QString mName;
QString mDisplayName;
QUrl mPath; QUrl mPath;
UBFeatureElementType elementType; UBFeatureElementType elementType;
QMap<QString,QString> metadata; QMap<QString,QString> metadata;
...@@ -182,6 +189,19 @@ public: ...@@ -182,6 +189,19 @@ public:
void assignFeaturesListVeiw(UBFeaturesListView *pList); void assignFeaturesListVeiw(UBFeaturesListView *pList);
void assignPathListView(UBFeaturesListView *pList); void assignPathListView(UBFeaturesListView *pList);
public:
static const QString rootPath;
static const QString audiosPath;
static const QString moviesPath;
static const QString picturesPath;
static const QString appPath;
static const QString flashPath;
static const QString shapesPath;
static const QString interactPath;
static const QString trashPath;
static const QString favoritePath;
static const QString webSearchPath;
signals: signals:
void maxFilesCountEvaluated(int pLimit); void maxFilesCountEvaluated(int pLimit);
void scanStarted(); void scanStarted();
...@@ -235,17 +255,7 @@ private: ...@@ -235,17 +255,7 @@ private:
QUrl trashDirectoryPath; QUrl trashDirectoryPath;
QUrl mLibSearchDirectoryPath; QUrl mLibSearchDirectoryPath;
QString rootPath;
QString audiosPath;
QString moviesPath;
QString picturesPath;
QString appPath;
QString flashPath;
QString shapesPath;
QString interactPath;
QString trashPath;
QString favoritePath;
QString webSearchPath;
int mLastItemOffsetIndex; int mLastItemOffsetIndex;
UBFeature currentElement; UBFeature currentElement;
......
...@@ -66,8 +66,7 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent) ...@@ -66,8 +66,7 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent)
, mDesktopStylusTool(UBDrawingController::drawingController()->stylusTool()) , mDesktopStylusTool(UBDrawingController::drawingController()->stylusTool())
{ {
mTransparentDrawingView = new UBBoardView(UBApplication::boardController, static_cast<QWidget*>(NULL), true); // deleted in UBDesktopAnnotationController::destructor mTransparentDrawingView = new UBBoardView(UBApplication::boardController, static_cast<QWidget*>(0), true); // deleted in UBDesktopAnnotationController::destructor
mTransparentDrawingView->setAttribute(Qt::WA_TranslucentBackground, true); mTransparentDrawingView->setAttribute(Qt::WA_TranslucentBackground, true);
#ifdef Q_WS_MAC #ifdef Q_WS_MAC
mTransparentDrawingView->setAttribute(Qt::WA_MacNoShadow, true); mTransparentDrawingView->setAttribute(Qt::WA_MacNoShadow, true);
...@@ -87,7 +86,7 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent) ...@@ -87,7 +86,7 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent)
mTransparentDrawingView->setScene(mTransparentDrawingScene); mTransparentDrawingView->setScene(mTransparentDrawingScene);
mTransparentDrawingScene->setDrawingMode(true); mTransparentDrawingScene->setDrawingMode(true);
mDesktopPalette = new UBDesktopPalette(mTransparentDrawingView); mDesktopPalette = new UBDesktopPalette(NULL); // FIX #633: The palette must be 'floating' in order to stay on top of the library palette
if (UBPlatformUtils::hasVirtualKeyboard()) if (UBPlatformUtils::hasVirtualKeyboard())
{ {
...@@ -102,9 +101,15 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent) ...@@ -102,9 +101,15 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent)
} }
connect(mDesktopPalette, SIGNAL(uniboardClick()), this, SLOT(goToUniboard())); connect(mDesktopPalette, SIGNAL(uniboardClick()), this, SLOT(goToUniboard()));
connect(mDesktopPalette, SIGNAL(uniboardClick()), this, SLOT(onToolClicked()));
connect(mDesktopPalette, SIGNAL(customClick()), this, SLOT(customCapture())); connect(mDesktopPalette, SIGNAL(customClick()), this, SLOT(customCapture()));
connect(mDesktopPalette, SIGNAL(customClick()), this, SLOT(onToolClicked()));
connect(mDesktopPalette, SIGNAL(windowClick()), this, SLOT(windowCapture())); connect(mDesktopPalette, SIGNAL(windowClick()), this, SLOT(windowCapture()));
connect(mDesktopPalette, SIGNAL(windowClick()), this, SLOT(onToolClicked()));
connect(mDesktopPalette, SIGNAL(screenClick()), this, SLOT(screenCapture())); connect(mDesktopPalette, SIGNAL(screenClick()), this, SLOT(screenCapture()));
connect(mDesktopPalette, SIGNAL(screenClick()), this, SLOT(onToolClicked()));
connect(UBApplication::mainWindow->actionPointer, SIGNAL(triggered()), this, SLOT(onToolClicked()));
connect(UBApplication::mainWindow->actionSelector, SIGNAL(triggered()), this, SLOT(onToolClicked()));
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()));
...@@ -114,13 +119,13 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent) ...@@ -114,13 +119,13 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent)
connect(UBDrawingController::drawingController(), SIGNAL(stylusToolChanged(int)), this, SLOT(stylusToolChanged(int))); connect(UBDrawingController::drawingController(), SIGNAL(stylusToolChanged(int)), this, SLOT(stylusToolChanged(int)));
// Add the desktop associated palettes // Add the desktop associated palettes
mDesktopPenPalette = new UBDesktopPenPalette(mTransparentDrawingView); mDesktopPenPalette = new UBDesktopPenPalette(NULL); // FIX #633: The palette must be 'floating' in order to stay on top of the library palette
connect(mDesktopPalette, SIGNAL(maximized()), mDesktopPenPalette, SLOT(onParentMaximized())); connect(mDesktopPalette, SIGNAL(maximized()), mDesktopPenPalette, SLOT(onParentMaximized()));
connect(mDesktopPalette, SIGNAL(minimizeStart(eMinimizedLocation)), mDesktopPenPalette, SLOT(onParentMinimized())); connect(mDesktopPalette, SIGNAL(minimizeStart(eMinimizedLocation)), mDesktopPenPalette, SLOT(onParentMinimized()));
mDesktopMarkerPalette = new UBDesktopMarkerPalette(mTransparentDrawingView); mDesktopMarkerPalette = new UBDesktopMarkerPalette(NULL); // FIX #633: The palette must be 'floating' in order to stay on top of the library palette
mDesktopEraserPalette = new UBDesktopEraserPalette(mTransparentDrawingView); mDesktopEraserPalette = new UBDesktopEraserPalette(NULL); // FIX #633: The palette must be 'floating' in order to stay on top of the library palette
mDesktopPalette->setBackgroundBrush(UBSettings::settings()->opaquePaletteColor); mDesktopPalette->setBackgroundBrush(UBSettings::settings()->opaquePaletteColor);
mDesktopPenPalette->setBackgroundBrush(UBSettings::settings()->opaquePaletteColor); mDesktopPenPalette->setBackgroundBrush(UBSettings::settings()->opaquePaletteColor);
...@@ -149,6 +154,12 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent) ...@@ -149,6 +154,12 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent)
connect(UBApplication::boardController->paletteManager()->rightPalette(), SIGNAL(resized()), this, SLOT(refreshMask())); connect(UBApplication::boardController->paletteManager()->rightPalette(), SIGNAL(resized()), this, SLOT(refreshMask()));
#endif #endif
onDesktopPaletteMaximized(); onDesktopPaletteMaximized();
// FIX #633: Ensure that these palettes stay on top of the other elements
mDesktopEraserPalette->raise();
mDesktopMarkerPalette->raise();
mDesktopPenPalette->raise();
mDesktopPalette->raise();
} }
UBDesktopAnnotationController::~UBDesktopAnnotationController() UBDesktopAnnotationController::~UBDesktopAnnotationController()
...@@ -238,11 +249,7 @@ void UBDesktopAnnotationController::setAssociatedPalettePosition(UBActionPalette ...@@ -238,11 +249,7 @@ void UBDesktopAnnotationController::setAssociatedPalettePosition(UBActionPalette
if(act->objectName() == actionName) if(act->objectName() == actionName)
{ {
int iAction = actions.indexOf(act); int iAction = actions.indexOf(act);
yPen = iAction * mDesktopPalette->buttonSize().height(); yPen = iAction * (mDesktopPalette->buttonSize().height() + 2 * mDesktopPalette->border() +6); // This is the mysterious value (6)
// Add the borders
yPen += (iAction) * (mDesktopPalette->border() + 4); // 4 has been set after some experiment. We must determine why this value is good
break; break;
} }
} }
...@@ -382,6 +389,7 @@ void UBDesktopAnnotationController::hideWindow() ...@@ -382,6 +389,7 @@ void UBDesktopAnnotationController::hideWindow()
void UBDesktopAnnotationController::goToUniboard() void UBDesktopAnnotationController::goToUniboard()
{ {
onToolClicked();
hideWindow(); hideWindow();
UBPlatformUtils::setDesktopMode(false); UBPlatformUtils::setDesktopMode(false);
...@@ -397,6 +405,7 @@ void UBDesktopAnnotationController::goToUniboard() ...@@ -397,6 +405,7 @@ void UBDesktopAnnotationController::goToUniboard()
void UBDesktopAnnotationController::customCapture() void UBDesktopAnnotationController::customCapture()
{ {
onToolClicked();
mIsFullyTransparent = true; mIsFullyTransparent = true;
updateBackground(); updateBackground();
...@@ -424,6 +433,7 @@ void UBDesktopAnnotationController::customCapture() ...@@ -424,6 +433,7 @@ void UBDesktopAnnotationController::customCapture()
void UBDesktopAnnotationController::windowCapture() void UBDesktopAnnotationController::windowCapture()
{ {
onToolClicked();
mIsFullyTransparent = true; mIsFullyTransparent = true;
updateBackground(); updateBackground();
...@@ -453,6 +463,7 @@ void UBDesktopAnnotationController::windowCapture() ...@@ -453,6 +463,7 @@ void UBDesktopAnnotationController::windowCapture()
void UBDesktopAnnotationController::screenCapture() void UBDesktopAnnotationController::screenCapture()
{ {
onToolClicked();
mIsFullyTransparent = true; mIsFullyTransparent = true;
updateBackground(); updateBackground();
...@@ -539,7 +550,6 @@ void UBDesktopAnnotationController::penActionPressed() ...@@ -539,7 +550,6 @@ void UBDesktopAnnotationController::penActionPressed()
*/ */
void UBDesktopAnnotationController::penActionReleased() void UBDesktopAnnotationController::penActionReleased()
{ {
qDebug() << "penActionReleased()";
mHoldTimerPen.stop(); mHoldTimerPen.stop();
if(mPendingPenButtonPressed) if(mPendingPenButtonPressed)
{ {
...@@ -594,7 +604,6 @@ void UBDesktopAnnotationController::eraserActionPressed() ...@@ -594,7 +604,6 @@ void UBDesktopAnnotationController::eraserActionPressed()
*/ */
void UBDesktopAnnotationController::eraserActionReleased() void UBDesktopAnnotationController::eraserActionReleased()
{ {
qDebug() << "eraserActionReleased()";
mHoldTimerEraser.stop(); mHoldTimerEraser.stop();
if(mPendingEraserButtonPressed) if(mPendingEraserButtonPressed)
{ {
...@@ -651,7 +660,6 @@ void UBDesktopAnnotationController::markerActionPressed() ...@@ -651,7 +660,6 @@ void UBDesktopAnnotationController::markerActionPressed()
*/ */
void UBDesktopAnnotationController::markerActionReleased() void UBDesktopAnnotationController::markerActionReleased()
{ {
qDebug() << "markerActionReleased()";
mHoldTimerMarker.stop(); mHoldTimerMarker.stop();
if(mPendingMarkerButtonPressed) if(mPendingMarkerButtonPressed)
{ {
...@@ -930,3 +938,9 @@ void UBDesktopAnnotationController::refreshMask() ...@@ -930,3 +938,9 @@ void UBDesktopAnnotationController::refreshMask()
updateMask(true); updateMask(true);
} }
} }
void UBDesktopAnnotationController::onToolClicked(){
mDesktopEraserPalette->hide();
mDesktopMarkerPalette->hide();
mDesktopPenPalette->hide();
}
...@@ -111,6 +111,7 @@ class UBDesktopAnnotationController : public QObject ...@@ -111,6 +111,7 @@ class UBDesktopAnnotationController : public QObject
void onDesktopPaletteMinimize(); void onDesktopPaletteMinimize();
void onTransparentWidgetResized(); void onTransparentWidgetResized();
void refreshMask(); void refreshMask();
void onToolClicked();
private: private:
void setAssociatedPalettePosition(UBActionPalette* palette, const QString& actionName); void setAssociatedPalettePosition(UBActionPalette* palette, const QString& actionName);
......
...@@ -259,7 +259,7 @@ void UBFeaturesWidget::onDisplayMetadata( QMap<QString,QString> metadata ) ...@@ -259,7 +259,7 @@ void UBFeaturesWidget::onDisplayMetadata( QMap<QString,QString> metadata )
}break; }break;
} }
UBFeature feature( QString(), QImage(previewImageUrl), QString(), metadata["Url"], FEATURE_ITEM ); UBFeature feature( "/root", QImage(previewImageUrl), QString(), metadata["Url"], FEATURE_ITEM );
feature.setMetadata( metadata ); feature.setMetadata( metadata );
centralWidget->showElement(feature, UBFeaturesCentralWidget::FeaturePropertiesList); centralWidget->showElement(feature, UBFeaturesCentralWidget::FeaturePropertiesList);
...@@ -676,7 +676,7 @@ UBFeaturesProgressInfo::UBFeaturesProgressInfo(QWidget *parent) : ...@@ -676,7 +676,7 @@ UBFeaturesProgressInfo::UBFeaturesProgressInfo(QWidget *parent) :
void UBFeaturesProgressInfo::setCommmonInfoText(const QString &str) void UBFeaturesProgressInfo::setCommmonInfoText(const QString &str)
{ {
mProgressBar->setFormat(str + tr(" load") + "(%p%)"); mProgressBar->setFormat(tr("Loading ") + str + " (%p%)");
} }
void UBFeaturesProgressInfo::setDetailedInfoText(const QString &str) void UBFeaturesProgressInfo::setDetailedInfoText(const QString &str)
...@@ -1080,7 +1080,7 @@ QVariant UBFeaturesModel::data(const QModelIndex &index, int role) const ...@@ -1080,7 +1080,7 @@ QVariant UBFeaturesModel::data(const QModelIndex &index, int role) const
return QVariant(); return QVariant();
if (role == Qt::DisplayRole) { if (role == Qt::DisplayRole) {
return featuresList->at(index.row()).getName(); return featuresList->at(index.row()).getDisplayName();
} }
else if (role == Qt::DecorationRole) { else if (role == Qt::DecorationRole) {
...@@ -1311,7 +1311,7 @@ void UBFeaturesModel::moveData(const UBFeature &source, const UBFeature &destina ...@@ -1311,7 +1311,7 @@ void UBFeaturesModel::moveData(const UBFeature &source, const UBFeature &destina
} }
} }
UBFeature newElement( destVirtualPath, sourceIcon, name, QUrl::fromLocalFile(destFullPath), sourceType ); UBFeature newElement( destVirtualPath + "/" + name, sourceIcon, name, QUrl::fromLocalFile(destFullPath), sourceType );
addItem(newElement); addItem(newElement);
if (deleteManualy) { if (deleteManualy) {
......
...@@ -25,6 +25,7 @@ UBPropertyPalette::UBPropertyPalette(QWidget *parent, const char *name):UBAction ...@@ -25,6 +25,7 @@ UBPropertyPalette::UBPropertyPalette(QWidget *parent, const char *name):UBAction
{ {
setObjectName(name); setObjectName(name);
mbGrip = false; mbGrip = false;
setMaximumHeight(MAX_HEIGHT);
} }
/** /**
...@@ -35,6 +36,7 @@ UBPropertyPalette::UBPropertyPalette(QWidget *parent, const char *name):UBAction ...@@ -35,6 +36,7 @@ UBPropertyPalette::UBPropertyPalette(QWidget *parent, const char *name):UBAction
UBPropertyPalette::UBPropertyPalette(Qt::Orientation orientation, QWidget *parent):UBActionPalette(orientation, parent) UBPropertyPalette::UBPropertyPalette(Qt::Orientation orientation, QWidget *parent):UBActionPalette(orientation, parent)
{ {
mbGrip = false; mbGrip = false;
setMaximumHeight(MAX_HEIGHT);
} }
/** /**
......
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
#include "UBActionPalette.h" #include "UBActionPalette.h"
#define MAX_HEIGHT 20
class UBPropertyPalette : public UBActionPalette class UBPropertyPalette : public UBActionPalette
{ {
Q_OBJECT Q_OBJECT
......
...@@ -685,6 +685,7 @@ UBTeacherGuidePageZeroWidget::UBTeacherGuidePageZeroWidget(QWidget* parent, cons ...@@ -685,6 +685,7 @@ UBTeacherGuidePageZeroWidget::UBTeacherGuidePageZeroWidget(QWidget* parent, cons
mpSessionTitle = new UBTGAdaptableText(0, this, "UBTGSessionTitle"); mpSessionTitle = new UBTGAdaptableText(0, this, "UBTGSessionTitle");
mpSessionTitle->setPlaceHolderText(tr("Type session title here ...")); mpSessionTitle->setPlaceHolderText(tr("Type session title here ..."));
mpButtonTitleLayout->addWidget(mpSessionTitle); mpButtonTitleLayout->addWidget(mpSessionTitle);
connect(this, SIGNAL(resized()), mpSessionTitle, SLOT(onTextChanged()));
mpLayout->addLayout(mpButtonTitleLayout); mpLayout->addLayout(mpButtonTitleLayout);
...@@ -703,6 +704,7 @@ UBTeacherGuidePageZeroWidget::UBTeacherGuidePageZeroWidget(QWidget* parent, cons ...@@ -703,6 +704,7 @@ UBTeacherGuidePageZeroWidget::UBTeacherGuidePageZeroWidget(QWidget* parent, cons
mpAuthors->setObjectName("UBTGZeroPageInputText"); mpAuthors->setObjectName("UBTGZeroPageInputText");
mpAuthors->setPlaceHolderText(tr("Type authors here ...")); mpAuthors->setPlaceHolderText(tr("Type authors here ..."));
mpLayout->addWidget(mpAuthors); mpLayout->addWidget(mpAuthors);
connect(this, SIGNAL(resized()), mpAuthors, SLOT(onTextChanged()));
mpCreationLabel = new QLabel(this); mpCreationLabel = new QLabel(this);
mpCreationLabel->setObjectName("UBTGZeroPageDateLabel"); mpCreationLabel->setObjectName("UBTGZeroPageDateLabel");
...@@ -727,6 +729,7 @@ UBTeacherGuidePageZeroWidget::UBTeacherGuidePageZeroWidget(QWidget* parent, cons ...@@ -727,6 +729,7 @@ UBTeacherGuidePageZeroWidget::UBTeacherGuidePageZeroWidget(QWidget* parent, cons
mpObjectives->setObjectName("UBTGZeroPageInputText"); mpObjectives->setObjectName("UBTGZeroPageInputText");
mpObjectives->setPlaceHolderText(tr("Type objectives here...")); mpObjectives->setPlaceHolderText(tr("Type objectives here..."));
mpLayout->addWidget(mpObjectives); mpLayout->addWidget(mpObjectives);
connect(this, SIGNAL(resized()), mpObjectives, SLOT(onTextChanged()));
mpSeparatorObjectives = new QFrame(this); mpSeparatorObjectives = new QFrame(this);
mpSeparatorObjectives->setFixedHeight(UBTG_SEPARATOR_FIXED_HEIGHT); mpSeparatorObjectives->setFixedHeight(UBTG_SEPARATOR_FIXED_HEIGHT);
...@@ -747,6 +750,7 @@ UBTeacherGuidePageZeroWidget::UBTeacherGuidePageZeroWidget(QWidget* parent, cons ...@@ -747,6 +750,7 @@ UBTeacherGuidePageZeroWidget::UBTeacherGuidePageZeroWidget(QWidget* parent, cons
mpKeywords = new UBTGAdaptableText(0, this); mpKeywords = new UBTGAdaptableText(0, this);
mpKeywords->setPlaceHolderText(tr("Type keywords here ...")); mpKeywords->setPlaceHolderText(tr("Type keywords here ..."));
mpLayout->addWidget(mpKeywords); mpLayout->addWidget(mpKeywords);
connect(this, SIGNAL(resized()), mpKeywords, SLOT(onTextChanged()));
mpSchoolLevelItemLabel = new QLabel(this); mpSchoolLevelItemLabel = new QLabel(this);
mpSchoolLevelItemLabel->setObjectName("UBTGZeroPageItemLabel"); mpSchoolLevelItemLabel->setObjectName("UBTGZeroPageItemLabel");
...@@ -1122,6 +1126,12 @@ bool UBTeacherGuidePageZeroWidget::isModified() ...@@ -1122,6 +1126,12 @@ bool UBTeacherGuidePageZeroWidget::isModified()
return result; return result;
} }
void UBTeacherGuidePageZeroWidget::resizeEvent(QResizeEvent* ev){
emit resized();
QWidget::resizeEvent(ev);
}
/*************************************************************************** /***************************************************************************
* class UBTeacherGuideWidget * * class UBTeacherGuideWidget *
***************************************************************************/ ***************************************************************************/
...@@ -1238,3 +1248,4 @@ bool UBTeacherGuideWidget::isModified() ...@@ -1238,3 +1248,4 @@ bool UBTeacherGuideWidget::isModified()
else else
return mpEditionWidget->isModified(); return mpEditionWidget->isModified();
} }
...@@ -136,11 +136,16 @@ public: ...@@ -136,11 +136,16 @@ public:
QVector<tUBGEElementNode*> getData(); QVector<tUBGEElementNode*> getData();
bool isModified(); bool isModified();
signals:
void resized();
public slots: public slots:
void onActiveSceneChanged(); void onActiveSceneChanged();
void switchToMode(tUBTGZeroPageMode mode = tUBTGZeroPageMode_EDITION); void switchToMode(tUBTGZeroPageMode mode = tUBTGZeroPageMode_EDITION);
protected:
void resizeEvent(QResizeEvent* ev);
private: private:
void fillComboBoxes(); void fillComboBoxes();
void loadData(); void loadData();
......
...@@ -174,6 +174,7 @@ void UBTGAdaptableText::showEvent(QShowEvent* e) ...@@ -174,6 +174,7 @@ void UBTGAdaptableText::showEvent(QShowEvent* e)
if(!mIsUpdatingSize && mHasPlaceHolder && toPlainText().isEmpty()) if(!mIsUpdatingSize && mHasPlaceHolder && toPlainText().isEmpty())
setPlainText(mPlaceHolderText); setPlainText(mPlaceHolderText);
else else
// If the teacherguide is collapsed, don't updated the size. Or set the size as the expanded size
onTextChanged(); onTextChanged();
} }
...@@ -188,9 +189,12 @@ QString UBTGAdaptableText::text() ...@@ -188,9 +189,12 @@ QString UBTGAdaptableText::text()
void UBTGAdaptableText::onTextChanged() void UBTGAdaptableText::onTextChanged()
{ {
//qDebug() << ">> onTextChanged CALLED!";
qreal documentSize = document()->size().height(); qreal documentSize = document()->size().height();
if(height() == documentSize + mBottomMargin) //qDebug() << ">> documentSize: " << documentSize << ", height: " << height();
if(height() == documentSize + mBottomMargin){
return; return;
}
mIsUpdatingSize = true; mIsUpdatingSize = true;
...@@ -208,6 +212,7 @@ void UBTGAdaptableText::onTextChanged() ...@@ -208,6 +212,7 @@ void UBTGAdaptableText::onTextChanged()
setFocus(); setFocus();
} }
mIsUpdatingSize = false; mIsUpdatingSize = false;
} }
void UBTGAdaptableText::setInitialText(const QString& text) void UBTGAdaptableText::setInitialText(const QString& text)
{ {
......
...@@ -12,11 +12,13 @@ ...@@ -12,11 +12,13 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <QObject>
#include <QString> #include <QString>
#include <QCursor> #include <QCursor>
#include "UBThumbnailWidget.h" #include "UBThumbnailWidget.h"
#include "UBRubberBand.h" #include "UBRubberBand.h"
#include "UBMainWindow.h"
#include "board/UBBoardController.h" #include "board/UBBoardController.h"
...@@ -858,7 +860,9 @@ void UBSceneThumbnailNavigPixmap::updateButtonsState() ...@@ -858,7 +860,9 @@ void UBSceneThumbnailNavigPixmap::updateButtonsState()
void UBSceneThumbnailNavigPixmap::deletePage() void UBSceneThumbnailNavigPixmap::deletePage()
{ {
if(UBApplication::mainWindow->yesNoQuestion(QObject::tr("Remove Page"), QObject::tr("Are you sure you want to remove 1 page from the selected document '%0'?").arg(UBApplication::documentController->selectedDocument()->metaData(UBSettings::documentName).toString()))){
UBApplication::boardController->deleteScene(sceneIndex()); UBApplication::boardController->deleteScene(sceneIndex());
}
} }
void UBSceneThumbnailNavigPixmap::duplicatePage() void UBSceneThumbnailNavigPixmap::duplicatePage()
......
...@@ -733,6 +733,7 @@ bool UBWebController::isEduMedia(const QUrl& pUrl) ...@@ -733,6 +733,7 @@ bool UBWebController::isEduMedia(const QUrl& pUrl)
void UBWebController::loadUrl(const QUrl& url) void UBWebController::loadUrl(const QUrl& url)
{ {
bool webBrowserAlreadyInstanciated = dynamic_cast<WBBrowserWindow*>(mStackedWidget->widget(WebBrowser)) != NULL;
UBApplication::applicationController->showInternet(); UBApplication::applicationController->showInternet();
if (UBSettings::settings()->webUseExternalBrowser->get().toBool()) if (UBSettings::settings()->webUseExternalBrowser->get().toBool())
{ {
...@@ -740,8 +741,6 @@ void UBWebController::loadUrl(const QUrl& url) ...@@ -740,8 +741,6 @@ void UBWebController::loadUrl(const QUrl& url)
} }
else else
{ {
bool webBrowserAlreadyInstanciated = mStackedWidget->widget(WebBrowser) != NULL;
if (!webBrowserAlreadyInstanciated) { if (!webBrowserAlreadyInstanciated) {
(*mCurrentWebBrowser)->loadUrl(url); (*mCurrentWebBrowser)->loadUrl(url);
} }
......
...@@ -270,28 +270,6 @@ void WBBrowserWindow::setupToolBarForTutorial() ...@@ -270,28 +270,6 @@ void WBBrowserWindow::setupToolBarForTutorial()
if (tb && tb->menu()) if (tb && tb->menu())
tb->setMenu(NULL); tb->setMenu(NULL);
} }
// mTabWidget->addWebAction(mUniboardMainWindow->actionWebReload, QWebPage::Reload);
// mTabWidget->addWebAction(mUniboardMainWindow->actionStopLoading, QWebPage::Stop);
// mWebToolBar->insertWidget(mUniboardMainWindow->actionWebBigger, mTabWidget->lineEditStack());
// mSearchToolBar = new WBToolbarSearch(mWebToolBar);
// mSearchAction = mWebToolBar->insertWidget(mUniboardMainWindow->actionWebBigger, mSearchToolBar);
// connect(mSearchToolBar, SIGNAL(search(const QUrl&)), SLOT(loadUrl(const QUrl&)));
// mChaseWidget = new WBChaseWidget(this);
// mWebToolBar->insertWidget(mUniboardMainWindow->actionWebBigger, mChaseWidget);
// mWebToolBar->insertSeparator(mUniboardMainWindow->actionWebBigger);
// connect(mUniboardMainWindow->actionHome, SIGNAL(triggered()), this , SLOT(slotHome()));
// connect(mUniboardMainWindow->actionBookmarks, SIGNAL(triggered()), this , SLOT(bookmarks()));
// connect(mUniboardMainWindow->actionAddBookmark, SIGNAL(triggered()), this , SLOT(addBookmark()));
// connect(mUniboardMainWindow->actionWebBigger, SIGNAL(triggered()), this , SLOT(slotViewZoomIn()));
// connect(mUniboardMainWindow->actionWebSmaller, SIGNAL(triggered()), this , SLOT(slotViewZoomOut()));
mWebToolBar->show(); mWebToolBar->show();
} }
......
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