Skip to content
Permalink
Browse files

[processing] handle provider modifications when settings have been ed…

…ited
  • Loading branch information
volaya committed Apr 27, 2016
1 parent f33749a commit bee4068b898e06158c2484be4807732368ddeed1
@@ -27,11 +27,17 @@

import os

from PyQt.QtCore import QPyNullVariant, QCoreApplication, QSettings
from PyQt.QtCore import QPyNullVariant, QCoreApplication, QSettings, QObject, pyqtSignal
from PyQt.QtGui import QIcon
from processing.tools.system import defaultOutputFolder
import processing.tools.dataobjects

class SettingsWatcher(QObject):

settingsChanged = pyqtSignal()

settingsWatcher = SettingsWatcher()


class ProcessingConfig:

@@ -48,8 +48,9 @@
from qgis.gui import QgsDoubleSpinBox
from qgis.gui import QgsSpinBox

from processing.core.ProcessingConfig import ProcessingConfig
from processing.core.ProcessingConfig import Setting
from processing.core.ProcessingConfig import (ProcessingConfig,
settingsWatcher,
Setting)
from processing.core.Processing import Processing
from processing.gui.menus import updateMenus
from processing.gui.menus import menusSettingsGroup
@@ -249,6 +250,7 @@ def accept(self):
return
setting.save()
Processing.updateAlgsList()
settingsWatcher.settingsChanged.emit()
updateMenus()

QDialog.accept(self)
@@ -36,7 +36,7 @@
from processing.gui.Postprocessing import handleAlgorithmResults
from processing.core.Processing import Processing, algListWatcher
from processing.core.ProcessingLog import ProcessingLog
from processing.core.ProcessingConfig import ProcessingConfig
from processing.core.ProcessingConfig import ProcessingConfig, settingsWatcher
from processing.gui.MessageDialog import MessageDialog
from processing.gui import AlgorithmClassification
from processing.gui.AlgorithmDialog import AlgorithmDialog
@@ -53,8 +53,6 @@

class ProcessingToolbox(BASE, WIDGET):

updateAlgList = True

def __init__(self):
super(ProcessingToolbox, self).__init__(None)
self.tipWasClosed = False
@@ -85,6 +83,7 @@ def openSettings(url):

algListWatcher.providerRemoved.connect(self.removeProvider)
algListWatcher.providerAdded.connect(self.addProvider)
settingsWatcher.settingsChanged.connect(self.fillTree)

def showDisabled(self):
self.txtDisabled.setVisible(False)
@@ -157,12 +156,7 @@ def activateProvider(self, providerName):
QMessageBox.warning(self, "Activate provider",
"The provider has been activated, but it might need additional configuration.")


def updateProvider(self, providerName, updateAlgsList=True):
if updateAlgsList:
self.updateAlgList = False
Processing.updateAlgsList()
self.updateAlgList = True
def updateProvider(self, providerName):
item = self._providerItem(providerName)
if item is not None:
item.refresh()

0 comments on commit bee4068

Please sign in to comment.
You can’t perform that action at this time.