@@ -92,10 +92,6 @@ QgsPluginManager::QgsPluginManager( QWidget *parent, bool pluginsAreEnabled, Qt:
92
92
// Don't let QgsOptionsDialogBase to narrow the vertical tab list widget
93
93
mOptListWidget ->setMaximumWidth ( 16777215 );
94
94
95
- // Restiore UI state for widgets not handled by QgsOptionsDialogBase
96
- QgsSettings settings;
97
- mPluginsDetailsSplitter ->restoreState ( settings.value ( QStringLiteral ( " Windows/PluginManager/secondSplitterState" ) ).toByteArray () );
98
-
99
95
// load translated description strings from qgspluginmanager_texts
100
96
initTabDescriptions ();
101
97
@@ -118,15 +114,18 @@ QgsPluginManager::QgsPluginManager( QWidget *parent, bool pluginsAreEnabled, Qt:
118
114
leFilter->setFocus ( Qt::MouseFocusReason );
119
115
wvDetails->page ()->setLinkDelegationPolicy ( QWebPage::DelegateAllLinks );
120
116
121
- // Don't restore the last used tab from QgsSettings
122
- mOptionsListWidget ->setCurrentRow ( 0 );
123
-
124
117
// Connect other signals
125
118
connect ( mOptionsListWidget , &QListWidget::currentRowChanged, this , &QgsPluginManager::setCurrentTab );
126
119
connect ( vwPlugins->selectionModel (), &QItemSelectionModel::currentChanged, this , &QgsPluginManager::currentPluginChanged );
127
120
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 () );
130
129
131
130
// Hide widgets only suitable with Python support enabled (they will be uncovered back in setPythonUtils)
132
131
buttonUpgradeAll->hide ();
@@ -158,6 +157,7 @@ QgsPluginManager::~QgsPluginManager()
158
157
159
158
QgsSettings settings;
160
159
settings.setValue ( QStringLiteral ( " Windows/PluginManager/secondSplitterState" ), mPluginsDetailsSplitter ->saveState () );
160
+ settings.setValue ( QStringLiteral ( " Windows/PluginManager/option" ), mOptionsListWidget ->currentRow () );
161
161
}
162
162
163
163
0 commit comments