Source

thg-qt-mq / try1.diff

# HG changeset patch
# Parent 89e7cdc025a63c1406d2f78ca97a94886853c9c8
diff --git a/tortoisehg/hgqt/settings.py b/tortoisehg/hgqt/settings.py
--- a/tortoisehg/hgqt/settings.py
+++ b/tortoisehg/hgqt/settings.py
@@ -1238,8 +1238,13 @@ class SettingsForm(QWidget):
         else:
             page = self.createPage(pagename, info)
             self.refreshPage(page)
-        frame = page[2][0].parentWidget()
-        self.stack.setCurrentWidget(frame)
+
+        widget = page[2][0]
+        index = self.stack.indexOf(widget)
+        if index >= 0:
+            self.stack.setCurrentIndex(index)
+        else:
+            self.stack.setCurrentWidget(widget.parentWidget())
 
     def editClicked(self):
         'Open internal editor in stacked widget'
@@ -1393,7 +1398,7 @@ class SettingsForm(QWidget):
     def fillToolsFrame(self):
         self.toolsFrame = frame = customtools.ToolsFrame(parent=self)
         self.stack.addWidget(frame)
-        return (), frame.widgets
+        return (), [frame]
 
     def eventFilter(self, obj, event):
         if event.type() in (QEvent.Enter, QEvent.FocusIn):