Beispiel #1
0
def locateTileset(which):
    """locate the file with a tileset"""
    path = KStandardDirs.locate("kmahjonggtileset", QString(which))
    if path is None:
        logException(TileException('cannot find kmahjonggtileset %s' %
                                   (which)))
    return QString(path)
Beispiel #2
0
def loadUi(base):
    """load the ui file for class base, deriving the file name from the class name"""
    name = base.__class__.__name__.lower() + '.ui'
    if os.path.exists(name):
        directory = os.getcwd()
    else:
        directory = os.path.dirname(str(KStandardDirs.locate("appdata", name)))
    uic.loadUi(os.path.join(directory, name), base)
Beispiel #3
0
def loadUi(base):
    """load the ui file for class base, deriving the file name from the class name"""
    name = base.__class__.__name__.lower() + '.ui'
    if os.path.exists(name):
        directory = os.getcwd()
    else:
        directory = os.path.dirname(str(KStandardDirs.locate("appdata", name)))
    uic.loadUi(os.path.join(directory, name), base)
Beispiel #4
0
def locatebackground(which):
    """locate the file with a background"""
    return QString(KStandardDirs.locate("kmahjonggbackground", QString(which)))
Beispiel #5
0
def locateTileset(which):
    """locate the file with a tileset"""
    return QString(KStandardDirs.locate("kmahjonggtileset",
                QString(which)))
Beispiel #6
0
def locatebackground(which):
    """locate the file with a background"""
    return QString(KStandardDirs.locate("kmahjonggbackground",
                QString(which)))