2
* KMix -- KDE's full featured mini mixer
5
* Copyright (C) 2000 Stefan Schimanski <1Stein@gmx.de>
6
* Copyright (C) 2001 Preston Brown <pbrown@kde.org>
8
* This program is free software; you can redistribute it and/or
9
* modify it under the terms of the GNU Library General Public
10
* License as published by the Free Software Foundation; either
11
* version 2 of the License, or (at your option) any later version.
13
* This program is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
* Library General Public License for more details.
18
* You should have received a copy of the GNU Library General Public
19
* License along with this program; if not, write to the Free
20
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23
#include <qbuttongroup.h>
24
#include <qwhatsthis.h>
27
#include <qradiobutton.h>
31
#include <kapplication.h>
34
#include "kmixprefdlg.h"
35
#include "kmixerwidget.h"
38
KMixPrefDlg::KMixPrefDlg( QWidget *parent )
41
setCaption( i18n( "Configure" ) );
42
setButtons( Ok|Cancel|Apply );
43
setDefaultButton( Ok );
46
m_generalTab = new QFrame( this );
47
setMainWidget( m_generalTab );
49
QBoxLayout *layout = new QVBoxLayout( m_generalTab );
50
layout->setMargin( 0 );
51
layout->setSpacing( KDialog::spacingHint() );
53
// -----------------------------------------------------------
56
label = new QLabel( i18n("Behavior"), m_generalTab );
57
layout->addWidget(label);
60
l = new QHBoxLayout();
63
m_dockingChk = new QCheckBox( i18n("&Dock in system tray"), m_generalTab );
64
l->addWidget( m_dockingChk );
65
m_dockingChk->setWhatsThis( i18n("Docks the mixer into the KDE system tray"));
67
l = new QHBoxLayout();
70
m_volumeChk = new QCheckBox(i18n("Enable system tray &volume control"), m_generalTab);
71
l->addWidget(m_volumeChk);
72
m_volumeChk->setWhatsThis( i18n("Allows to control the volume from the system tray"));
73
connect(m_dockingChk, SIGNAL(stateChanged(int)), SLOT(dockIntoPanelChange(int)) );
75
l = new QHBoxLayout();
78
m_onLogin = new QCheckBox( i18n("Restore volumes on login"), m_generalTab );
79
l->addWidget( m_onLogin );
81
// -----------------------------------------------------------
83
label = new QLabel( i18n("Visual"), m_generalTab );
84
layout->addWidget(label);
86
l = new QHBoxLayout();
89
m_showTicks = new QCheckBox( i18n("Show &tickmarks"), m_generalTab );
90
l->addWidget( m_showTicks );
91
m_showTicks->setWhatsThis( i18n("Enable/disable tickmark scales on the sliders"));
93
l = new QHBoxLayout();
96
m_showLabels = new QCheckBox( i18n("Show &labels"), m_generalTab );
97
l->addWidget( m_showLabels );
98
m_showLabels->setWhatsThis( i18n("Enables/disables description labels above the sliders"));
100
QBoxLayout *orientationLayout = new QHBoxLayout();
101
orientationLayout->addSpacing(10);
102
layout->addItem( orientationLayout );
103
QButtonGroup* orientationGroup = new QButtonGroup( m_generalTab );
104
orientationGroup->setExclusive(true);
105
QLabel* qlb = new QLabel( i18n("Slider orientation: "), m_generalTab );
106
_rbHorizontal = new QRadioButton(i18n("&Horizontal"), m_generalTab );
107
_rbVertical = new QRadioButton(i18n("&Vertical" ), m_generalTab );
108
orientationGroup->addButton(_rbHorizontal);
109
orientationGroup->addButton(_rbVertical);
111
orientationLayout->addWidget(qlb);
112
orientationLayout->addWidget(_rbHorizontal);
113
orientationLayout->addWidget(_rbVertical);
115
orientationLayout->addStretch();
116
layout->addStretch();
117
showButtonSeparator(true);
119
connect( this, SIGNAL(applyClicked()), this, SLOT(apply()) );
120
connect( this, SIGNAL(okClicked()), this, SLOT(apply()) );
123
KMixPrefDlg::~KMixPrefDlg()
127
void KMixPrefDlg::apply()
129
// disabling buttons => users sees that we are working
130
enableButtonOk(false);
131
enableButtonCancel(false);
132
enableButtonApply(false);
133
kapp->processEvents();
134
emit signalApplied( this );
135
// re-enable (in case of "Apply")
136
enableButtonOk(true);
137
enableButtonCancel(true);
138
enableButtonApply(true);
141
void KMixPrefDlg::dockIntoPanelChange(int state)
143
if ( state == Qt::Unchecked ) {
144
m_volumeChk->setDisabled(true);
146
m_volumeChk->setEnabled(true);
150
#include "kmixprefdlg.moc"