예제 #1
0
def customProfiles():
    _customProfiles = []
    profileFiles = customProfileFiles()
    for f in profileFiles:
        profile = Profile.fromFile(f)
        _customProfiles.append(profile)
    return _customProfiles
예제 #2
0
def customProfiles():
    _customProfiles = []
    profileFiles = customProfileFiles()
    for f in profileFiles:
        profile = Profile.fromFile(f)
        _customProfiles.append(profile)
    return _customProfiles
def _recoverPreviousState():
    global previousStateFilename
    if previousStateFilename:
        profile = Profile.fromFile(previousStateFilename)
        profile.apply()
        previousStateFilename = None
def applyProfile(profileFile):
    profile = Profile.fromFile(os.path.join(os.path.dirname(__file__), 'userprofiles', profileFile))
    profile.apply()
    return profile
예제 #5
0
from PyQt4.QtCore import QSettings
from PyQt4.QtGui import QMessageBox

from qgis.core import QgsApplication
from qgis.utils import iface

from profiles.profile import Profile
from profiles.utils import saveCurrentStatus
import time

profiles = {}

profileFiles = glob.glob(os.path.join(os.path.dirname(__file__), '*.json'))
for f in profileFiles:
    profile = Profile.fromFile(f)
    profiles[profile.name] = profile


def customProfileFiles():
    customProfileFilepath = os.path.join(QgsApplication.qgisSettingsDirPath(), 'profiles')

    if os.path.exists(customProfileFilepath):
        return glob.glob(os.path.join(customProfileFilepath, '*.json'))
    else:
        return []


def hasCustomProfiles():
    return bool(customProfileFiles())
예제 #6
0
def _recoverPreviousState():
    global previousStateFilename
    if previousStateFilename:
        profile = Profile.fromFile(previousStateFilename)
        profile.apply()
        previousStateFilename = None
예제 #7
0
def applyProfile(profileFile):
    profile = Profile.fromFile(os.path.join(os.path.dirname(__file__), 'userprofiles', profileFile))
    profile.apply()
    return profile
예제 #8
0
import time

from qgis.PyQt.QtCore import QSettings
from qgis.PyQt.QtWidgets import QMessageBox

from qgis.core import QgsApplication
from qgis.utils import iface

from profiles.profile import Profile
from profiles.utils import saveCurrentStatus

profiles = {}

profileFiles = glob.glob(os.path.join(os.path.dirname(__file__), '*.json'))
for f in profileFiles:
    profile = Profile.fromFile(f)
    profiles[profile.name] = profile


def customProfileFiles():
    customProfileFilepath = os.path.join(QgsApplication.qgisSettingsDirPath(),
                                         'profiles')

    if os.path.exists(customProfileFilepath):
        return glob.glob(os.path.join(customProfileFilepath, '*.json'))
    else:
        return []


def hasCustomProfiles():
    return bool(customProfileFiles())