]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Fix a bug where we were setting default settings no matter what and do some minor...
authorJoão Mesquita <jmesquita@freeswitch.org>
Tue, 19 Jan 2010 23:54:32 +0000 (23:54 +0000)
committerJoão Mesquita <jmesquita@freeswitch.org>
Tue, 19 Jan 2010 23:54:32 +0000 (23:54 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16411 d0543943-73ff-0310-b7d9-9358b9ac24b2

fscomm/fshost.cpp
fscomm/main.cpp
fscomm/mainwindow.cpp
fscomm/mod_qsettings/mod_qsettings.cpp
fscomm/preferences/accountdialog.cpp
fscomm/preferences/prefaccounts.cpp

index 39b1b72afd09321f5bf3dafc46896791256f0752..736af8ed5e4e2680ea3581d4c0f32676d3a4eb88 100644 (file)
@@ -366,7 +366,7 @@ void FSHost::generalEventHandler(switch_event_t *event)
             }
             else
             {
-                //qDebug() << QString("We got a not treated custom event: %1\n").arg(!zstr(event->subclass_name) ? event->subclass_name : "NULL"));
+                printEventHeaders(event);
             }
             break;
         }
index b86dc112173ada8a63ef7216d7e218901cfa83c8..9f8c461c7e6382fcec9e9d2781f36a732c671c16 100644 (file)
@@ -46,7 +46,6 @@ int main(int argc, char *argv[])
     QObject::connect(&g_FSHost, SIGNAL(ready()), splash, SLOT(close()));
     MainWindow w;    
     QObject::connect(&g_FSHost, SIGNAL(ready()), &w, SLOT(show()));
-    QObject::connect(&g_FSHost, SIGNAL(ready()), &w, SLOT(print()));
     g_FSHost.start();
     return a.exec();
 }
index c7060b20c35035169dac4e48ba857b65966c3b2d..289a8ad46305f301a50faa4473d0975f5fcfc14e 100644 (file)
@@ -98,6 +98,9 @@ MainWindow::MainWindow(QWidget *parent) :
     /* Set the context menus */
     ui->tableAccounts->addAction(ui->actionSetDefaultAccount);
 
+    /* Set other properties */
+    ui->tableAccounts->horizontalHeader()->setStretchLastSection(true);
+
 }
 
 MainWindow::~MainWindow()
index 1723963d6074147d1ccdfd8f20cd4c571a88942b..bc3fb34e16b59d5439d0b28935fcd0b202081aa0 100644 (file)
@@ -180,8 +180,13 @@ static switch_status_t do_config(void)
     switch_xml_free(xml);
 
     QSettings settings;
-    if (!settings.allKeys().contains("FreeSWITCH/conf"))
+    settings.beginGroup("FreeSWITCH/conf");
+    if (settings.childGroups().isEmpty())
+    {
+        qDebug() << "We are settings default.";
         setQSettingsDefaults();
+    }
+    settings.endGroup();
     setGlobals();
 
     return SWITCH_STATUS_SUCCESS;
index 0a2a7774482d3dcf4e4a33095b637a979eb17b1e..3010d7f1f59bd888dbc2031c7bbf75d55d57d946 100644 (file)
@@ -14,6 +14,8 @@ AccountDialog::AccountDialog(QString accId, QWidget *parent) :
     connect(this, SIGNAL(accepted()), this, SLOT(writeConfig()));
     connect(ui->sofiaExtraParamAddBtn, SIGNAL(clicked()), this, SLOT(addExtraParam()));
     connect(ui->sofiaExtraParamRemBtn, SIGNAL(clicked()), this, SLOT(remExtraParam()));
+
+    ui->sofiaExtraParamTable->horizontalHeader()->setStretchLastSection(true);
 }
 
 AccountDialog::~AccountDialog()
@@ -55,6 +57,9 @@ void AccountDialog::addExtraParam()
     ui->sofiaExtraParamTable->setRowCount(ui->sofiaExtraParamTable->rowCount()+1);
     ui->sofiaExtraParamTable->setItem(ui->sofiaExtraParamTable->rowCount()-1,0,paramNameItem);
     ui->sofiaExtraParamTable->setItem(ui->sofiaExtraParamTable->rowCount()-1,1,paramValItem);
+    ui->sofiaExtraParamTable->resizeColumnsToContents();
+    ui->sofiaExtraParamTable->resizeRowsToContents();
+    ui->sofiaExtraParamTable->horizontalHeader()->setStretchLastSection(true);
 }
 
 void AccountDialog::readConfig()
@@ -95,6 +100,10 @@ void AccountDialog::readConfig()
 
     _settings->endGroup();
     _settings->endGroup();
+
+    ui->sofiaExtraParamTable->resizeColumnsToContents();
+    ui->sofiaExtraParamTable->resizeRowsToContents();
+    ui->sofiaExtraParamTable->horizontalHeader()->setStretchLastSection(true);
 }
 
 void AccountDialog::writeConfig()
index 4f0e86a124ec29fd29ac5c5232a52a09b6f05aee..0fed6d973f5effb3c0440c08b26ba49a38396cb7 100644 (file)
@@ -11,6 +11,8 @@ PrefAccounts::PrefAccounts(Ui::PrefDialog *ui) :
     connect(_ui->sofiaGwAddBtn, SIGNAL(clicked()), this, SLOT(addAccountBtnClicked()));
     connect(_ui->sofiaGwRemBtn, SIGNAL(clicked()), this, SLOT(remAccountBtnClicked()));
     connect(_ui->sofiaGwEditBtn, SIGNAL(clicked()), this, SLOT(editAccountBtnClicked()));
+
+    _ui->accountsTable->horizontalHeader()->setStretchLastSection(true);
 }
 
 void PrefAccounts::addAccountBtnClicked()
@@ -131,6 +133,9 @@ void PrefAccounts::readConfig()
         _ui->accountsTable->setItem(_ui->accountsTable->rowCount()-1, 0, item0);
         _ui->accountsTable->setItem(_ui->accountsTable->rowCount()-1, 1, item1);
     }
+    _ui->accountsTable->resizeRowsToContents();
+    _ui->accountsTable->resizeColumnsToContents();
+    _ui->accountsTable->horizontalHeader()->setStretchLastSection(true);
 
     _settings->endGroup();