Skip to content

Commit 100a14e

Browse files
authored
Merge pull request #8214 from borysiasty/plugin_manager_fixes
Plugin manager minor fixes
2 parents a0d46d1 + 57faed4 commit 100a14e

File tree

3 files changed

+8
-24
lines changed

3 files changed

+8
-24
lines changed

python/pyplugin_installer/installer.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,6 @@ def installFromZipFile(self, filePath):
600600
loadPlugin(pluginName)
601601
plugins.getAllInstalled()
602602
plugins.rebuild()
603-
self.exportPluginsToManager()
604603

605604
if settings.contains('/PythonPlugins/' + pluginName):
606605
if settings.value('/PythonPlugins/' + pluginName, False, bool):
@@ -613,6 +612,7 @@ def installFromZipFile(self, filePath):
613612
if startPlugin(pluginName):
614613
settings.setValue('/PythonPlugins/' + pluginName, True)
615614

615+
self.exportPluginsToManager()
616616
msg = "<b>%s</b>" % self.tr("Plugin installed successfully")
617617
else:
618618
msg = "<b>%s:</b> %s" % (self.tr("Plugin installation failed"), infoString)

src/app/pluginmanager/qgspluginmanager.cpp

+7-20
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ QgsPluginManager::QgsPluginManager( QWidget *parent, bool pluginsAreEnabled, Qt:
6868
mPythonUtils = nullptr;
6969

7070
setupUi( this );
71-
connect( vwPlugins, &QListView::clicked, this, &QgsPluginManager::vwPlugins_clicked );
7271
connect( vwPlugins, &QListView::doubleClicked, this, &QgsPluginManager::vwPlugins_doubleClicked );
7372
connect( wvDetails, &QgsWebView::linkClicked, this, &QgsPluginManager::wvDetails_linkClicked );
7473
connect( leFilter, &QgsFilterLineEdit::textChanged, this, &QgsPluginManager::leFilter_textChanged );
@@ -128,7 +127,13 @@ QgsPluginManager::QgsPluginManager( QWidget *parent, bool pluginsAreEnabled, Qt:
128127
mPluginsDetailsSplitter->restoreState( settings.value( QStringLiteral( "Windows/PluginManager/secondSplitterState" ) ).toByteArray() );
129128
// 2) The current mOptionsListWidget index (it will overwrite the "tab" setting of QgsOptionsDialogBase that handles the stackedWidget page
130129
// instead of the mOptionsListWidget index). Then the signal connected above will update the relevant page as well.
131-
mOptionsListWidget->setCurrentRow( settings.value( QStringLiteral( "Windows/PluginManager/option" ), 0 ).toInt() );
130+
int option = settings.value( QStringLiteral( "Windows/PluginManager/option" ), 0 ).toInt();
131+
mOptionsListWidget->setCurrentRow( option );
132+
if ( option == 0 )
133+
{
134+
// The first option won't fire the currentRowChanged signal, so initialize the first tab explicitly
135+
setCurrentTab( 0 );
136+
}
132137

133138
// Hide widgets only suitable with Python support enabled (they will be uncovered back in setPythonUtils)
134139
buttonUpgradeAll->hide();
@@ -1235,31 +1240,13 @@ void QgsPluginManager::setCurrentTab( int idx )
12351240

12361241

12371242
void QgsPluginManager::currentPluginChanged( const QModelIndex &index )
1238-
{
1239-
if ( index.column() == 0 )
1240-
{
1241-
// Do exactly the same as if a plugin was clicked
1242-
vwPlugins_clicked( index );
1243-
}
1244-
}
1245-
1246-
1247-
1248-
void QgsPluginManager::vwPlugins_clicked( const QModelIndex &index )
12491243
{
12501244
if ( index.column() == 0 )
12511245
{
12521246
// If the model has been filtered, the index row in the proxy won't match the index row in the underlying model
12531247
// so we need to jump through this little hoop to get the correct item
12541248
QModelIndex realIndex = mModelProxy->mapToSource( index );
12551249
QStandardItem *mypItem = mModelPlugins->itemFromIndex( realIndex );
1256-
if ( !mypItem->isEnabled() )
1257-
{
1258-
//The item is inactive (uncompatible or broken plugin), so it can't be selected. Display it's data anyway.
1259-
vwPlugins->clearSelection();
1260-
}
1261-
// Display details in any case: selection changed, inactive button clicked,
1262-
// or previously selected plugin clicked (while details view contains the welcome message for a category)
12631250
showPluginDetails( mypItem );
12641251
}
12651252
}

src/app/pluginmanager/qgspluginmanager.h

-3
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,6 @@ class QgsPluginManager : public QgsOptionsDialogBase, private Ui::QgsPluginManag
111111
//! Load/unload plugin when checkbox state changed
112112
void pluginItemChanged( QStandardItem *item );
113113

114-
//! Display details of inactive item too
115-
void vwPlugins_clicked( const QModelIndex &index );
116-
117114
//! Load/unload plugin by double-click
118115
void vwPlugins_doubleClicked( const QModelIndex &index );
119116

0 commit comments

Comments
 (0)