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()
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();
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));
_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());
ui->sofiaGwUsernameEdit->clear();
ui->sofiaGwRealmEdit->clear();
ui->sofiaGwPasswordEdit->clear();
- ui->sofiaGwExtensionEdit->clear();
ui->sofiaGwExpireSecondsSpin->setValue(60);
ui->sofiaGwRegisterCombo->setCurrentIndex(0);
ui->sofiaGwRegisterTransportCombo->setCurrentIndex(0);
<x>0</x>
<y>0</y>
<width>389</width>
- <height>394</height>
+ <height>427</height>
</rect>
</property>
<property name="windowTitle">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
- <string>name</string>
+ <string>Account Name</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
- <string>username</string>
+ <string>Usernane</string>
</property>
</widget>
</item>
<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>