Skip to content

Commit

Permalink
[ui] Display info in Options window if QGIS is compiled without OpenCL
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored and nyalldawson committed Apr 6, 2020
1 parent b72111f commit c53610e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
2 changes: 0 additions & 2 deletions src/app/qgisapp.cpp
Expand Up @@ -11411,9 +11411,7 @@ QMap< QString, int > QgisApp::optionsPagesMap()
sOptionsPagesMap.insert( QCoreApplication::translate( "QgsOptionsBase", "Network" ), 13 );
sOptionsPagesMap.insert( QCoreApplication::translate( "QgsOptionsBase", "Locator" ), 14 );
sOptionsPagesMap.insert( QCoreApplication::translate( "QgsOptionsBase", "Advanced" ), 15 );
#ifdef HAVE_OPENCL
sOptionsPagesMap.insert( QCoreApplication::translate( "QgsOptionsBase", "Acceleration" ), 16 );
#endif
} );

QMap< QString, int > map = sOptionsPagesMap;
Expand Down
15 changes: 12 additions & 3 deletions src/app/qgsoptions.cpp
Expand Up @@ -1192,9 +1192,18 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl, const QList<QgsOpti

#else

mOptionsListWidget->removeItemWidget( mOptionsListWidget->findItems( tr( "Acceleration" ), Qt::MatchExactly ).first() );
mOptionsStackedWidget->removeWidget( mOptionsPageAcceleration );

mGPUEnableCheckBox->setChecked( false );
for ( int idx = 0; idx < mOptionsPageAccelerationLayout->count(); ++idx )
{
QWidget *item = mOptionsPageAccelerationLayout->itemAt( idx )->widget();
if ( item )
{
item->setEnabled( false );
}
}
QLabel *noOpenCL = new QLabel( tr( "QGIS is compiled without OpenCL support. "
"GPU acceleration is not available." ), this );
mOptionsPageAccelerationLayout->insertWidget( 0, noOpenCL );

#endif

Expand Down
2 changes: 1 addition & 1 deletion src/ui/qgsoptionsbase.ui
Expand Up @@ -5443,7 +5443,7 @@ The bigger the number, the faster zooming with the mouse wheel will be.</string>
</layout>
</widget>
<widget class="QWidget" name="mOptionsPageAcceleration">
<layout class="QVBoxLayout" name="verticalLayout_29">
<layout class="QVBoxLayout" name="mOptionsPageAccelerationLayout">
<item>
<widget class="QLabel" name="label_53">
<property name="text">
Expand Down

0 comments on commit c53610e

Please sign in to comment.