Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport queued_ltr_backports] [GUI] Fix processing algorithms and models window's title when group name is empty #58849

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def __init__(self, alg, model, algName=None, configuration=None):
self.configuration = configuration
self.context = createContext()

self.setWindowTitle(' - '.join([self._alg.group(), self._alg.displayName()]))
self.setWindowTitle(' - '.join([self._alg.group(), self._alg.displayName()]) if self._alg.group() else self._alg.displayName())

self.widget = ModelerParametersWidget(alg, model, algName, configuration, context=self.context, dialog=self)
QgsGui.enableAutoGeometryRestore(self)
Expand Down
5 changes: 4 additions & 1 deletion src/gui/processing/models/qgsmodeldesignerdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ QgsModelDesignerDialog::QgsModelDesignerDialog( QWidget *parent, Qt::WindowFlags
beginUndoCommand( tr( "Change Model Group" ), GroupChanged );
mModel->setGroup( group );
endUndoCommand();
updateWindowTitle();
}
} );

Expand Down Expand Up @@ -824,7 +825,9 @@ void QgsModelDesignerDialog::updateWindowTitle()
{
QString title = tr( "Model Designer" );
if ( !mModel->name().isEmpty() )
title = QStringLiteral( "%1 - %2" ).arg( title, mModel->name() );
title = mModel->group().isEmpty()
? QStringLiteral( "%1: %2" ).arg( title, mModel->name() )
: QStringLiteral( "%1: %2 - %3" ).arg( title, mModel->group(), mModel->name() );

if ( isDirty() )
title.prepend( '*' );
Expand Down
8 changes: 6 additions & 2 deletions src/gui/processing/qgsprocessingalgorithmdialogbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -323,11 +323,15 @@ void QgsProcessingAlgorithmDialogBase::setAlgorithm( QgsProcessingAlgorithm *alg
QString title;
if ( ( QgsGui::higFlags() & QgsGui::HigDialogTitleIsTitleCase ) && !( algorithm->flags() & QgsProcessingAlgorithm::FlagDisplayNameIsLiteral ) )
{
title = QStringLiteral( "%1 - %2" ).arg( QgsStringUtils::capitalize( mAlgorithm->group(), Qgis::Capitalization::TitleCase ), QgsStringUtils::capitalize( mAlgorithm->displayName(), Qgis::Capitalization::TitleCase ) );
title = mAlgorithm->group().isEmpty()
? QgsStringUtils::capitalize( mAlgorithm->displayName(), Qgis::Capitalization::TitleCase )
: QStringLiteral( "%1 - %2" ).arg( QgsStringUtils::capitalize( mAlgorithm->group(), Qgis::Capitalization::TitleCase ), QgsStringUtils::capitalize( mAlgorithm->displayName(), Qgis::Capitalization::TitleCase ) );
}
else
{
title = QStringLiteral( "%1 - %2" ).arg( mAlgorithm->group(), mAlgorithm->displayName() );
title = mAlgorithm->group().isEmpty()
? mAlgorithm->displayName()
: QStringLiteral( "%1 - %2" ).arg( mAlgorithm->group(), mAlgorithm->displayName() );
}

setWindowTitle( title );
Expand Down
Loading