Skip to content

Commit

Permalink
address review
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbruy committed Jul 3, 2024
1 parent 790b1a5 commit b8587e2
Show file tree
Hide file tree
Showing 23 changed files with 142 additions and 142 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/processing/qgsprocessingfavoritealgorithmlog.h *
* src/gui/processing/qgsprocessingfavoritealgorithmmanager.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
Expand All @@ -10,15 +10,15 @@



class QgsProcessingFavoriteAlgorithmLog : QObject
class QgsProcessingFavoriteAlgorithmManager : QObject
{
%Docstring(signature="appended")
A log for tracking favorite Processing algorithms.
A manager for tracking favorite Processing algorithms.

:py:class:`QgsProcessingFavoriteAlgorithmLog` is not usually directly created, instead
use the instance accessible through :py:func:`QgsGui.processingFavoriteAlgorithmLog()`.
:py:class:`QgsProcessingFavoriteAlgorithmManager` is not usually directly created, instead
use the instance accessible through :py:func:`QgsGui.processingFavoriteAlgorithmManager()`.

The log contents are saved and restored via :py:class:`QgsSettings`.
The favorite algorithms are saved and restored via :py:class:`QgsSettings`.

.. note::

Expand All @@ -28,13 +28,13 @@ The log contents are saved and restored via :py:class:`QgsSettings`.
%End

%TypeHeaderCode
#include "qgsprocessingfavoritealgorithmlog.h"
#include "qgsprocessingfavoritealgorithmmanager.h"
%End
public:

QgsProcessingFavoriteAlgorithmLog( QObject *parent = 0 );
QgsProcessingFavoriteAlgorithmManager( QObject *parent = 0 );
%Docstring
Constructor for QgsProcessingFavoriteAlgorithmLog, with the specified
Constructor for QgsProcessingFavoriteAlgorithmManager, with the specified
``parent`` object.
%End

Expand All @@ -47,15 +47,15 @@ Returns a list of the IDs of favorite Processing algorithms.
%Docstring
Adds the algorithm with matching ``id`` to the favorite algorithms list.

If this changes the list of favorite algorithm IDs then the :py:func:`~QgsProcessingFavoriteAlgorithmLog.changed` signal
If this changes the list of favorite algorithm IDs then the :py:func:`~QgsProcessingFavoriteAlgorithmManager.changed` signal
will be emitted.
%End

void remove( const QString &id );
%Docstring
Removes the algorithm with matching ``id`` from the favorite algorithms list.

If this changes the list of favorite algorithm IDs then the :py:func:`~QgsProcessingFavoriteAlgorithmLog.changed` signal
If this changes the list of favorite algorithm IDs then the :py:func:`~QgsProcessingFavoriteAlgorithmManager.changed` signal
will be emitted.
%End

Expand Down Expand Up @@ -85,7 +85,7 @@ is removed from the list.
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/processing/qgsprocessingfavoritealgorithmlog.h *
* src/gui/processing/qgsprocessingfavoritealgorithmmanager.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ of this model.

QgsProcessingToolboxModel( QObject *parent /TransferThis/ = 0, QgsProcessingRegistry *registry = 0,
QgsProcessingRecentAlgorithmLog *recentLog = 0,
QgsProcessingFavoriteAlgorithmLog *favoriteLog = 0 );
QgsProcessingFavoriteAlgorithmManager *favoriteManager = 0 );
%Docstring
Constructor for QgsProcessingToolboxModel, with the given ``parent`` object.

Expand All @@ -304,7 +304,7 @@ by the model.
If ``recentLog`` is specified then it will be used to create a "Recently used" top
level group containing recently used algorithms.

If ``favoriteLog`` is specified then it will be used to create a "Favorites" top
If ``favoriteManager`` is specified then it will be used to create a "Favorites" top
level group containing favorite algorithms. Since QGIS 3.40
%End

Expand Down Expand Up @@ -430,7 +430,7 @@ the results.
explicit QgsProcessingToolboxProxyModel( QObject *parent /TransferThis/ = 0,
QgsProcessingRegistry *registry = 0,
QgsProcessingRecentAlgorithmLog *recentLog = 0,
QgsProcessingFavoriteAlgorithmLog *favoriteLog = 0 );
QgsProcessingFavoriteAlgorithmManager *favoriteManager = 0 );
%Docstring
Constructor for QgsProcessingToolboxProxyModel, with the given ``parent`` object.

Expand All @@ -442,7 +442,7 @@ by the model.
If ``recentLog`` is specified then it will be used to create a "Recently used" top
level group containing recently used algorithms.

