welcome: enable configuring of logo and text
This commit is contained in:
@@ -35,9 +35,12 @@ suggested_languages:
|
||||
- 'zh'
|
||||
|
||||
# Show a welcome page after language selection.
|
||||
# Default: usage: yes
|
||||
# A custom logo and text can be defined. Otherwise a default is used.
|
||||
# Default: logo: None, text: None, usage: yes
|
||||
welcome_page:
|
||||
usage: yes
|
||||
logo : '/your/distribution/logo.png'
|
||||
text : 'A welcoming text to inform about the installation.'
|
||||
usage : yes
|
||||
|
||||
# Minimum disk size needed for the installation (in Gigabyte)
|
||||
# Default: 5
|
||||
|
||||
@@ -42,7 +42,7 @@ def _configure_variables_set(config):
|
||||
|
||||
def _load_default_config():
|
||||
return {
|
||||
'welcome_page': {'usage': True},
|
||||
'welcome_page': {'usage': True, 'logo': None, 'text': None},
|
||||
'internet_connection_required': True,
|
||||
'internet_checker_url': 'http://nmcheck.gnome.org/check_network_status.txt',
|
||||
'suggested_languages': ['en', 'ar', 'de', 'es', 'fr', 'ja', 'ru', 'zh'],
|
||||
@@ -78,6 +78,8 @@ def _valid(config):
|
||||
return (
|
||||
_match(config, 'welcome_page', dict) and
|
||||
_match(config['welcome_page'], 'usage', bool) and
|
||||
_match(config['welcome_page'], 'logo', str, type(None)) and
|
||||
_match(config['welcome_page'], 'text', str, type(None)) and
|
||||
_match(config, 'internet_connection_required', bool) and
|
||||
_match(config, 'internet_checker_url', str) and
|
||||
_match(config, 'suggested_languages', list) and
|
||||
|
||||
@@ -17,8 +17,17 @@ class WelcomePage(Gtk.Box, Page):
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
Gtk.Box.__init__(self, **kwargs)
|
||||
text = self.description.get_label()
|
||||
text = text.format(global_state.get_config('distribution_name'))
|
||||
config = global_state.get_config('welcome_page')
|
||||
|
||||
if config['logo']:
|
||||
self.image_name = None
|
||||
self.image_path = config['logo']
|
||||
|
||||
if config['text']:
|
||||
text = config['text']
|
||||
else:
|
||||
text = self.description.get_label()
|
||||
text = text.format(global_state.get_config('distribution_name'))
|
||||
self.description.set_label(text)
|
||||
|
||||
### callbacks ###
|
||||
|
||||
Reference in New Issue
Block a user