Пример #1
0
    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))
Пример #2
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)