62 QString fileName = QFileDialog::getSaveFileName(
this,
65 tr(
"Log files (*.log *.LOG)" ) );
70 if ( fileName.isEmpty() )
77 const QString logSeparator = QStringLiteral(
"|~|" );
78 QFile logFile( fileName );
79 if ( logFile.open( QIODevice::WriteOnly | QIODevice::Truncate ) )
81 QTextStream logOut( &logFile );
84 logOut << QStringLiteral(
"ALGORITHM%1%2%3%4\n" ).arg( logSeparator,
85 entry.timestamp.toString(
"yyyy-MM-dd HH:mm:ss" ),
87 entry.entry.value( QStringLiteral(
"python_command" ) ).toString() );
100 setObjectName( QStringLiteral(
"QgsProcessingHistoryDialog" ) );
103 setWindowTitle( tr(
"Processing History" ) );
105 QVBoxLayout *vl =
new QVBoxLayout();
107 vl->addWidget( mWidget, 1 );
109 mButtonBox =
new QDialogButtonBox( QDialogButtonBox::Close | QDialogButtonBox::Help );
111 QPushButton *clearButton =
new QPushButton( tr(
"Clear" ) );
112 clearButton->setToolTip( tr(
"Clear history" ) );
113 mButtonBox->addButton( clearButton, QDialogButtonBox::ActionRole );
115 QPushButton *saveButton =
new QPushButton( tr(
"Save As…" ) );
116 saveButton->setToolTip( tr(
"Save history" ) );
117 mButtonBox->addButton( saveButton, QDialogButtonBox::ActionRole );
122 connect( mButtonBox->button( QDialogButtonBox::Close ), &QPushButton::clicked, mWidget, [ = ]() { close(); } );
124 vl->addWidget( mButtonBox );
Encapsulates a history entry.
bool clearHistory(Qgis::HistoryProviderBackend backend, const QString &providerId=QString())
Clears the history for the specified backend.
QList< QgsHistoryEntry > queryEntries(const QDateTime &start=QDateTime(), const QDateTime &end=QDateTime(), const QString &providerId=QString(), Qgis::HistoryProviderBackends backends=Qgis::HistoryProviderBackend::LocalProfile) const
Queries history entries which occurred between the specified start and end times.
QgsProcessingHistoryDialog(QWidget *parent=nullptr)
Constructor for QgsProcessingHistoryDialog.