Skip to content

Commit

Permalink
fixed #6635. Partial solution, now it goes to (0,0) upon model loading
Browse files Browse the repository at this point in the history
  • Loading branch information
volaya committed Nov 18, 2012
1 parent 063f4de commit 3f40232
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
1 change: 0 additions & 1 deletion python/plugins/sextante/CMakeLists.txt
Expand Up @@ -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)
Expand Down
Expand Up @@ -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):
Expand Down
7 changes: 2 additions & 5 deletions python/plugins/sextante/modeler/ModelerDialog.py
Expand Up @@ -50,11 +50,7 @@ def __init__(self, alg=None):
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.view.centerOn(0, 0)
else:
self.alg = ModelerAlgorithm()
self.alg.setModelerView(self)
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 3f40232

Please sign in to comment.