From e776bc768cf9afca1867200e25d64d315cd72a3e Mon Sep 17 00:00:00 2001 From: Calvin Morrison Date: Fri, 15 May 2026 10:10:04 -0400 Subject: Full mixer implementation — tray, popup, prefs, devices tab with port indicators MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds the complete tmix feature set built since the initial skeleton: balance knob, level meters, KLed mute button, system tray with scroll-wheel volume and recording indicator, tray popup, preferences dialog, right-click context menus, single-instance enforcement, scroll area, window geometry persistence, and Devices tab with PA card profile switcher and live port availability indicators (2-column layout, in-place updates on plug/unplug). Co-Authored-By: Claude Sonnet 4.6 --- src/ui/preferencesdlg.cpp | 111 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 src/ui/preferencesdlg.cpp (limited to 'src/ui/preferencesdlg.cpp') diff --git a/src/ui/preferencesdlg.cpp b/src/ui/preferencesdlg.cpp new file mode 100644 index 0000000..b6df120 --- /dev/null +++ b/src/ui/preferencesdlg.cpp @@ -0,0 +1,111 @@ +#include "preferencesdlg.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +PreferencesDlg::PreferencesDlg( TQWidget *parent ) + : KDialogBase( Tabbed, i18n("Configure TMix"), + Ok | Apply | Cancel, Ok, parent ) +{ + // ---- General ------------------------------------------------------------- + TQFrame *gen = addPage( i18n("General") ); + TQVBoxLayout *gl = new TQVBoxLayout( gen, marginHint(), spacingHint() ); + + m_dockInTray = new TQCheckBox( i18n("Dock in system tray"), gen ); + gl->addWidget( m_dockInTray ); + + m_showPopup = new TQCheckBox( i18n("Show mini volume popup on tray click"), gen ); + gl->addWidget( m_showPopup ); + + m_showRecTray = new TQCheckBox( i18n("Show microphone-in-use icon in tray"), gen ); + gl->addWidget( m_showRecTray ); + + m_confirmQuit = new TQCheckBox( i18n("Ask for confirmation before quitting"), gen ); + gl->addWidget( m_confirmQuit ); + + + gl->addSpacing( 8 ); + + TQHBoxLayout *stepRow = new TQHBoxLayout( 0, 0, spacingHint() ); + stepRow->addWidget( new TQLabel( i18n("Scroll wheel volume step:"), gen ) ); + m_scrollStep = new TQSpinBox( 1, 20, 1, gen ); + m_scrollStep->setSuffix( i18n(" %") ); + stepRow->addWidget( m_scrollStep ); + stepRow->addStretch(); + gl->addLayout( stepRow ); + + gl->addStretch(); + + // ---- View ---------------------------------------------------------------- + TQFrame *view = addPage( i18n("View") ); + TQVBoxLayout *vl = new TQVBoxLayout( view, marginHint(), spacingHint() ); + + m_noTabs = new TQCheckBox( i18n("Show all devices in one view (no tabs)"), view ); + vl->addWidget( m_noTabs ); + + vl->addSpacing( 8 ); + vl->addWidget( new TQLabel( i18n("Show tabs:"), view ) ); + m_showOutput = new TQCheckBox( i18n("Output"), view ); + m_showInput = new TQCheckBox( i18n("Input"), view ); + m_showPlayback = new TQCheckBox( i18n("Playback"), view ); + m_showRecording = new TQCheckBox( i18n("Recording"), view ); + vl->addWidget( m_showOutput ); + vl->addWidget( m_showInput ); + vl->addWidget( m_showPlayback ); + vl->addWidget( m_showRecording ); + vl->addStretch(); + + load(); +} + +void PreferencesDlg::load() +{ + TDEConfig *cfg = TDEGlobal::config(); + + cfg->setGroup("General"); + m_dockInTray->setChecked( cfg->readBoolEntry("DockInTray", true) ); + m_showPopup->setChecked( cfg->readBoolEntry("ShowPopup", true) ); + m_showRecTray->setChecked( cfg->readBoolEntry("ShowRecordingTray", true) ); + m_confirmQuit->setChecked( cfg->readBoolEntry("ConfirmQuit", false) ); + m_scrollStep->setValue( cfg->readNumEntry( "ScrollStep", 5) ); + + cfg->setGroup("View"); + m_noTabs->setChecked( cfg->readBoolEntry("NoTabs", false) ); + m_showOutput->setChecked( cfg->readBoolEntry("ShowOutput", true) ); + m_showInput->setChecked( cfg->readBoolEntry("ShowInput", true) ); + m_showPlayback->setChecked( cfg->readBoolEntry("ShowPlayback", true) ); + m_showRecording->setChecked( cfg->readBoolEntry("ShowRecording", true) ); +} + +void PreferencesDlg::save() +{ + TDEConfig *cfg = TDEGlobal::config(); + + cfg->setGroup("General"); + cfg->writeEntry( "DockInTray", m_dockInTray->isChecked() ); + cfg->writeEntry( "ShowPopup", m_showPopup->isChecked() ); + cfg->writeEntry( "ShowRecordingTray", m_showRecTray->isChecked() ); + cfg->writeEntry( "ConfirmQuit", m_confirmQuit->isChecked() ); + cfg->writeEntry( "ScrollStep", m_scrollStep->value() ); + + cfg->setGroup("View"); + cfg->writeEntry( "NoTabs", m_noTabs->isChecked() ); + cfg->writeEntry( "ShowOutput", m_showOutput->isChecked() ); + cfg->writeEntry( "ShowInput", m_showInput->isChecked() ); + cfg->writeEntry( "ShowPlayback", m_showPlayback->isChecked() ); + cfg->writeEntry( "ShowRecording", m_showRecording->isChecked() ); + + cfg->sync(); + emit settingsChanged(); +} + +void PreferencesDlg::slotOk() { save(); accept(); } +void PreferencesDlg::slotApply() { save(); } + +#include "preferencesdlg.moc" -- cgit v1.2.3