If ``favoriteLog`` is specified then it will be used to create a "Favorites" top
If ``favoriteManager`` is specified then it will be used to create a "Favorites" top
level group containing favorite algorithms. SInce QGIS 3.40
%End

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Processing toolbox tree view, showing algorithms and providers in a tree structu
QgsProcessingToolboxTreeView( QWidget *parent /TransferThis/ = 0,
QgsProcessingRegistry *registry = 0,
QgsProcessingRecentAlgorithmLog *recentLog = 0,
QgsProcessingFavoriteAlgorithmLog *favoriteLog = 0 );
QgsProcessingFavoriteAlgorithmManager *favoriteManager = 0 );
%Docstring
Constructor for QgsProcessingToolboxTreeView, with the specified ``parent`` widget.

Expand All @@ -41,21 +41,21 @@ to associate a registry with the view.
If ``recentLog`` is specified then it will be used to create a "Recently used" top
level group containing recently used algorithms.

If ``favoriteLog`` is specified then it will be used to create a "Favorites" top
If ``favoriteManager`` is specified then it will be used to create a "Favorites" top
level group containing favorite algorithms. Since QGIS 3.40
%End

void setRegistry(
QgsProcessingRegistry *registry,
QgsProcessingRecentAlgorithmLog *recentLog = 0,
QgsProcessingFavoriteAlgorithmLog *favoriteLog = 0 );
QgsProcessingFavoriteAlgorithmManager *favoriteManager = 0 );
%Docstring
Sets the processing ``registry`` associated with the view.

If ``recentLog`` is specified then it will be used to create a "Recently used" top
level group containing recently used algorithms.

If ``favoriteLog`` is specified then it will be used to create a "Favorites" top
If ``favoriteManager`` is specified then it will be used to create a "Favorites" top
level group containing favorite algorithms. Since QGIS 3.40
%End

Expand Down
4 changes: 2 additions & 2 deletions python/PyQt6/gui/auto_generated/qgsgui.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ Returns the global processing recent algorithm log, used for tracking recently u
.. versionadded:: 3.4
%End

static QgsProcessingFavoriteAlgorithmLog *processingFavoriteAlgorithmLog();
static QgsProcessingFavoriteAlgorithmManager *processingFavoriteAlgorithmManager();
%Docstring
Returns the global Processing favorite algorithm log, used for tracking favorite Processing algorithms.
Returns the global Processing favorite algorithm manager, used for tracking favorite Processing algorithms.

.. versionadded:: 3.40
%End
Expand Down
2 changes: 1 addition & 1 deletion python/PyQt6/gui/gui_auto.sip
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@
%Include auto_generated/processing/qgsprocessingalgorithmconfigurationwidget.sip
%Include auto_generated/processing/qgsprocessingalgorithmdialogbase.sip
%Include auto_generated/processing/qgsprocessingbatchalgorithmdialogbase.sip
%Include auto_generated/processing/qgsprocessingfavoritealgorithmlog.sip
%Include auto_generated/processing/qgsprocessingfavoritealgorithmmanager.sip
%Include auto_generated/processing/qgsprocessinggui.sip
%Include auto_generated/processing/qgsprocessingguiregistry.sip
%Include auto_generated/processing/qgsprocessinghistoryprovider.sip
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/processing/qgsprocessingfavoritealgorithmlog.h *
* src/gui/processing/qgsprocessingfavoritealgorithmmanager.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
Expand All @@ -10,15 +10,15 @@



