Commit b09a4f37 authored by llea's avatar llea

Bug fixed when no ringtones directory found

parent 04b732b6
This diff is collapsed.
......@@ -26,34 +26,36 @@ void ConfigurationPanel::init()
// List skin choice from "skins" directory
QDir dir(Skin::getPath(QString(SKINDIR)));
if ( !dir.exists() ) {
printf ("Cannot find skins directory\n");
}
dir.setFilter( QDir::Dirs | QDir::NoSymLinks);
dir.setSorting( QDir::Name );
QStringList list;
list = dir.entryList();
for (unsigned int i = 0; i < dir.count(); i++) {
if (list[i] != "." && list[i] != ".." && list[i] != "CVS") {
SkinChoice->insertItem(list[i]);
}
}
printf ("\nCannot find 'skins' directory\n");
} else {
dir.setFilter( QDir::Dirs | QDir::NoSymLinks);
dir.setSorting( QDir::Name );
QStringList list;
list = dir.entryList();
for (unsigned int i = 0; i < dir.count(); i++) {
if (list[i] != "." && list[i] != ".." && list[i] != "CVS") {
SkinChoice->insertItem(list[i]);
}
}
}
// List ring choice from "rings" directory
// List ring choice from "rings" directory
QDir ringdir(Skin::getPath(QString(RINGDIR)));
if ( !ringdir.exists() ) {
printf ("Cannot find rings directory\n");
}
ringdir.setFilter( QDir::Files | QDir::NoSymLinks);
ringdir.setSorting( QDir::Name );
QStringList ringlist;
ringlist = ringdir.entryList();
for (unsigned int i = 0; i < ringdir.count(); i++) {
if (ringlist[i] != "." && ringlist[i] != ".." && ringlist[i] != "CVS") {
ringsChoice->insertItem(ringlist[i]);
}
}
printf ("\nCannot find 'rings' directory\n");
} else {
ringdir.setFilter( QDir::Files | QDir::NoSymLinks);
ringdir.setSorting( QDir::Name );
QStringList ringlist;
ringlist = ringdir.entryList();
for (unsigned int i = 0; i < ringdir.count(); i++) {
if (ringlist[i] != "." && ringlist[i] != ".." && ringlist[i] != "CVS") {
ringsChoice->insertItem(ringlist[i]);
}
}
}
// For signalisations tab
fullName->setText(QString(Config::getchar("Signalisations", "SIP.fullName", "")));
userPart->setText(QString(Config::getchar("Signalisations", "SIP.userPart", "")));
......@@ -69,13 +71,14 @@ void ConfigurationPanel::init()
"stun.fwdnet.net:3478"));
((QRadioButton*)stunButtonGroup->find(Config::get("Signalisations", "STUN.useStun", 1)))->setChecked(true);
// For audio tab
ossButton->setChecked(Config::get("Audio", "Drivers.driverOSS", (int)true));
alsaButton->setChecked(Config::get("Audio", "Drivers.driverALSA", (int)false));
((QRadioButton*)DriverChoice->find(Config::get("Audio", "Drivers.driverName", 0)))->setChecked(true);
#ifdef ALSA
alsaButton->setEnabled(true);
#else
alsaButton->setEnabled(false);
#endif
codec1->setCurrentText(QString(Config::getchar("Audio", "Codecs.codec1", "G711u")));
codec2->setCurrentText(QString(Config::getchar("Audio", "Codecs.codec2", "G711u")));
codec3->setCurrentText(QString(Config::getchar("Audio", "Codecs.codec3", "G711u")));
......@@ -139,15 +142,13 @@ void ConfigurationPanel::saveSlot()
Config::set("Signalisations", "DTMF.sendDTMFas" , sendDTMFas->currentItem());
Config::set("Signalisations", "STUN.STUNserver", STUNserver->text());
Config::set("Audio", "Drivers.driverALSA", alsaButton->isChecked());
Config::set("Audio", "Drivers.driverOSS", ossButton->isChecked());
Config::set("Audio", "Codecs.codec1", codec1->currentText());
Config::set("Audio", "Codecs.codec2", codec2->currentText());
Config::set("Audio", "Codecs.codec3", codec3->currentText());
Config::set("Audio", "Codecs.codec4", codec4->currentText());
Config::set("Audio", "Codecs.codec5", codec5->currentText());
Config::set("Audio", "Rings.ringChoice", ringsChoice->currentText());
if (ringsChoice->currentText() != NULL)
Config::set("Audio", "Rings.ringChoice", ringsChoice->currentText());
Config::set("Preferences", "Themes.skinChoice", SkinChoice->currentText());
Config::set("Preferences", "Options.zoneToneChoice",
......@@ -236,5 +237,11 @@ void ConfigurationPanel::useStunSlot(int id)
void ConfigurationPanel::applySkinSlot()
{
Config::set("Preferences", "Themes.skinChoice", SkinChoice->currentText());
Config::set("Preferences", "Themes.skinChoice", SkinChoice->currentText());
}
void ConfigurationPanel::driverSlot(int id)
{
Config::set("Audio", "Drivers.driverName", id);
}
This diff is collapsed.
/****************************************************************************
** Form interface generated from reading ui file 'configurationpanel.ui'
**
** Created: Mon Apr 25 16:32:28 2005
** Created: Tue Apr 26 15:15:15 2005
** by: The User Interface Compiler ($Id$)
**
** WARNING! All changes made in this file will be lost!
......@@ -128,6 +128,7 @@ public slots:
virtual void changeTabSlot();
virtual void useStunSlot( int id );
virtual void applySkinSlot();
virtual void driverSlot( int id );
protected:
QGridLayout* ConfigurationPanelLayout;
......
......@@ -33,7 +33,7 @@ ConfigurationTree::~ConfigurationTree (void) {
int
ConfigurationTree::populateFromFile (const char *fileName) {
if (fileName == NULL) {
printf("filename est NULL\n");
printf("Filename is NULL\n");
return 0;
}
......@@ -41,7 +41,7 @@ ConfigurationTree::populateFromFile (const char *fileName) {
file.open(fileName, fstream::in);
if (!file.is_open()) {
cout << "Error opening file";
printf("\nConfig-file is creating ...\n");
return 0;
}
......@@ -91,7 +91,7 @@ ConfigurationTree::saveToFile (const char *fileName) {
file.open(fileName, fstream::out);
if (!file.is_open()) {
cout << "Error opening file";
printf("\nError opening file\n");
return 0;
}
......
......@@ -48,4 +48,6 @@
// bytes in buffer
#define YES 0
#define NO 1
#define OSS_DRIVER 0
#define ALSA_DRIVER 1
#endif // __GLOBAL_H__
......@@ -141,11 +141,11 @@ Manager::createSettingsPath (void) {
*/
void
Manager::selectAudioDriver (void) {
if (Config::getb("Audio", "Drivers.driverOSS")) {
if (Config::geti("Audio", "Drivers.driverName") == OSS_DRIVER) {
useAlsa = false;
this->audiodriver = new AudioDriversOSS (AudioDrivers::ReadWrite, error);
}
if (Config::getb("Audio", "Drivers.driverALSA")) {
if (Config::geti("Audio", "Drivers.driverName") == ALSA_DRIVER) {
#ifdef ALSA
useAlsa = true;
this->audiodriver = new AudioDriversALSA (AudioDrivers::WriteOnly, error);
......@@ -393,7 +393,6 @@ Manager::getNumberPendingCalls (void) {
void
Manager::handleRemoteEvent (int code, char * reason, int remotetype, int line) {
QString qinfo;
int theline;
switch (remotetype) {
// Registration success
......
/****************************************************************************
** Form implementation generated from reading ui file 'phonebook.ui'
**
** Created: Mon Apr 25 16:32:27 2005
** Created: Tue Apr 26 15:15:15 2005
** by: The User Interface Compiler ($Id$)
**
** WARNING! All changes made in this file will be lost!
......
/****************************************************************************
** Form interface generated from reading ui file 'phonebook.ui'
**
** Created: Mon Apr 25 16:32:27 2005
** Created: Tue Apr 26 15:15:15 2005
** by: The User Interface Compiler ($Id$)
**
** WARNING! All changes made in this file will be lost!
......
/****************************************************************************
** Form implementation generated from reading ui file 'url_input.ui'
**
** Created: Mon Apr 25 16:32:28 2005
** Created: Tue Apr 26 15:15:15 2005
** by: The User Interface Compiler ($Id$)
**
** WARNING! All changes made in this file will be lost!
......
/****************************************************************************
** Form interface generated from reading ui file 'url_input.ui'
**
** Created: Mon Apr 25 16:32:27 2005
** Created: Tue Apr 26 15:15:15 2005
** by: The User Interface Compiler ($Id$)
**
** WARNING! All changes made in this file will be lost!
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment