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 __init__ (self): CTK.Box.__init__ (self, {'class': 'market-target-selection'}) # Properties self.refresh = CTK.Refreshable({'id': 'market-target-selection-refresh'}) self.refresh.register (lambda: TargetSelection_Refresh(self.refresh).Render()) # Install as.. combo = CTK.ComboCfg('tmp!market!install!target', trans_options(TARGETS)) table = CTK.PropsTable() table.Add (_('Install as a new..'), combo, _(NOTE_CREATE_NEW)) submit = CTK.Submitter (URL_TARGET_APPLY) # Refresh only when the combo changes. Do not freshes when the # 'Next' button is clicked (and thus all the submitters are # sent). In case a Submitter from within the refreshable # failed, the error message would be lost with the refresh. submit.bind ('submit_success', CTK.DruidContent__JS_if_internal_submit (self.refresh.JS_to_refresh())) submit += table # Build GUI self += CTK.RawHTML ("<h2>%s</h2>" %(_("Deployment Type"))) self += submit self += self.refresh
def __init__ (self, refresh): CTK.Box.__init__ (self) # Populate cfg with the current type if not CTK.cfg.get_val('%s!method'%(KEY_PRE)): CTK.cfg['%s!method'%(KEY_PRE)] = METHODS[0][0] # Build widget combo = CTK.ComboCfg ('%s!method' %(KEY_PRE), trans_options(METHODS)) table = CTK.PropsTable() table.Add (_('Configuration method'), combo, _(NOTE_METHOD)) submit = CTK.Submitter (URL_METHOD_APPLY) submit.bind ('submit_success', CTK.DruidContent__JS_if_internal_submit (refresh.JS_to_refresh())) submit += table self += submit
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))
def __init__ (self, refresh, dbtypes): CTK.Box.__init__ (self) # Collect data supported = get_supported_dbs (dbtypes) types = [(x['db'], x['name']) for x in supported] # Populate cfg with the current type if not CTK.cfg.get_val('%s!db_type'%(KEY_PRE)): CTK.cfg['%s!db_type' %(KEY_PRE)] = types[0][0] # Build widget combo = CTK.ComboCfg ('%s!db_type'%(KEY_PRE), trans_options(types)) table = CTK.PropsTable() table.Add (_('Engine'), combo, _(NOTE_DBTYPE)) submit = CTK.Submitter (URL_DBTYPE_APPLY) submit.bind ('submit_success', CTK.DruidContent__JS_if_internal_submit (refresh.JS_to_refresh())) submit += table self += submit