def _varmenu_select(userid, choice, popupid):
    if es.exists('variable', choice):
        parentmenu = popuplib.find(popupid)
        parent = parentmenu._xa[0]
        if str(parent) != 'core':
            if xa.exists(parent) and choice in xa.find(parent).variables:
                var = xa.find(parent).variables[choice]
                menu = _variableEditMenu(userid, parent, var, popupid)
                menu.send(userid)
        else:
            for var in xa.corevars():
                if var.getName() == choice:
                    menu = _variableEditMenu(userid, parent, var, popupid)
                    menu.send(userid)
Beispiel #2
0
def _varmenu_select(userid,choice,popupid):
    if es.exists('variable', choice):
        parentmenu = popuplib.find(popupid)
        parent = parentmenu._xa[0]
        if str(parent) != 'core':
            if xa.exists(parent) and choice in xa.find(parent).variables:
                var = xa.find(parent).variables[choice]
                menu = _variableEditMenu(userid, parent, var, popupid)
                menu.send(userid)
        else:
            for var in xa.corevars():
                if var.getName() == choice:
                    menu = _variableEditMenu(userid, parent, var, popupid)
                    menu.send(userid)
Beispiel #3
0
def _variableCoreListMenu(userid, parent):
    varlist = xa.corevars()
    varmenu = popuplib.easymenu('xalistsettingmenu_'+str(userid)+'_core',None,_varmenu_select)
    varmenu.settitle(lang['core variables'])
    varmenu.submenu(parent)
    varmenu._xa = ['core', parent]
    menulist.append(varmenu)
    for var in sorted(varlist):
        var._def = str(var)
        var._descr = 'Core variable'
        value = str(var)
        if len(value) > 10:
            value = value[0:10]
        varmenu.addoption(str(var.getName()), xaconfig.language.createLanguageString(str(var.getName())+' = '+str(value)))
    return varmenu
def _variableCoreListMenu(userid, parent):
    varlist = xa.corevars()
    varmenu = popuplib.easymenu('xalistsettingmenu_' + str(userid) + '_core',
                                None, _varmenu_select)
    varmenu.settitle(lang['core variables'])
    varmenu.submenu(parent)
    varmenu._xa = ['core', parent]
    menulist.append(varmenu)
    for var in sorted(varlist):
        var._def = str(var)
        var._descr = 'Core variable'
        value = str(var)
        if len(value) > 10:
            value = value[0:10]
        varmenu.addoption(
            str(var.getName()),
            xaconfig.language.createLanguageString(
                str(var.getName()) + ' = ' + str(value)))
    return varmenu