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

preferencesAboutTextFull
Ilia Ryabokon 12 years ago
commit c7c978bed7
  1. 12
      src/board/UBBoardView.cpp
  2. 2
      src/board/UBBoardView.h
  3. 20
      src/domain/UBGraphicsStrokesGroup.cpp
  4. 3
      src/domain/UBGraphicsStrokesGroup.h
  5. 18
      src/gui/UBTeacherGuideWidget.cpp

@ -600,7 +600,7 @@ void UBBoardView::handleItemMousePress(QMouseEvent *event)
mLastPressedMousePos = mapToScene(event->pos()); mLastPressedMousePos = mapToScene(event->pos());
if (movingItem && QGraphicsSvgItem::Type != movingItem->type() if (movingItem && !hasSelectedParents(movingItem) && QGraphicsSvgItem::Type != movingItem->type()
&& UBGraphicsDelegateFrame::Type != movingItem->type() && UBGraphicsDelegateFrame::Type != movingItem->type()
&& !mMultipleSelectionIsEnabled) && !mMultipleSelectionIsEnabled)
{ {
@ -1414,3 +1414,13 @@ UBBoardView::setToolCursor (int tool)
controlViewport->setCursor (UBResources::resources ()->penCursor); controlViewport->setCursor (UBResources::resources ()->penCursor);
} }
} }
bool UBBoardView::hasSelectedParents(QGraphicsItem * item)
{
if (item->isSelected())
return true;
if (item->parentItem()==NULL)
return false;
return hasSelectedParents(item->parentItem());
}

@ -149,6 +149,8 @@ class UBBoardView : public QGraphicsView
bool mMultipleSelectionIsEnabled; bool mMultipleSelectionIsEnabled;
bool isControl; bool isControl;
static bool hasSelectedParents(QGraphicsItem * item);
private slots: private slots:
void settingChanged(QVariant newValue); void settingChanged(QVariant newValue);

@ -115,3 +115,23 @@ QVariant UBGraphicsStrokesGroup::itemChange(GraphicsItemChange change, const QVa
QVariant newValue = mDelegate->itemChange(change, value); QVariant newValue = mDelegate->itemChange(change, value);
return QGraphicsItemGroup::itemChange(change, newValue); return QGraphicsItemGroup::itemChange(change, newValue);
} }
QPainterPath UBGraphicsStrokesGroup::shape () const
{
QPainterPath path;
if (isSelected())
{
path.addRect(boundingRect());
}
else
{
foreach(QGraphicsItem* item, childItems())
{
path.addPath(item->shape());
}
}
return path;
}

@ -25,6 +25,9 @@ public:
virtual void setUuid(const QUuid &pUuid); virtual void setUuid(const QUuid &pUuid);
protected: protected:
virtual QPainterPath shape () const;
virtual void mousePressEvent(QGraphicsSceneMouseEvent *event); virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);
virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event); virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);

@ -879,17 +879,21 @@ void UBTeacherGuidePageZeroWidget::fillComboBoxes()
parametersFile.close(); parametersFile.close();
QStringList licences; QStringList licences;
licences << tr("Attribution CC BY") << tr("Attribution-NoDerivs CC BY-ND") licences << tr("Attribution CC BY")
<< tr("Attribution-NoDerivs CC BY-ND")
<< tr("Attribution-ShareAlike CC BY-SA") << tr("Attribution-ShareAlike CC BY-SA")
<< tr("Attribution-NonCommercial CC BY-NC") << tr("Attribution-NonCommercial CC BY-NC")
<< tr("Attribution-NonCommercial-NoDerivs CC BY-NC-ND") << tr("Attribution-NonCommercial-NoDerivs CC BY-NC-ND")
<< tr("Attribution-NonCommercial-ShareAlike CC BY-NC-SA") << tr("Attribution-NonCommercial-ShareAlike CC BY-NC-SA")
<< tr("Public domain") << tr("Copyright"); << tr("Public domain")
<< tr("Copyright");
mpLicenceBox->addItems(licences); mpLicenceBox->addItems(licences);
QStringList licenceIconList; QStringList licenceIconList;
licenceIconList << ":images/licenses/ccby.png" licenceIconList << ":images/licenses/ccby.png"
<< ":images/licenses/ccbynd.png" << ":images/licenses/ccbysa.png" << ":images/licenses/ccbynd.png"
<< ":images/licenses/ccbync.png" << ":images/licenses/ccbyncnd.png" << ":images/licenses/ccbysa.png"
<< ":images/licenses/ccbync.png"
<< ":images/licenses/ccbyncnd.png"
<< ":images/licenses/ccbyncsa.png"; << ":images/licenses/ccbyncsa.png";
for (int i = 0; i < licenceIconList.count(); i += 1) for (int i = 0; i < licenceIconList.count(); i += 1)
mpLicenceBox->setItemData(i, licenceIconList.at(i)); mpLicenceBox->setItemData(i, licenceIconList.at(i));
@ -945,7 +949,7 @@ void UBTeacherGuidePageZeroWidget::loadData()
currentIndex = mpSchoolTypeBox->findText(documentProxy->metaData(UBSettings::sessionType).toString()); currentIndex = mpSchoolTypeBox->findText(documentProxy->metaData(UBSettings::sessionType).toString());
mpSchoolTypeBox->setCurrentIndex((currentIndex != -1) ? currentIndex : 0); mpSchoolTypeBox->setCurrentIndex((currentIndex != -1) ? currentIndex : 0);
currentIndex = mpLicenceBox->findText(documentProxy->metaData(UBSettings::sessionLicence).toString()); currentIndex = documentProxy->metaData(UBSettings::sessionLicence).toInt();
mpLicenceBox->setCurrentIndex((currentIndex != -1) ? currentIndex : 0); mpLicenceBox->setCurrentIndex((currentIndex != -1) ? currentIndex : 0);
} }
@ -962,7 +966,7 @@ void UBTeacherGuidePageZeroWidget::persistData()
documentProxy->setMetaData(UBSettings::sessionGradeLevel, mpSchoolLevelBox->currentText()); documentProxy->setMetaData(UBSettings::sessionGradeLevel, mpSchoolLevelBox->currentText());
documentProxy->setMetaData(UBSettings::sessionSubjects, mpSchoolSubjectsBox->currentText()); documentProxy->setMetaData(UBSettings::sessionSubjects, mpSchoolSubjectsBox->currentText());
documentProxy->setMetaData(UBSettings::sessionType, mpSchoolTypeBox->currentText()); documentProxy->setMetaData(UBSettings::sessionType, mpSchoolTypeBox->currentText());
documentProxy->setMetaData(UBSettings::sessionLicence, mpLicenceBox->currentText()); documentProxy->setMetaData(UBSettings::sessionLicence, mpLicenceBox->currentIndex());
} }
} }
@ -1087,7 +1091,7 @@ QVector<tUBGEElementNode*> UBTeacherGuidePageZeroWidget::getData()
elementNode = new tUBGEElementNode(); elementNode = new tUBGEElementNode();
elementNode->name = "licence"; elementNode->name = "licence";
elementNode->attributes.insert("value", mpLicenceBox->currentText()); elementNode->attributes.insert("value", QString("%1").arg(mpLicenceBox->currentIndex()));
result << elementNode; result << elementNode;
return result; return result;
} }

Loading…
Cancel
Save