Diffstat (limited to 'noncore/net/linphone/linphoneconfig.cpp') (more/less context) (ignore 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 @@ | |||
1 | #include <qspinbox.h> | ||
2 | #include <qlineedit.h> | ||
3 | #include <qcheckbox.h> | ||
4 | #include <qslider.h> | ||
5 | |||
6 | #include <qpe/config.h> | ||
7 | |||
8 | #include "linphoneconfig.h" | ||
9 | |||
10 | |||
11 | LinPhoneConfig::LinPhoneConfig( QWidget* parent , const char* name , bool modal, WFlags fl ) : SettingsDialog( parent, name, modal, fl ) { | ||
12 | loadConfig(); | ||
13 | } | ||
14 | |||
15 | LinPhoneConfig::~LinPhoneConfig() { | ||
16 | } | ||
17 | |||
18 | void LinPhoneConfig::loadConfig() { | ||
19 | Config cfg("opie-phone"); | ||
20 | cfg.setGroup( "net" ); | ||
21 | cfg.setGroup( "sip" ); | ||
22 | PortSpin->setValue( cfg.readNumEntry( "sip_port", 5060 ) ); | ||
23 | UserPartLine->setText( cfg.readEntry( "username", "" ) ); | ||
24 | HostPartLine->setText( cfg.readEntry( "hostname", "" ) ); | ||
25 | CheckBoxReg->setChecked( cfg.readBoolEntry( "use_registrar", 0 ) ); | ||
26 | ServerAddressLine->setText( cfg.readEntry( "registrar", "" ) ); | ||
27 | // cannot use crypt due to gnome stuff in linephone | ||
28 | PasswordLine->setText( cfg.readEntry( "reg_password", "" ) ); | ||
29 | RecordLine->setText( cfg.readEntry( "addr_of_rec", "" ) ); | ||
30 | CheckBoxProxy->setChecked( cfg.readBoolEntry( "as_proxy", 0 ) ); | ||
31 | cfg.setGroup( "rtp" ); | ||
32 | RTPPort->setText( cfg.readEntry( "audio_rtp_port", "" ) ); | ||
33 | SliderJitter->setValue( cfg.readNumEntry( "jitt_comp", 60 ) ); | ||
34 | cfg.setGroup( "audio" ); | ||
35 | // source | ||
36 | cfg.setGroup( "video" ); | ||
37 | cfg.setGroup( "codecs" ); | ||
38 | cfg.setGroup( "address_book" ); | ||
39 | } | ||
40 | |||
41 | void LinPhoneConfig::writeConfig() { | ||
42 | Config cfg("opie-phone"); | ||
43 | cfg.setGroup( "net" ); | ||
44 | cfg.setGroup( "sip" ); | ||
45 | cfg.writeEntry( "sip_port", PortSpin->value() ); | ||
46 | cfg.writeEntry( "username", UserPartLine->text() ); | ||
47 | cfg.writeEntry( "hostname", HostPartLine->text() ); | ||
48 | cfg.writeEntry( "use_registrar", CheckBoxReg->isChecked() ); | ||
49 | cfg.writeEntry( "registrar", ServerAddressLine->text() ); | ||
50 | cfg.writeEntry( "reg_password", PasswordLine->text() ); | ||
51 | cfg.writeEntry( "addr_of_rec", RecordLine->text() ); | ||
52 | cfg.writeEntry( "as_proxy", CheckBoxProxy->isChecked() ); | ||
53 | cfg.setGroup( "rtp" ); | ||
54 | cfg.writeEntry( "audio_rtp_port", RTPPort->text() ); | ||
55 | cfg.writeEntry( "jitt_comp", SliderJitter->value() ); | ||
56 | cfg.setGroup( "audio" ); | ||
57 | cfg.setGroup( "video" ); | ||
58 | cfg.setGroup( "codecs" ); | ||
59 | cfg.setGroup( "address_book" ); | ||
60 | } | ||
61 | |||
62 | void LinPhoneConfig::accept() { | ||
63 | writeConfig(); | ||
64 | QDialog::accept(); | ||
65 | } | ||