16 #ifndef QGSPROCESSINGALGORITHMDIALOGBASE_H
17 #define QGSPROCESSINGALGORITHMDIALOGBASE_H
21 #include "ui_qgsprocessingalgorithmdialogbase.h"
22 #include "ui_qgsprocessingalgorithmprogressdialogbase.h"
31 class QgsProcessingAlgorithmDialogBase;
53 QgsProcessingAlgorithmDialogFeedback();
57 void progressTextChanged(
const QString &text );
58 void errorReported(
const QString &text,
bool fatalError );
59 void infoPushed(
const QString &text );
60 void commandInfoPushed(
const QString &text );
61 void debugInfoPushed(
const QString &text );
62 void consoleInfoPushed(
const QString &text );
67 void reportError(
const QString &error,
bool fatalError )
override;
68 void pushInfo(
const QString &info )
override;
101 QgsProcessingAlgorithmDialogBase( QWidget *parent
SIP_TRANSFERTHIS =
nullptr, Qt::WindowFlags flags = Qt::WindowFlags() );
102 ~QgsProcessingAlgorithmDialogBase()
override;
141 bool wasExecuted()
const {
return mExecuted; }
148 QVariantMap results()
const {
return mResults; }
162 void saveLogToFile( const QString &path, LogFormat format = FormatPlainText );
171 void reportError( const QString &error,
bool fatalError );
176 void pushInfo( const QString &info );
181 void pushDebugInfo( const QString &message );
186 void pushCommandInfo( const QString &info );
191 void setPercentage(
double percent );
196 void setProgressText( const QString &text );
201 void pushConsoleInfo( const QString &info );
207 QDialog *createProgressDialog();
226 void copyLogToClipboard();
231 void showParameters();
233 void reject() override;
237 void closeEvent( QCloseEvent *e ) override;
242 QPushButton *runButton();
247 QPushButton *cancelButton();
252 QPushButton *changeParametersButton();
257 QDialogButtonBox *buttonBox();
262 QTabWidget *tabWidget();
267 void clearProgress();
274 void setExecuted(
bool executed );
279 void setExecutedAnyResult(
bool executedAnyResult );
286 void setResults( const QVariantMap &results );
291 void setInfo( const QString &message,
bool isError = false,
bool escapeHtml = true );
302 virtual
void resetAdditionalGui();
307 void updateRunButtonVisibility();
313 void blockControlsWhileRunning();
319 virtual
void blockAdditionalControlsWhileRunning();
329 void hideShortHelp();
342 static QString formatStringForLog( const QString &
string );
351 void algorithmFinished(
bool successful, const QVariantMap &result );
363 virtual
void runAlgorithm();
368 void toggleCollapsed();
370 void splitterChanged(
int pos,
int index );
371 void mTabWidget_currentChanged(
int index );
372 void linkClicked( const QUrl &url );
373 void algExecuted(
bool successful, const QVariantMap &results );
374 void taskTriggered(
QgsTask *task );
379 QPushButton *mButtonRun =
nullptr;
380 QPushButton *mButtonClose =
nullptr;
381 QPushButton *mButtonChangeParameters =
nullptr;
382 QByteArray mSplitterState;
383 QToolButton *mButtonCollapse =
nullptr;
386 bool mExecuted = false;
387 bool mExecutedAnyResult = false;
388 QVariantMap mResults;
393 bool mHelpCollapsed = false;
396 void scrollToBottomOfLog();
397 void processEvents();
409 class QgsProcessingAlgorithmProgressDialog :
public QDialog,
private Ui::QgsProcessingProgressDialogBase
418 QgsProcessingAlgorithmProgressDialog( QWidget *parent =
nullptr );
423 QProgressBar *progressBar();
428 QPushButton *cancelButton();
433 QTextEdit *logTextEdit();
437 void reject()
override;
445 #endif // QGSPROCESSINGALGORITHMDIALOGBASE_H