57 QString fileName = QFileDialog::getSaveFileName(
this, tr(
"Save File" ), QDir::homePath(), tr(
"Log files (*.log *.LOG)" ) );
62 if ( fileName.isEmpty() )
69 const QString logSeparator = QStringLiteral(
"|~|" );
70 QFile logFile( fileName );
71 if ( logFile.open( QIODevice::WriteOnly | QIODevice::Truncate ) )
73 QTextStream logOut( &logFile );
76 logOut << QStringLiteral(
"ALGORITHM%1%2%3%4\n" ).arg( logSeparator, entry.timestamp.toString(
"yyyy-MM-dd HH:mm:ss" ), logSeparator, entry.entry.value( QStringLiteral(
"python_command" ) ).toString() );
89 setObjectName( QStringLiteral(
"QgsProcessingHistoryDialog" ) );
92 setWindowTitle( tr(
"Processing History" ) );
94 QVBoxLayout *vl =
new QVBoxLayout();
96 vl->addWidget( mWidget, 1 );
98 mButtonBox =
new QDialogButtonBox( QDialogButtonBox::Close | QDialogButtonBox::Help );
100 QPushButton *clearButton =
new QPushButton( tr(
"Clear" ) );
101 clearButton->setToolTip( tr(
"Clear history" ) );
102 mButtonBox->addButton( clearButton, QDialogButtonBox::ActionRole );
104 QPushButton *saveButton =
new QPushButton( tr(
"Save As…" ) );
105 saveButton->setToolTip( tr(
"Save history" ) );
106 mButtonBox->addButton( saveButton, QDialogButtonBox::ActionRole );
111 connect( mButtonBox->button( QDialogButtonBox::Close ), &QPushButton::clicked, mWidget, [=]() { close(); } );
113 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.