From kde-commits Mon Oct 04 17:41:23 2010 From: =?utf-8?q?Gustavo=20P=2E=20Boiko?= Date: Mon, 04 Oct 2010 17:41:23 +0000 To: kde-commits Subject: playground/network/telepathy-accounts-kcm-plugins/gabble Message-Id: <20101004174123.B8ABDAC88C () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=128621413814398 SVN commit 1182475 by boiko: Replace the custom integer widgets by spinboxes M +13 -32 proxy-settings-widget.cpp M +3 -29 proxy-settings-widget.ui M +9 -21 server-settings-widget.cpp M +15 -20 server-settings-widget.ui --- trunk/playground/network/telepathy-accounts-kcm-plugins/gabble/proxy-settings-widget.cpp #1182474:1182475 @@ -125,9 +125,9 @@ if (d->stunPortParameter) { if (values.contains(d->stunPortParameter->name())) { - d->ui->stunPortLineEdit->setValue(values.value(d->stunPortParameter->name()).toUInt()); + d->ui->stunPortSpinBox->setValue(values.value(d->stunPortParameter->name()).toUInt()); } else { - d->ui->stunPortLineEdit->setValue(d->stunPortParameter->defaultValue().toUInt()); + d->ui->stunPortSpinBox->setValue(d->stunPortParameter->defaultValue().toUInt()); } } @@ -143,10 +143,10 @@ if (d->fallbackStunPortParameter) { if (values.contains(d->fallbackStunPortParameter->name())) { - d->ui->fallbackStunPortLineEdit->setValue(values.value( + d->ui->fallbackStunPortSpinBox->setValue(values.value( d->fallbackStunPortParameter->name()).toUInt()); } else { - d->ui->fallbackStunPortLineEdit->setValue( + d->ui->fallbackStunPortSpinBox->setValue( d->fallbackStunPortParameter->defaultValue().toUInt()); } } @@ -163,10 +163,10 @@ if (d->httpsProxyPortParameter) { if (values.contains(d->httpsProxyPortParameter->name())) { - d->ui->httpsProxyPortLineEdit->setValue(values.value( + d->ui->httpsProxyPortSpinBox->setValue(values.value( d->httpsProxyPortParameter->name()).toUInt()); } else { - d->ui->httpsProxyPortLineEdit->setValue( + d->ui->httpsProxyPortSpinBox->setValue( d->httpsProxyPortParameter->defaultValue().toUInt()); } } @@ -203,7 +203,7 @@ if (!d->stunPortParameter) { d->ui->stunPortLabel->hide(); - d->ui->stunPortLineEdit->hide(); + d->ui->stunPortSpinBox->hide(); } if (!d->fallbackStunServerParameter) { @@ -213,7 +213,7 @@ if (!d->fallbackStunPortParameter) { d->ui->fallbackStunPortLabel->hide(); - d->ui->fallbackStunPortLineEdit->hide(); + d->ui->fallbackStunPortSpinBox->hide(); } if (!d->httpsProxyServerParameter) { @@ -223,7 +223,7 @@ if (!d->httpsProxyPortParameter) { d->ui->httpsProxyPortLabel->hide(); - d->ui->httpsProxyPortLineEdit->hide(); + d->ui->httpsProxyPortSpinBox->hide(); } if (!d->fallbackSocks5ProxiesParameter) { @@ -274,7 +274,7 @@ } if (d->stunPortParameter) { - parameters.insert(d->stunPortParameter, d->ui->stunPortLineEdit->value()); + parameters.insert(d->stunPortParameter, d->ui->stunPortSpinBox->value()); } if (d->fallbackStunServerParameter) { @@ -283,7 +283,7 @@ } if (d->fallbackStunPortParameter) { - parameters.insert(d->fallbackStunPortParameter, d->ui->fallbackStunPortLineEdit->value()); + parameters.insert(d->fallbackStunPortParameter, d->ui->fallbackStunPortSpinBox->value()); } if (d->httpsProxyServerParameter) { @@ -291,7 +291,7 @@ } if (d->httpsProxyPortParameter) { - parameters.insert(d->httpsProxyPortParameter, d->ui->httpsProxyPortLineEdit->value()); + parameters.insert(d->httpsProxyPortParameter, d->ui->httpsProxyPortSpinBox->value()); } if (d->fallbackSocks5ProxiesParameter) { @@ -312,26 +312,7 @@ { kDebug(); - // Validate all the int's and uint's. - if (d->ui->stunPortLineEdit->validity() != QValidator::Acceptable) { - KMessageBox::error(this, - i18n("\"%1\" is not an acceptable value for %2") - .arg(d->ui->stunPortLineEdit->text()) - .arg(d->ui->stunPortLabel->text())); - return false; - } else if (d->ui->fallbackStunPortLineEdit->validity() != QValidator::Acceptable) { - KMessageBox::error(this, - i18n("\"%1\" is not an acceptable value for %2") - .arg(d->ui->fallbackStunPortLineEdit->text()) - .arg(d->ui->fallbackStunPortLabel->text())); - return false; - } else if (d->ui->httpsProxyPortLineEdit->validity() != QValidator::Acceptable) { - KMessageBox::error(this, - i18n("\"%1\" is not an acceptable value for %2") - .arg(d->ui->httpsProxyPortLineEdit->text()) - .arg(d->ui->httpsProxyPortLabel->text())); - return false; - } + //TODO: check what parameters should be validated return true; } --- trunk/playground/network/telepathy-accounts-kcm-plugins/gabble/proxy-settings-widget.ui #1182474:1182475 @@ -40,14 +40,7 @@ - - - - 60 - 16777215 - - - + @@ -71,14 +64,7 @@ - - - - 60 - 16777215 - - - + @@ -111,14 +97,7 @@ - - - - 60 - 16777215 - - - + @@ -171,11 +150,6 @@ QTextEdit
ktextedit.h
- - UnsignedIntegerEdit - QLineEdit -
KCMTelepathyAccounts/UnsignedIntegerEdit
-
--- trunk/playground/network/telepathy-accounts-kcm-plugins/gabble/server-settings-widget.cpp #1182474:1182475 @@ -112,18 +112,18 @@ if (d->portParameter) { if (values.contains(d->portParameter->name())) { - d->ui->portLineEdit->setValue(values.value(d->portParameter->name()).toUInt()); + d->ui->portSpinBox->setValue(values.value(d->portParameter->name()).toUInt()); } else { - d->ui->portLineEdit->setValue(d->portParameter->defaultValue().toUInt()); + d->ui->portSpinBox->setValue(d->portParameter->defaultValue().toUInt()); } } if (d->keepaliveIntervalParameter) { if (values.contains(d->keepaliveIntervalParameter->name())) { - d->ui->keepaliveIntervalLineEdit->setValue(values.value( + d->ui->keepaliveIntervalSpinBox->setValue(values.value( d->keepaliveIntervalParameter->name()).toUInt()); } else { - d->ui->keepaliveIntervalLineEdit->setValue( + d->ui->keepaliveIntervalSpinBox->setValue( d->keepaliveIntervalParameter->defaultValue().toUInt()); } } @@ -174,12 +174,12 @@ if (!d->portParameter) { d->ui->portLabel->hide(); - d->ui->portLineEdit->hide(); + d->ui->portSpinBox->hide(); } if (!d->keepaliveIntervalParameter) { d->ui->keepaliveIntervalLabel->hide(); - d->ui->keepaliveIntervalLineEdit->hide(); + d->ui->keepaliveIntervalSpinBox->hide(); } if (!d->lowBandwidthParameter) { @@ -233,11 +233,11 @@ } if (d->portParameter) { - parameters.insert(d->portParameter, d->ui->portLineEdit->value()); + parameters.insert(d->portParameter, d->ui->portSpinBox->value()); } if (d->keepaliveIntervalParameter) { - parameters.insert(d->keepaliveIntervalParameter, d->ui->keepaliveIntervalLineEdit->value()); + parameters.insert(d->keepaliveIntervalParameter, d->ui->keepaliveIntervalSpinBox->value()); } if (d->lowBandwidthParameter) { @@ -264,19 +264,7 @@ { kDebug(); - if (d->ui->portLineEdit->validity() != QValidator::Acceptable) { - KMessageBox::error(this, - i18n("\"%1\" is not an acceptable value for %2") - .arg(d->ui->portLineEdit->text()) - .arg(d->ui->portLabel->text())); - return false; - } else if (d->ui->keepaliveIntervalLineEdit->validity() != QValidator::Acceptable) { - KMessageBox::error(this, - i18n("\"%1\" is not an acceptable value for %2") - .arg(d->ui->keepaliveIntervalLineEdit->text()) - .arg(d->ui->keepaliveIntervalLabel->text())); - return false; - } + //TODO: check which parameters need validation return true; } --- trunk/playground/network/telepathy-accounts-kcm-plugins/gabble/server-settings-widget.ui #1182474:1182475 @@ -19,38 +19,38 @@ Server Settings - - - - + + Server Address: - + - - - - - + Server Port: - - + + + + + 0 + 0 + + + - - + serverLineEdit @@ -69,7 +69,7 @@ - + @@ -121,11 +121,6 @@ QLineEdit
klineedit.h
- - UnsignedIntegerEdit - QLineEdit -
KCMTelepathyAccounts/UnsignedIntegerEdit
-