class QgsProcessingFavoriteAlgorithmLog : QObject
class QgsProcessingFavoriteAlgorithmManager : QObject
{
%Docstring(signature="appended")
A log for tracking favorite Processing algorithms.
A manager for tracking favorite Processing algorithms.

:py:class:`QgsProcessingFavoriteAlgorithmLog` is not usually directly created, instead
use the instance accessible through :py:func:`QgsGui.processingFavoriteAlgorithmLog()`.
:py:class:`QgsProcessingFavoriteAlgorithmManager` is not usually directly created, instead
use the instance accessible through :py:func:`QgsGui.processingFavoriteAlgorithmManager()`.

The log contents are saved and restored via :py:class:`QgsSettings`.
The favorite algorithms are saved and restored via :py:class:`QgsSettings`.

.. note::

Expand All @@ -28,13 +28,13 @@ The log contents are saved and restored via :py:class:`QgsSettings`.
%End

%TypeHeaderCode
#include "qgsprocessingfavoritealgorithmlog.h"
#include "qgsprocessingfavoritealgorithmmanager.h"
%End
public:

QgsProcessingFavoriteAlgorithmLog( QObject *parent = 0 );
QgsProcessingFavoriteAlgorithmManager( QObject *parent = 0 );
%Docstring
Constructor for QgsProcessingFavoriteAlgorithmLog, with the specified
Constructor for QgsProcessingFavoriteAlgorithmManager, with the specified
``parent`` object.
%End

Expand All @@ -47,15 +47,15 @@ Returns a list of the IDs of favorite Processing algorithms.
%Docstring
Adds the algorithm with matching ``id`` to the favorite algorithms list.

If this changes the list of favorite algorithm IDs then the :py:func:`~QgsProcessingFavoriteAlgorithmLog.changed` signal
If this changes the list of favorite algorithm IDs then the :py:func:`~QgsProcessingFavoriteAlgorithmManager.changed` signal
will be emitted.
%End

void remove( const QString &id );
%Docstring
Removes the algorithm with matching ``id`` from the favorite algorithms list.

If this changes the list of favorite algorithm IDs then the :py:func:`~QgsProcessingFavoriteAlgorithmLog.changed` signal
If this changes the list of favorite algorithm IDs then the :py:func:`~QgsProcessingFavoriteAlgorithmManager.changed` signal
will be emitted.
%End

Expand Down Expand Up @@ -85,7 +85,7 @@ is removed from the list.
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/processing/qgsprocessingfavoritealgorithmlog.h *
* src/gui/processing/qgsprocessingfavoritealgorithmmanager.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ of this model.

QgsProcessingToolboxModel( QObject *parent /TransferThis/ = 0, QgsProcessingRegistry *registry = 0,
QgsProcessingRecentAlgorithmLog *recentLog = 0,
QgsProcessingFavoriteAlgorithmLog *favoriteLog = 0 );
QgsProcessingFavoriteAlgorithmManager *favoriteManager = 0 );
%Docstring
Constructor for QgsProcessingToolboxModel, with the given ``parent`` object.

Expand All @@ -304,7 +304,7 @@ by the model.
If ``recentLog`` is specified then it will be used to create a "Recently used" top
level group containing recently used algorithms.

If ``favoriteLog`` is specified then it will be used to create a "Favorites" top
If ``favoriteManager`` is specified then it will be used to create a "Favorites" top
level group containing favorite algorithms. Since QGIS 3.40
%End

Expand Down Expand Up @@ -430,7 +430,7 @@ the results.
explicit QgsProcessingToolboxProxyModel( QObject *parent /TransferThis/ = 0,
QgsProcessingRegistry *registry = 0,
QgsProcessingRecentAlgorithmLog *recentLog = 0,
QgsProcessingFavoriteAlgorithmLog *favoriteLog = 0 );
QgsProcessingFavoriteAlgorithmManager *favoriteManager = 0 );
%Docstring
Constructor for QgsProcessingToolboxProxyModel, with the given ``parent`` object.

Expand All @@ -442,7 +442,7 @@ by the model.
If ``recentLog`` is specified then it will be used to create a "Recently used" top
level group containing recently used algorithms.

If ``favoriteLog`` is specified then it will be used to create a "Favorites" top
If ``favoriteManager`` is specified then it will be used to create a "Favorites" top
level group containing favorite algorithms. SInce QGIS 3.40
%End

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Processing toolbox tree view, showing algorithms and providers in a tree structu
QgsProcessingToolboxTreeView( QWidget *parent /TransferThis/ = 0,
QgsProcessingRegistry *registry = 0,
QgsProcessingRecentAlgorithmLog *recentLog = 0,
QgsProcessingFavoriteAlgorithmLog *favoriteLog = 0 );
QgsProcessingFavoriteAlgorithmManager *favoriteManager = 0 );
%Docstring
Constructor for QgsProcessingToolboxTreeView, with the specified ``parent`` widget.

Expand All @@ -41,21 +41,21 @@ to associate a registry with the view.
If ``recentLog`` is specified then it will be used to create a "Recently used" top
level group containing recently used algorithms.

If ``favoriteLog`` is specified then it will be used to create a "Favorites" top
If ``favoriteManager`` is specified then it will be used to create a "Favorites" top
level group containing favorite algorithms. Since QGIS 3.40
%End

void setRegistry(
QgsProcessingRegistry *registry,
QgsProcessingRecentAlgorithmLog *recentLog = 0,
QgsProcessingFavoriteAlgorithmLog *favoriteLog = 0 );
QgsProcessingFavoriteAlgorithmManager *favoriteManager = 0 );
%Docstring
Sets the processing ``registry`` associated with the view.

If ``recentLog`` is specified then it will be used to create a "Recently used" top
level group containing recently used algorithms.

If ``favoriteLog`` is specified then it will be used to create a "Favorites" top
If ``favoriteManager`` is specified then it will be used to create a "Favorites" top
level group containing favorite algorithms. Since QGIS 3.40
%End

