Diffstat (limited to 'noncore/comm/keypebble/krfboptions.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/comm/keypebble/krfboptions.cpp | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/noncore/comm/keypebble/krfboptions.cpp b/noncore/comm/keypebble/krfboptions.cpp new file mode 100644 index 0000000..9daf3f0 --- a/dev/null +++ b/noncore/comm/keypebble/krfboptions.cpp | |||
@@ -0,0 +1,52 @@ | |||
1 | #include <qpe/config.h> | ||
2 | #include <qpe/qpeapplication.h> | ||
3 | #include "krfboptions.h" | ||
4 | |||
5 | KRFBOptions::KRFBOptions() | ||
6 | { | ||
7 | Config config( "keypebble" ); | ||
8 | readSettings( &config ); | ||
9 | } | ||
10 | |||
11 | KRFBOptions::~KRFBOptions() | ||
12 | { | ||
13 | Config config( "keypebble" ); | ||
14 | writeSettings( &config ); | ||
15 | } | ||
16 | |||
17 | void KRFBOptions::readSettings( Config *config ) | ||
18 | { | ||
19 | hexTile = config->readBoolEntry( "HexTile" ); | ||
20 | corre = config->readBoolEntry( "CORRE" ); | ||
21 | rre = config->readBoolEntry( "RRE" ); | ||
22 | copyrect = config->readBoolEntry( "CopyRect", true ); | ||
23 | colors256 = config->readBoolEntry( "Colors256" ); | ||
24 | shared = config->readBoolEntry( "Shared" ); | ||
25 | readOnly = config->readBoolEntry( "ReadOnly" ); | ||
26 | updateRate = config->readNumEntry( "UpdateRate", 50 ); | ||
27 | } | ||
28 | |||
29 | void KRFBOptions::writeSettings( Config *config ) | ||
30 | { | ||
31 | config->writeEntry( "HexTile", hexTile ); | ||
32 | config->writeEntry( "CORRE", corre ); | ||
33 | config->writeEntry( "RRE", rre ); | ||
34 | config->writeEntry( "CopyRect", copyrect ); | ||
35 | config->writeEntry( "Colors256", colors256 ); | ||
36 | config->writeEntry( "Shared", shared ); | ||
37 | config->writeEntry( "ReadOnly", readOnly ); | ||
38 | config->writeEntry( "UpdateRate", updateRate ); | ||
39 | } | ||
40 | |||
41 | int KRFBOptions::encodings() | ||
42 | { | ||
43 | // Initially one because we always support raw encoding | ||
44 | int count = 1; | ||
45 | |||
46 | count += hexTile ? 1 : 0; | ||
47 | count += corre ? 1 : 0; | ||
48 | count += rre ? 1 : 0; | ||
49 | count += copyrect ? 1 : 0; | ||
50 | |||
51 | return count; | ||
52 | } | ||