def showMainScreen():
    exitCondition = ""
    customPaths = CustomPathFile()

    while (exitCondition != -1):
        #load the custom paths
        options = ['Add']

        for aPath in customPaths.getPaths():
            options.append(aPath['path'] + ' - ' + aPath['expression'])

        #show the gui
        exitCondition = dialog.select(utils.getString(30020), options)

        if (exitCondition >= 0):
            if (exitCondition == 0):
                path = selectPath()

                #could return None if dialog canceled
                if (path != None):
                    customPaths.addPath(path)
            else:
                #delete?
                if (dialog.yesno(heading=utils.getString(30021),
                                 line1=utils.getString(30022))):
                    #delete this path - subtract one because of "add" item
                    customPaths.deletePath(exitCondition - 1)
예제 #2
0
def showMainScreen(contentType):
    exitCondition = ""
    customPaths = CustomPathFile(contentType)

    while (exitCondition != -1):
        # load the custom paths
        options = ['Add']

        for aPath in customPaths.getPaths():
            options.append(aPath['path'] + ' - ' + aPath['expression'])

        # show the gui
        exitCondition = dialog.select(utils.getString(30020), options)

        if (exitCondition >= 0):
            if (exitCondition == 0):
                path = selectPath(contentType)

                # could return None if dialog canceled
                if (path is not None):
                    customPaths.addPath(path)
            else:
                # delete?
                if (dialog.yesno(heading=utils.getString(30021),
                                 line1=utils.getString(30022))):
                    # get the id of the selected item
                    aPath = customPaths.getPaths()[exitCondition - 1]
                    # delete that id
                    customPaths.deletePath(aPath['id'])