Commit 4d00fc55 authored by Aleksei Kanash's avatar Aleksei Kanash

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

parents c36f903f 363d37ec
......@@ -4,6 +4,7 @@ html, body{
margin: 0;
padding: 0;
border-radius: 50px;
overflow: hidden;
}
body{
......@@ -212,6 +213,7 @@ li>div{
.real_text{
width: 100%;
height: 100%;
word-wrap: break-word;
}
.block_border{
......@@ -357,7 +359,6 @@ li>div{
#wgt_name{
height: 44px;
width: 200px;
margin: 10px 10px 0 10px;
padding: 0;
float: left;
......@@ -366,9 +367,8 @@ li>div{
color: #8c5730;
}
#wgt_reload, #wgt_edit, #wgt_display{
#wgt_reload, #wgt_edit, #wgt_display, #wgt_help{
cursor: pointer;
width: 80px;
height: 44px;
margin: 10px 10px 0 0;
float: right;
......@@ -378,7 +378,6 @@ li>div{
}
#wgt_display{
width: 100px;
padding-left: 40px;
background-image: url(../img/slate-edit.png);
background-repeat: no-repeat;
......@@ -387,7 +386,6 @@ li>div{
}
#wgt_edit{
width: 100px;
padding-left: 40px;
background-image: url(../img/slate-edit.png);
background-repeat: no-repeat;
......@@ -479,4 +477,28 @@ li>div{
background-color: #333 !important;
color: white !important;
background-image: url(../img/ar_down_white.png) !important;
}
.pad_help{
background-image: url(../img/slate-help-white.png) !important;
}
#wgt_help{
padding-left: 32px;
background-image: url(../img/slate-help.png);
background-repeat: no-repeat;
background-position: top 0;
}
#help{
width: 100%;
height: 100%;
overflow: auto;
display: none;
background-color: #ccc;
padding: 5px 0 5px 5px;
}
.open{
}
\ No newline at end of file
......@@ -48,7 +48,8 @@
<tr style="height: 54px;">
<td class="b_top_left">&nbsp;</td>
<td class="b_top_center">
<div id="wgt_name"></div>
<div id="wgt_name"></div>
<div id="wgt_help"></div>
<div id="wgt_display" class="selected"></div>
<div id="wgt_edit"></div>
<select class="style_select">
......@@ -59,10 +60,11 @@
</td>
<td class="b_top_right">&nbsp;</td>
</tr>
<tr>
<td class="b_center_left">&nbsp;</td>
<td>
<div id="help"></div>
<div id="slider">
<ul>
</ul>
......@@ -72,7 +74,7 @@
</td>
<td class="b_center_right">&nbsp;</td>
</tr>
<tr style="height: 54px;">
<td class="b_bottom_left">&nbsp;</td>
<td class="b_bottom_center">&nbsp;</td>
......
......@@ -22,7 +22,8 @@
<tr style="height: 54px;">
<td class="b_top_left">&nbsp;</td>
<td class="b_top_center">
<div id="wgt_name"></div>
<div id="wgt_name"></div>
<div id="wgt_help"></div>
<div id="wgt_display" class="selected"></div>
<div id="wgt_edit"></div>
<select class="style_select">
......@@ -33,10 +34,11 @@
</td>
<td class="b_top_right">&nbsp;</td>
</tr>
<tr>
<td class="b_center_left">&nbsp;</td>
<td>
<div id="help"></div>
<div id="slider">
<ul>
</ul>
......@@ -46,7 +48,7 @@
</td>
<td class="b_center_right">&nbsp;</td>
</tr>
<tr style="height: 54px;">
<td class="b_bottom_left">&nbsp;</td>
<td class="b_bottom_center">&nbsp;</td>
......
......@@ -22,7 +22,8 @@
<tr style="height: 54px;">
<td class="b_top_left">&nbsp;</td>
<td class="b_top_center">
<div id="wgt_name"></div>
<div id="wgt_name"></div>
<div id="wgt_help"></div>
<div id="wgt_display" class="selected"></div>
<div id="wgt_edit"></div>
<select class="style_select">
......@@ -33,10 +34,11 @@
</td>
<td class="b_top_right">&nbsp;</td>
</tr>
<tr>
<td class="b_center_left">&nbsp;</td>
<td>
<div id="help"></div>
<div id="slider">
<ul>
</ul>
......@@ -46,7 +48,7 @@
</td>
<td class="b_center_right">&nbsp;</td>
</tr>
<tr style="height: 54px;">
<td class="b_bottom_left">&nbsp;</td>
<td class="b_bottom_center">&nbsp;</td>
......
......@@ -65,6 +65,10 @@ class UBDrawingController : public QObject
mIsDesktopMode = mode;
}
bool isInDesktopMode(){
return mIsDesktopMode;
}
public slots:
void setStylusTool(int tool);
......
......@@ -779,7 +779,7 @@ void UBGraphicsScene::eraseLineTo(const QPointF &pEndPoint, const qreal &pWidth)
if (mShouldUseOMP)
{
//#pragma omp parallel for
#pragma omp parallel for
for (int i = 0; i < collidItemsSize; i++)
{
UBGraphicsPolygonItem *collidingPolygonItem = qgraphicsitem_cast<UBGraphicsPolygonItem*>(collidItems.at(i));
......@@ -789,7 +789,7 @@ void UBGraphicsScene::eraseLineTo(const QPointF &pEndPoint, const qreal &pWidth)
if(eraserInnerRect.contains(collidingPolygonItem->boundingRect()))
{
//#pragma omp critical
#pragma omp critical
// Put the entire polygon into the remove list
toBeRemovedItems << collidingPolygonItem;
}
......@@ -826,7 +826,7 @@ void UBGraphicsScene::eraseLineTo(const QPointF &pEndPoint, const qreal &pWidth)
}
else */if (croppedPathSimplified.isEmpty())
{
//#pragma omp critical
#pragma omp critical
// Put the entire polygon into the remove list if the eraser removes all its visible content
toBeRemovedItems << collidingPolygonItem;
}
......@@ -837,7 +837,7 @@ void UBGraphicsScene::eraseLineTo(const QPointF &pEndPoint, const qreal &pWidth)
foreach(const QPolygonF &pol, croppedPathSimplified.toFillPolygons())
{
UBGraphicsPolygonItem* croppedPolygonItem = collidingPolygonItem->deepCopy(pol);
//#pragma omp critical
#pragma omp critical
if(NULL != pGroup){
croppedPolygonItem->setStrokesGroup(pGroup);
//pGroup->addToGroup(croppedPolygonItem);
......@@ -845,7 +845,7 @@ void UBGraphicsScene::eraseLineTo(const QPointF &pEndPoint, const qreal &pWidth)
// Add this new polygon to the 'added' list
toBeAddedItems << croppedPolygonItem;
}
//#pragma omp critical
#pragma omp critical
// Remove the original polygonitem because it has been replaced by many smaller polygons
toBeRemovedItems << collidingPolygonItem;
}
......@@ -902,7 +902,7 @@ void UBGraphicsScene::eraseLineTo(const QPointF &pEndPoint, const qreal &pWidth)
}
}
if(eDrawingMode_Vector == UBDrawingController::drawingController()->drawingMode()){
if(eDrawingMode_Vector == DRAWING_MODE && !UBDrawingController::drawingController()->isInDesktopMode()){
foreach(QGraphicsItem* item, toBeRemovedItems){
UBGraphicsPolygonItem* poly = dynamic_cast<UBGraphicsPolygonItem*>(item);
if(NULL != poly){
......@@ -920,7 +920,7 @@ void UBGraphicsScene::eraseLineTo(const QPointF &pEndPoint, const qreal &pWidth)
mRemovedItems += toBeRemovedItems;
}
if(eDrawingMode_Vector == UBDrawingController::drawingController()->drawingMode()){
if(eDrawingMode_Vector == DRAWING_MODE && !UBDrawingController::drawingController()->isInDesktopMode()){
foreach(QGraphicsItem* item, toBeAddedItems){
UBGraphicsPolygonItem* poly = dynamic_cast<UBGraphicsPolygonItem*>(item);
if(NULL != poly && NULL != poly->strokesGroup()){
......
......@@ -231,7 +231,6 @@ void UBActionPalette::mouseReleaseEvent(QMouseEvent * event)
void UBActionPalette::actionChanged()
{
emit itemOnActionPaletteChanged();
for(int i = 0; i < mActions.length() && i < mButtons.length(); i++)
{
mButtons.at(i)->setVisible(mActions.at(i)->isVisible());
......
......@@ -61,7 +61,6 @@ class UBActionPalette : public UBFloatingPalette
void closed();
void buttonGroupClicked(int id);
void customMouseReleased();
void itemOnActionPaletteChanged();
protected:
virtual void paintEvent(QPaintEvent *event);
......
......@@ -1100,6 +1100,7 @@ UBTeacherGuideWidget::UBTeacherGuideWidget(QWidget* parent, const char* name) :
, mpPageZeroWidget(NULL)
, mpEditionWidget(NULL)
, mpPresentationWidget(NULL)
, mKeyboardActionFired(false)
{
setObjectName(name);
if (UBSettings::settings()->teacherGuidePageZeroActivated->get().toBool()) {
......@@ -1113,11 +1114,9 @@ UBTeacherGuideWidget::UBTeacherGuideWidget(QWidget* parent, const char* name) :
addWidget(mpPresentationWidget);
}
connect(UBApplication::boardController->controlView(),
SIGNAL(clickOnBoard()), this, SLOT(showPresentationMode()));
connect(UBApplication::boardController->controlView(), SIGNAL(clickOnBoard()), this, SLOT(showPresentationMode()));
connectToStylusPalette();
connect(UBApplication::boardController, SIGNAL(activeSceneChanged()), this,
SLOT(onActiveSceneChanged()));
connect(UBApplication::boardController, SIGNAL(activeSceneChanged()), this, SLOT(onActiveSceneChanged()));
}
UBTeacherGuideWidget::~UBTeacherGuideWidget()
......@@ -1138,12 +1137,38 @@ void UBTeacherGuideWidget::onActiveSceneChanged()
}
#include "core/UBApplication.h"
#include "gui/UBMainWindow.h"
void UBTeacherGuideWidget::onTriggeredAction(bool checked)
{
Q_UNUSED(checked);
if(!mKeyboardActionFired)
showPresentationMode();
mKeyboardActionFired=false;
}
void UBTeacherGuideWidget::onTriggeredKeyboardAction(bool checked)
{
Q_UNUSED(checked);
mKeyboardActionFired = true;
}
void UBTeacherGuideWidget::connectToStylusPalette()
{
if (UBApplication::boardController->paletteManager())
connect( UBApplication::boardController->paletteManager()->stylusPalette(), SIGNAL(itemOnActionPaletteChanged()), this, SLOT(showPresentationMode()));
else
QTimer::singleShot(100, this, SLOT(connectToStylusPalette()));
connect(UBApplication::mainWindow->actionPen, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionEraser, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionMarker, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionPointer, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionPlay, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionZoomIn, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionZoomOut, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionCapture, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionHand, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionLine, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionText, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionSelector, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionVirtualKeyboard, SIGNAL(triggered(bool)), this, SLOT(onTriggeredKeyboardAction(bool)));
}
void UBTeacherGuideWidget::showPresentationMode()
......
......@@ -214,6 +214,11 @@ private:
UBTeacherGuideEditionWidget* mpEditionWidget;
UBTeacherGuidePresentationWidget* mpPresentationWidget;
QVector<tUBGEElementNode*>mCurrentData;
bool mKeyboardActionFired;
private slots:
void onTriggeredAction(bool checked);
void onTriggeredKeyboardAction(bool checked);
};
#endif // UBTEACHERGUIDEWIDGET_H
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