コード例 #1
0
ファイル: rootchangepassword.py プロジェクト: bjwt/leopard
    def __init__(self, screen):
        """
        Constructor

        @type  screen: SnackScreen
        @param screen: SnackScreen instance
        """
        self.__screen = screen

        msg = TextboxReflowed(40, PASSWD_WINDOW_MSG.localize())

        self.__buttonsBar = ButtonBar(self.__screen, [(OK.localize(), "ok"),
            (BACK.localize(), 'back')])

        self.__passwd = Entry(24, "", password=1)
        self.__passwdConfirm = Entry(24, "", password=1)

        passwdLabel = Label(PASSWD_LABEL.localize())
        passwdConfirmLabel = Label(PASSWD_CONFIRM_LABEL.localize())

        passwdGrid = Grid(2, 2)
        passwdGrid.setField(passwdLabel, 0, 0, anchorLeft=1)
        passwdGrid.setField(passwdConfirmLabel, 0, 1, anchorLeft=1)
        passwdGrid.setField(self.__passwd, 1, 0)
        passwdGrid.setField(self.__passwdConfirm, 1, 1)

        self.__grid = GridForm(self.__screen, PASSWD_WINDOW_TITLE.localize(), 1, 3)
        self.__grid.add(msg, 0, 0)
        self.__grid.add(passwdGrid, 0, 1, (0, 1, 0, 0))
        self.__grid.add(self.__buttonsBar, 0, 2, (0, 1, 0, 0))
コード例 #2
0
ファイル: installprogress.py プロジェクト: bjwt/leopard
    def showGeneralError(self):
        """
        Displays an error when there is any error during installation

        @rtype: nothing
        @returns: nothing
        """
        ButtonChoiceWindow(self.__screen, ERROR_INSTALLATION.localize(),
                           ERROR_INSTALLATION_MSG.localize(),
                           buttons=[(OK.localize(), 'ok')],
                           width=50)
コード例 #3
0
ファイル: selectharddisk.py プロジェクト: bjwt/leopard
    def showErrorDiskSize(self):
        """
        Displays an error about the disk size

        @rtype: nothing
        @returns: nothing
        """
        ButtonChoiceWindow(self.__screen, ERROR_DISK_SIZE.localize(),
                           ERROR_DISK_SIZE_MSG.localize(),
                           buttons=[(OK.localize(), 'ok')],
                           width=50)
コード例 #4
0
ファイル: selectharddisk.py プロジェクト: bjwt/leopard
    def showErrorNoDisk(self):
        """
        Displays an error when no disk found

        @rtype: nothing
        @returns: nothing
        """
        ButtonChoiceWindow(self.__screen, ERROR_NO_DISK_FOUND.localize(),
                           ERROR_NO_DISK_FOUND_MSG.localize(),
                           buttons=[(OK.localize(), 'ok')],
                           width=50)
コード例 #5
0
ファイル: rootchangepassword.py プロジェクト: bjwt/leopard
    def showErrorLength(self):
        """
        Displays an error about the password length

        @rtype: nothing
        @returns: nothing
        """
        ButtonChoiceWindow(self.__screen, ERROR_PASSWD_LENGTH.localize(),
                           ERROR_PASSWD_LENGTH_MSG.localize(),
                           buttons=[(OK.localize(), 'ok')],
                           width=50)
コード例 #6
0
ファイル: rootchangepassword.py プロジェクト: bjwt/leopard
    def showErrorMismatch(self):
        """
        Displays an error about the password mismatch

        @rtype: nothing
        @returns: nothing
        """
        ButtonChoiceWindow(self.__screen, ERROR_PASSWD_MISMATCH.localize(),
                           ERROR_PASSWD_MISMATCH_MSG.localize(),
                           buttons=[(OK.localize(), 'ok'), (BACK.localize(),
                               'back')],
                           width = 50)
コード例 #7
0
ファイル: licensewindow.py プロジェクト: bjwt/leopard
    def __init__(self, screen):
        """
        Constructor
        """
        self.__screen = screen
        self.__msg  = Textbox(70, 8, "", scroll = 1, wrap = 1)
        self.__acceptButton = ButtonBar(self.__screen, [(LICENSE_BUTTON_ACCEPT.localize(), ACCEPT_LABEL)])
        self.__declineButton = ButtonBar(self.__screen, [(LICENSE_BUTTON_DECLINE.localize(), DECLINE_LABEL)])
        self.__defaultButton = ButtonBar(self.__screen, [(OK.localize(), OK_LABEL), (BACK.localize(), BACK_LABEL)])

        self.__grid = GridForm(self.__screen, WELCOME_IBM_POWERKVM.localize() % STR_VERSION, 1, 5)
        self.__grid.add(self.__msg, 0, 0)