Expand Down
4 changes: 2 additions & 2 deletions python/gui/auto_generated/qgsgui.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ Returns the global processing recent algorithm log, used for tracking recently u
.. versionadded:: 3.4
%End

static QgsProcessingFavoriteAlgorithmLog *processingFavoriteAlgorithmLog();
static QgsProcessingFavoriteAlgorithmManager *processingFavoriteAlgorithmManager();
%Docstring
Returns the global Processing favorite algorithm log, used for tracking favorite Processing algorithms.
Returns the global Processing favorite algorithm manager, used for tracking favorite Processing algorithms.

.. versionadded:: 3.40
%End
Expand Down
2 changes: 1 addition & 1 deletion python/gui/gui_auto.sip
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@
%Include auto_generated/processing/qgsprocessingalgorithmconfigurationwidget.sip
%Include auto_generated/processing/qgsprocessingalgorithmdialogbase.sip
%Include auto_generated/processing/qgsprocessingbatchalgorithmdialogbase.sip
%Include auto_generated/processing/qgsprocessingfavoritealgorithmlog.sip
%Include auto_generated/processing/qgsprocessingfavoritealgorithmmanager.sip
%Include auto_generated/processing/qgsprocessinggui.sip
%Include auto_generated/processing/qgsprocessingguiregistry.sip
%Include auto_generated/processing/qgsprocessinghistoryprovider.sip
Expand Down
10 changes: 5 additions & 5 deletions python/plugins/processing/gui/ProcessingToolbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def __init__(self):

self.algorithmTree.setRegistry(QgsApplication.processingRegistry(),
QgsGui.instance().processingRecentAlgorithmLog(),
QgsGui.instance().processingFavoriteAlgorithmLog())
QgsGui.instance().processingFavoriteAlgorithmManager())
filters = QgsProcessingToolboxProxyModel.Filters(QgsProcessingToolboxProxyModel.Filter.FilterToolbox)
if ProcessingConfig.getSetting(ProcessingConfig.SHOW_ALGORITHMS_KNOWN_ISSUES):
filters |= QgsProcessingToolboxProxyModel.Filter.FilterShowKnownIssues
Expand Down Expand Up @@ -200,7 +200,7 @@ def showPopupMenu(self, point):

popupmenu.addSeparator()
actionText = QCoreApplication.translate('ProcessingToolbox', 'Add to Favorites')
if QgsGui.instance().processingFavoriteAlgorithmLog().isFavorite(alg.id()):
if QgsGui.instance().processingFavoriteAlgorithmManager().isFavorite(alg.id()):
actionText = QCoreApplication.translate('ProcessingToolbox', 'Remove from Favorites')
favoriteAction = QAction(actionText, popupmenu)
favoriteAction.triggered.connect(self.toggleFavorite)
Expand Down Expand Up @@ -244,7 +244,7 @@ def executeAlgorithm(self):
def toggleFavorite(self):
alg = self.algorithmTree.selectedAlgorithm()
if alg is not None:
if QgsGui.instance().processingFavoriteAlgorithmLog().isFavorite(alg.id()):
QgsGui.instance().processingFavoriteAlgorithmLog().remove(alg.id())
if QgsGui.instance().processingFavoriteAlgorithmManager().isFavorite(alg.id()):
QgsGui.instance().processingFavoriteAlgorithmManager().remove(alg.id())
else:
QgsGui.instance().processingFavoriteAlgorithmLog().add(alg.id())
QgsGui.instance().processingFavoriteAlgorithmManager().add(alg.id())
4 changes: 2 additions & 2 deletions src/gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ set(QGIS_GUI_SRCS
processing/qgsprocessingconfigurationwidgets.cpp
processing/qgsprocessingdxflayerswidgetwrapper.cpp
processing/qgsprocessingenummodelerwidget.cpp
processing/qgsprocessingfavoritealgorithmlog.cpp
processing/qgsprocessingfavoritealgorithmmanager.cpp
processing/qgsprocessingfeaturesourceoptionswidget.cpp
processing/qgsprocessingfieldmapwidgetwrapper.cpp
processing/qgsprocessingguiregistry.cpp
Expand Down Expand Up @@ -1353,7 +1353,7 @@ set(QGIS_GUI_HDRS
processing/qgsprocessingconfigurationwidgets.h
processing/qgsprocessingdxflayerswidgetwrapper.h
processing/qgsprocessingenummodelerwidget.h
processing/qgsprocessingfavoritealgorithmlog.h
processing/qgsprocessingfavoritealgorithmmanager.h
processing/qgsprocessingfeaturesourceoptionswidget.h
processing/qgsprocessingfieldmapwidgetwrapper.h
processing/qgsprocessinggui.h
Expand Down
Loading

0 comments on commit b8587e2

Please sign in to comment.