Skip to content

Commit

Permalink
[processing] added option to not show disabled providers tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
volaya committed Jan 29, 2016
1 parent d921f48 commit 4c2c905
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
5 changes: 5 additions & 0 deletions python/plugins/processing/core/ProcessingConfig.py
Expand Up @@ -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 = {}
Expand Down Expand Up @@ -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,
Expand Down
17 changes: 13 additions & 4 deletions python/plugins/processing/gui/ProcessingToolbox.py
Expand Up @@ -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)

Expand All @@ -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...'))
Expand All @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/ui/ProcessingToolbox.ui
Expand Up @@ -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>
Expand Down

0 comments on commit 4c2c905

Please sign in to comment.