コード例 #8
0
ファイル: datetimesetup.py プロジェクト: bjwt/leopard
    def showErrorWrongFormat(self, str_date):
        """
        Displays an error about the datetime format

        @rtype: nothing
        @returns: nothing
        """
        ButtonChoiceWindow(self.__screen, ERROR_DATETIME_FORMAT.localize(),
                           ERROR_DATETIME_FORMAT_MSG.localize() % str_date,
                           buttons=[(OK.localize(), 'ok'), (BACK.localize(),
                               'back')],
                           width = 50)
コード例 #9
0
ファイル: ntpsetup.py プロジェクト: bjwt/leopard
    def __init__(self, screen):
        """
        Constructor

        @type  screen: SnackScreen
        @param screen: SnackScreen instance
        """
        self.__screen = screen

        self.__enablelabel = Label(ENABLE_LABEL.localize())
        self.__ntp_server_1_label = Label(NTPSETUP_SERVER_1.localize())
        self.__ntp_server_2_label = Label(NTPSETUP_SERVER_2.localize())
        self.__ntp_server_3_label = Label(NTPSETUP_SERVER_3.localize())
        self.__ntp_server_4_label = Label(NTPSETUP_SERVER_4.localize())

        self.__enablentp = Checkbox("")

        self.__localserverhost_1 = ""
        self.__localserverhost_2 = ""
        self.__localserverhost_3 = ""
        self.__localserverhost_4 = ""

        self.__server_1 = Entry(35, "")
        self.__server_2 = Entry(35, "")
        self.__server_3 = Entry(35, "")
        self.__server_4 = Entry(35, "")

        self.useDynamicCheckBox()

        self.__contentGrid = Grid(3, 6)

        self.__contentGrid.setField(self.__enablelabel, 0, 0, anchorLeft=1)
        self.__contentGrid.setField(self.__enablentp, 1, 0, (1, 0, 0, 0))
        self.__enablentp.setCallback(self.useDynamicCheckBox)

        self.__contentGrid.setField(self.__ntp_server_1_label, 1, 1, anchorLeft=1)
        self.__contentGrid.setField(self.__ntp_server_2_label, 1, 2, anchorLeft=1)
        self.__contentGrid.setField(self.__ntp_server_3_label, 1, 3, anchorLeft=1)
        self.__contentGrid.setField(self.__ntp_server_4_label, 1, 4, anchorLeft=1)

        self.__contentGrid.setField(self.__server_1, 2, 1, (1, 0, 0, 0))
        self.__contentGrid.setField(self.__server_2, 2, 2, (1, 0, 0, 0))
        self.__contentGrid.setField(self.__server_3, 2, 3, (1, 0, 0, 0))
        self.__contentGrid.setField(self.__server_4, 2, 4, (1, 0, 0, 0))

        self.__buttonsBar = ButtonBar(self.__screen, [(OK.localize(),"ok"),
            (BACK.localize(), "back")])

        self.__grid = GridForm(self.__screen, NTPSETUP_CONFIG_NTP.localize(), 1, 2)
        self.__grid.add(self.__contentGrid, 0, 0, (0,0,0,1))
        self.__grid.add(self.__buttonsBar, 0, 1)
コード例 #10
0
ファイル: upgradeprogress.py プロジェクト: bjwt/leopard
    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()
コード例 #11
0
ファイル: entitlementerror.py プロジェクト: bjwt/leopard
    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))
コード例 #12
0
ファイル: selectharddisk.py プロジェクト: bjwt/leopard
    def __showDiskInformation(self, diskData, size, name):
        """
        Displays detailed information about the selected disk

        @type: str
        @param: disk selected

        @rtype: nothing
        @returns: nothing
        """
        layout = self.__formatPartitioningLayout(diskData, size)

        ButtonChoiceWindow(self.__screen, "%s - %s" % (SELECT_TITLE.localize(), name),
                           '\n'.join(layout),
                           buttons=[(OK.localize(), 'ok')],
                           width=70)
コード例 #13
0
ファイル: selectharddisk.py プロジェクト: bjwt/leopard
    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')
