author | harlekin <harlekin> | 2004-02-22 23:38:58 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2004-02-22 23:38:58 (UTC) |
commit | 666a49773d06ac94c19996d763854725c2f7a578 (patch) (side-by-side diff) | |
tree | c886c9373ed967ed5dfe468ac6260d4c5218c4d1 /noncore/net/linphone/linphoneconfig.cpp | |
parent | 2fc1e609a40a47df6a38256faccfee7916b59bbd (diff) | |
download | opie-666a49773d06ac94c19996d763854725c2f7a578.zip opie-666a49773d06ac94c19996d763854725c2f7a578.tar.gz opie-666a49773d06ac94c19996d763854725c2f7a578.tar.bz2 |
initial checkin of opie linphone, not really usefull yet, just to make sure I dont loose any data
Diffstat (limited to 'noncore/net/linphone/linphoneconfig.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/linphone/linphoneconfig.cpp | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/noncore/net/linphone/linphoneconfig.cpp b/noncore/net/linphone/linphoneconfig.cpp new file mode 100644 index 0000000..ee02e1a --- a/dev/null +++ b/noncore/net/linphone/linphoneconfig.cpp @@ -0,0 +1,65 @@ +#include <qspinbox.h> +#include <qlineedit.h> +#include <qcheckbox.h> +#include <qslider.h> + +#include <qpe/config.h> + +#include "linphoneconfig.h" + + +LinPhoneConfig::LinPhoneConfig( QWidget* parent , const char* name , bool modal, WFlags fl ) : SettingsDialog( parent, name, modal, fl ) { + loadConfig(); +} + +LinPhoneConfig::~LinPhoneConfig() { +} + +void LinPhoneConfig::loadConfig() { + Config cfg("opie-phone"); + cfg.setGroup( "net" ); + cfg.setGroup( "sip" ); + PortSpin->setValue( cfg.readNumEntry( "sip_port", 5060 ) ); + UserPartLine->setText( cfg.readEntry( "username", "" ) ); + HostPartLine->setText( cfg.readEntry( "hostname", "" ) ); + CheckBoxReg->setChecked( cfg.readBoolEntry( "use_registrar", 0 ) ); + ServerAddressLine->setText( cfg.readEntry( "registrar", "" ) ); + // cannot use crypt due to gnome stuff in linephone + PasswordLine->setText( cfg.readEntry( "reg_password", "" ) ); + RecordLine->setText( cfg.readEntry( "addr_of_rec", "" ) ); + CheckBoxProxy->setChecked( cfg.readBoolEntry( "as_proxy", 0 ) ); + cfg.setGroup( "rtp" ); + RTPPort->setText( cfg.readEntry( "audio_rtp_port", "" ) ); + SliderJitter->setValue( cfg.readNumEntry( "jitt_comp", 60 ) ); + cfg.setGroup( "audio" ); + // source + cfg.setGroup( "video" ); + cfg.setGroup( "codecs" ); + cfg.setGroup( "address_book" ); +} + +void LinPhoneConfig::writeConfig() { + Config cfg("opie-phone"); + cfg.setGroup( "net" ); + cfg.setGroup( "sip" ); + cfg.writeEntry( "sip_port", PortSpin->value() ); + cfg.writeEntry( "username", UserPartLine->text() ); + cfg.writeEntry( "hostname", HostPartLine->text() ); + cfg.writeEntry( "use_registrar", CheckBoxReg->isChecked() ); + cfg.writeEntry( "registrar", ServerAddressLine->text() ); + cfg.writeEntry( "reg_password", PasswordLine->text() ); + cfg.writeEntry( "addr_of_rec", RecordLine->text() ); + cfg.writeEntry( "as_proxy", CheckBoxProxy->isChecked() ); + cfg.setGroup( "rtp" ); + cfg.writeEntry( "audio_rtp_port", RTPPort->text() ); + cfg.writeEntry( "jitt_comp", SliderJitter->value() ); + cfg.setGroup( "audio" ); + cfg.setGroup( "video" ); + cfg.setGroup( "codecs" ); + cfg.setGroup( "address_book" ); +} + +void LinPhoneConfig::accept() { + writeConfig(); + QDialog::accept(); +} |