summaryrefslogtreecommitdiff
path: root/src/ui/backendcontroller.cpp
diff options
context:
space:
mode:
authorCalvin Morrison <calvin@pobox.com>2026-05-24 14:45:24 -0400
committerCalvin Morrison <calvin@pobox.com>2026-05-24 14:45:24 -0400
commitff020f03a29dd26bda0b891c562226fa7a61eb19 (patch)
tree2152d68b222dfc654e55a2add1860cbc6e8e5bdf /src/ui/backendcontroller.cpp
parent71d01139cf2ac4380c2ee13ecdcff77eb1d42897 (diff)
show error page in OSS mixer window when backend fails to open
If /dev/mixer can't be opened (missing device, bad permissions, etc.) the window now shows the error reason instead of silently not appearing. The tray is also skipped in the error case. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'src/ui/backendcontroller.cpp')
-rw-r--r--src/ui/backendcontroller.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/ui/backendcontroller.cpp b/src/ui/backendcontroller.cpp
index e24b0e1..25716e0 100644
--- a/src/ui/backendcontroller.cpp
+++ b/src/ui/backendcontroller.cpp
@@ -130,25 +130,23 @@ void BackendController::startAlsa( bool showWindow )
void BackendController::startOss( bool showWindow )
{
m_ossModel = new OssModel( this );
- if ( !m_ossModel->open() ) {
- delete m_ossModel;
- m_ossModel = 0;
- return;
- }
+ m_ossModel->open(); // window shows an error page if this fails
+
m_ossWin = new OssMixerWindow( m_ossModel );
connect( m_ossWin, TQ_SIGNAL(settingsChanged()),
this, TQ_SLOT(onSettingsChanged()) );
static_cast<TmixApp*>(tdeApp)->setMainWindow( m_ossWin );
+ bool hasError = !m_ossModel->lastError().isEmpty();
TDEConfig *cfg = TDEGlobal::config();
cfg->setGroup("Tray");
bool dockInTray = cfg->readBoolEntry("DockInTray", true);
- if ( dockInTray ) {
+ if ( dockInTray && !hasError ) {
m_ossTray = new OssTray( m_ossModel, m_ossWin, m_ossWin );
m_ossWin->setTray( m_ossTray );
m_ossTray->show();
}
- if ( !dockInTray || showWindow )
+ if ( !dockInTray || showWindow || hasError )
m_ossWin->show();
}
#endif