Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
about: make the SHA a link to github
  • Loading branch information
jef-n committed May 20, 2015
1 parent a2a5e97 commit 3eb4af3
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 31 deletions.
2 changes: 1 addition & 1 deletion src/app/qgisapp.cpp
Expand Up @@ -2767,7 +2767,7 @@ void QgisApp::about()

versionString += "<tr>";
versionString += "<td>" + tr( "QGIS version" ) + "</td><td>" + QGis::QGIS_VERSION + "</td>";
versionString += "<td>" + tr( "QGIS code revision" ) + "</td><td>" + QGis::QGIS_DEV_VERSION + "</td>";
versionString += "<td>" + tr( "QGIS code revision" ) + QString( "</td><td><a href=\"https://github.com/qgis/QGIS/commit/%1\">%1</a></td>" ).arg( QGis::QGIS_DEV_VERSION );

versionString += "</tr><tr>";

Expand Down
32 changes: 10 additions & 22 deletions src/app/qgsabout.cpp
Expand Up @@ -39,8 +39,7 @@ QgsAbout::QgsAbout( QWidget *parent )
#endif
{
setupUi( this );
QString title = QString( "%1 - %2 Bit" ).arg( windowTitle() ).arg( QSysInfo::WordSize );
initOptionsBase( true, title );
initOptionsBase( true, QString( "%1 - %2 Bit" ).arg( windowTitle() ).arg( QSysInfo::WordSize ) );
init();
}

Expand All @@ -55,9 +54,7 @@ void QgsAbout::init()
// check internet connection in order to hide/show the developers map widget
int DEVELOPERS_MAP_INDEX = 5;
QTcpSocket socket;
QString host = "qgis.org";
int port = 80;
socket.connectToHost( host, port );
socket.connectToHost( "qgis.org", 80 );
if ( socket.waitForConnected( 1000 ) )
setDevelopersMap();
else
Expand All @@ -66,6 +63,8 @@ void QgsAbout::init()
developersMapView->page()->setLinkDelegationPolicy( QWebPage::DelegateAllLinks );
developersMapView->setContextMenuPolicy( Qt::NoContextMenu );

connect( developersMapView, SIGNAL( linkClicked( const QUrl & ) ), this, SLOT( openUrl( const QUrl & ) ) );

// set the 60x60 icon pixmap
QPixmap icon( QgsApplication::iconsPath() + "qgis-icon-60x60.png" );
qgisIcon->setPixmap( icon );
Expand Down Expand Up @@ -176,9 +175,8 @@ void QgsAbout::init()
donorsHTML += "</table>";
#endif

QString myStyle = QgsApplication::reportStyleSheet();
txtDonors->clear();
txtDonors->document()->setDefaultStyleSheet( myStyle );
txtDonors->document()->setDefaultStyleSheet( QgsApplication::reportStyleSheet() );
txtDonors->setHtml( donorsHTML );
QgsDebugMsg( QString( "donorsHTML:%1" ).arg( donorsHTML.toAscii().constData() ) );
}
Expand Down Expand Up @@ -218,8 +216,7 @@ void QgsAbout::setLicence()
#endif
if ( licenceFile.open( QIODevice::ReadOnly ) )
{
QString content = licenceFile.readAll();
txtLicense->setText( content );
txtLicense->setText( licenceFile.readAll() );
}
}

Expand All @@ -232,9 +229,8 @@ void QgsAbout::setVersion( QString v )

void QgsAbout::setWhatsNew()
{
QString myStyle = QgsApplication::reportStyleSheet();
txtWhatsNew->clear();
txtWhatsNew->document()->setDefaultStyleSheet( myStyle );
txtWhatsNew->document()->setDefaultStyleSheet( QgsApplication::reportStyleSheet() );
txtWhatsNew->setSource( "file:///" + QgsApplication::pkgDataPath() + "/doc/news.html" );
}

Expand Down Expand Up @@ -273,17 +269,15 @@ void QgsAbout::setPluginInfo()

void QgsAbout::on_btnQgisUser_clicked()
{
// find a browser
QString url = "http://lists.osgeo.org/mailman/listinfo/qgis-user";
openUrl( url );
openUrl( QString( "http://lists.osgeo.org/mailman/listinfo/qgis-user" ) );
}

void QgsAbout::on_btnQgisHome_clicked()
{
openUrl( "http://qgis.org" );
openUrl( QString( "http://qgis.org" ) );
}

void QgsAbout::openUrl( QString url )
void QgsAbout::openUrl( const QUrl &url )
{
//use the users default browser
QDesktopServices::openUrl( url );
Expand Down Expand Up @@ -319,12 +313,6 @@ QString QgsAbout::fileSystemSafe( QString fileName )
return result;
}

void QgsAbout::on_developersMapView_linkClicked( const QUrl &url )
{
QString link = url.toString();
openUrl( link );
}

void QgsAbout::setDevelopersMap()
{
developersMapView->settings()->setAttribute( QWebSettings::JavascriptEnabled, true );
Expand Down
3 changes: 1 addition & 2 deletions src/app/qgsabout.h
Expand Up @@ -35,12 +35,11 @@ class APP_EXPORT QgsAbout : public QgsOptionsDialogBase, private Ui::QgsAbout
void setPluginInfo();
void setDevelopersMap();
void init();
void openUrl( QString url );

private slots:
void on_btnQgisUser_clicked();
void on_btnQgisHome_clicked();
void on_developersMapView_linkClicked( const QUrl &url );
void openUrl( const QUrl &url );
};

#endif
13 changes: 7 additions & 6 deletions src/ui/qgsabout.ui
Expand Up @@ -196,13 +196,14 @@ p, li { white-space: pre-wrap; }
</layout>
</item>
<item>
<widget class="QWebView" name="txtVersion">
<property name="url">
<url>
<string>about:blank</string>
</url>
<widget class="QTextBrowser" name="txtVersion">
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
<property name="openLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="spacer_2">
Expand Down

0 comments on commit 3eb4af3

Please sign in to comment.