Skip to content
Permalink
Browse files
add tooltips for groups and providers (fix #5951)
  • Loading branch information
alexbruy committed Dec 1, 2012
1 parent 53790ad commit 32ca04062e168595d5935e5d24357a5cca23b1fc
@@ -187,7 +187,8 @@ def fillTree(self):
groupItem = groups[alg.group]
else:
groupItem = QTreeWidgetItem()
groupItem.setText(0,alg.group)
groupItem.setText(0, alg.group)
groupItem.setToolTip(0, alg.group)
groups[alg.group] = groupItem
algItem = TreeAlgorithmItem(alg)
groupItem.addChild(algItem)
@@ -204,12 +205,12 @@ def fillTree(self):
algItem = TreeActionItem(action)
groupItem.addChild(algItem)


if len(groups) > 0:
providerItem = QTreeWidgetItem()
providerItem.setText(0, Sextante.getProviderFromName(providerName).getDescription()
+ " [" + str(len(provider)) + " geoalgorithms]")
providerItem.setIcon(0, Sextante.getProviderFromName(providerName).getIcon())
providerItem.setToolTip(0, providerItem.text(0))
for groupItem in groups.values():
providerItem.addChild(groupItem)
self.algorithmTree.addTopLevelItem(providerItem)
@@ -49,10 +49,10 @@ def __init__(self, alg=None):
self.alg = alg
self.textGroup.setText(alg.group)
self.textName.setText(alg.name)
self.repaintModel()
self.repaintModel()
else:
self.alg = ModelerAlgorithm()
self.view.centerOn(0, 0)
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
@@ -333,13 +333,15 @@ def fillAlgorithmTree(self):
else:
groupItem = QtGui.QTreeWidgetItem()
groupItem.setText(0, alg.group)
groupItem.setToolTip(0, alg.group)
groups[alg.group] = groupItem
algItem = TreeAlgorithmItem(alg)
groupItem.addChild(algItem)

if len(groups) > 0:
providerItem = QtGui.QTreeWidgetItem()
providerItem.setText(0, Providers.providers[providerName].getDescription())
providerItem.setToolTip(0, Providers.providers[providerName].getDescription())
providerItem.setIcon(0, Providers.providers[providerName].getIcon())
for groupItem in groups.values():
providerItem.addChild(groupItem)
@@ -348,17 +350,14 @@ def fillAlgorithmTree(self):
for groupItem in groups.values():
if text != "":
groupItem.setExpanded(True)


self.algorithmTree.sortItems(0, Qt.AscendingOrder)


class TreeAlgorithmItem(QtGui.QTreeWidgetItem):

def __init__(self, alg):
QTreeWidgetItem.__init__(self)
self.alg = alg
self.setText(0, alg.name)
self.setToolTip(0, alg.name)
self.setIcon(0, alg.getIcon())


0 comments on commit 32ca040

Please sign in to comment.