Copyright 2010 Comarch S.A.
*******************************************************************************/
-//! \file AboutWidget.cpp
-//! \brief Simple "about" widget - product, company, license info
-//! \author Bartosz Szatkowski <bulislaw@linux.com>
+/*! \file AboutWidget.cpp
+ \brief Simple "about" widget - product, company, license info
+
+ \author Bartosz Szatkowski <bulislaw@linux.com>
+*/
#include "AboutWidget.h"
+
AboutWidget::AboutWidget(GUIInterface *parent): QDialog(parent)
{
+ setWindowTitle(tr("About"));
+
+#ifndef Q_WS_MAEMO_5
+ resize(380,450);
+
+ view= new QDeclarativeView();
+ view->setSource(QUrl::fromLocalFile("/usr/share/mdictionary/qml/AboutWidget.qml"));
+ view->setResizeMode(QDeclarativeView::SizeRootObjectToView);
+ view->setAlignment(Qt::AlignCenter);
+ view->show();
+
+ mainLayout = new QVBoxLayout;
+ mainLayout->addWidget(view);
+
+ QGraphicsObject *rootObject = view->rootObject();
+ connect(rootObject, SIGNAL(linkClicked(QString)), this, SLOT(openUrl(QString)));
+ this->setLayout(mainLayout);
+
+#else
setModal(true);
QString infoNote, licenseNote, comarchNote;
infoNote = "<center><h2><u>mDictionary</u></h2></center>";
"<<a href=\"http://www.gnu.org/licenses/\">"
"http://www.gnu.org/licenses/</a>>."
"</p></font>");
-
- setWindowTitle(tr("About"));
mainLayout = new QVBoxLayout;
- /*on desktop we place all content in scroll area, on maemo by default all
- widgets that are in menu are placed in scroll area created by menu, so we
- don't have to do it here*/
- #ifndef Q_WS_MAEMO_5
- scrollLayout = new QVBoxLayout;
- scroll = new QScrollArea;
- w = new QWidget(this);
- #endif
-
-
imageLabel = new QLabel;
mainLabel = new QLabel;
licenseLabel = new QLabel;
mainLayout->addWidget(mainLabel, 0, Qt::AlignHCenter);
mainLayout->addWidget(licenseLabel, 0, Qt::AlignHCenter);
- //add content to scroll area, and remove fram from it
- #ifndef Q_WS_MAEMO_5
- w->setLayout(mainLayout);
- scroll->setWidget(w);
- scroll->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
- scrollLayout->addWidget(scroll, 0, Qt::AlignHCenter);
- this->setLayout(scrollLayout);
- w->setMinimumSize(img.width()*1.6, img.height()*2.45);
- scroll->setLineWidth(0);
- scroll->setMidLineWidth(0);
- scroll->setFrameStyle(QFrame::NoFrame);;
- #else
- setLayout(mainLayout);
- #endif
+ setLayout(mainLayout);
+#endif
+}
+
+
+void AboutWidget::openUrl(QString url){
+ QDesktopServices::openUrl(url);
}