Skip to content

Commit

Permalink
Fix Linux build and hide checkbox on Mac
Browse files Browse the repository at this point in the history
  • Loading branch information
acolombier committed May 22, 2024
1 parent 5c3551d commit 217dc86
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
17 changes: 17 additions & 0 deletions src/preferences/dialog/dlgprefwaveform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

#include "library/dao/analysisdao.h"
#include "library/library.h"
#ifdef __APPLE__
#include "util/cmdlineargs.h"
#endif
#include "moc_dlgprefwaveform.cpp"
#include "preferences/waveformsettings.h"
#include "util/db/dbconnectionpooled.h"
Expand Down Expand Up @@ -219,6 +222,20 @@ void DlgPrefWaveform::slotUpdate() {
useAccelerationCheckBox->setChecked(false);
}

#ifdef __APPLE__
if (!CmdlineArgs::Instance().getDeveloper() &&
m_pConfig->getValue(
ConfigKey("[Waveform]", "use_hardware_acceleration"),
factory->preferredBackend()) ==
factory->preferredBackend()) {
useAccelerationCheckBox->hide();
waveformSpacer->changeSize(0, 20);
} else {
useAccelerationCheckBox->show();
waveformSpacer->changeSize(20, 20);
}
#endif

// The combobox holds a list of [handle name, handle index]
int currentIndex = waveformTypeComboBox->findData(factory->getType());
if (currentIndex != -1 && waveformTypeComboBox->currentIndex() != currentIndex) {
Expand Down
4 changes: 2 additions & 2 deletions src/preferences/dialog/dlgprefwaveformdlg.ui
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@
<item row="18" column="1" colspan="2">
<widget class="QLabel" name="requiresGLSLLabel">
<property name="text">
<string>This functionality requires waveform acceleration &quot;(GLSL)&quot;.</string>
<string>This functionality requires waveform acceleration.</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
Expand Down Expand Up @@ -672,7 +672,7 @@ Select from different types of displays for the waveform, which differ primarily
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<spacer name="waveformSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
Expand Down
2 changes: 1 addition & 1 deletion src/waveform/waveformwidgetfactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -949,7 +949,7 @@ void WaveformWidgetFactory::evaluateWidgets() {
// that load GL widgets (spinnies, waveforms) in singletons.
// Also excluded in enum WaveformWidgetType
// https://bugs.launchpad.net/bugs/1928772
addHandle(collectedHandles, type, waveformWidgetVars<SoftwareWaveformWidget>();
addHandle(collectedHandles, type, waveformWidgetVars<SoftwareWaveformWidget>());
#endif
addHandle(collectedHandles, type, waveformWidgetVars<GLWaveformWidget>());
addHandle(collectedHandles, type, waveformWidgetVars<GLSLFilteredWaveformWidget>());
Expand Down

0 comments on commit 217dc86

Please sign in to comment.