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