Skip to content
Permalink
Browse files

[processing] added option to not show disabled providers tooltip

  • Loading branch information
volaya committed Jan 29, 2016
1 parent d921f48 commit 4c2c905c32456ccaf4b671bfe17037c84fd003f3
@@ -52,6 +52,7 @@ class ProcessingConfig:
WARN_UNMATCHING_CRS = 'WARN_UNMATCHING_CRS'
DEFAULT_OUTPUT_RASTER_LAYER_EXT = 'DEFAULT_OUTPUT_RASTER_LAYER_EXT'
DEFAULT_OUTPUT_VECTOR_LAYER_EXT = 'DEFAULT_OUTPUT_VECTOR_LAYER_EXT'
SHOW_PROVIDERS_TOOLTIP = "SHOW_PROVIDERS_TOOLTIP"

settings = {}
settingIcons = {}
@@ -80,6 +81,10 @@ def initialize():
ProcessingConfig.tr('General'),
ProcessingConfig.SHOW_RECENT_ALGORITHMS,
ProcessingConfig.tr('Show recently executed algorithms'), True))
ProcessingConfig.addSetting(Setting(
ProcessingConfig.tr('General'),
ProcessingConfig.SHOW_PROVIDERS_TOOLTIP,
ProcessingConfig.tr('Show tooltip when there are disabled providers'), True))
ProcessingConfig.addSetting(Setting(
ProcessingConfig.tr('General'),
ProcessingConfig.OUTPUT_FOLDER,
@@ -55,6 +55,7 @@ class ProcessingToolbox(BASE, WIDGET):

def __init__(self):
super(ProcessingToolbox, self).__init__(None)
self.tipWasClosed = False
self.setupUi(self)
self.setAllowedAreas(Qt.LeftDockWidgetArea | Qt.RightDockWidgetArea)

@@ -66,10 +67,14 @@ def __init__(self):
self.txtTip.setVisible(self.disabledProviders())
self.txtDisabled.linkActivated.connect(self.showDisabled)

def openSettings():
dlg = ConfigDialog(self)
dlg.exec_()
self.txtTip.setVisible(self.disabledProviders())
def openSettings(url):
if url == "close":
self.txtTip.setVisible(False)
self.tipWasClosed = True
else:
dlg = ConfigDialog(self)
dlg.exec_()
self.txtTip.setVisible(self.disabledProviders())
self.txtTip.linkActivated.connect(openSettings)
if hasattr(self.searchBox, 'setPlaceholderText'):
self.searchBox.setPlaceholderText(self.tr('Search...'))
@@ -83,6 +88,10 @@ def showDisabled(self):
self.algorithmTree.expandAll()

def disabledProviders(self):
showTip = ProcessingConfig.getSetting(ProcessingConfig.SHOW_PROVIDERS_TOOLTIP)
if not showTip or self.tipWasClosed:
return False

for providerName in Processing.algs.keys():
name = 'ACTIVATE_' + providerName.upper().replace(' ', '_')
if not ProcessingConfig.getSetting(name):
@@ -81,7 +81,7 @@ color: rgb(255, 255, 255);</string>
<enum>QFrame::Raised</enum>
</property>
<property name="text">
<string>You can add more algorithms to the toolbox, &lt;a href=&quot;enable&quot;&gt;enable additional providers.&lt;/a&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;You can add more algorithms to the toolbox, &lt;a href=&quot;enable&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;enable additional providers.&lt;/span&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&quot;close&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;[close]&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="wordWrap">
<bool>true</bool>

0 comments on commit 4c2c905

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