author | kergoth <kergoth> | 2002-01-25 22:14:26 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2002-01-25 22:14:26 (UTC) |
commit | 15318cad33835e4e2dc620d033e43cd930676cdd (patch) (side-by-side diff) | |
tree | c2fa0399a2c47fda8e2cd0092c73a809d17f68eb /noncore/comm/keypebble/krfboptions.cpp | |
download | opie-15318cad33835e4e2dc620d033e43cd930676cdd.zip opie-15318cad33835e4e2dc620d033e43cd930676cdd.tar.gz opie-15318cad33835e4e2dc620d033e43cd930676cdd.tar.bz2 |
Initial revision
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 @@ +#include <qpe/config.h> +#include <qpe/qpeapplication.h> +#include "krfboptions.h" + +KRFBOptions::KRFBOptions() +{ + Config config( "keypebble" ); + readSettings( &config ); +} + +KRFBOptions::~KRFBOptions() +{ + Config config( "keypebble" ); + writeSettings( &config ); +} + +void KRFBOptions::readSettings( Config *config ) +{ + hexTile = config->readBoolEntry( "HexTile" ); + corre = config->readBoolEntry( "CORRE" ); + rre = config->readBoolEntry( "RRE" ); + copyrect = config->readBoolEntry( "CopyRect", true ); + colors256 = config->readBoolEntry( "Colors256" ); + shared = config->readBoolEntry( "Shared" ); + readOnly = config->readBoolEntry( "ReadOnly" ); + updateRate = config->readNumEntry( "UpdateRate", 50 ); +} + +void KRFBOptions::writeSettings( Config *config ) +{ + config->writeEntry( "HexTile", hexTile ); + config->writeEntry( "CORRE", corre ); + config->writeEntry( "RRE", rre ); + config->writeEntry( "CopyRect", copyrect ); + config->writeEntry( "Colors256", colors256 ); + config->writeEntry( "Shared", shared ); + config->writeEntry( "ReadOnly", readOnly ); + config->writeEntry( "UpdateRate", updateRate ); +} + +int KRFBOptions::encodings() +{ + // Initially one because we always support raw encoding + int count = 1; + + count += hexTile ? 1 : 0; + count += corre ? 1 : 0; + count += rre ? 1 : 0; + count += copyrect ? 1 : 0; + + return count; +} |