From b7673c7616e1423a323aad6c61e002fc4b822ab0 Mon Sep 17 00:00:00 2001 From: Borys Jurgiel Date: Tue, 16 Oct 2018 23:06:13 +0200 Subject: [PATCH 1/3] [Plugin Manager] Fix plugin status checkbox not refreshed after installing from zip --- python/pyplugin_installer/installer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/pyplugin_installer/installer.py b/python/pyplugin_installer/installer.py index 5f8218c811d8..5396df60cbad 100644 --- a/python/pyplugin_installer/installer.py +++ b/python/pyplugin_installer/installer.py @@ -600,7 +600,6 @@ def installFromZipFile(self, filePath): loadPlugin(pluginName) plugins.getAllInstalled() plugins.rebuild() - self.exportPluginsToManager() if settings.contains('/PythonPlugins/' + pluginName): if settings.value('/PythonPlugins/' + pluginName, False, bool): @@ -613,6 +612,7 @@ def installFromZipFile(self, filePath): if startPlugin(pluginName): settings.setValue('/PythonPlugins/' + pluginName, True) + self.exportPluginsToManager() msg = "%s" % self.tr("Plugin installed successfully") else: msg = "%s: %s" % (self.tr("Plugin installation failed"), infoString) From 9254e49c07997e565fa8ec8bb4a0aaf035b9cd12 Mon Sep 17 00:00:00 2001 From: Borys Jurgiel Date: Wed, 17 Oct 2018 10:22:25 +0200 Subject: [PATCH 2/3] [Plugin Manager] Fix empty initial tab when the window state is saved with the first option (All Plugins) selected. --- src/app/pluginmanager/qgspluginmanager.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/app/pluginmanager/qgspluginmanager.cpp b/src/app/pluginmanager/qgspluginmanager.cpp index 331180579a13..1516a90c4ae7 100644 --- a/src/app/pluginmanager/qgspluginmanager.cpp +++ b/src/app/pluginmanager/qgspluginmanager.cpp @@ -128,7 +128,13 @@ QgsPluginManager::QgsPluginManager( QWidget *parent, bool pluginsAreEnabled, Qt: mPluginsDetailsSplitter->restoreState( settings.value( QStringLiteral( "Windows/PluginManager/secondSplitterState" ) ).toByteArray() ); // 2) The current mOptionsListWidget index (it will overwrite the "tab" setting of QgsOptionsDialogBase that handles the stackedWidget page // instead of the mOptionsListWidget index). Then the signal connected above will update the relevant page as well. - mOptionsListWidget->setCurrentRow( settings.value( QStringLiteral( "Windows/PluginManager/option" ), 0 ).toInt() ); + int option = settings.value( QStringLiteral( "Windows/PluginManager/option" ), 0 ).toInt(); + mOptionsListWidget->setCurrentRow( option ); + if ( option == 0 ) + { + // The first option won't fire the currentRowChanged signal, so initialize the first tab explicitly + setCurrentTab( 0 ); + } // Hide widgets only suitable with Python support enabled (they will be uncovered back in setPythonUtils) buttonUpgradeAll->hide(); From 57faed4c77be9884aa014266b07e57c40842286a Mon Sep 17 00:00:00 2001 From: Borys Jurgiel Date: Wed, 17 Oct 2018 12:13:56 +0200 Subject: [PATCH 3/3] [Plugin Manager] Small cleanups: don't connect redundant signal, remove unused condition. --- src/app/pluginmanager/qgspluginmanager.cpp | 19 ------------------- src/app/pluginmanager/qgspluginmanager.h | 3 --- 2 files changed, 22 deletions(-) diff --git a/src/app/pluginmanager/qgspluginmanager.cpp b/src/app/pluginmanager/qgspluginmanager.cpp index 1516a90c4ae7..166553d01847 100644 --- a/src/app/pluginmanager/qgspluginmanager.cpp +++ b/src/app/pluginmanager/qgspluginmanager.cpp @@ -68,7 +68,6 @@ QgsPluginManager::QgsPluginManager( QWidget *parent, bool pluginsAreEnabled, Qt: mPythonUtils = nullptr; setupUi( this ); - connect( vwPlugins, &QListView::clicked, this, &QgsPluginManager::vwPlugins_clicked ); connect( vwPlugins, &QListView::doubleClicked, this, &QgsPluginManager::vwPlugins_doubleClicked ); connect( wvDetails, &QgsWebView::linkClicked, this, &QgsPluginManager::wvDetails_linkClicked ); connect( leFilter, &QgsFilterLineEdit::textChanged, this, &QgsPluginManager::leFilter_textChanged ); @@ -1241,17 +1240,6 @@ void QgsPluginManager::setCurrentTab( int idx ) void QgsPluginManager::currentPluginChanged( const QModelIndex &index ) -{ - if ( index.column() == 0 ) - { - // Do exactly the same as if a plugin was clicked - vwPlugins_clicked( index ); - } -} - - - -void QgsPluginManager::vwPlugins_clicked( const QModelIndex &index ) { if ( index.column() == 0 ) { @@ -1259,13 +1247,6 @@ void QgsPluginManager::vwPlugins_clicked( const QModelIndex &index ) // so we need to jump through this little hoop to get the correct item QModelIndex realIndex = mModelProxy->mapToSource( index ); QStandardItem *mypItem = mModelPlugins->itemFromIndex( realIndex ); - if ( !mypItem->isEnabled() ) - { - //The item is inactive (uncompatible or broken plugin), so it can't be selected. Display it's data anyway. - vwPlugins->clearSelection(); - } - // Display details in any case: selection changed, inactive button clicked, - // or previously selected plugin clicked (while details view contains the welcome message for a category) showPluginDetails( mypItem ); } } diff --git a/src/app/pluginmanager/qgspluginmanager.h b/src/app/pluginmanager/qgspluginmanager.h index 8b6d596550be..d8d76b1e57fd 100644 --- a/src/app/pluginmanager/qgspluginmanager.h +++ b/src/app/pluginmanager/qgspluginmanager.h @@ -111,9 +111,6 @@ class QgsPluginManager : public QgsOptionsDialogBase, private Ui::QgsPluginManag //! Load/unload plugin when checkbox state changed void pluginItemChanged( QStandardItem *item ); - //! Display details of inactive item too - void vwPlugins_clicked( const QModelIndex &index ); - //! Load/unload plugin by double-click void vwPlugins_doubleClicked( const QModelIndex &index );