61 QString fileName = QFileDialog::getSaveFileName(
this,
64 tr(
"Log files (*.log *.LOG)" ) );
69 if ( fileName.isEmpty() )
76 const QString logSeparator = QStringLiteral(
"|~|" );
77 QFile logFile( fileName );
78 if ( logFile.open( QIODevice::WriteOnly | QIODevice::Truncate ) )
80 QTextStream logOut( &logFile );
83 logOut << QStringLiteral(
"ALGORITHM%1%2%3%4\n" ).arg( logSeparator,
84 entry.timestamp.toString(
"yyyy-MM-dd HH:mm:ss" ),
86 entry.entry.value( QStringLiteral(
"python_command" ) ).toString() );
99 setObjectName( QStringLiteral(
"QgsProcessingHistoryDialog" ) );
102 setWindowTitle( tr(
"Processing History" ) );
104 QVBoxLayout *vl =
new QVBoxLayout();
106 vl->addWidget( mWidget, 1 );
108 mButtonBox =
new QDialogButtonBox( QDialogButtonBox::Close | QDialogButtonBox::Help );
110 QPushButton *clearButton =
new QPushButton( tr(
"Clear" ) );
111 clearButton->setToolTip( tr(
"Clear history" ) );
112 mButtonBox->addButton( clearButton, QDialogButtonBox::ActionRole );
114 QPushButton *saveButton =
new QPushButton( tr(
"Save As…" ) );
115 saveButton->setToolTip( tr(
"Save history" ) );
116 mButtonBox->addButton( saveButton, QDialogButtonBox::ActionRole );
121 connect( mButtonBox->button( QDialogButtonBox::Close ), &QPushButton::clicked, mWidget, [ = ]() { close(); } );
123 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.