1717#include " qgsproject.h"
1818#include " qgisapp.h"
1919#include " qgsversioninfo.h"
20+ #include " qgsapplication.h"
2021
2122#include < QHBoxLayout>
2223#include < QVBoxLayout>
2324#include < QListView>
2425#include < QSettings>
26+ #include < QDesktopServices>
2527
2628QgsWelcomePage::QgsWelcomePage ( QWidget* parent )
2729 : QWidget( parent )
@@ -38,25 +40,30 @@ QgsWelcomePage::QgsWelcomePage( QWidget* parent )
3840 QListView* welcomeScreenListView = new QListView ();
3941 mModel = new QgsWelcomePageItemsModel ();
4042 welcomeScreenListView->setModel ( mModel );
43+ welcomeScreenListView->setSizePolicy (QSizePolicy::Ignored, QSizePolicy::Ignored);
4144 layout->addWidget ( welcomeScreenListView );
4245 welcomeScreenListView->setStyleSheet ( " QListView::item {"
4346 " margin-top: 5px;"
4447 " margin-bottom: 5px;"
4548 " margin-left: 15px;"
4649 " margin-right: 15px;"
4750 " border-width: 1px;"
48- " border-color: #535353 ;"
51+ " border-color: #999 ;"
4952 " border-radius: 9px;"
50- " background: #cccccc ;"
53+ " background: #eee ;"
5154 " padding: 10px;"
5255 " }"
5356 " QListView::item:selected:active {"
5457 " background: #aaaaaa;"
5558 " }" );
5659
57- QgsWebView* webView = new QgsWebView ();
58- webView->setUrl ( QUrl ( " http://blog.qgis.org" ) );
59- layout->addWidget ( webView );
60+ QgsWebView* whatsNewPage = new QgsWebView ();
61+ whatsNewPage->setUrl ( QUrl::fromLocalFile ( QgsApplication::whatsNewFilePath () ) );
62+ whatsNewPage->page ()->setLinkDelegationPolicy ( QWebPage::DelegateAllLinks );
63+ whatsNewPage->setContextMenuPolicy ( Qt::NoContextMenu );
64+ whatsNewPage->setSizePolicy (QSizePolicy::Ignored, QSizePolicy::Ignored);
65+ layout->addWidget ( whatsNewPage );
66+ connect ( whatsNewPage, SIGNAL (linkClicked (QUrl)), this , SLOT (whatsNewLinkClicked (QUrl)));
6067
6168 mVersionInformation = new QLabel;
6269 mainLayout->addWidget ( mVersionInformation );
@@ -84,7 +91,7 @@ void QgsWelcomePage::versionInfoReceived()
8491 QgsVersionInfo* versionInfo = qobject_cast<QgsVersionInfo*>( sender () );
8592 Q_ASSERT ( versionInfo );
8693
87- if ( versionInfo->isDevelopmentVersion () )
94+ if ( versionInfo->newVersionAvailable () )
8895 {
8996 mVersionInformation ->setVisible ( true );
9097 mVersionInformation ->setText ( QString ( " <b>%1</b>: %2" )
@@ -96,3 +103,8 @@ void QgsWelcomePage::versionInfoReceived()
96103 " }" );
97104 }
98105}
106+
107+ void QgsWelcomePage::whatsNewLinkClicked (const QUrl& url)
108+ {
109+ QDesktopServices::openUrl ( url );
110+ }
0 commit comments