OLD | NEW |
1 # This file is part of the Juju Quickstart Plugin, which lets users set up a | 1 # This file is part of the Juju Quickstart Plugin, which lets users set up a |
2 # Juju environment in very few steps (https://launchpad.net/juju-quickstart). | 2 # Juju environment in very few steps (https://launchpad.net/juju-quickstart). |
3 # Copyright (C) 2013 Canonical Ltd. | 3 # Copyright (C) 2013 Canonical Ltd. |
4 # | 4 # |
5 # This program is free software: you can redistribute it and/or modify it under | 5 # This program is free software: you can redistribute it and/or modify it under |
6 # the terms of the GNU Affero General Public License version 3, as published by | 6 # the terms of the GNU Affero General Public License version 3, as published by |
7 # the Free Software Foundation. | 7 # the Free Software Foundation. |
8 # | 8 # |
9 # This program is distributed in the hope that it will be useful, but WITHOUT | 9 # This program is distributed in the hope that it will be useful, but WITHOUT |
10 # ANY WARRANTY; without even the implied warranties of MERCHANTABILITY, | 10 # ANY WARRANTY; without even the implied warranties of MERCHANTABILITY, |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 text = [bullet, ' {}'.format(env_short_description)] | 226 text = [bullet, ' {}'.format(env_short_description)] |
227 widgets.append(ui.MenuButton(text, ui.thunk(detail_view, env_data))) | 227 widgets.append(ui.MenuButton(text, ui.thunk(detail_view, env_data))) |
228 # Add the buttons used to create new environments. | 228 # Add the buttons used to create new environments. |
229 widgets.extend([ | 229 widgets.extend([ |
230 urwid.Divider(), | 230 urwid.Divider(), |
231 urwid.Text(( | 231 urwid.Text(( |
232 'highlight', 'Create a new environment:')), | 232 'highlight', 'Create a new environment:')), |
233 urwid.Divider(), | 233 urwid.Divider(), |
234 ]) | 234 ]) |
235 # The Juju GUI can be safely installed in the bootstrap node only if its | 235 # The Juju GUI can be safely installed in the bootstrap node only if its |
236 # series is "precise". Suggest this setting by pre-filling the value. | 236 # series matches one of the series supported by the GUI. |
237 preferred_series = settings.JUJU_GUI_PREFERRED_SERIES | 237 # Suggest the most recent supported series by pre-filling the value. |
| 238 preferred_series = settings.JUJU_GUI_SUPPORTED_SERIES[-1] |
238 widgets.extend([ | 239 widgets.extend([ |
239 ui.MenuButton( | 240 ui.MenuButton( |
240 ['\N{BULLET} new ', ('highlight', label), ' environment'], | 241 ['\N{BULLET} new ', ('highlight', label), ' environment'], |
241 ui.thunk(edit_view, { | 242 ui.thunk(edit_view, { |
242 'type': env_type, 'default-series': preferred_series}) | 243 'type': env_type, 'default-series': preferred_series}) |
243 ) | 244 ) |
244 for env_type, label in envs.get_supported_env_types(env_type_db) | 245 for env_type, label in envs.get_supported_env_types(env_type_db) |
245 ]) | 246 ]) |
246 # Set up the application status messages. | 247 # Set up the application status messages. |
247 status = [' \N{UPWARDS ARROW LEFTWARDS OF DOWNWARDS ARROW} navigate '] | 248 status = [' \N{UPWARDS ARROW LEFTWARDS OF DOWNWARDS ARROW} navigate '] |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
450 ('cancel', ui.thunk(cancel, env_data)), | 451 ('cancel', ui.thunk(cancel, env_data)), |
451 ('restore', ui.thunk(render_form, env_data, initial_errors)), | 452 ('restore', ui.thunk(render_form, env_data, initial_errors)), |
452 ) | 453 ) |
453 widgets.append(forms.create_actions(actions)) | 454 widgets.append(forms.create_actions(actions)) |
454 contents = ui.TabNavigationListBox( | 455 contents = ui.TabNavigationListBox( |
455 urwid.SimpleFocusListWalker(widgets)) | 456 urwid.SimpleFocusListWalker(widgets)) |
456 app.set_contents(contents) | 457 app.set_contents(contents) |
457 | 458 |
458 # Render the initial form. | 459 # Render the initial form. |
459 render_form(env_data, initial_errors) | 460 render_form(env_data, initial_errors) |
OLD | NEW |