Skip to content

Commit f97a011

Browse files
committedNov 10, 2017
[Plugin manager] Remember last visited tab. Fixes #8786
1 parent 992d1e2 commit f97a011

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed
 

‎src/app/pluginmanager/qgspluginmanager.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,6 @@ QgsPluginManager::QgsPluginManager( QWidget *parent, bool pluginsAreEnabled, Qt:
9292
// Don't let QgsOptionsDialogBase to narrow the vertical tab list widget
9393
mOptListWidget->setMaximumWidth( 16777215 );
9494

95-
// Restiore UI state for widgets not handled by QgsOptionsDialogBase
96-
QgsSettings settings;
97-
mPluginsDetailsSplitter->restoreState( settings.value( QStringLiteral( "Windows/PluginManager/secondSplitterState" ) ).toByteArray() );
98-
9995
// load translated description strings from qgspluginmanager_texts
10096
initTabDescriptions();
10197

@@ -118,15 +114,18 @@ QgsPluginManager::QgsPluginManager( QWidget *parent, bool pluginsAreEnabled, Qt:
118114
leFilter->setFocus( Qt::MouseFocusReason );
119115
wvDetails->page()->setLinkDelegationPolicy( QWebPage::DelegateAllLinks );
120116

121-
// Don't restore the last used tab from QgsSettings
122-
mOptionsListWidget->setCurrentRow( 0 );
123-
124117
// Connect other signals
125118
connect( mOptionsListWidget, &QListWidget::currentRowChanged, this, &QgsPluginManager::setCurrentTab );
126119
connect( vwPlugins->selectionModel(), &QItemSelectionModel::currentChanged, this, &QgsPluginManager::currentPluginChanged );
127120
connect( mModelPlugins, &QStandardItemModel::itemChanged, this, &QgsPluginManager::pluginItemChanged );
128-
// Force setting the status filter (if the active tab was 0, the setCurrentRow( 0 ) above doesn't take any action)
129-
setCurrentTab( 0 );
121+
122+
// Restiore UI state for widgets not handled by QgsOptionsDialogBase
123+
QgsSettings settings;
124+
// 1) The second splitter state:
125+
mPluginsDetailsSplitter->restoreState( settings.value( QStringLiteral( "Windows/PluginManager/secondSplitterState" ) ).toByteArray() );
126+
// 2) The current mOptionsListWidget index (it will overwrite the "tab" setting of QgsOptionsDialogBase that handles the stackedWidget page
127+
// instead of the mOptionsListWidget index). Then the signal connected above will update the relevant page as well.
128+
mOptionsListWidget->setCurrentRow( settings.value( QStringLiteral( "Windows/PluginManager/option" ), 0 ).toInt() );
130129

131130
// Hide widgets only suitable with Python support enabled (they will be uncovered back in setPythonUtils)
132131
buttonUpgradeAll->hide();
@@ -158,6 +157,7 @@ QgsPluginManager::~QgsPluginManager()
158157

159158
QgsSettings settings;
160159
settings.setValue( QStringLiteral( "Windows/PluginManager/secondSplitterState" ), mPluginsDetailsSplitter->saveState() );
160+
settings.setValue( QStringLiteral( "Windows/PluginManager/option" ), mOptionsListWidget->currentRow() );
161161
}
162162

163163

0 commit comments

Comments
 (0)
Please sign in to comment.