Skip to content
Permalink
Browse files

fixed #6635. Partial solution, now it goes to (0,0) upon model loading

  • Loading branch information
volaya committed Nov 18, 2012
1 parent 063f4de commit 28531f3f7eaac34a05640a4847ad8e783a0389b4
@@ -7,7 +7,6 @@ ADD_SUBDIRECTORY(ftools)
ADD_SUBDIRECTORY(gdal)
ADD_SUBDIRECTORY(grass)
ADD_SUBDIRECTORY(gui)
#ADD_SUBDIRECTORY(help)
ADD_SUBDIRECTORY(images)
ADD_SUBDIRECTORY(lidar)
ADD_SUBDIRECTORY(mmqgisx)
@@ -69,7 +69,7 @@ def _loadAlgorithms(self):
folder = os.path.join(os.path.dirname(__file__), "models")
self.loadFromFolder(folder)

def loadFromFolder(self,folder):
def loadFromFolder(self,folder):
if not os.path.exists(folder):
return
for descriptionFile in os.listdir(folder):
@@ -49,14 +49,10 @@ def __init__(self, alg=None):
self.alg = alg
self.textGroup.setText(alg.group)
self.textName.setText(alg.name)
self.repaintModel()
last = self.scene.getLastAlgorithmItem()
if last is not None:
self.view.ensureVisible(last)
else:
self.view.ensureVisible(0,0,10,10)
self.repaintModel()
else:
self.alg = ModelerAlgorithm()
self.view.centerOn(0, 0)
self.alg.setModelerView(self)
self.help = None
self.update = False #indicates whether to update or not the toolbox after closing this dialog
@@ -267,6 +263,7 @@ def openModel(self):
self.textName.setText(alg.name)
self.repaintModel()
self.view.ensureVisible(self.scene.getLastAlgorithmItem())
self.view.centerOn(0,0)
except WrongModelException, e:
QMessageBox.critical(self, "Could not open model", "The selected model could not be loaded\nWrong line:" + e.msg)

0 comments on commit 28531f3

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