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
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())
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())