]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Prepare UI modifications for codec and profile clid configuration.
authorJoão Mesquita <jmesquita@freeswitch.org>
Mon, 25 Jan 2010 06:18:35 +0000 (06:18 +0000)
committerJoão Mesquita <jmesquita@freeswitch.org>
Mon, 25 Jan 2010 06:18:35 +0000 (06:18 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16507 d0543943-73ff-0310-b7d9-9358b9ac24b2

fscomm/mainwindow.cpp
fscomm/preferences/accountdialog.cpp
fscomm/preferences/accountdialog.h
fscomm/preferences/accountdialog.ui

index 3ff3b4f695e3806de4103f80369fc9fd6c8bb90f..10544f2686b397b65b2316991f28ab9f68f4ca8f 100644 (file)
@@ -168,7 +168,6 @@ void MainWindow::coreLoadingError(QString err)
 
 void MainWindow::accountAdd(QSharedPointer<Account> acc)
 {
-    qDebug() << "Adding: " << acc.data()->getName();
     ui->tableAccounts->setRowCount(ui->tableAccounts->rowCount()+1);
     QTableWidgetItem *gwField = new QTableWidgetItem(acc.data()->getName());
     QTableWidgetItem *stField = new QTableWidgetItem(acc.data()->getStateName());
@@ -181,7 +180,6 @@ void MainWindow::accountAdd(QSharedPointer<Account> acc)
 
 void MainWindow::accountDel(QSharedPointer<Account> acc)
 {
-    qDebug() << "Deleting: " << acc.data()->getName();
     foreach (QTableWidgetItem *i, ui->tableAccounts->findItems(acc.data()->getName(), Qt::MatchExactly))
     {
         if (i->text() == acc.data()->getName())
index 1d0783881a96aad224aefcc6db2dabee44d16177..7470c5e3245a4a7714dd43e68daf93813e358d46 100644 (file)
@@ -8,14 +8,18 @@ AccountDialog::AccountDialog(QString accId, QWidget *parent) :
     QDialog(parent),
     _accId(accId),
     ui(new Ui::AccountDialog)
-{
+{    
     ui->setupUi(this);
     _settings = new QSettings;
     connect(this, SIGNAL(accepted()), this, SLOT(writeConfig()));
     connect(ui->sofiaExtraParamAddBtn, SIGNAL(clicked()), this, SLOT(addExtraParam()));
     connect(ui->sofiaExtraParamRemBtn, SIGNAL(clicked()), this, SLOT(remExtraParam()));
+    connect(ui->clidSettingsCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(clidSettingsComboChanged(int)));
+    connect(ui->codecSettingsCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(codecSettingsComboChanged(int)));
 
     ui->sofiaExtraParamTable->horizontalHeader()->setStretchLastSection(true);
+    ui->tabWidget->removeTab(ui->tabWidget->indexOf(ui->codecPage));
+    ui->tabWidget->removeTab(ui->tabWidget->indexOf(ui->clidPage));
 }
 
 AccountDialog::~AccountDialog()
@@ -23,6 +27,23 @@ AccountDialog::~AccountDialog()
     delete ui;
 }
 
+void AccountDialog::codecSettingsComboChanged(int index)
+{
+    if (index == 0)
+        ui->tabWidget->removeTab(ui->tabWidget->indexOf(ui->codecPage));
+    else
+        ui->tabWidget->insertTab(1,ui->codecPage,tr("Codecs"));
+
+}
+
+void AccountDialog::clidSettingsComboChanged(int index)
+{
+    if (index == 0)
+        ui->tabWidget->removeTab(ui->tabWidget->indexOf(ui->clidPage));
+    else
+        ui->tabWidget->insertTab(1,ui->clidPage,tr("Caller ID"));
+}
+
 void AccountDialog::remExtraParam()
 {
     QList<QTableWidgetSelectionRange> sel = ui->sofiaExtraParamTable->selectedRanges();
@@ -75,7 +96,6 @@ void AccountDialog::readConfig()
     ui->sofiaGwUsernameEdit->setText(_settings->value("username").toString());
     ui->sofiaGwRealmEdit->setText(_settings->value("realm").toString());
     ui->sofiaGwPasswordEdit->setText(_settings->value("password").toString());
-    ui->sofiaGwExtensionEdit->setText(_settings->value("extension").toString());
     ui->sofiaGwExpireSecondsSpin->setValue(_settings->value("expire-seconds").toInt());
     ui->sofiaGwRegisterCombo->setCurrentIndex(ui->sofiaGwRegisterCombo->findText(_settings->value("register").toString(),
                                                                                  Qt::MatchExactly));
@@ -127,7 +147,6 @@ void AccountDialog::writeConfig()
     _settings->setValue("username", ui->sofiaGwUsernameEdit->text());
     _settings->setValue("realm", ui->sofiaGwRealmEdit->text());
     _settings->setValue("password", ui->sofiaGwPasswordEdit->text());
-    _settings->setValue("extension", ui->sofiaGwExtensionEdit->text());
     _settings->setValue("expire-seconds", ui->sofiaGwExpireSecondsSpin->value());
     _settings->setValue("register", ui->sofiaGwRegisterCombo->currentText());
     _settings->setValue("register-transport", ui->sofiaGwRegisterTransportCombo->currentText());
@@ -158,7 +177,6 @@ void AccountDialog::clear()
     ui->sofiaGwUsernameEdit->clear();
     ui->sofiaGwRealmEdit->clear();
     ui->sofiaGwPasswordEdit->clear();
-    ui->sofiaGwExtensionEdit->clear();
     ui->sofiaGwExpireSecondsSpin->setValue(60);
     ui->sofiaGwRegisterCombo->setCurrentIndex(0);
     ui->sofiaGwRegisterTransportCombo->setCurrentIndex(0);
index 9be1b6e26f46642caf2ead66a5fd82d24da5ed82..40831f56b6b37e457f77551096ef02a4611986fe 100644 (file)
@@ -25,6 +25,8 @@ private slots:
     void writeConfig();
     void addExtraParam();
     void remExtraParam();
+    void codecSettingsComboChanged(int);
+    void clidSettingsComboChanged(int);
 
 protected:
     void changeEvent(QEvent *e);
index 9323f68993b7f74dfe4b8cbb2ab94f01f1e90d8a..309102a8219f6435e1718d9dda4a4cba049870bc 100644 (file)
@@ -10,7 +10,7 @@
     <x>0</x>
     <y>0</y>
     <width>389</width>
-    <height>394</height>
+    <height>427</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -33,7 +33,7 @@
        <item row="0" column="0">
         <widget class="QLabel" name="label">
          <property name="text">
-          <string>name</string>
+          <string>Account Name</string>
          </property>
         </widget>
        </item>
@@ -43,7 +43,7 @@
        <item row="1" column="0">
         <widget class="QLabel" name="label_2">
          <property name="text">
-          <string>username</string>
+          <string>Usernane</string>
          </property>
         </widget>
        </item>
@@ -53,7 +53,7 @@
        <item row="2" column="0">
         <widget class="QLabel" name="label_3">
          <property name="text">
-          <string>realm</string>
+          <string>Domain</string>
          </property>
         </widget>
        </item>
        <item row="3" column="0">
         <widget class="QLabel" name="label_6">
          <property name="text">
-          <string>password</string>
+          <string>Password</string>
          </property>
         </widget>
        </item>
        <item row="3" column="1">
-        <widget class="QLineEdit" name="sofiaGwPasswordEdit"/>
-       </item>
-       <item row="4" column="0">
-        <widget class="QLabel" name="label_7">
-         <property name="text">
-          <string>extension</string>
+        <widget class="QLineEdit" name="sofiaGwPasswordEdit">
+         <property name="toolTip">
+          <string>Account password </string>
+         </property>
+         <property name="echoMode">
+          <enum>QLineEdit::Password</enum>
          </property>
         </widget>
        </item>
-       <item row="4" column="1">
-        <widget class="QLineEdit" name="sofiaGwExtensionEdit"/>
-       </item>
-       <item row="5" column="0">
+       <item row="4" column="0">
         <widget class="QLabel" name="label_10">
          <property name="text">
-          <string>expire-seconds</string>
+          <string>Expire</string>
          </property>
         </widget>
        </item>
-       <item row="5" column="1">
+       <item row="4" column="1">
         <widget class="QSpinBox" name="sofiaGwExpireSecondsSpin">
+         <property name="toolTip">
+          <string>Seconds before account expires</string>
+         </property>
          <property name="value">
           <number>60</number>
          </property>
         </widget>
        </item>
-       <item row="6" column="0">
+       <item row="5" column="0">
         <widget class="QLabel" name="label_11">
          <property name="text">
-          <string>register</string>
+          <string>Register</string>
          </property>
         </widget>
        </item>
-       <item row="6" column="1">
+       <item row="5" column="1">
         <widget class="QComboBox" name="sofiaGwRegisterCombo">
+         <property name="toolTip">
+          <string>Account must register or must not register</string>
+         </property>
          <item>
           <property name="text">
            <string>true</string>
          </item>
         </widget>
        </item>
-       <item row="7" column="0">
+       <item row="6" column="0">
         <widget class="QLabel" name="label_12">
          <property name="text">
-          <string>register-transport</string>
+          <string>Transport</string>
          </property>
         </widget>
        </item>
-       <item row="7" column="1">
+       <item row="6" column="1">
         <widget class="QComboBox" name="sofiaGwRegisterTransportCombo">
+         <property name="toolTip">
+          <string>What transport to use for this account</string>
+         </property>
          <item>
           <property name="text">
            <string>udp</string>
          </item>
         </widget>
        </item>
-       <item row="8" column="0">
+       <item row="7" column="0">
         <widget class="QLabel" name="label_13">
          <property name="text">
-          <string>retry-seconds</string>
+          <string>Retry</string>
          </property>
         </widget>
        </item>
-       <item row="8" column="1">
+       <item row="7" column="1">
         <widget class="QSpinBox" name="sofiaGwRetrySecondsSpin">
+         <property name="toolTip">
+          <string>How many seconds to retry registration</string>
+         </property>
          <property name="value">
           <number>30</number>
          </property>
         </widget>
        </item>
+       <item row="8" column="0">
+        <widget class="QLabel" name="label_4">
+         <property name="text">
+          <string>Codec Settings</string>
+         </property>
+        </widget>
+       </item>
+       <item row="9" column="0">
+        <widget class="QLabel" name="label_5">
+         <property name="text">
+          <string>CallerID Settings</string>
+         </property>
+        </widget>
+       </item>
+       <item row="8" column="1">
+        <widget class="QComboBox" name="codecSettingsCombo">
+         <property name="enabled">
+          <bool>false</bool>
+         </property>
+         <item>
+          <property name="text">
+           <string>Global</string>
+          </property>
+         </item>
+         <item>
+          <property name="text">
+           <string>Custom</string>
+          </property>
+         </item>
+        </widget>
+       </item>
+       <item row="9" column="1">
+        <widget class="QComboBox" name="clidSettingsCombo">
+         <property name="enabled">
+          <bool>false</bool>
+         </property>
+         <item>
+          <property name="text">
+           <string>Global</string>
+          </property>
+         </item>
+         <item>
+          <property name="text">
+           <string>Custom</string>
+          </property>
+         </item>
+        </widget>
+       </item>
+      </layout>
+     </widget>
+     <widget class="QWidget" name="codecPage">
+      <attribute name="title">
+       <string>Codecs</string>
+      </attribute>
+     </widget>
+     <widget class="QWidget" name="clidPage">
+      <attribute name="title">
+       <string>CallerID</string>
+      </attribute>
+      <layout class="QFormLayout" name="formLayout_2">
+       <item row="0" column="0">
+        <widget class="QLabel" name="label_15">
+         <property name="text">
+          <string>CallerID Name:</string>
+         </property>
+        </widget>
+       </item>
+       <item row="0" column="1">
+        <widget class="QLineEdit" name="sofiaCallerIDName"/>
+       </item>
+       <item row="1" column="0">
+        <widget class="QLabel" name="label_14">
+         <property name="text">
+          <string>CallerID Number:</string>
+         </property>
+        </widget>
+       </item>
+       <item row="1" column="1">
+        <widget class="QLineEdit" name="sofiaCallerIDNum"/>
+       </item>
       </layout>
      </widget>
      <widget class="QWidget" name="tab_2">
    <slot>accept()</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>257</x>
-     <y>563</y>
+     <x>266</x>
+     <y>417</y>
     </hint>
     <hint type="destinationlabel">
      <x>157</x>
    <slot>reject()</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>325</x>
-     <y>563</y>
+     <x>334</x>
+     <y>417</y>
     </hint>
     <hint type="destinationlabel">
      <x>286</x>