Skip to content
Permalink
Browse files

Merge pull request #8214 from borysiasty/plugin_manager_fixes

Plugin manager minor fixes
  • Loading branch information
borysiasty committed Oct 17, 2018
2 parents a0d46d1 + 57faed4 commit 100a14ed32493e9bcd7af99698d50fedb3e0360c
@@ -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 = "<b>%s</b>" % self.tr("Plugin installed successfully")
else:
msg = "<b>%s:</b> %s" % (self.tr("Plugin installation failed"), infoString)
@@ -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 );
@@ -128,7 +127,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();
@@ -1235,31 +1240,13 @@ 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 )
{
// If the model has been filtered, the index row in the proxy won't match the index row in the underlying model
// 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 );
}
}
@@ -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 );

0 comments on commit 100a14e

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