Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[FEATURE] clearly mark deprecated plugins in plugin manager
  • Loading branch information
alexbruy committed Sep 13, 2013
1 parent 9ce316d commit 8a27c76
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions images/images.qrc
Expand Up @@ -369,6 +369,7 @@
<file>themes/default/pie-chart.png</file>
<file>themes/default/plugin.png</file>
<file>themes/default/pluginExperimental.png</file>
<file>themes/default/pluginDeprecated.png</file>
<file>themes/default/propertyicons/action.svg</file>
<file>themes/default/propertyicons/attributes.png</file>
<file>themes/default/propertyicons/colormap.png</file>
Expand Down
Binary file added images/themes/default/pluginDeprecated.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions python/pyplugin_installer/installer.py
Expand Up @@ -208,6 +208,7 @@ def exportPluginsToManager(self):
"error" : plugin["error"],
"error_details" : plugin["error_details"],
"experimental" : plugin["experimental"] and "true" or "false",
"deprecated" : plugin["deprecated"] and "true" or "false",
"version_available" : plugin["version_available"],
"zip_repository" : plugin["zip_repository"],
"download_url" : plugin["download_url"],
Expand Down
8 changes: 7 additions & 1 deletion python/pyplugin_installer/installer_data.py
Expand Up @@ -71,6 +71,7 @@
"error" unicode, # NULL | broken | incompatible | dependent
"error_details" unicode, # error description
"experimental" boolean, # true if experimental, false if stable
"deprecated" boolean, # true if deprected, false if actual
"version_available" unicode, # available version
"zip_repository" unicode, # the remote repository id
"download_url" unicode, # url for downloading the plugin
Expand Down Expand Up @@ -403,6 +404,9 @@ def xmlDownloaded(self):
experimental = False
if pluginNodes.item(i).firstChildElement("experimental").text().strip().upper() in ["TRUE","YES"]:
experimental = True
deprecated = False
if pluginNodes.item(i).firstChildElement("deprecated").text().strip().upper() in ["TRUE","YES"]:
deprecated = True
icon = pluginNodes.item(i).firstChildElement("icon").text().strip()
if icon and not icon.startswith("http"):
icon = "http://%s/%s" % ( QUrl(self.mRepositories[reposName]["url"]).host() , icon )
Expand All @@ -427,6 +431,7 @@ def xmlDownloaded(self):
"rating_votes" : pluginNodes.item(i).firstChildElement("rating_votes").text().strip(),
"icon" : icon,
"experimental" : experimental,
"deprecated" : deprecated,
"filename" : fileName,
"installed" : False,
"available" : True,
Expand Down Expand Up @@ -645,6 +650,7 @@ def pluginMetadata(fct):
"library" : path,
"pythonic" : True,
"experimental" : pluginMetadata("experimental").strip().upper() in ["TRUE","YES"],
"deprecated" : pluginMetadata("deprecated").strip().upper() in ["TRUE","YES"],
"version_available" : "",
"zip_repository" : "",
"download_url" : path, # warning: local path as url!
Expand Down Expand Up @@ -729,7 +735,7 @@ def rebuild(self):
self.mPlugins[key][attrib] = plugin[attrib]
# other remote metadata is preffered:
for attrib in ["name", "description", "about", "category", "tags", "changelog", "author_name", "author_email", "homepage",
"tracker", "code_repository", "experimental", "version_available", "zip_repository",
"tracker", "code_repository", "experimental", "deprecated", "version_available", "zip_repository",
"download_url", "filename", "downloads", "average_vote", "rating_votes"]:
if ( not attrib in translatableAttributes ) or ( attrib == "name" ): # include name!
if plugin[attrib]:
Expand Down
8 changes: 8 additions & 0 deletions src/app/pluginmanager/qgspluginmanager.cpp
Expand Up @@ -659,6 +659,14 @@ void QgsPluginManager::showPluginDetails( QStandardItem * item )
" </td></tr>"
"</table>" ).arg( tr( "This plugin is experimental" ) );
};
if ( metadata->value( "deprecated" ) == "true" )
{
html += QString( "<table bgcolor=\"#EEBBCC\" cellspacing=\"2\" cellpadding=\"2\" width=\"100%\">"
" <tr><td width=\"100%\" style=\"color:#660000\">"
" <img src=\":/images/themes/default/pluginDeprecated.png\" width=\"32\"><b>%1</b>"
" </td></tr>"
"</table>" ).arg( tr( "This plugin is deprecated" ) );
};
// if ( metadata->value( "status" ) == t.b.d. )
// {
// html += QString( "<table bgcolor=\"#CCCCFF\" cellspacing=\"2\" cellpadding=\"6\" width=\"100%\">"
Expand Down

0 comments on commit 8a27c76

Please sign in to comment.