Skip to content
Permalink
Browse files

[FEATURE] add option to show/hide deprecated plugins in plugin manager

  • Loading branch information
alexbruy committed Sep 11, 2013
1 parent 8a27c76 commit 6d5df7cb2555a994ee94bb09c667ea82949ef820
@@ -713,12 +713,14 @@ def rebuild(self):
self.mPlugins[i] = self.localCache[i].copy()
settings = QSettings()
allowExperimental = settings.value(settingsGroup+"/allowExperimental", False, type=bool)
allowDeprecated = settings.value(settingsGroup+"/allowDeprecated", False, type=bool)
for i in self.repoCache.values():
for j in i:
plugin=j.copy() # do not update repoCache elements!
key = plugin["id"]
# check if the plugin is allowed and if there isn't any better one added already.
if (allowExperimental or not plugin["experimental"]) \
and (allowDeprecated or not plugin["deprecated"]) \
and not (self.mPlugins.has_key(key) and self.mPlugins[key]["version_available"] and compareVersions(self.mPlugins[key]["version_available"], plugin["version_available"]) < 2):
# The mPlugins dict contains now locally installed plugins.
# Now, add the available one if not present yet or update it if present already.
@@ -187,6 +187,12 @@ void QgsPluginManager::setPythonUtils( QgsPythonUtils* pythonUtils )
ckbExperimental->setChecked( true );
}

if ( settings.value( settingsGroup + "/allowDeprecated", false ).toBool() )
{
ckbDeprecated->setChecked( true );
}


int interval = settings.value( settingsGroup + "/checkOnStartInterval", "" ).toInt( );
int indx = mCheckingOnStartIntervals.indexOf( interval ); // if none found, just use -1 index.
comboInterval->setCurrentIndex( indx );
@@ -1236,6 +1242,15 @@ void QgsPluginManager::on_ckbExperimental_toggled( bool state )
QgsPythonRunner::run( "pyplugin_installer.instance().exportPluginsToManager()" );
}

void QgsPluginManager::on_ckbDeprecated_toggled( bool state )
{
QString settingsGroup;
QgsPythonRunner::eval( "pyplugin_installer.instance().exportSettingsGroup()", settingsGroup );
QSettings settings;
settings.setValue( settingsGroup + "/allowDeprecated", QVariant( state ) );
QgsPythonRunner::run( "pyplugin_installer.installer_data.plugins.rebuild()" );
QgsPythonRunner::run( "pyplugin_installer.instance().exportPluginsToManager()" );
}


// PRIVATE METHODS ///////////////////////////////////////////////////////////////////
@@ -153,6 +153,9 @@ class QgsPluginManager : public QgsOptionsDialogBase, private Ui::QgsPluginManag
//! Reload plugin metadata registry after allowing/disallowing experimental plugins
void on_ckbExperimental_toggled( bool state );

//! Reload plugin metadata registry after allowing/disallowing deprecated plugins
void on_ckbDeprecated_toggled( bool state );

//! Open help browser
void on_buttonBox_helpRequested( ) { QgsContextHelp::run( metaObject()->className() ); }

0 comments on commit 6d5df7c

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