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

preferencesAboutTextFull
bmagnin 12 years ago
commit 94d91bb489
  1. 4
      resources/i18n/sankore_fr.ts
  2. 4
      resources/i18n/sankore_fr_CH.ts
  3. 8
      src/adaptors/UBSvgSubsetAdaptor.cpp
  4. 50
      src/domain/UBGraphicsWidgetItem.cpp
  5. 1
      src/domain/UBGraphicsWidgetItem.h

@ -377,7 +377,7 @@
</message>
<message>
<source>Show Desktop</source>
<translation>Afficher le bureau</translation>
<translation>Bureau</translation>
</message>
<message>
<source>Ctrl+Shift+H</source>
@ -1961,7 +1961,7 @@ Voulez-vous ignorer les erreurs pour ce serveur ?</translation>
</message>
<message>
<source>Add a link</source>
<translation>Ajouter un lien.web</translation>
<translation>Ajouter un lien web</translation>
</message>
<message>
<source>Page: %0</source>

@ -377,7 +377,7 @@
</message>
<message>
<source>Show Desktop</source>
<translation>Afficher le bureau</translation>
<translation>Bureau</translation>
</message>
<message>
<source>Ctrl+Shift+H</source>
@ -1961,7 +1961,7 @@ Voulez-vous ignorer les erreurs pour ce serveur ?</translation>
</message>
<message>
<source>Add a link</source>
<translation>Ajouter un lien.web</translation>
<translation>Ajouter un lien web</translation>
</message>
<message>
<source>Page: %0</source>

@ -1229,10 +1229,10 @@ bool UBSvgSubsetAdaptor::UBSvgSubsetWriter::persistScene(int pageIndex)
//disabling g section parsing as a group of elements. Use groups refs instead
// mXmlWriter.writeStartElement("g");
// mXmlWriter.writeAttribute(UBSettings::uniboardDocumentNamespaceUri, "uuid", UBStringUtils::toCanonicalUuid(strokesGroupItem->uuid()));
QMatrix matrix = item->sceneMatrix();
if (!matrix.isIdentity()){
mXmlWriter.writeAttribute("transform", toSvgTransform(matrix));
}
// QMatrix matrix = item->sceneMatrix();
// if (!matrix.isIdentity()){
// mXmlWriter.writeAttribute("transform", toSvgTransform(matrix));
// }
// Add the polygons
foreach(QGraphicsItem* item, strokesGroupItem->childItems()){

@ -113,6 +113,7 @@ void UBGraphicsWidgetItem::initialize()
connect(page()->mainFrame(), SIGNAL(javaScriptWindowObjectCleared()), this, SLOT(javaScriptWindowObjectCleared()));
connect(page(), SIGNAL(geometryChangeRequested(const QRect&)), this, SLOT(geometryChangeRequested(const QRect&)));
connect(this, SIGNAL(loadFinished(bool)), this, SLOT(mainFrameLoadFinished (bool)));
connect(page()->mainFrame(), SIGNAL(initialLayoutCompleted()), this, SLOT(initialLayoutCompleted()));
connect(page(), SIGNAL(linkClicked(const QUrl&)), this, SLOT(onLinkClicked(const QUrl&)));
}
@ -121,6 +122,11 @@ void UBGraphicsWidgetItem::onLinkClicked(const QUrl& url)
UBApplication::webController->loadUrl(url);
}
void UBGraphicsWidgetItem::initialLayoutCompleted()
{
mInitialLoadDone = true;
}
QUrl UBGraphicsWidgetItem::mainHtml()
{
return mMainHtmlUrl;
@ -564,40 +570,33 @@ void UBGraphicsWidgetItem::injectInlineJavaScript()
void UBGraphicsWidgetItem::paint( QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{
if (scene() && scene()->renderingContext() != UBGraphicsScene::Screen)
{
if (scene() && scene()->renderingContext() != UBGraphicsScene::Screen) {
painter->drawPixmap(0, 0, snapshot());
}
else
{
if (!mInitialLoadDone || mLoadIsErronous)
{
QString message;
else {
QGraphicsWebView::paint(painter, option, widget);
}
if (mInitialLoadDone && mLoadIsErronous)
message = tr("Cannot load content");
else
message = tr("Loading ...");
if (!mInitialLoadDone) {
QString message;
painter->setFont(QFont("Arial", 12));
message = tr("Loading ...");
QFontMetrics fm = painter->fontMetrics();
QRect txtBoundingRect = fm.boundingRect(message);
painter->setFont(QFont("Arial", 12));
txtBoundingRect.moveCenter(rect().center().toPoint());
txtBoundingRect.adjust(-10, -5, 10, 5);
QFontMetrics fm = painter->fontMetrics();
QRect txtBoundingRect = fm.boundingRect(message);
painter->setPen(Qt::NoPen);
painter->setBrush(UBSettings::paletteColor);
painter->drawRoundedRect(txtBoundingRect, 3, 3);
txtBoundingRect.moveCenter(rect().center().toPoint());
txtBoundingRect.adjust(-10, -5, 10, 5);
painter->setPen(Qt::white);
painter->drawText(rect(), Qt::AlignCenter, message);
}
else
QGraphicsWebView::paint(painter, option, widget);
}
painter->setPen(Qt::NoPen);
painter->setBrush(UBSettings::paletteColor);
painter->drawRoundedRect(txtBoundingRect, 3, 3);
painter->setPen(Qt::white);
painter->drawText(rect(), Qt::AlignCenter, message);
}
}
void UBGraphicsWidgetItem::geometryChangeRequested(const QRect& geom)
@ -618,7 +617,6 @@ void UBGraphicsWidgetItem::javaScriptWindowObjectCleared()
void UBGraphicsWidgetItem::mainFrameLoadFinished (bool ok)
{
mInitialLoadDone = true;
mLoadIsErronous = !ok;
update(boundingRect());
takeSnapshot();

@ -163,6 +163,7 @@ class UBGraphicsWidgetItem : public QGraphicsWebView, public UBItem, public UBRe
private slots:
void onLinkClicked(const QUrl& url);
void initialLayoutCompleted();
private:
bool mIsFrozen;

Loading…
Cancel
Save