X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=src%2Fmdictionary%2Fgui%2FAboutWidget.cpp;h=1d0516eeef5ca417328404b23d34c541343da0c9;hb=97d38e49e5466769cf74644ee9fa2c668f39ed9c;hp=1a4763a4806397bb02f462a586a0239746b1786f;hpb=ed7ccbdc8c2fb4367bbbfb4c8d335aa2e037869b;p=mdictionary diff --git a/src/mdictionary/gui/AboutWidget.cpp b/src/mdictionary/gui/AboutWidget.cpp index 1a4763a..1d0516e 100644 --- a/src/mdictionary/gui/AboutWidget.cpp +++ b/src/mdictionary/gui/AboutWidget.cpp @@ -18,14 +18,43 @@ Copyright 2010 Comarch S.A. *******************************************************************************/ -//! \file AboutWidget.cpp -//! \brief Simple "about" widget - product, company, license info -//! \author Bartosz Szatkowski +/*! \file AboutWidget.cpp + \brief Simple "about" widget - product, company, license info + + \author Bartosz Szatkowski +*/ #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("src/mdictionary/qml/AboutWidget.qml")); + view->setResizeMode(QDeclarativeView::SizeRootObjectToView); + view->setAlignment(Qt::AlignCenter); + view->show(); + + /* QDeclarativeView *view2 = new QDeclarativeView(); + view2->setSource(QUrl("src/mdictionary/qml/TranslationView.qml")); + view2->setResizeMode(QDeclarativeView::SizeRootObjectToView); + view2->setAlignment(Qt::AlignCenter); + view2->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 = "

mDictionary

"; comarchNote = "
Maemo/Meego Multilingual Dictionary
"; @@ -35,16 +64,16 @@ AboutWidget::AboutWidget(GUIInterface *parent): QDialog(parent) comarchNote += "
" "Report bug"; licenseNote = QString("

This program is free" - "software: you can redistribute it and/or modify\n" + " software: you can redistribute it and/or modify\n" "it under the terms of the GNU General Public License as" - "published by\n" + " published by\n" "the Free Software Foundation, either version 3 of the License," - "or\n" + " or\n" "(at your option) any later version.
" "This program is distributed in the hope that it will be" - "useful,\n" + " useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty" - "of\n" + " of\n" "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. " "See the\n" "GNU General Public License for more details.
" @@ -54,20 +83,8 @@ AboutWidget::AboutWidget(GUIInterface *parent): QDialog(parent) "<" "http://www.gnu.org/licenses/>." "

"); - - 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; @@ -92,18 +109,11 @@ AboutWidget::AboutWidget(GUIInterface *parent): QDialog(parent) 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); }