From a350f3ed88a03817606e4d7218f10691469441bd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Philipp=20H=C3=B6rist?= <philipp@hoerist.com>
Date: Fri, 29 Nov 2019 23:38:15 +0100
Subject: [PATCH] Assistant: return page on add_default_page()

---
 gajim/gtk/assistant.py |  1 +
 test/gtk/assistant.py  | 21 +++++++++------------
 2 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/gajim/gtk/assistant.py b/gajim/gtk/assistant.py
index 5416f91ebc..112f89b778 100644
--- a/gajim/gtk/assistant.py
+++ b/gajim/gtk/assistant.py
@@ -105,6 +105,7 @@ def add_default_page(self, name):
 
         self._pages[name] = page
         self._ui.stack.add_named(page, name)
+        return page
 
     def get_current_page(self):
         return self._ui.stack.get_visible_child_name()
diff --git a/test/gtk/assistant.py b/test/gtk/assistant.py
index d988e87fae..6d818e1fce 100644
--- a/test/gtk/assistant.py
+++ b/test/gtk/assistant.py
@@ -17,18 +17,15 @@ def __init__(self):
         self.add_pages({'start': Start(),
                         'progress': Progress()})
 
-        self.add_default_page('error')
-        self.add_default_page('success')
-
-        success_page = self.get_page('success')
-        success_page.set_title('Success')
-        success_page.set_heading('Success Heading')
-        success_page.set_text('This is the success text')
-
-        error_page = self.get_page('error')
-        error_page.set_title('Error')
-        error_page.set_heading('Error Heading')
-        error_page.set_text('This is the error text')
+        error = self.add_default_page('error')
+        error.set_title('Error')
+        error.set_heading('Error Heading')
+        error.set_text('This is the error text')
+
+        success = self.add_default_page('success')
+        success.set_title('Success')
+        success.set_heading('Success Heading')
+        success.set_text('This is the success text')
 
         self.add_button('forward', 'Forward', 'suggested-action')
         self.add_button('close', 'Close', 'destructive-action')
-- 
GitLab