def __build_GUI__(self):
        # Skip phase if it's configuring an already installed app
        install_type = CTK.cfg.get_val('%s!install_type' % (CFG_PREFIX))
        if install_type == 'local_directory':
            self += CTK.DruidContent_TriggerNext()
            return

        # Refresh
        refresh = CTK.Refreshable(
            {'id': 'wizard2-stage-install-dir-type-refresh'})
        refresh.register(lambda: self.Refresh_Content(refresh, self).Render())

        # Radio buttons
        radios = CTK.RadioGroupCfg('%s!install_dir_type' % (CFG_PREFIX),
                                   INSTALL_DIR_OPTIONS,
                                   {'checked': INSTALL_DIR_OPTIONS[0][0]})

        # Submitter
        submit = CTK.Submitter(URL_STAGE_INSTALL_DIR_APPLY)
        submit.bind(
            'submit_success',
            CTK.DruidContent__JS_if_internal_submit(refresh.JS_to_refresh()))
        submit += radios

        # GUI Layout
        self += submit
        self += refresh
        self.bind('goto_next_stage',
                  CTK.DruidContent__JS_to_goto_next(self.id))
    def __build_GUI__(self):
        table = CTK.PropsTable()
        table.Add(
            _('Web Directory'),
            CTK.TextCfg('%s!web_directory' % (CFG_PREFIX), False,
                        {'class': 'noauto'}), _(NOTE_WEBDIR))

        submit = CTK.Submitter(URL_STAGE_ENTER_WEBDIR_APPLY)
        submit.bind('submit_success',
                    CTK.DruidContent__JS_to_goto_next(table.id))
        submit += table

        self += submit
    def __build_GUI__(self):
        app_fetch = CTK.cfg.get_val('%s!app_fetch' % (CFG_PREFIX))
        skip = False

        # Special cases
        if not app_fetch:
            skip = True

        if not app_fetch.startswith('http'):
            skip = True

            # (app_fetch != 'auto')):

        # Skip the phase?
        if skip:
            self += CTK.RawHTML(js=CTK.DruidContent__JS_to_goto_next(self.id))
            return

        # Report
        report = CTK.Box()
        report += CTK.RawHTML(_("Initiating download.."))

        # Download widget
        down = CTK.Downloader('package', app_fetch)
        down.bind('finished', CTK.DruidContent__JS_to_goto_next(self.id))
        down.bind('stopped', "")  ## TODO!!
        down.bind('error', "")  ## TODO!!
        down.bind(
            'update',
            "$('#%s').html('Downloaded: ' + (event.downloaded / 1024).toFixed() + ' Kb');"
            % (report.id))

        self += CTK.RawHTML(
            '<p>%s</p>' %
            (_('The application is being downloaded. Hold on tight!')))
        self += down
        self += report
        self += CTK.RawHTML(js=down.JS_to_start())
    def __build_GUI__(self):
        table = CTK.PropsTable()
        table.Add(
            _('Domain Name'),
            CTK.TextCfg('%s!vserver_nick' % (CFG_PREFIX), False,
                        {'class': 'noauto'}), _(NOTE_VSERVER))

        box = CTK.Box({'class': 'market-target-selection'})

        submit = CTK.Submitter(URL_STAGE_ENTER_VSERVER_APPLY)
        submit.bind('submit_success',
                    CTK.DruidContent__JS_to_goto_next(box.id))
        submit += table

        box += submit
        self += box
    def __build_GUI__(self):
        # Refresh
        refresh = CTK.Refreshable({'id': 'wizard2-stage-install-type-refresh'})
        refresh.register(lambda: self.Refresh_Content(refresh, self).Render())

        # Radio buttons
        radios = CTK.RadioGroupCfg('%s!install_type' % (CFG_PREFIX),
                                   INSTALL_OPTIONS,
                                   {'checked': INSTALL_OPTIONS[0][0]})

        # Submitter
        submit = CTK.Submitter(URL_STAGE_INSTALL_APPLY)
        submit.bind(
            'submit_success',
            CTK.DruidContent__JS_if_internal_submit(refresh.JS_to_refresh()))
        submit += radios

        # GUI Layout
        self += submit
        self += refresh
        self.bind('goto_next_stage',
                  CTK.DruidContent__JS_to_goto_next(self.id))