mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-23 00:02:38 -05:00
[settings] use dedicated category for plugin manager
This commit is contained in:
parent
321f050f44
commit
4759610ddd
@ -294,7 +294,7 @@ class QgsPluginInstaller(QObject):
|
||||
def exportSettingsGroup(self):
|
||||
""" Return QgsSettings settingsGroup value """
|
||||
# todo QGIS 4 remove
|
||||
return "plugins/_plugin_manager"
|
||||
return "plugin-manager"
|
||||
|
||||
# ----------------------------------------- #
|
||||
def upgradeAllUpgradeable(self):
|
||||
@ -578,7 +578,7 @@ class QgsPluginInstaller(QObject):
|
||||
if not os.path.isfile(filePath):
|
||||
return
|
||||
|
||||
QgsSettingsTree.createPluginTreeNode("_plugin_manager").childSetting("last-zip-directory").setValue(QFileInfo(filePath).absoluteDir().absolutePath())
|
||||
QgsSettingsTree.nodeCopy("plugin-manager").childSetting("last-zip-directory").setValue(QFileInfo(filePath).absoluteDir().absolutePath())
|
||||
|
||||
pluginName = None
|
||||
with zipfile.ZipFile(filePath, 'r') as zf:
|
||||
|
@ -229,22 +229,22 @@ class Repositories(QObject):
|
||||
|
||||
def checkingOnStart(self) -> bool:
|
||||
""" return true if checking for news and updates is enabled """
|
||||
return QgsSettingsTree.createPluginTreeNode("_plugin_manager").childSetting('automatically-check-for-updates').value()
|
||||
return QgsSettingsTree.nodeCopy("plugin-manager").childSetting('automatically-check-for-updates').value()
|
||||
|
||||
def setCheckingOnStart(self, state: bool):
|
||||
""" set state of checking for news and updates """
|
||||
QgsSettingsTree.createPluginTreeNode("_plugin_manager").childSetting('automatically-check-for-updates').setValue(state)
|
||||
QgsSettingsTree.nodeCopy("plugin-manager").childSetting('automatically-check-for-updates').setValue(state)
|
||||
|
||||
def saveCheckingOnStartLastDate(self):
|
||||
""" set today's date as the day of last checking """
|
||||
QgsSettingsTree.createPluginTreeNode("_plugin_manager").childSetting('check-on-start-last-date').setValue(QDate.currentDate())
|
||||
QgsSettingsTree.nodeCopy("plugin-manager").childSetting('check-on-start-last-date').setValue(QDate.currentDate())
|
||||
|
||||
def timeForChecking(self) -> bool:
|
||||
""" determine whether it's the time for checking for news and updates now """
|
||||
settings = QgsSettings()
|
||||
try:
|
||||
# QgsSettings may contain ivalid value...
|
||||
interval = QgsSettingsTree.createPluginTreeNode("_plugin_manager").childSetting('check-on-start-last-date').valueAs(type=QDate).daysTo(QDate.currentDate())
|
||||
interval = QgsSettingsTree.nodeCopy("plugin-manager").childSetting('check-on-start-last-date').valueAs(type=QDate).daysTo(QDate.currentDate())
|
||||
except:
|
||||
interval = 0
|
||||
if interval >= Repositories.CHECK_ON_START_INTERVAL:
|
||||
@ -711,8 +711,8 @@ class Plugins(QObject):
|
||||
self.mPlugins = {}
|
||||
for i in list(self.localCache.keys()):
|
||||
self.mPlugins[i] = self.localCache[i].copy()
|
||||
allowExperimental = QgsSettingsTree.createPluginTreeNode("_plugin_manager").childSetting("allow-experimental").value()
|
||||
allowDeprecated = QgsSettingsTree.createPluginTreeNode("_plugin_manager").childSetting("allow-deprecated").value()
|
||||
allowExperimental = QgsSettingsTree.nodeCopy("plugin-manager").childSetting("allow-experimental").value()
|
||||
allowDeprecated = QgsSettingsTree.nodeCopy("plugin-manager").childSetting("allow-deprecated").value()
|
||||
for i in list(self.repoCache.values()):
|
||||
for j in i:
|
||||
plugin = j.copy() # do not update repoCache elements!
|
||||
@ -808,7 +808,7 @@ class Plugins(QObject):
|
||||
# ----------------------------------------- #
|
||||
def markNews(self):
|
||||
""" mark all new plugins as new """
|
||||
seenPlugins = QgsSettingsTree.createPluginTreeNode("_plugin_manager").childSetting("seen-plugins").valueWithDefaultOverride(list(self.mPlugins.keys()))
|
||||
seenPlugins = QgsSettingsTree.nodeCopy("plugin-manager").childSetting("seen-plugins").valueWithDefaultOverride(list(self.mPlugins.keys()))
|
||||
if len(seenPlugins) > 0:
|
||||
for plugin in list(self.mPlugins.keys()):
|
||||
if seenPlugins.count(plugin) == 0 and self.mPlugins[plugin]["status"] == "not installed":
|
||||
@ -817,7 +817,7 @@ class Plugins(QObject):
|
||||
# ----------------------------------------- #
|
||||
def updateSeenPluginsList(self):
|
||||
""" update the list of all seen plugins """
|
||||
setting = QgsSettingsTree.createPluginTreeNode("_plugin_manager").childSetting("seen-plugins")
|
||||
setting = QgsSettingsTree.nodeCopy("plugin-manager").childSetting("seen-plugins")
|
||||
seenPlugins = setting.valueWithDefaultOverride(list(self.mPlugins.keys()))
|
||||
for plugin in list(self.mPlugins.keys()):
|
||||
if seenPlugins.count(plugin) == 0:
|
||||
|
@ -53,7 +53,7 @@ class QgsPluginManager : public QgsOptionsDialogBase, private Ui::QgsPluginManag
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
||||
static inline QgsSettingsTreeNode *sTreePluginManager = QgsSettingsTree::sTreePlugins->createChildNode( QStringLiteral( "_plugin_manager" ) );
|
||||
static inline QgsSettingsTreeNode *sTreePluginManager = QgsSettingsTree::treeRoot()->createChildNode( QStringLiteral( "plugin-manager" ) );
|
||||
|
||||
static const QgsSettingsEntryBool *settingsAutomaticallyCheckForPluginUpdates;
|
||||
static const QgsSettingsEntryBool *settingsAllowExperimental;
|
||||
|
Loading…
x
Reference in New Issue
Block a user