This commit includes an improved Preferences dialog for KMix.
It also exposes some previously hidden options and features,
some of which experimental (build-time option, off by default).
It also includes some minor UI improvements.
Signed-off-by: Mavridis Philippe <mavridisf@gmail.com>
(cherry picked from commit 2cc6752c15
)
r14.1.x
parent
5d08ceabaf
commit
14e1211f5c
@ -0,0 +1,142 @@
|
||||
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
|
||||
<class>KMixAppearanceConfig</class>
|
||||
<widget class="TQWidget">
|
||||
<property name="name">
|
||||
<cstring>KMixAppearanceConfig</cstring>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>464</width>
|
||||
<height>280</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="caption">
|
||||
<string>Appearance</string>
|
||||
</property>
|
||||
<grid>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="TQComboBox" row="0" column="1">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Horizontal</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Vertical</string>
|
||||
</property>
|
||||
</item>
|
||||
<property name="name">
|
||||
<cstring>kcfg_Orientation</cstring>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>3</hsizetype>
|
||||
<vsizetype>0</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="TQLabel" row="1" column="0">
|
||||
<property name="name">
|
||||
<cstring>lblValueStyle</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Volume values:</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="TQLabel" row="0" column="0">
|
||||
<property name="name">
|
||||
<cstring>lblOrientation</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Sliders orientation:</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="TQCheckBox" row="3" column="0" rowspan="1" colspan="2">
|
||||
<property name="name">
|
||||
<cstring>kcfg_Tickmarks</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Show &tickmarks</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="TQCheckBox" row="4" column="0" rowspan="1" colspan="2">
|
||||
<property name="name">
|
||||
<cstring>kcfg_Labels</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Show &labels</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="TQCheckBox" row="2" column="0" rowspan="1" colspan="2">
|
||||
<property name="name">
|
||||
<cstring>kcfg_Menubar</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Show &menu bar</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<spacer row="5" column="1">
|
||||
<property name="name">
|
||||
<cstring>spacer5</cstring>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>Expanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>111</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
<widget class="TQComboBox" row="1" column="1">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>None</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Absolute</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Relative</string>
|
||||
</property>
|
||||
</item>
|
||||
<property name="name">
|
||||
<cstring>kcfg_ValueStyle</cstring>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>3</hsizetype>
|
||||
<vsizetype>0</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</grid>
|
||||
</widget>
|
||||
<layoutdefaults spacing="6" margin="11"/>
|
||||
</UI>
|
@ -0,0 +1,157 @@
|
||||
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
|
||||
<class>KMixBehaviorConfig</class>
|
||||
<widget class="TQWidget">
|
||||
<property name="name">
|
||||
<cstring>KMixBehaviorConfig</cstring>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>659</width>
|
||||
<height>345</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="caption">
|
||||
<string>Behavior</string>
|
||||
</property>
|
||||
<vbox>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="TQCheckBox">
|
||||
<property name="name">
|
||||
<cstring>kcfg_starttdeRestore</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Automatically start mixer when you &login</string>
|
||||
</property>
|
||||
<property name="tristate">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="TQCheckBox">
|
||||
<property name="name">
|
||||
<cstring>kcfg_AllowDocking</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Enable system &tray icon</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="TQGroupBox">
|
||||
<property name="name">
|
||||
<cstring>grpSystray</cstring>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>System Tray</string>
|
||||
</property>
|
||||
<grid>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<spacer row="1" column="0">
|
||||
<property name="name">
|
||||
<cstring>spacer1_2</cstring>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
<widget class="TQCheckBox" row="0" column="0" rowspan="1" colspan="2">
|
||||
<property name="name">
|
||||
<cstring>kcfg_TrayVolumeControl</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Enable system tray volume &slider</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="TQLayoutWidget" row="1" column="1">
|
||||
<property name="name">
|
||||
<cstring>layout1</cstring>
|
||||
</property>
|
||||
<vbox>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="TQCheckBox">
|
||||
<property name="name">
|
||||
<cstring>kcfg_DockIconMuting</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Middle click on system tray icon toggles muting</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="TQCheckBox">
|
||||
<property name="name">
|
||||
<cstring>kcfg_Visible</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Show mixer window when starting KMix</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</vbox>
|
||||
</widget>
|
||||
</grid>
|
||||
</widget>
|
||||
<spacer>
|
||||
<property name="name">
|
||||
<cstring>spacer3</cstring>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>Expanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>161</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</vbox>
|
||||
</widget>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>kcfg_TrayVolumeControl</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>kcfg_DockIconMuting</receiver>
|
||||
<slot>setEnabled(bool)</slot>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>kcfg_TrayVolumeControl</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>kcfg_Visible</receiver>
|
||||
<slot>setEnabled(bool)</slot>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>kcfg_AllowDocking</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>grpSystray</receiver>
|
||||
<slot>setEnabled(bool)</slot>
|
||||
</connection>
|
||||
</connections>
|
||||
<layoutdefaults spacing="6" margin="11"/>
|
||||
</UI>
|
@ -0,0 +1,87 @@
|
||||
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
|
||||
<class>KMixExperimental</class>
|
||||
<widget class="TQWidget">
|
||||
<property name="name">
|
||||
<cstring>KMixExperimental</cstring>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>637</width>
|
||||
<height>310</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="caption">
|
||||
<string>Experimental features</string>
|
||||
</property>
|
||||
<vbox>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="TQLabel">
|
||||
<property name="name">
|
||||
<cstring>lblWarning</cstring>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>7</hsizetype>
|
||||
<vsizetype>4</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>Raised</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><p align="center"><b>WARNING!</b><br>
|
||||
These are features which are experimental and/or untested.<br>
|
||||
Please avoid using them in production.</p>
|
||||
<p align="center">The settings here will be applied after a restart.</p></string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="TQGroupBox">
|
||||
<property name="name">
|
||||
<cstring>grpBox</cstring>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>5</hsizetype>
|
||||
<vsizetype>5</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Exprerimental features</string>
|
||||
</property>
|
||||
<vbox>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="TQCheckBox">
|
||||
<property name="name">
|
||||
<cstring>kcfg_MultiDriver</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Enable multi-driver mode</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="TQCheckBox">
|
||||
<property name="name">
|
||||
<cstring>kcfg_Experimental_ViewSurround</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Enable Surround View (EXPERIMENTAL)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</vbox>
|
||||
</widget>
|
||||
</vbox>
|
||||
</widget>
|
||||
<layoutdefaults spacing="6" margin="11"/>
|
||||
</UI>
|
@ -0,0 +1,102 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE kcfg SYSTEM "http://www.kde.org/standards/kcfg/1.0/kcfg.dtd">
|
||||
<kcfg>
|
||||
<kcfgfile name="kmixrc"/>
|
||||
<group name="General">
|
||||
<entry key="AllowDocking" type="Bool">
|
||||
<default>true</default>
|
||||
<label>Enable system tray icon</label>
|
||||
<whatsthis>Docks the mixer into the TDE panel</whatsthis>
|
||||
</entry>
|
||||
<entry key="TrayVolumeControl" type="Bool">
|
||||
<default>true</default>
|
||||
<label>Enable system tray volume slider</label>
|
||||
<whatsthis>If enabled, clicking on the system tray icon pops up a volume indicator, otherwise it opens the mixer.</whatsthis>
|
||||
</entry>
|
||||
<entry key="Tickmarks" type="Bool">
|
||||
<default>true</default>
|
||||
<label>Show tickmarks</label>
|
||||
<whatsthis>Enable/disable tickmark scales on the sliders</whatsthis>
|
||||
</entry>
|
||||
<entry name="Labels" type="Bool">
|
||||
<default>true</default>
|
||||
<label>Show labels</label>
|
||||
<whatsthis>Enables/disables description labels above the sliders</whatsthis>
|
||||
</entry>
|
||||
<entry key="ValueStyle" type="Enum">
|
||||
<choices>
|
||||
<choice name="None">
|
||||
<label>None</label>
|
||||
</choice>
|
||||
<choice name="Absolute">
|
||||
<label>Absolute</label>
|
||||
</choice>
|
||||
<choice name="Relative">
|
||||
<label>Relative</label>
|
||||
</choice>
|
||||
</choices>
|
||||
<default>None</default>
|
||||
<label>Volume Values</label>
|
||||
<whatsthis>How volume values are displayed</whatsthis>
|
||||
</entry>
|
||||
<entry key="starttdeRestore" type="Bool">
|
||||
<default>true</default>
|
||||
<label>Autostart</label>
|
||||
<whatsthis>Automatically start mixer when you login</whatsthis>
|
||||
</entry>
|
||||
<entry key="DockIconMuting" type="Bool">
|
||||
<default>false</default>
|
||||
<label>Middle click on system tray icon toggles muting</label>
|
||||
</entry>
|
||||
<entry key="Visible" type="Bool">
|
||||
<default>false</default>
|
||||
<label>Show mixer window when starting KMix</label>
|
||||
<whatsthis>Check this to make KMix open the mixer window on startup by default. By default this is unchecked, causing only the system tray icon to be shown on startup. Note that if both system tray icon and this option are disabled then this option is assumed to be checked (to avoid starting KMix with no GUI at all).</whatsthis>
|
||||
</entry>
|
||||
<entry key="Menubar" type="Bool">
|
||||
<default>true</default>
|
||||
<label>Show menubar</label>
|
||||
<whatsthis>Show the menu bar in the mixer window.</whatsthis>
|
||||
</entry>
|
||||
<entry key="MultiDriver" type="Bool">
|
||||
<default>false</default>
|
||||
<label>Enable multi-driver mode</label>
|
||||
<whatsthis>Try scanning all backends. By default this is unchecked, which results in the first found backend being used.</whatsthis>
|
||||
</entry>
|
||||
<entry key="Experimental_ViewSurround" type="Bool">
|
||||
<default>false</default>
|
||||
<label>Enable Surround View (EXPERIMENTAL)</label>
|
||||
</entry>
|
||||
<entry key="Experimental_ViewGrid" type="Bool">
|
||||
<default>false</default>
|
||||
<label>Enable Grid View (EXPERIMENTAL)</label>
|
||||
</entry>
|
||||
<entry key="Orientation" type="Enum">
|
||||
<choices>
|
||||
<choice name="Horizontal">
|
||||
<label>Horizontal</label>
|
||||
</choice>
|
||||
<choice name="Vertical">
|
||||
<label>Vertical</label>
|
||||
</choice>
|
||||
</choices>
|
||||
<default>Vertical</default>
|
||||
<label>Slider Orientation</label>
|
||||
</entry>
|
||||
<entry key="UseDefaultMaster" type="Bool">
|
||||
<default>true</default>
|
||||
</entry>
|
||||
<entry key="MasterMixer" type="String">
|
||||
<default></default>
|
||||
</entry>
|
||||
<entry key="MasterMixerDevice" type="String">
|
||||
<default></default>
|
||||
</entry>
|
||||
<entry key="Size" type="Size">
|
||||
<default></default>
|
||||
</entry>
|
||||
<entry key="Position" type="Point">
|
||||
<default></default>
|
||||
</entry>
|
||||
</group>
|
||||
</kcfg>
|
@ -1,140 +0,0 @@
|
||||
/*
|
||||
* KMix -- KDE's full featured mini mixer
|
||||
*
|
||||
*
|
||||
* Copyright (C) 2000 Stefan Schimanski <1Stein@gmx.de>
|
||||
* Copyright (C) 2001 Preston Brown <pbrown@kde.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this program; if not, write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include <tqbuttongroup.h>
|
||||
#include <tqlayout.h>
|
||||
#include <tqwhatsthis.h>
|
||||
#include <tqcheckbox.h>
|
||||
#include <tqlabel.h>
|
||||
#include <tqradiobutton.h>
|
||||
|
||||
#include <tdelocale.h>
|
||||
// For "kapp"
|
||||
#include <tdeapplication.h>
|
||||
|
||||
#include "kmix.h"
|
||||
#include "kmixprefdlg.h"
|
||||
#include "kmixerwidget.h"
|
||||
|
||||
|
||||
KMixPrefDlg::KMixPrefDlg( TQWidget *parent )
|
||||
: KDialogBase( Plain, i18n( "Configure" ),
|
||||
Ok|Cancel|Apply, Ok, parent )
|
||||
{
|
||||
// general buttons
|
||||
m_generalTab = plainPage( /* i18n("&General") */ );
|
||||
|
||||
TQBoxLayout *layout = new TQVBoxLayout( m_generalTab );
|
||||
layout->setSpacing( KDialog::spacingHint() );
|
||||
|
||||
m_dockingChk = new TQCheckBox( i18n("&Dock into panel"), m_generalTab );
|
||||
layout->addWidget( m_dockingChk );
|
||||
TQWhatsThis::add(m_dockingChk, i18n("Docks the mixer into the TDE panel"));
|
||||
|
||||
m_volumeChk = new TQCheckBox(i18n("Enable system tray &volume control"),
|
||||
m_generalTab);
|
||||
layout->addWidget(m_volumeChk);
|
||||
|
||||
m_showTicks = new TQCheckBox( i18n("Show &tickmarks"), m_generalTab );
|
||||
layout->addWidget( m_showTicks );
|
||||
TQWhatsThis::add(m_showTicks,
|
||||
i18n("Enable/disable tickmark scales on the sliders"));
|
||||
|
||||
m_showLabels = new TQCheckBox( i18n("Show &labels"), m_generalTab );
|
||||
layout->addWidget( m_showLabels );
|
||||
TQWhatsThis::add(m_showLabels,
|
||||
i18n("Enables/disables description labels above the sliders"));
|
||||
|
||||
|
||||
m_onLogin = new TQCheckBox( i18n("Restore volumes on login"), m_generalTab );
|
||||
layout->addWidget( m_onLogin );
|
||||
|
||||
m_dockIconMuting = new TQCheckBox(
|
||||
i18n("Middle click on system tray icon toggles muting"), m_generalTab );
|
||||
layout->addWidget( m_dockIconMuting );
|
||||
|
||||
TQBoxLayout *numbersLayout = new TQHBoxLayout( layout );
|
||||
TQButtonGroup *numbersGroup = new TQButtonGroup( 3, Qt::Horizontal, i18n("Numbers"), m_generalTab );
|
||||
numbersGroup->setRadioButtonExclusive(true);
|
||||
TQLabel* qlbl = new TQLabel( i18n("Volume Values: "), m_generalTab );
|
||||
_rbNone = new TQRadioButton( i18n("&None"), m_generalTab );
|
||||
_rbAbsolute = new TQRadioButton( i18n("A&bsolute"), m_generalTab );
|
||||
_rbRelative = new TQRadioButton( i18n("&Relative"), m_generalTab );
|
||||
numbersGroup->insert(_rbNone);
|
||||
numbersGroup->insert(_rbAbsolute);
|
||||
numbersGroup->insert(_rbRelative);
|
||||
numbersGroup->hide();
|
||||
|
||||
numbersLayout->add(qlbl);
|
||||
numbersLayout->add(_rbNone);
|
||||
numbersLayout->add(_rbAbsolute);
|
||||
numbersLayout->add(_rbRelative);
|
||||
numbersLayout->addStretch();
|
||||
|
||||
m_autoStartChk = new TQCheckBox( i18n("&Autostart"), m_generalTab );
|
||||
layout->addWidget( m_autoStartChk );
|
||||
TQWhatsThis::add(m_autoStartChk, i18n("Automatically start mixer when you login"));
|
||||
|
||||
TQBoxLayout *orientationLayout = new TQHBoxLayout( layout );
|
||||
TQButtonGroup* orientationGroup = new TQButtonGroup( 2, Qt::Horizontal, i18n("Orientation"), m_generalTab );
|
||||
//orientationLayout->add(orientationGroup);
|
||||
orientationGroup->setRadioButtonExclusive(true);
|
||||
TQLabel* qlb = new TQLabel( i18n("Slider Orientation: "), m_generalTab );
|
||||
_rbHorizontal = new TQRadioButton(i18n("&Horizontal"), m_generalTab );
|
||||
_rbVertical = new TQRadioButton(i18n("&Vertical" ), m_generalTab );
|
||||
orientationGroup->insert(_rbHorizontal);
|
||||
orientationGroup->insert(_rbVertical);
|
||||
orientationGroup->hide();
|
||||
//orientationLayout->add(qlb);
|
||||
//orientationLayout->add(orientationGroup);
|
||||
|
||||
orientationLayout->add(qlb);
|
||||
orientationLayout->add(_rbHorizontal);
|
||||
orientationLayout->add(_rbVertical);
|
||||
|
||||
orientationLayout->addStretch();
|
||||
layout->addStretch();
|
||||
enableButtonSeparator(true);
|
||||
|
||||
connect( this, TQT_SIGNAL(applyClicked()), this, TQT_SLOT(apply()) );
|
||||
connect( this, TQT_SIGNAL(okClicked()), this, TQT_SLOT(apply()) );
|
||||
}
|
||||
|
||||
KMixPrefDlg::~KMixPrefDlg()
|
||||
{
|
||||
}
|
||||
|
||||
void KMixPrefDlg::apply()
|
||||
{
|
||||
// disabling buttons => users sees that we are working
|
||||
enableButtonOK(false);
|
||||
enableButtonCancel(false);
|
||||
enableButtonApply(false);
|
||||
kapp->processEvents();
|
||||
emit signalApplied( this );
|
||||
// re-enable (in case of "Apply")
|
||||
enableButtonOK(true);
|
||||
enableButtonCancel(true);
|
||||
enableButtonApply(true);
|
||||
}
|
||||
|
||||
#include "kmixprefdlg.moc"
|
@ -1,70 +0,0 @@
|
||||
/*
|
||||
* KMix -- KDE's full featured mini mixer
|
||||
*
|
||||
*
|
||||
* Copyright (C) 2000 Stefan Schimanski <1Stein@gmx.de>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this program; if not, write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef KPREFDLG_H
|
||||
#define KPREFDLG_H
|
||||
|
||||
#include <kdialogbase.h>
|
||||
|
||||
class KMixPrefWidget;
|
||||
class KMixApp;
|
||||
class TQCheckBox;
|
||||
class TQRadioButton;
|
||||
|
||||
class
|
||||
KMixPrefDlg : public KDialogBase
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
||||
friend class KMixWindow;
|
||||
|
||||
public:
|
||||
KMixPrefDlg( TQWidget *parent );
|
||||
~KMixPrefDlg();
|
||||
|
||||
signals:
|
||||
void signalApplied( KMixPrefDlg *prefDlg );
|
||||
|
||||
private slots:
|
||||
void apply();
|
||||
|
||||
private:
|
||||
TQFrame *m_generalTab;
|
||||
KMixApp *m_mixApp;
|
||||
KMixPrefWidget *m_mixPrefTab;
|
||||
|
||||
TQCheckBox *m_autoStartChk;
|
||||
TQCheckBox *m_dockingChk;
|
||||
TQCheckBox *m_volumeChk;
|
||||
TQCheckBox *m_hideOnCloseChk;
|
||||
TQCheckBox *m_showTicks;
|
||||
TQCheckBox *m_showLabels;
|
||||
TQCheckBox *m_onLogin;
|
||||
TQCheckBox *m_dockIconMuting;
|
||||
TQRadioButton *_rbVertical;
|
||||
TQRadioButton *_rbHorizontal;
|
||||
TQRadioButton *_rbNone;
|
||||
TQRadioButton *_rbAbsolute;
|
||||
TQRadioButton *_rbRelative;
|
||||
};
|
||||
|
||||
#endif
|
@ -0,0 +1,6 @@
|
||||
File=kmix.kcfg
|
||||
Singleton=true
|
||||
ClassName=KMixSettings
|
||||
Mutators=true
|
||||
Visibility=KDE_EXPORT
|
||||
SetUserTexts=true
|
@ -1,212 +0,0 @@
|
||||
/*
|
||||
* KMix -- KDE's full featured mini mixer
|
||||
*
|
||||
*
|
||||
* Copyright (C) 1996-2004 Christian Esken <esken@kde.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this program; if not, write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "viewgrid.h"
|
||||
|
||||
// TQt
|
||||
#include <tqwidget.h>
|
||||
|
||||
// KDE
|
||||
#include <kdebug.h>
|
||||
|
||||
// KMix
|
||||
#include "mdwenum.h"
|
||||
#include "mdwslider.h"
|
||||
#include "mdwswitch.h"
|
||||
#include "mixer.h"
|
||||
|
||||
/**
|
||||
*/
|
||||
ViewGrid::ViewGrid(TQWidget* parent, const char* name, const TQString & caption, Mixer* mixer, ViewBase::ViewFlags vflags)
|
||||
: ViewBase(parent, name, caption, mixer, WStyle_Customize|WStyle_NoBorder, vflags)
|
||||
{
|
||||
m_spacingHorizontal = 5;
|
||||
m_spacingVertical = 5;
|
||||
|
||||
if ( _vflags & ViewBase::Vertical ) {
|
||||
//_layoutMDW = new TQVBoxLayout(this);
|
||||
}
|
||||
else {
|
||||
//_layoutMDW = new TQHBoxLayout(this);
|
||||
}
|
||||
init();
|
||||
}
|
||||
|
||||
ViewGrid::~ViewGrid() {
|
||||
}
|
||||
|
||||
void ViewGrid::setMixSet(MixSet *mixset)
|
||||
{
|
||||
MixDevice* md;
|
||||
int testCounter = 0;
|
||||
for ( md = mixset->first(); md != 0; md = mixset->next() ) {
|
||||
if (testCounter<8) {
|
||||
_mixSet->append(md);
|
||||
}
|
||||
testCounter++;
|
||||
}
|
||||
}
|
||||
|
||||
int ViewGrid::count()
|
||||
{
|
||||
return ( _mixSet->count() );
|
||||
}
|
||||
|
||||
int ViewGrid::advice() {
|
||||
if ( _mixSet->count() > 0 ) {
|
||||
// The standard input and output views are always advised, if there are devices in it
|
||||
return 100;
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
TQWidget* ViewGrid::add(MixDevice *md)
|
||||
{
|
||||
MixDeviceWidget *mdw = 0;
|
||||
if ( md->isEnum() ) {
|
||||
Qt::Orientation orientation = (_vflags & ViewBase::Vertical) ? Qt::Horizontal : Qt::Vertical;
|
||||
mdw = new MDWEnum(
|
||||
_mixer, // the mixer for this device
|
||||
md, // MixDevice (parameter)
|
||||
orientation, // Orientation
|
||||
this, // parent
|
||||
this, // View widget
|
||||
md->name().latin1()
|
||||
);
|
||||
} // an enum
|
||||
else if (md->isSwitch()) {
|
||||
Qt::Orientation orientation = (_vflags & ViewBase::Vertical) ? Qt::Horizontal : Qt::Vertical;
|
||||
mdw =
|
||||
new MDWSwitch(
|
||||
_mixer, // the mixer for this device
|
||||
md, // MixDevice (parameter)
|
||||
false, // Small
|
||||
orientation, // Orientation
|
||||
this, // parent
|
||||
this, // View widget
|
||||
md->name().latin1()
|
||||
);
|
||||
} // a switch
|
||||
|
||||
else { // must be a slider
|
||||
Qt::Orientation orientation = (_vflags & ViewBase::Vertical) ? Qt::Horizontal : Qt::Vertical;
|
||||
mdw =
|
||||
new MDWSlider(
|
||||
_mixer, // the mixer for this device
|
||||
md, // MixDevice (parameter)
|
||||
true, // Show Mute LED
|
||||
true, // Show Record LED
|
||||
false, // Small
|
||||
orientation, // Orientation
|
||||
this, // parent
|
||||
this, // View widget
|
||||
md->name().latin1()
|
||||
);
|
||||
}
|
||||
return mdw;
|
||||
}
|
||||
|
||||
TQSize ViewGrid::sizeHint() const {
|
||||
// kdDebug(67100) << "ViewGrid::sizeHint(): NewSize is " << _layoutMDW->sizeHint() << "\n";
|
||||
return( m_sizeHint);
|
||||
}
|
||||
|
||||
void ViewGrid::constructionFinished() {
|
||||
//_layoutMDW->activate();
|
||||
|
||||
// do a manual layout
|
||||
configurationUpdate();
|
||||
}
|
||||
|
||||
void ViewGrid::refreshVolumeLevels() {
|
||||
// kdDebug(67100) << "ViewGrid::refreshVolumeLevels()\n";
|
||||
|
||||
m_sizeHint.setWidth (0);
|
||||
m_sizeHint.setHeight(0);
|
||||
|
||||
m_testingX = 0;
|
||||
m_testingY = 0;
|
||||
|
||||
TQWidget *mdw = _mdws.first();
|
||||
MixDevice* md;
|
||||
for ( md = _mixSet->first(); md != 0; md = _mixSet->next() ) {
|
||||
if ( mdw == 0 ) {
|
||||
kdError(67100) << "ViewGrid::refreshVolumeLevels(): mdw == 0\n";
|
||||
break; // sanity check (normally the lists are set up correctly)
|
||||
}
|
||||
else {
|
||||
if ( mdw->inherits("MDWSlider")) {
|
||||
//kdDebug(67100) << "ViewGrid::refreshVolumeLevels(): updating\n";
|
||||
// a slider, fine. Lets update its value
|
||||
static_cast<MDWSlider*>(mdw)->update();
|
||||
}
|
||||
else if ( mdw->inherits("MDWSwitch")) {
|
||||
//kdDebug(67100) << "ViewGrid::refreshVolumeLevels(): updating\n";
|
||||
// a slider, fine. Lets update its value
|
||||
static_cast<MDWSwitch*>(mdw)->update();
|
||||
}
|
||||
else if ( mdw->inherits("MDWEnum")) {
|
||||
static_cast<MDWEnum*>(mdw)->update();
|
||||
}
|
||||
else {
|
||||
kdError(67100) << "ViewGrid::refreshVolumeLevels(): mdw is unknown/unsupported type\n";
|
||||
// no slider. Cannot happen in theory => skip it
|
||||
}
|
||||
}
|
||||
mdw = _mdws.next();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
This implementation makes sure the Grid's geometry is updated
|
||||
after hiding/showing channels.
|
||||
*/
|
||||
void ViewGrid::configurationUpdate() {
|
||||
m_sizeHint.setWidth (0);
|
||||
m_sizeHint.setHeight(0);
|
||||
|
||||
m_testingX = 0;
|
||||
m_testingY = 0;
|
||||
|
||||
for (TQWidget *qw = _mdws.first(); qw !=0; qw = _mdws.next() ) {
|
||||
|
||||
if ( qw->inherits("MixDeviceWidget")) {
|
||||
MixDeviceWidget* mdw = static_cast<MixDeviceWidget*>(qw);
|
||||
int xPos = m_testingX * m_spacingHorizontal;
|
||||
int yPos = m_testingY * m_spacingVertical ;
|
||||
mdw->move( xPos, yPos );
|
||||
mdw->resize( mdw->sizeHint() );
|
||||
int xMax = xPos + mdw->width() ; if ( xMax > m_sizeHint.width() ) m_sizeHint.setWidth(xMax);
|
||||
int yMax = yPos + mdw->height(); if ( yMax > m_sizeHint.height() ) m_sizeHint.setHeight(yMax);
|
||||
|
||||
m_testingX += 5;
|
||||
if ( m_testingX > 50 ) {
|
||||
m_testingY += 10;
|
||||
m_testingX = 0;
|
||||
}
|
||||
} // inherits MixDeviceWidget
|
||||
} // for all MDW's
|
||||
}
|
||||
|
||||
|
||||
#include "viewgrid.moc"
|
@ -1,43 +0,0 @@
|
||||
#ifndef ViewGrid_h
|
||||
#define ViewGrid_h
|
||||
|
||||
class TQBoxLayout;
|
||||
#include "tqsize.h"
|
||||
class TQWidget;
|
||||
|
||||
class Mixer;
|
||||
#include "viewbase.h"
|
||||
|
||||
class ViewGrid : public ViewBase
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ViewGrid(TQWidget* parent, const char* name, const TQString & caption, Mixer* mixer, ViewBase::ViewFlags vflags);
|
||||
~ViewGrid();
|
||||
|
||||
virtual int count();
|
||||
virtual int advice();
|
||||
virtual void setMixSet(MixSet *mixset);
|
||||
virtual TQWidget* add(MixDevice *mdw);
|
||||
virtual void configurationUpdate();
|
||||
virtual void constructionFinished();
|
||||
|
||||
TQSize sizeHint() const;
|
||||
|
||||
public slots:
|
||||
virtual void refreshVolumeLevels();
|
||||
|
||||
private:
|
||||
unsigned int m_spacingHorizontal;
|
||||
unsigned int m_spacingVertical;
|
||||
|
||||
// m_maxX and m_maxY are the highest coordiantes encountered
|
||||
TQSize m_sizeHint;
|
||||
|
||||
unsigned int m_testingX;
|
||||
unsigned int m_testingY;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in new issue