1
/***************************************************************************
2
* Copyright (C) 2009-2012 by Savoir-Faire Linux *
3
* Author : Jérémy Quentin <jeremy.quentin@savoirfairelinux.com> *
4
* Emmanuel Lepage Vallee <emmanuel.lepage@savoirfairelinux.com>*
6
* This program is free software; you can redistribute it and/or modify *
7
* it under the terms of the GNU General Public License as published by *
8
* the Free Software Foundation; either version 3 of the License, or *
9
* (at your option) any later version. *
11
* This program is distributed in the hope that it will be useful, *
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14
* GNU General Public License for more details. *
16
* You should have received a copy of the GNU General Public License *
17
* along with this program; if not, write to the *
18
* Free Software Foundation, Inc., *
19
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
20
***************************************************************************/
24
#include "lib/configurationmanager_interface_singleton.h"
25
#include "conf/ConfigurationSkeleton.h"
26
#include "conf/ConfigurationDialog.h"
27
#include <QtGui/QHeaderView>
29
#include "lib/sflphone_const.h"
31
DlgAudio::DlgAudio(KConfigDialog *parent)
36
KUrlRequester_ringtone->setMode(KFile::File | KFile::ExistingOnly);
37
KUrlRequester_ringtone->lineEdit()->setObjectName("kcfg_ringtone");
38
KUrlRequester_ringtone->lineEdit()->setReadOnly(true);
40
KUrlRequester_destinationFolder->setMode(KFile::Directory|KFile::ExistingOnly|KFile::LocalOnly);
41
KUrlRequester_destinationFolder->setUrl(KUrl(QDir::home().path()));
42
KUrlRequester_destinationFolder->lineEdit()->setObjectName("kcfg_destinationFolder");
43
KUrlRequester_destinationFolder->lineEdit()->setReadOnly(true);
45
connect( box_alsaPlugin, SIGNAL(activated(int)), parent, SLOT(updateButtons()));
46
connect( this, SIGNAL(updateButtons()), parent, SLOT(updateButtons()));
55
void DlgAudio::updateWidgets()
61
void DlgAudio::updateSettings()
64
ConfigurationSkeleton * skeleton = ConfigurationSkeleton::self();
65
skeleton->setAlsaPlugin(box_alsaPlugin->currentText());
67
//codecTableHasChanged = false;
70
bool DlgAudio::hasChanged()
72
ConfigurationSkeleton * skeleton = ConfigurationSkeleton::self();
73
bool alsaPluginHasChanged = skeleton->interface() == ConfigurationSkeleton::EnumInterface::ALSA && skeleton->alsaPlugin() != box_alsaPlugin->currentText();
74
return alsaPluginHasChanged ;
77
void DlgAudio::loadAlsaSettings()
79
ConfigurationManagerInterface& configurationManager = ConfigurationManagerInterfaceSingleton::getInstance();
80
if(QString(configurationManager.getAudioManager()) == "alsa") {
81
ConfigurationSkeleton* skeleton = ConfigurationSkeleton::self();
83
int index = box_alsaPlugin->findText(skeleton->alsaPlugin());
84
if(index < 0) index = 0;
85
QStringList pluginList = configurationManager.getAudioPluginList ();
86
box_alsaPlugin->clear ( );
87
box_alsaPlugin->addItems ( pluginList );
88
box_alsaPlugin->setCurrentIndex ( index );
90
QStringList inputDeviceList = configurationManager.getAudioInputDeviceList ();
91
kcfg_alsaInputDevice->clear ( );
92
kcfg_alsaInputDevice->addItems ( inputDeviceList );
93
kcfg_alsaInputDevice->setCurrentIndex ( skeleton->alsaInputDevice() );
95
QStringList outputDeviceList = configurationManager.getAudioOutputDeviceList ();
96
kcfg_alsaOutputDevice->clear ( );
97
kcfg_alsaOutputDevice->addItems ( outputDeviceList );
98
kcfg_alsaOutputDevice->setCurrentIndex( skeleton->alsaOutputDevice() );
100
groupBox_alsa->setEnabled(true);
103
groupBox_alsa->setEnabled(false);
b'\\ No newline at end of file'