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 28531f3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 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
9 changes: 3 additions & 6 deletions python/plugins/sextante/modeler/ModelerDialog.py
Expand Up @@ -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
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 28531f3

Please sign in to comment.