Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
tails
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
944
Issues
944
List
Boards
Labels
Service Desk
Milestones
Merge Requests
11
Merge Requests
11
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tails
tails
Commits
b47410a7
Commit
b47410a7
authored
Jan 23, 2020
by
segfault
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Greeter: Define headerbar in UI file instead of code
parent
0159a230
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
39 additions
and
24 deletions
+39
-24
config/chroot_local-includes/usr/lib/python3/dist-packages/tailsgreeter/ui/main_window.py
.../lib/python3/dist-packages/tailsgreeter/ui/main_window.py
+3
-21
config/chroot_local-includes/usr/share/tails/greeter/main.ui.in
.../chroot_local-includes/usr/share/tails/greeter/main.ui.in
+36
-0
po/POTFILES.in
po/POTFILES.in
+0
-1
po/POTFILES.skip
po/POTFILES.skip
+0
-1
refresh-translations
refresh-translations
+0
-1
No files found.
config/chroot_local-includes/usr/lib/python3/dist-packages/tailsgreeter/ui/main_window.py
View file @
b47410a7
...
...
@@ -113,6 +113,8 @@ class GreeterMainWindow(Gtk.Window, TranslatableWindow):
self
.
toolbutton_settings_add
=
builder
.
get_object
(
'toolbutton_settings_add'
)
self
.
listbox_settings
=
builder
.
get_object
(
"listbox_settings"
)
self
.
listbox_region
=
builder
.
get_object
(
"listbox_region"
)
self
.
button_start
=
builder
.
get_object
(
"button_start"
)
self
.
headerbar
=
builder
.
get_object
(
"headerbar"
)
# Set preferred width
self
.
set_default_size
(
min
(
Gdk
.
Screen
.
get_default
().
get_width
(),
...
...
@@ -133,7 +135,7 @@ class GreeterMainWindow(Gtk.Window, TranslatableWindow):
# Add children to ApplicationWindow
self
.
add
(
self
.
box_main
)
self
.
set_titlebar
(
self
.
_build_headerbar
()
)
self
.
set_titlebar
(
self
.
headerbar
)
# Set keyboard focus chain
self
.
_set_focus_chain
()
...
...
@@ -164,26 +166,6 @@ class GreeterMainWindow(Gtk.Window, TranslatableWindow):
Gtk
.
AccelFlags
.
VISIBLE
,
self
.
cb_accelgroup_setting_activated
)
def
_build_headerbar
(
self
)
->
Gtk
.
HeaderBar
:
headerbar
=
Gtk
.
HeaderBar
()
headerbar_sizegroup
=
Gtk
.
SizeGroup
(
Gtk
.
SizeGroupMode
.
HORIZONTAL
)
self
.
button_shutdown
=
Gtk
.
Button
.
new_with_label
(
_
(
"Shutdown"
))
self
.
button_shutdown
.
connect
(
'clicked'
,
self
.
cb_button_shutdown_clicked
)
headerbar_sizegroup
.
add_widget
(
self
.
button_shutdown
)
headerbar
.
pack_start
(
self
.
button_shutdown
)
self
.
button_start
=
Gtk
.
Button
.
new_with_mnemonic
(
_
(
"_Start Tails"
))
Gtk
.
StyleContext
.
add_class
(
self
.
button_start
.
get_style_context
(),
'suggested-action'
)
self
.
button_start
.
connect
(
'clicked'
,
self
.
cb_button_start_clicked
)
headerbar_sizegroup
.
add_widget
(
self
.
button_start
)
headerbar
.
pack_end
(
self
.
button_start
)
headerbar
.
show_all
()
return
headerbar
def
_set_focus_chain
(
self
):
self
.
box_language
.
set_focus_chain
([
self
.
frame_language
,
...
...
config/chroot_local-includes/usr/share/tails/greeter/main.ui.in
View file @
b47410a7
...
...
@@ -634,4 +634,40 @@
</row>
</data>
</object>
<object
class=
"GtkHeaderBar"
id=
"headerbar"
>
<property
name=
"visible"
>
True
</property>
<child>
<object
class=
"GtkButton"
id=
"button_shutdown"
>
<property
name=
"label"
translatable=
"yes"
>
Shutdown
</property>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
True
</property>
<signal
name=
"clicked"
handler=
"cb_button_shutdown_clicked"
/>
</object>
<packing>
<property
name=
"pack-type"
>
start
</property>
</packing>
</child>
<child>
<object
class=
"GtkButton"
id=
"button_start"
>
<property
name=
"label"
translatable=
"yes"
>
_Start Tails
</property>
<property
name=
"use_underline"
>
True
</property>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
True
</property>
<signal
name=
"clicked"
handler=
"cb_button_start_clicked"
/>
<style>
<class
name=
"suggested-action"
/>
</style>
</object>
<packing>
<property
name=
"pack-type"
>
end
</property>
</packing>
</child>
</object>
<object
class=
"GtkSizeGroup"
>
<property
name=
"mode"
>
GTK_SIZE_GROUP_HORIZONTAL
</property>
<widgets>
<widget
name=
"button_shutdown"
/>
<widget
name=
"button_start"
/>
</widgets>
</object>
</interface>
po/POTFILES.in
View file @
b47410a7
...
...
@@ -6,7 +6,6 @@ tmp/pot/electrum.pot
tmp/pot/Frontend.pm.pot
tmp/pot/greeter-add_settings_dialog.py.pot
tmp/pot/greeter-additional_settings.py.pot
tmp/pot/greeter-main_window.py.pot
tmp/pot/greeter-persistence.py.pot
tmp/pot/greeter-persistent_storage.py.pot
tmp/pot/greeter-region_settings.py.pot
...
...
po/POTFILES.skip
View file @
b47410a7
...
...
@@ -3,7 +3,6 @@ config/chroot_local-includes/usr/share/doc/tails/website/
config/chroot_local-includes/usr/lib/python3/dist-packages/tailsgreeter/settings/persistence.py
config/chroot_local-includes/usr/lib/python3/dist-packages/tailsgreeter/ui/add_settings_dialog.py
config/chroot_local-includes/usr/lib/python3/dist-packages/tailsgreeter/ui/additional_settings.py
config/chroot_local-includes/usr/lib/python3/dist-packages/tailsgreeter/ui/main_window.py
config/chroot_local-includes/usr/lib/python3/dist-packages/tailsgreeter/ui/persistent_storage.py
config/chroot_local-includes/usr/lib/python3/dist-packages/tailsgreeter/ui/region_settings.py
config/chroot_local-includes/usr/lib/python3/dist-packages/unlock_veracrypt_volumes/volume.py
...
...
refresh-translations
View file @
b47410a7
...
...
@@ -31,7 +31,6 @@ PYTHON_PROGS="/etc/whisperback/config.py \
/usr/lib/python3/dist-packages/tailsgreeter/settings/persistence.py
\
/usr/lib/python3/dist-packages/tailsgreeter/ui/add_settings_dialog.py
\
/usr/lib/python3/dist-packages/tailsgreeter/ui/additional_settings.py
\
/usr/lib/python3/dist-packages/tailsgreeter/ui/main_window.py
\
/usr/lib/python3/dist-packages/tailsgreeter/ui/persistent_storage.py
\
/usr/lib/python3/dist-packages/tailsgreeter/ui/region_settings.py
\
/usr/lib/python3/dist-packages/unlock_veracrypt_volumes/volume.py
\
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment