def __init__(self, screen, installed_disk=None): """ Constructor. @type screen: SnackScreen @param screen: SnackScreen instance @type installed_disk: String @param installed_disk: The disk where PowerKVM was installed @rtype: None @return: Nothing """ if installed_disk != None: reinstall_disk_msg = REINSTALL_DISK_MSG.localize() % installed_disk else: reinstall_disk_msg = "" self.__screen = screen self.__msg = TextboxReflowed(60, reinstall_disk_msg + WARNING_MSG.localize()) self.__buttonsBar = ButtonBar(self.__screen, [(NO.localize(), "no"), (YES.localize(), "yes")]) self.__grid = GridForm(self.__screen, IBM_POWERKVM.localize() % STR_VERSION, 1, 3) self.__grid.add(self.__msg, 0, 0) self.__grid.add(self.__buttonsBar, 0, 1, (0, 1, 0, 0))
def __init__(self, screen): """ Constructor @type screen: SnackScreen @param screen: SnackScreen instance """ self.__screen = screen self.__grid = GridForm(self.__screen, IBM_POWERKVM.localize() % STR_VERSION, 1, 1)
def showMessageBox(self, message): """ Draws the message box @rtype: nothing @returns: nothing """ textBox = TextboxReflowed(len(message), message) okButtonBar = ButtonBar(self.__screen, [(OK.localize(), "ok")]) grid = GridForm(self.__screen, IBM_POWERKVM.localize() % STR_VERSION, 1, 2) grid.add(textBox, 0, 0) grid.add(okButtonBar, 0, 1, (0, 1, 0, 0)) grid.run() self.__screen.popWindow()
def __init__(self, screen): """ Constructor @type screen: SnackScreen @param screen: SnackScreen instance """ self.__screen = screen self.__msg = INVALID_ENTITLEMENT.localize() + REBOOT_MSG.localize() self.__msg = TextboxReflowed(40, self.__msg) self.__buttonsBar = ButtonBar(self.__screen, [(OK.localize(), "ok")]) self.__grid = GridForm(self.__screen, IBM_POWERKVM.localize() % STR_VERSION, 1, 2) self.__grid.add(self.__msg, 0, 0) self.__grid.add(self.__buttonsBar, 0, 1, (0,1,0,0))
def showConfirmationBox(self, message): """ Draws the confirmation box and returns the selected button @rtype: str @returns: True for 'YES', False for 'NO' """ textBox = TextboxReflowed(len(message), message) buttonsBar = ButtonBar(self.__screen, [(YES.localize(), True), (NO.localize(), False)]) grid = GridForm(self.__screen, IBM_POWERKVM.localize() % STR_VERSION, 1, 2) grid.add(textBox, 0, 0) grid.add(buttonsBar, 0, 1, (0, 1, 0, 0)) result = grid.run() self.__screen.popWindow() return buttonsBar.buttonPressed(result)
def __init__(self, screen): """ Constructor @type screen: SnackScreen @param screen: SnackScreen instance """ self.__screen = screen self.__screen.pushHelpLine(SELECT_HELP_LINE.localize()) self.__msg = TextboxReflowed(40, SELECT_DEVICE_TO_INSTALL.localize()) self.__list = Listbox(5, returnExit=1) self.__buttonsBar = ButtonBar(self.__screen, [(OK.localize(), "ok"), (BACK.localize(), "back")]) self.__grid = GridForm(self.__screen, IBM_POWERKVM.localize() % STR_VERSION, 1, 3) self.__grid.add(self.__msg, 0, 0) self.__grid.add(self.__list, 0, 1, (0, 1, 0, 0)) self.__grid.add(self.__buttonsBar, 0, 2) self.__grid.addHotKey('F3')
def __init__(self, screen, device, data): """ Constructor @type screen: SnackScreen @param screen: SnackScreen instance """ self.__screen = screen self.__device = device self.__data = data self.__textbox = Textbox(40, 10, "", scroll = 1) self.__buttonsBar = ButtonBar(self.__screen, [(OK.localize(), "ok"), (BACK.localize(), "back")]) self.__grid = GridForm(self.__screen, IBM_POWERKVM.localize() % STR_VERSION, 1, 3) self.__grid.add(self.__textbox, 0, 0) self.__grid.add(self.__buttonsBar, 0, 1)
def __init__(self, screen): """ Constructor. @type screen: SnackScreen @param screen: SnackScreen instance @rtype: None @return: Nothing """ self.__screen = screen self.__msg = REINSTALL_ERROR_MSG.localize() self.__msg = TextboxReflowed(40, self.__msg) self.__buttonsBar = ButtonBar(self.__screen, [(OK.localize(), "ok")]) self.__grid = GridForm(self.__screen, IBM_POWERKVM.localize() % STR_VERSION, 1, 2) self.__grid.add(self.__msg, 0, 0) self.__grid.add(self.__buttonsBar, 0, 1, (0,1,0,0))
def __init__(self, screen): """ Constructor @type screen: SnackScreen @param screen: SnackScreen instance """ self.__total = 0 self.__screen = screen self.__progressBar = Scale(self.__screen.width-35, 100) self.__msg = TextboxReflowed(self.__screen.width-30, PREPARING_TO_INSTALL_IBM_POWERKVM.localize()) self.__grid = GridForm(self.__screen, IBM_POWERKVM.localize() % STR_VERSION, 1, 3) self.__grid.add(self.__progressBar, 0, 0) self.__grid.add(self.__msg, 0, 1, (0, 1, 0, 0)) self.__grid.draw() self.__screen.refresh() self.__installedPackages = 0