コード例 #14
0
ファイル: reinstallerror.py プロジェクト: bjwt/leopard
    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))
コード例 #15
0
ファイル: summary.py プロジェクト: bjwt/leopard
    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)
コード例 #16
0
ファイル: datetimesetup.py プロジェクト: bjwt/leopard
    def __init__(self, screen):
        """
        Constructor

        @type  screen: SnackScreen
        @param screen: SnackScreen instance
        """
        self.__screen = screen

        self.__date_label = Label(DATE_LABEL.localize())
        self.__time_label = Label(TIME_LABEL.localize())

        self.__list_year   = Listbox(1, scroll=0, width=4, returnExit=1)
        self.__list_month  = Listbox(1, scroll=0, width=2, returnExit=1)
        self.__list_day    = Listbox(1, scroll=0, width=2, returnExit=1)
        self.__list_hour   = Listbox(1, scroll=0, width=2, returnExit=1)
        self.__list_minute = Listbox(1, scroll=0, width=2, returnExit=1)
        self.__list_second = Listbox(1, scroll=0, width=2, returnExit=1)


        self.__contentGrid = Grid(6, 2)
        self.__contentGrid.setField(self.__date_label, 0, 0, anchorLeft=1)
        self.__contentGrid.setField(self.__list_year,  1, 0, anchorLeft=1)
        self.__contentGrid.setField(Label("/"),        2, 0, anchorLeft=1)
        self.__contentGrid.setField(self.__list_month,      3, 0, anchorLeft=1)
        self.__contentGrid.setField(Label("/"),        4, 0, anchorLeft=1)
        self.__contentGrid.setField(self.__list_day,        5, 0, anchorLeft=1)


        self.__contentGrid.setField(self.__time_label, 0, 1, (1, 0, 0, 0))
        self.__contentGrid.setField(self.__list_hour,       1, 1, anchorLeft=1)
        self.__contentGrid.setField(Label(":"),        2, 1, anchorLeft=1)
        self.__contentGrid.setField(self.__list_minute,     3, 1, anchorLeft=1)
        self.__contentGrid.setField(Label(":"),        4, 1, anchorLeft=1)
        self.__contentGrid.setField(self.__list_second,     5, 1, anchorLeft=1)

        self.__buttonsBar = ButtonBar(self.__screen, [(OK.localize(),"ok"),
            (BACK.localize(), "back")])

        self.__grid = GridForm(self.__screen, DATE_TIME_SETUP.localize(), 1, 2)
        self.__grid.add(self.__contentGrid, 0, 0, (0,0,0,1))
        self.__grid.add(self.__buttonsBar, 0, 1)
コード例 #17
0
ファイル: adjusttimezone.py プロジェクト: bjwt/leopard
    def __init__(self, screen):
        """
        Constructor

        @type  screen: SnackScreen
        @param screen: SnackScreen instance
        """
        self.__screen = screen
        self.__msg = TextboxReflowed(40, TIMEZONE_LABEL.localize())
        self.__list = Listbox(5, scroll=1, returnExit=1)
        self.__utc = Checkbox(TIMEZONE_UTC_CHECKBOX_LABEL.localize(), isOn=0)
        self.__buttonsBar = ButtonBar(self.__screen, [(OK.localize(), "ok"),
            (BACK.localize(), "back")])

        self.__grid = GridForm(self.__screen,
                TIMEZONE_SELECTION_LABEL.localize(), 1, 4)
        self.__grid.add(self.__msg, 0, 0)
        self.__grid.add(self.__list, 0, 1, (0, 1, 0, 0))
        self.__grid.add(self.__utc, 0, 2, (0, 1, 0, 0), anchorLeft=1)
        self.__grid.add(self.__buttonsBar, 0, 3, (0, 1, 0, 0))
コード例 #18
0
ファイル: menu.py プロジェクト: bjwt/leopard
    def __init__(self, screen):
        """
        Constructor

        @type  screen: SnackScreen
        @param screen: SnackScreen instance
        """
        self.__screen = screen

        self.__msg = TextboxReflowed(40,
                SELECT_ONE_OF_THE_OPTIONS_BELOW.localize())
        self.__list = Listbox(5, returnExit=0)

        self.__buttonsBar = ButtonBar(self.__screen, [(OK.localize(), "ok"),
            (BACK.localize(), "back")])

        self.__grid = GridForm(self.__screen, WELCOME_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, (0,1,0,0))


        self.__screen.pushHelpLine(HELP_LINE.localize())