Skip to content

Commit

Permalink
[Plugin Manager] better formatting of plugin details
Browse files Browse the repository at this point in the history
  • Loading branch information
borysiasty committed Jun 26, 2013
1 parent 619558d commit fe913a3
Showing 1 changed file with 26 additions and 13 deletions.
39 changes: 26 additions & 13 deletions src/app/pluginmanager/qgspluginmanager.cpp
Expand Up @@ -636,9 +636,15 @@ void QgsPluginManager::showPluginDetails( QStandardItem * item )
html += QString( "<img src=\"%1\" style=\"float:right;\">" ).arg( metadata->value( "icon" ) );
}

html += QString( "<h3>%2</h3><br/>" ).arg( metadata->value( "description" ) );
html += QString( "<h3>%1</h3>" ).arg( metadata->value( "description" ) );

if ( ! metadata->value( "average_vote" ).isEmpty() )
if ( ! metadata->value( "about" ).isEmpty() )
{
html += metadata->value( "about" );
}

html += "<table><tr><td align='right' width='100%'>";
if ( ! metadata->value( "average_vote" ).isEmpty() && metadata->value( "average_vote" ).toFloat() )
{
// draw stars
int stars = qRound( metadata->value( "average_vote" ).toFloat() );
Expand All @@ -648,11 +654,16 @@ void QgsPluginManager::showPluginDetails( QStandardItem * item )
}
html += tr( "<br/>%1 rating vote(s)<br/>" ).arg( metadata->value( "rating_votes" ) );
}
if ( ! metadata->value( "downloads" ).isEmpty() )
else if ( ! metadata->value( "downloads" ).isEmpty() )
{
html += tr( "%1 downloads<br/>" ).arg( metadata->value( "downloads" ) );
// spacer between description and downloads
html += "<br/>";
}
if ( ! metadata->value( "downloads" ).isEmpty() )
{
html += tr( "%1 downloads" ).arg( metadata->value( "downloads" ) );
}
html += "</td></tr></table><br/>";

if ( ! metadata->value( "category" ).isEmpty() )
{
Expand All @@ -662,14 +673,6 @@ void QgsPluginManager::showPluginDetails( QStandardItem * item )
{
html += QString( "%1: %2 <br/>" ).arg( tr( "Tags" ) ).arg( metadata->value( "tags" ) );
}
if ( ! metadata->value( "author_email" ).isEmpty() )
{
html += QString( "%1: <a href='mailto:%2'>%3</a><br/>" ).arg( tr( "Author" ) ).arg( metadata->value( "author_email" ) ).arg( metadata->value( "author_name" ) );
}
else if ( ! metadata->value( "author_name" ).isEmpty() )
{
html += QString( "%1: %2<br/>" ).arg( tr( "Author" ) ).arg( metadata->value( "author_name" ) );
}
if ( ! metadata->value( "homepage" ).isEmpty() || ! metadata->value( "tracker" ).isEmpty() || ! metadata->value( "code_repository" ).isEmpty() )
{
html += QString( "%1: " ).arg( tr( "More info" ) );
Expand All @@ -687,9 +690,19 @@ void QgsPluginManager::showPluginDetails( QStandardItem * item )
}
html += "<br/>";
}

html += "<br/>" ;

if ( ! metadata->value( "author_email" ).isEmpty() )
{
html += QString( "%1: <a href='mailto:%2'>%3</a>" ).arg( tr( "Author" ) ).arg( metadata->value( "author_email" ) ).arg( metadata->value( "author_name" ) );
html += "<br/><br/>" ;
}
else if ( ! metadata->value( "author_name" ).isEmpty() )
{
html += QString( "%1: %2" ).arg( tr( "Author" ) ).arg( metadata->value( "author_name" ) );
html += "<br/><br/>" ;
}

if ( ! metadata->value( "version_installed" ).isEmpty() )
{
QString ver = metadata->value( "version_installed" );
Expand Down

0 comments on commit fe913a3

Please sign in to comment.