Exemplo n.º 1
0
def selectLanguage():
    hl = getSetting("hl", str)
    keys = list(languages.keys())
    values = list(languages.values())
    preselect = keys.index(hl) if hl in languages else -1
    if (index := selectDialog(values, heading=30125,
                              preselect=preselect)) >= 0:
        setSetting("hl", keys[index], str)
        setSetting("hl.text", values[index], str)
Exemplo n.º 2
0
def selectLocation():
    gl = getSetting("gl", str)
    keys = list(locations.keys())
    values = list(locations.values())
    preselect = keys.index(gl) if gl in locations else -1
    if (index := selectDialog(values, heading=30127,
                              preselect=preselect)) >= 0:
        setSetting("gl", keys[index], str)
        setSetting("gl.text", values[index], str)
Exemplo n.º 3
0
def selectInstance():
    instance = getSetting("instance", str)
    instances = client.instances(sort_by="health")
    if instances:
        preselect = instances.index(instance) if instance in instances else -1
        index = selectDialog(instances, heading=30105, preselect=preselect)
        if index >= 0:
            setSetting("instance", instances[index], str)
Exemplo n.º 4
0
def sortBy(sort_by="relevance"):
    keys = list(__sortBy__.keys())
    index = selectDialog(
        [localizedString(value) for value in __sortBy__.values()],
        heading=30130,
        preselect=keys.index(sort_by))
    if index >= 0:
        sort_by = keys[index]
    return sort_by
Exemplo n.º 5
0
def removeChannelsFromFeed():
    if (indices := selectDialog(list(channel_feed.values()),
                                heading=30014,
                                multi=True)):
        keys = list(channel_feed.keys())
        channel_feed.remove(*(keys[index] for index in indices))