mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-15 00:04:00 -04:00
Fix confusing override of accept method for non-dialog acceptance
This commit is contained in:
parent
47bf1f49d8
commit
6fff62e668
@ -116,9 +116,6 @@ the given ``format``.
|
||||
|
||||
public slots:
|
||||
|
||||
virtual void accept();
|
||||
|
||||
|
||||
void reportError( const QString &error, bool fatalError );
|
||||
%Docstring
|
||||
Reports an ``error`` string to the dialog's log.
|
||||
@ -271,6 +268,11 @@ Formats an input ``string`` for display in the log tab.
|
||||
virtual void finished( bool successful, const QVariantMap &result, QgsProcessingContext &context, QgsProcessingFeedback *feedback );
|
||||
%Docstring
|
||||
Called when the algorithm has finished executing.
|
||||
%End
|
||||
|
||||
virtual void runAlgorithm();
|
||||
%Docstring
|
||||
Called when the dialog's algorithm should be run. Must be overridden by subclasses.
|
||||
%End
|
||||
|
||||
};
|
||||
|
@ -159,7 +159,7 @@ class AlgorithmDialog(QgsProcessingAlgorithmDialogBase):
|
||||
|
||||
return self.algorithm().preprocessParameters(parameters)
|
||||
|
||||
def accept(self):
|
||||
def runAlgorithm(self):
|
||||
feedback = self.createFeedback()
|
||||
context = dataobjects.createContext(feedback)
|
||||
|
||||
|
@ -95,7 +95,7 @@ QgsProcessingAlgorithmDialogBase::QgsProcessingAlgorithmDialogBase( QWidget *par
|
||||
splitterChanged( 0, 0 );
|
||||
|
||||
connect( mButtonBox, &QDialogButtonBox::rejected, this, &QgsProcessingAlgorithmDialogBase::closeClicked );
|
||||
connect( mButtonBox, &QDialogButtonBox::accepted, this, &QgsProcessingAlgorithmDialogBase::accept );
|
||||
connect( mButtonBox, &QDialogButtonBox::accepted, this, &QgsProcessingAlgorithmDialogBase::runAlgorithm );
|
||||
|
||||
// Rename OK button to Run
|
||||
mButtonRun = mButtonBox->button( QDialogButtonBox::Ok );
|
||||
@ -262,10 +262,6 @@ void QgsProcessingAlgorithmDialogBase::finished( bool, const QVariantMap &, QgsP
|
||||
|
||||
}
|
||||
|
||||
void QgsProcessingAlgorithmDialogBase::accept()
|
||||
{
|
||||
}
|
||||
|
||||
void QgsProcessingAlgorithmDialogBase::openHelp()
|
||||
{
|
||||
QUrl algHelp = mAlgorithm->helpUrl();
|
||||
@ -464,6 +460,11 @@ void QgsProcessingAlgorithmDialogBase::closeEvent( QCloseEvent *e )
|
||||
}
|
||||
}
|
||||
|
||||
void QgsProcessingAlgorithmDialogBase::runAlgorithm()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void QgsProcessingAlgorithmDialogBase::setPercentage( double percent )
|
||||
{
|
||||
// delay setting maximum progress value until we know algorithm reports progress
|
||||
|
@ -168,8 +168,6 @@ class GUI_EXPORT QgsProcessingAlgorithmDialogBase : public QDialog, private Ui::
|
||||
|
||||
public slots:
|
||||
|
||||
void accept() override;
|
||||
|
||||
/**
|
||||
* Reports an \a error string to the dialog's log.
|
||||
*
|
||||
@ -315,6 +313,11 @@ class GUI_EXPORT QgsProcessingAlgorithmDialogBase : public QDialog, private Ui::
|
||||
*/
|
||||
virtual void finished( bool successful, const QVariantMap &result, QgsProcessingContext &context, QgsProcessingFeedback *feedback );
|
||||
|
||||
/**
|
||||
* Called when the dialog's algorithm should be run. Must be overridden by subclasses.
|
||||
*/
|
||||
virtual void runAlgorithm();
|
||||
|
||||
private slots:
|
||||
|
||||
void openHelp();
|
||||
|
Loading…
x
Reference in New Issue
Block a user