Skip to content
Permalink
Browse files
Fix error when enabling additional providers in processing
Add an interface method to show the options dialog at a specific
page. This is required since plugins can now embed their options
in the main options dialog, so they may also need a way to
force this dialog to open.

Implement this in processing so that enabling additional providers
works again.
  • Loading branch information
nyalldawson committed Mar 24, 2017
1 parent 109be1b commit 2354696f26f924baf708c8ddbbbf9b16ad2f0309
@@ -213,6 +213,7 @@ class QgisInterface : QObject
virtual QList<QgsComposerInterface *> openComposers() = 0;
virtual QgsComposerInterface *openComposer( QgsComposition *composition ) = 0;
virtual void closeComposer( QgsComposition *composition ) = 0;
virtual void showOptionsDialog( QWidget *parent = 0, const QString &currentPage = QString() ) = 0;

virtual QMap<QString, QVariant> defaultStyleSheetOptions() = 0;

@@ -73,6 +73,7 @@ def __init__(self, parent):
layout.setMargin(0)
self.setLayout(layout)
layout.addWidget(self.config_widget)
self.setObjectName('processingOptions')

def apply(self):
self.config_widget.accept()
@@ -74,8 +74,7 @@ def openSettings(url):
self.txtTip.setVisible(False)
self.tipWasClosed = True
else:
dlg = ConfigDialog(self)
dlg.exec_()
iface.showOptionsDialog(iface.mainWindow(), 'processingOptions')
self.txtTip.setVisible(self.disabledProviders())
self.txtTip.linkActivated.connect(openSettings)
if hasattr(self.searchBox, 'setPlaceholderText'):
@@ -418,6 +418,11 @@ void QgisAppInterface::closeComposer( QgsComposition *composition )
}
}

void QgisAppInterface::showOptionsDialog( QWidget *parent, const QString &currentPage )
{
return qgis->showOptionsDialog( parent, currentPage );
}

QMap<QString, QVariant> QgisAppInterface::defaultStyleSheetOptions()
{
return qgis->styleSheetBuilder()->defaultOptions();
@@ -208,6 +208,7 @@ class APP_EXPORT QgisAppInterface : public QgisInterface
QList<QgsComposerInterface *> openComposers() override;
QgsComposerInterface *openComposer( QgsComposition *composition ) override;
void closeComposer( QgsComposition *composition ) override;
virtual void showOptionsDialog( QWidget *parent = nullptr, const QString &currentPage = QString() ) override;

//! Return changeable options built from settings and/or defaults
QMap<QString, QVariant> defaultStyleSheetOptions() override;
@@ -293,6 +293,13 @@ class GUI_EXPORT QgisInterface : public QObject
*/
virtual void closeComposer( QgsComposition *composition ) = 0;

/**
* Opens the options dialog. The \a currentPage argument can be used to force
* the dialog to open at a specific page.
* @note added in QGIS 3.0
*/
virtual void showOptionsDialog( QWidget *parent = nullptr, const QString &currentPage = QString() ) = 0;

//! Return changeable options built from settings and/or defaults
virtual QMap<QString, QVariant> defaultStyleSheetOptions() = 0;

0 comments on commit 2354696

Please sign in to comment.