Skip to content

Commit a4d6fd3

Browse files
committedApr 24, 2023
Use QgsProcessingHistoryDialog for Processing history dialog
And remove old class
1 parent 45d8918 commit a4d6fd3

File tree

5 files changed

+11
-398
lines changed

5 files changed

+11
-398
lines changed
 

‎python/plugins/processing/ProcessingPlugin.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@
3838
QgsSettings)
3939
from qgis.gui import (QgsGui,
4040
QgsOptionsWidgetFactory,
41-
QgsCustomDropHandler)
41+
QgsCustomDropHandler,
42+
QgsProcessingHistoryDialog)
4243
from qgis.PyQt.QtCore import QObject, Qt, QItemSelectionModel, QCoreApplication, QDir, QFileInfo, pyqtSlot
4344
from qgis.PyQt.QtWidgets import QWidget, QMenu, QAction
4445
from qgis.PyQt.QtGui import QIcon, QKeySequence
4546
from qgis.utils import iface
4647

4748
from processing.core.Processing import Processing
4849
from processing.gui.ProcessingToolbox import ProcessingToolbox
49-
from processing.gui.HistoryDialog import HistoryDialog
5050
from processing.gui.ConfigDialog import ConfigOptionsPage
5151
from processing.gui.ResultsDock import ResultsDock
5252
from processing.gui.MessageDialog import MessageDialog
@@ -499,8 +499,9 @@ def openResults(self):
499499
self.resultsDock.show()
500500

501501
def openHistory(self):
502-
dlg = HistoryDialog()
503-
dlg.exec_()
502+
dlg = QgsProcessingHistoryDialog(self.iface.mainWindow())
503+
dlg.setAttribute(Qt.WA_DeleteOnClose)
504+
dlg.show()
504505

505506
def tr(self, message, disambiguation=None, n=-1):
506507
return QCoreApplication.translate('ProcessingPlugin', message, disambiguation=disambiguation, n=n)

‎python/plugins/processing/gui/BatchPanel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
QAction
3939
)
4040

41-
# adding to this list? also update the HistoryDialog.py executeAlgorithm imports!!
41+
# adding to this list? also update the QgsProcessingHistoryProvider executeAlgorithm imports!!
4242

4343
from qgis.PyQt.QtCore import (
4444
QTime, # NOQA - must be here for saved file evaluation

‎python/plugins/processing/gui/HistoryDialog.py

Lines changed: 0 additions & 293 deletions
This file was deleted.

‎python/plugins/processing/ui/DlgHistory.ui

Lines changed: 0 additions & 96 deletions
This file was deleted.

‎src/gui/processing/qgsprocessinghistorywidget.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ QgsProcessingHistoryWidget::QgsProcessingHistoryWidget( QWidget *parent )
3636
QVBoxLayout *vl = new QVBoxLayout();
3737
vl->setContentsMargins( 0, 0, 0, 0 );
3838
vl->addWidget( mHistoryWidget );
39-
39+
setLayout( vl );
4040
}
4141

4242
void QgsProcessingHistoryWidget::clearHistory()
@@ -48,7 +48,7 @@ void QgsProcessingHistoryWidget::clearHistory()
4848
QMessageBox::No
4949
) == QMessageBox::Yes )
5050
{
51-
QgsGui::historyProviderRegistry()->clearHistory( Qgis::HistoryProviderBackend::LocalProfile, QStringLiteral( "providerId" ) );
51+
QgsGui::historyProviderRegistry()->clearHistory( Qgis::HistoryProviderBackend::LocalProfile, QStringLiteral( "processing" ) );
5252
}
5353
}
5454

@@ -78,8 +78,8 @@ void QgsProcessingHistoryWidget::saveLog()
7878
QTextStream logOut( &logFile );
7979
for ( const QgsHistoryEntry &entry : entries )
8080
{
81-
logOut << QStringLiteral( "ALGORITHM{}{}{}{}\n" ).arg( logSeparator,
82-
entry.timestamp.toString( "YYYY-mm-dd HH:MM:SS" ),
81+
logOut << QStringLiteral( "ALGORITHM%1%2%3%4\n" ).arg( logSeparator,
82+
entry.timestamp.toString( "YYYY-mm-dd HH:MM:ss" ),
8383
logSeparator,
8484
entry.entry.value( QStringLiteral( "python_command" ) ).toString() );
8585
}
@@ -94,6 +94,7 @@ void QgsProcessingHistoryWidget::saveLog()
9494
QgsProcessingHistoryDialog::QgsProcessingHistoryDialog( QWidget *parent )
9595
: QDialog( parent )
9696
{
97+
setObjectName( QStringLiteral( "QgsProcessingHistoryDialog" ) );
9798
QgsGui::instance()->enableAutoGeometryRestore( this );
9899

99100
QVBoxLayout *vl = new QVBoxLayout();

0 commit comments

Comments
 (0)
Please sign in to comment.