564d9533 |
#
# Copyright (C) 2017 vmware inc.
#
# Author: Xiaolin Li <xiaolinl@vmware.com>
from menu import Menu
from window import Window
from actionresult import ActionResult
class LinuxSelector(object): |
08b29746 |
def __init__(self, maxy, maxx, install_config): |
564d9533 |
self.install_config = install_config
self.maxx = maxx
self.maxy = maxy |
08b29746 |
self.win_width = 60 |
564d9533 |
self.win_height = 13
|
a672bd24 |
self.win_starty = (self.maxy - self.win_height) // 2
self.win_startx = (self.maxx - self.win_width) // 2 |
564d9533 |
|
08b29746 |
self.menu_starty = self.win_starty + 6 |
564d9533 |
self.menu_items = [] |
9def2a2d |
self.menu_items.append(("1. VMware hypervisor optimized", self.set_linux_esx_installation, True)) |
08b29746 |
self.menu_items.append(("2. Generic", self.set_linux_esx_installation, False)) |
564d9533 |
self.host_menu = Menu(self.menu_starty, self.maxx, self.menu_items, |
08b29746 |
default_selected=0, tab_enable=False) |
564d9533 |
self.window = Window(self.win_height, self.win_width, self.maxy, self.maxx, |
a672bd24 |
'Select Linux kernel to install', True, tab_enabled=False, |
08b29746 |
position=1, can_go_next=True) |
564d9533 |
self.window.set_action_panel(self.host_menu)
def set_linux_esx_installation(self, is_linux_esx):
self.install_config['install_linux_esx'] = is_linux_esx
return ActionResult(True, None)
def display(self, params): |
08b29746 |
self.window.addstr(0, 0, 'The installer has detected that you are installing')
self.window.addstr(1, 0, 'Photon OS on a VMware hypervisor.')
self.window.addstr(2, 0, 'Which type of Linux kernel would you like to install?') |
564d9533 |
return self.window.do_action() |