Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gajim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dexter Gaon-Shatford
gajim
Commits
fe6842af
Commit
fe6842af
authored
5 years ago
by
Philipp Hörist
Browse files
Options
Downloads
Patches
Plain Diff
Assistant: Add get_page()
Use get_page() instead of page specific methods
parent
1452e842
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
gajim/gtk/assistant.py
+2
-5
2 additions, 5 deletions
gajim/gtk/assistant.py
test/gtk/assistant.py
+10
-8
10 additions, 8 deletions
test/gtk/assistant.py
with
12 additions
and
13 deletions
gajim/gtk/assistant.py
+
2
−
5
View file @
fe6842af
...
...
@@ -114,11 +114,8 @@ def show_page(self, name, transition=Gtk.StackTransitionType.NONE):
self
.
_set_buttons_visible
(
buttons
)
self
.
_ui
.
stack
.
set_visible_child_full
(
name
,
transition
)
def
get_error_page
(
self
):
return
self
.
_pages
[
'
error
'
]
def
get_success_page
(
self
):
return
self
.
_pages
[
'
success
'
]
def
get_page
(
self
,
name
):
return
self
.
_pages
[
name
]
def
_set_buttons_visible
(
self
,
buttons
):
for
button
in
self
.
_buttons
.
values
():
...
...
This diff is collapsed.
Click to expand it.
test/gtk/assistant.py
+
10
−
8
View file @
fe6842af
...
...
@@ -20,6 +20,16 @@ def __init__(self):
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
'
)
self
.
add_button
(
'
forward
'
,
'
Forward
'
,
'
suggested-action
'
)
self
.
add_button
(
'
close
'
,
'
Close
'
,
'
destructive-action
'
)
self
.
add_button
(
'
back
'
,
'
Back
'
)
...
...
@@ -77,17 +87,9 @@ def _on_page_changed(self, _assistant, page_name):
self
.
set_default_button
(
'
forward
'
)
elif
page_name
==
'
success
'
:
success_page
=
self
.
get_success_page
()
success_page
.
set_title
(
'
Success
'
)
success_page
.
set_heading
(
'
Success Heading
'
)
success_page
.
set_text
(
'
This is the success text
'
)
self
.
set_default_button
(
'
forward
'
)
elif
page_name
==
'
error
'
:
error_page
=
self
.
get_error_page
()
error_page
.
set_title
(
'
Error
'
)
error_page
.
set_heading
(
'
Error Heading
'
)
error_page
.
set_text
(
'
This is the error text
'
)
self
.
set_default_button
(
'
back
'
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment