Skip to content
Permalink
Browse files

[Plugin manager] [need-docs] [FEATURE?] Add links to the plugin detai…

…ls page to open the local directory of installed plugin and the download page/link of the available version (do not confuse with plugin homepage).
  • Loading branch information
borysiasty committed Sep 13, 2018
1 parent 23f1e43 commit 8394981b98ea21a5313918a99c51e206cc19258d
Showing with 25 additions and 10 deletions.
  1. +1 −0 images/images.qrc
  2. +1 −0 images/themes/default/externalLink.svg
  3. +23 −10 src/app/pluginmanager/qgspluginmanager.cpp
@@ -148,6 +148,7 @@
<file>themes/default/copyright_label.svg</file>
<file>themes/default/dbmanager.svg</file>
<file>themes/default/extents.svg</file>
<file>themes/default/externalLink.svg</file>
<file>themes/default/gpsicons/barchart.svg</file>
<file>themes/default/gpsicons/polarchart.svg</file>
<file>themes/default/grass_location.svg</file>
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -256 1850 1850"><path d="M1504 819v320q0 119-88 203t-213 84H332q-124 0-213-84-88-84-88-203V307q0-119 88-203t213-84h737q15 0 24 9t9 23v64q0 14-9 23t-24 9H332q-69 0-118 47t-49 113v832q0 66 49 113t118 47h871q69 0 118-47t49-113V820q0-14 9-23t24-9h67q15 0 24 9t9 23z" fill="currentColor"/><path d="M400 1003l130 151 964-829 174 182V23h-436l130 151" fill="currentColor"/></svg>
@@ -677,8 +677,8 @@ void QgsPluginManager::showPluginDetails( QStandardItem *item )
" padding-right:10px;"
" text-align:right;"
" }"
" td.version {"
" cursor:pointer;"
" td.version img {"
" height:0.8em;"
" }"
"</style>";

@@ -940,17 +940,30 @@ void QgsPluginManager::showPluginDetails( QStandardItem *item )
{
QString ver = metadata->value( QStringLiteral( "version_installed" ) );
if ( ver == QLatin1String( "-1" ) ) ver = '?';
html += QStringLiteral( "<tr><td class='key'>%1 </td><td class='version' title='%2 %3'> %4 </td></tr>" ).arg( tr( "Installed version" ),
tr( "in" ),
metadata->value( QStringLiteral( "library" ) ),
ver );
html += QStringLiteral( "<tr><td class='key'>%1 </td><td class='version' title='%2 %3'> %4 <a href=\"%5\">
"<img src=\"qrc:/images/themes/default/externalLink.svg\"></a></td></tr>"
).arg( tr( "Installed version" ),
tr( "in" ),
metadata->value( QStringLiteral( "library" ) ),
ver,
QUrl::fromLocalFile( metadata->value( QStringLiteral( "library" ) ) ).toString() );
}
if ( ! metadata->value( QStringLiteral( "version_available" ) ).isEmpty() )
{
html += QStringLiteral( "<tr><td class='key'>%1 </td><td class='version' title='%2 %3'> %4 </td></tr>" ).arg( tr( "Available version" ),
tr( "in" ),
metadata->value( QStringLiteral( "zip_repository" ) ),
metadata->value( QStringLiteral( "version_available" ) ) );
QString downloadUrl = metadata->value( QStringLiteral( "download_url" ) );
if ( downloadUrl.contains( QStringLiteral( "plugins.qgis.org" ) ) )
{
// For the main repo, open the plugin version page instead of the download link. For other repositories the download link is the only known endpoint.
downloadUrl = downloadUrl.replace( QStringLiteral( "download/" ), QStringLiteral( "" ) );
}

html += QStringLiteral( "<tr><td class='key'>%1 </td><td class='version' title='%2 %3'> %4 <a href=\"%5\">"
"<img src=\"qrc:/images/themes/default/externalLink.svg\"></a></td></tr>"
).arg( tr( "Available version" ),
tr( "in" ),
metadata->value( QStringLiteral( "zip_repository" ) ),
metadata->value( QStringLiteral( "version_available" ) ),
downloadUrl );
}

if ( ! metadata->value( QStringLiteral( "changelog" ) ).isEmpty() )

0 comments on commit 8394981

Please sign in to comment.
You can’t perform that action at this time.