summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (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,52 +1,56 @@
#include <qpe/config.h>
#include <qpe/qpeapplication.h>
#include "krfboptions.h"
KRFBOptions::KRFBOptions()
{
- Config config( "keypebble" );
- readSettings( &config );
+ readSettings();
}
KRFBOptions::~KRFBOptions()
{
- Config config( "keypebble" );
- writeSettings( &config );
+ writeSettings();
}
-void KRFBOptions::readSettings( Config *config )
+void KRFBOptions::readSettings()
{
- 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 );
+ Config config( "keypebble" );
+ config.setGroup("Settings");
+ hexTile = config.readBoolEntry( "HexTile", 0 );
+ corre = config.readBoolEntry( "CORRE", 0 );
+ rre = config.readBoolEntry( "RRE", 0 );
+ copyrect = config.readBoolEntry( "CopyRect", 1 );
+ colors256 = config.readBoolEntry( "Colors256", 0 );
+ shared = config.readBoolEntry( "Shared", 0 );
+ readOnly = config.readBoolEntry( "ReadOnly", 0 );
+ updateRate = config.readNumEntry( "UpdateRate", 50 );
+ deIconify = config.readBoolEntry( "DeIconify", 0 );
}
-void KRFBOptions::writeSettings( Config *config )
+void KRFBOptions::writeSettings()
{
- 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 );
+ Config config( "keypebble" );
+ config.setGroup("Settings");
+ 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 );
+ config.writeEntry( "DeIconify", deIconify );
}
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;
}
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
@@ -1,31 +1,31 @@
// -*- c++ -*-
#ifndef KRFBOPTIONS_H
#define KRFBOPTIONS_H
class Config;
class KRFBOptions
{
public:
KRFBOptions();
~KRFBOptions();
int encodings();
- void readSettings( Config *config );
- void writeSettings( Config *config );
+ void readSettings();
+ void writeSettings();
bool hexTile;
bool corre;
bool rre;
bool copyrect;
bool colors256;
bool shared;
bool readOnly;
bool deIconify;
int updateRate;
};
#endif // KRFBOPTIONS_H
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
@@ -26,97 +26,96 @@ static char * menu_xpm[] = {
" c None",
". c #000000",
"+ c #FFFDAD",
"@ c #FFFF00",
"# c #E5E100",
" ",
" ",
" ......... ",
" .+++++++. ",
" .+@@@@#. ",
" .+@@@#. ",
" .+@@#. ",
" .+@#. ",
" .+#. ",
" .+. ",
" .. ",
" "};
const int StatusTextId = 0;
KVNC::KVNC( const char *name ) : QMainWindow( 0, name )
{
setCaption( tr("VNC Viewer") );
fullscreen = false;
canvas = new KRFBCanvas( this, "canvas" );
setCentralWidget( canvas );
connect( canvas->connection(), SIGNAL(statusChanged(const QString &)),
this, SLOT(statusMessage(const QString &)) );
connect( canvas->connection(), SIGNAL(error(const QString &)),
this, SLOT(error(const QString &)) );
connect( canvas->connection(), SIGNAL(connected()), this, SLOT(connected()) );
connect( canvas->connection(), SIGNAL(loggedIn()), this, SLOT(loggedIn()) );
connect( canvas->connection(), SIGNAL(disconnected()), this, SLOT(disconnected()) );
setupActions();
cornerButton = new QPushButton( this );
cornerButton->setPixmap( QPixmap( (const char**)menu_xpm ) );
connect( cornerButton, SIGNAL(pressed()), this, SLOT(showMenu()) );
canvas->setCornerWidget( cornerButton );
QTimer::singleShot( 0, canvas, SLOT(openConnection()) );
}
KVNC::~KVNC()
{
-
}
void KVNC::openURL( const QUrl &url )
{
canvas->openURL( url );
}
void KVNC::setupActions()
{
cornerMenu = new QPopupMenu( this );
fullScreenAction = new QAction( tr("Full Screen"), QString::null, 0, 0 );
connect( fullScreenAction, SIGNAL(activated()),
this, SLOT( toggleFullScreen() ) );
fullScreenAction->addTo( cornerMenu );
fullScreenAction->setEnabled( false );
optionsAction = new QAction( tr("Settings"), QString::null, 0, 0 );
connect( optionsAction, SIGNAL(activated()), this, SLOT( showOptions() ) );
optionsAction->addTo( cornerMenu );
connectAction = new QAction( tr("Connect..."), QString::null, 0, 0 );
connect( connectAction, SIGNAL(activated()),
canvas, SLOT( openConnection() ) );
connectAction->addTo( cornerMenu );
disconnectAction = new QAction( tr("Disconnect"), QString::null, 0, 0 );
connect( disconnectAction, SIGNAL(activated()),
this, SLOT( closeConnection() ) );
disconnectAction->addTo( cornerMenu );
disconnectAction->setEnabled( false );
}
void KVNC::toggleFullScreen()
{
if ( fullscreen ) {
canvas->releaseKeyboard();
canvas->reparent( this, 0, QPoint(0,0), false );
canvas->setFrameStyle( QFrame::Panel | QFrame::Sunken );
setCentralWidget( canvas );
canvas->show();
fullScreenAction->setText( tr("Full Screen") );
} else {
canvas->setFrameStyle( QFrame::NoFrame );
canvas->reparent( 0,WStyle_Tool | WStyle_Customize | WStyle_StaysOnTop,
QPoint(0,0),false);
canvas->resize(qApp->desktop()->width(), qApp->desktop()->height());
canvas->raise();
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
@@ -2,52 +2,53 @@
#include <qvbox.h>
#include <qcheckbox.h>
#include <qspinbox.h>
#include <qlabel.h>
#include <qlayout.h>
#include <qwhatsthis.h>
#include <qapplication.h>
#include "krfboptions.h"
#include "kvncoptionsdlg.h"
KVNCOptionsDlg::KVNCOptionsDlg( KRFBOptions *options,
QWidget *parent, char *name, bool modal )
: VncOptionsBase( parent, name, modal )
{
this->options = options;
hex->setChecked( options->hexTile );
corre->setChecked( options->corre );
rre->setChecked( options->rre );
copyRect->setChecked( options->copyrect );
// TODO
hex->setEnabled( false );
corre->setEnabled( false );
rre->setEnabled( false );
// /TODO
deIconify->setChecked( options->deIconify );
bit->setChecked( options->colors256 );
shared->setChecked( options->shared );
timeBox->setValue( options->updateRate );
}
KVNCOptionsDlg::~KVNCOptionsDlg()
{
}
void KVNCOptionsDlg::accept()
{
options->hexTile = hex->isChecked();
options->corre = corre->isChecked();
options->rre = rre->isChecked();
options->copyrect = copyRect->isChecked();
options->deIconify = deIconify->isChecked();
options->colors256 = bit->isChecked();
options->shared = shared->isChecked();
options->updateRate = timeBox->value();
+ options->writeSettings();
QDialog::accept();
}
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
@@ -1,18 +1,17 @@
#include <qurl.h>
#include <qpe/qpeapplication.h>
#include "kvnc.h"
int main( int argc, char **argv )
{
QPEApplication app( argc, argv );
KVNC *view = new KVNC( "Keypebble" );
app.showMainWidget( view );
if ( argc > 1 )
view->openURL( QUrl(argv[1]) );
return app.exec();
}
-