summaryrefslogtreecommitdiff
path: root/noncore/comm/keypebble
Unidiff
Diffstat (limited to 'noncore/comm/keypebble') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/comm/keypebble/krfboptions.cpp48
-rw-r--r--noncore/comm/keypebble/krfboptions.h4
-rw-r--r--noncore/comm/keypebble/kvnc.cpp1
-rw-r--r--noncore/comm/keypebble/kvncoptionsdlg.cpp1
-rw-r--r--noncore/comm/keypebble/main.cpp1
5 files changed, 29 insertions, 26 deletions
diff --git a/noncore/comm/keypebble/krfboptions.cpp b/noncore/comm/keypebble/krfboptions.cpp
index 9daf3f0..8c4320b 100644
--- a/noncore/comm/keypebble/krfboptions.cpp
+++ b/noncore/comm/keypebble/krfboptions.cpp
@@ -1,50 +1,54 @@
1#include <qpe/config.h> 1#include <qpe/config.h>
2#include <qpe/qpeapplication.h> 2#include <qpe/qpeapplication.h>
3#include "krfboptions.h" 3#include "krfboptions.h"
4 4
5KRFBOptions::KRFBOptions() 5KRFBOptions::KRFBOptions()
6{ 6{
7 Config config( "keypebble" ); 7 readSettings();
8 readSettings( &config );
9} 8}
10 9
11KRFBOptions::~KRFBOptions() 10KRFBOptions::~KRFBOptions()
12{ 11{
13 Config config( "keypebble" ); 12 writeSettings();
14 writeSettings( &config );
15} 13}
16 14
17void KRFBOptions::readSettings( Config *config ) 15void KRFBOptions::readSettings()
18{ 16{
19 hexTile = config->readBoolEntry( "HexTile" ); 17 Config config( "keypebble" );
20 corre = config->readBoolEntry( "CORRE" ); 18 config.setGroup("Settings");
21 rre = config->readBoolEntry( "RRE" ); 19 hexTile = config.readBoolEntry( "HexTile", 0 );
22 copyrect = config->readBoolEntry( "CopyRect", true ); 20 corre = config.readBoolEntry( "CORRE", 0 );
23 colors256 = config->readBoolEntry( "Colors256" ); 21 rre = config.readBoolEntry( "RRE", 0 );
24 shared = config->readBoolEntry( "Shared" ); 22 copyrect = config.readBoolEntry( "CopyRect", 1 );
25 readOnly = config->readBoolEntry( "ReadOnly" ); 23 colors256 = config.readBoolEntry( "Colors256", 0 );
26 updateRate = config->readNumEntry( "UpdateRate", 50 ); 24 shared = config.readBoolEntry( "Shared", 0 );
25 readOnly = config.readBoolEntry( "ReadOnly", 0 );
26 updateRate = config.readNumEntry( "UpdateRate", 50 );
27 deIconify = config.readBoolEntry( "DeIconify", 0 );
27} 28}
28 29
29void KRFBOptions::writeSettings( Config *config ) 30void KRFBOptions::writeSettings()
30{ 31{
31 config->writeEntry( "HexTile", hexTile ); 32 Config config( "keypebble" );
32 config->writeEntry( "CORRE", corre ); 33 config.setGroup("Settings");
33 config->writeEntry( "RRE", rre ); 34 config.writeEntry( "HexTile", hexTile );
34 config->writeEntry( "CopyRect", copyrect ); 35 config.writeEntry( "CORRE", corre );
35 config->writeEntry( "Colors256", colors256 ); 36 config.writeEntry( "RRE", rre );
36 config->writeEntry( "Shared", shared ); 37 config.writeEntry( "CopyRect", copyrect );
37 config->writeEntry( "ReadOnly", readOnly ); 38 config.writeEntry( "Colors256", colors256 );
38 config->writeEntry( "UpdateRate", updateRate ); 39 config.writeEntry( "Shared", shared );
40 config.writeEntry( "ReadOnly", readOnly );
41 config.writeEntry( "UpdateRate", updateRate );
42 config.writeEntry( "DeIconify", deIconify );
39} 43}
40 44
41int KRFBOptions::encodings() 45int KRFBOptions::encodings()
42{ 46{
43 // Initially one because we always support raw encoding 47 // Initially one because we always support raw encoding
44 int count = 1; 48 int count = 1;
45 49
46 count += hexTile ? 1 : 0; 50 count += hexTile ? 1 : 0;
47 count += corre ? 1 : 0; 51 count += corre ? 1 : 0;
48 count += rre ? 1 : 0; 52 count += rre ? 1 : 0;
49 count += copyrect ? 1 : 0; 53 count += copyrect ? 1 : 0;
50 54
diff --git a/noncore/comm/keypebble/krfboptions.h b/noncore/comm/keypebble/krfboptions.h
index 41cea35..fd2b65c 100644
--- a/noncore/comm/keypebble/krfboptions.h
+++ b/noncore/comm/keypebble/krfboptions.h
@@ -3,26 +3,26 @@
3#ifndef KRFBOPTIONS_H 3#ifndef KRFBOPTIONS_H
4#define KRFBOPTIONS_H 4#define KRFBOPTIONS_H
5 5
6class Config; 6class Config;
7 7
8class KRFBOptions 8class KRFBOptions
9{ 9{
10public: 10public:
11 KRFBOptions(); 11 KRFBOptions();
12 ~KRFBOptions(); 12 ~KRFBOptions();
13 13
14 int encodings(); 14 int encodings();
15 void readSettings( Config *config ); 15 void readSettings();
16 void writeSettings( Config *config ); 16 void writeSettings();
17 17
18 bool hexTile; 18 bool hexTile;
19 bool corre; 19 bool corre;
20 bool rre; 20 bool rre;
21 bool copyrect; 21 bool copyrect;
22 22
23 bool colors256; 23 bool colors256;
24 bool shared; 24 bool shared;
25 bool readOnly; 25 bool readOnly;
26 bool deIconify; 26 bool deIconify;
27 27
28 int updateRate; 28 int updateRate;
diff --git a/noncore/comm/keypebble/kvnc.cpp b/noncore/comm/keypebble/kvnc.cpp
index bb18999..43cffc5 100644
--- a/noncore/comm/keypebble/kvnc.cpp
+++ b/noncore/comm/keypebble/kvnc.cpp
@@ -62,25 +62,24 @@ KVNC::KVNC( const char *name ) : QMainWindow( 0, name )
62 setupActions(); 62 setupActions();
63 63
64 cornerButton = new QPushButton( this ); 64 cornerButton = new QPushButton( this );
65 cornerButton->setPixmap( QPixmap( (const char**)menu_xpm ) ); 65 cornerButton->setPixmap( QPixmap( (const char**)menu_xpm ) );
66 connect( cornerButton, SIGNAL(pressed()), this, SLOT(showMenu()) ); 66 connect( cornerButton, SIGNAL(pressed()), this, SLOT(showMenu()) );
67 canvas->setCornerWidget( cornerButton ); 67 canvas->setCornerWidget( cornerButton );
68 68
69 QTimer::singleShot( 0, canvas, SLOT(openConnection()) ); 69 QTimer::singleShot( 0, canvas, SLOT(openConnection()) );
70} 70}
71 71
72KVNC::~KVNC() 72KVNC::~KVNC()
73{ 73{
74
75} 74}
76 75
77void KVNC::openURL( const QUrl &url ) 76void KVNC::openURL( const QUrl &url )
78{ 77{
79 canvas->openURL( url ); 78 canvas->openURL( url );
80} 79}
81 80
82void KVNC::setupActions() 81void KVNC::setupActions()
83{ 82{
84 cornerMenu = new QPopupMenu( this ); 83 cornerMenu = new QPopupMenu( this );
85 84
86 fullScreenAction = new QAction( tr("Full Screen"), QString::null, 0, 0 ); 85 fullScreenAction = new QAction( tr("Full Screen"), QString::null, 0, 0 );
diff --git a/noncore/comm/keypebble/kvncoptionsdlg.cpp b/noncore/comm/keypebble/kvncoptionsdlg.cpp
index b9f57d1..9d61c7b 100644
--- a/noncore/comm/keypebble/kvncoptionsdlg.cpp
+++ b/noncore/comm/keypebble/kvncoptionsdlg.cpp
@@ -38,16 +38,17 @@ KVNCOptionsDlg::~KVNCOptionsDlg()
38} 38}
39 39
40void KVNCOptionsDlg::accept() 40void KVNCOptionsDlg::accept()
41{ 41{
42 options->hexTile = hex->isChecked(); 42 options->hexTile = hex->isChecked();
43 options->corre = corre->isChecked(); 43 options->corre = corre->isChecked();
44 options->rre = rre->isChecked(); 44 options->rre = rre->isChecked();
45 options->copyrect = copyRect->isChecked(); 45 options->copyrect = copyRect->isChecked();
46 options->deIconify = deIconify->isChecked(); 46 options->deIconify = deIconify->isChecked();
47 options->colors256 = bit->isChecked(); 47 options->colors256 = bit->isChecked();
48 options->shared = shared->isChecked(); 48 options->shared = shared->isChecked();
49 options->updateRate = timeBox->value(); 49 options->updateRate = timeBox->value();
50 options->writeSettings();
50 51
51 QDialog::accept(); 52 QDialog::accept();
52} 53}
53 54
diff --git a/noncore/comm/keypebble/main.cpp b/noncore/comm/keypebble/main.cpp
index a32a368..ee3cd79 100644
--- a/noncore/comm/keypebble/main.cpp
+++ b/noncore/comm/keypebble/main.cpp
@@ -6,13 +6,12 @@
6 6
7int main( int argc, char **argv ) 7int main( int argc, char **argv )
8{ 8{
9 QPEApplication app( argc, argv ); 9 QPEApplication app( argc, argv );
10 KVNC *view = new KVNC( "Keypebble" ); 10 KVNC *view = new KVNC( "Keypebble" );
11 app.showMainWidget( view ); 11 app.showMainWidget( view );
12 12
13 if ( argc > 1 ) 13 if ( argc > 1 )
14 view->openURL( QUrl(argv[1]) ); 14 view->openURL( QUrl(argv[1]) );
15 15
16 return app.exec(); 16 return app.exec();
17} 17}
18