aboutsummaryrefslogtreecommitdiffstats
path: root/kde2
diff options
context:
space:
mode:
authorFritz Elfert <felfert@to.com>2001-07-31 18:29:32 +0000
committerFritz Elfert <felfert@to.com>2001-07-31 18:29:32 +0000
commit5ab6d90452fcfe15d6aaafc599c5467d3c05552a (patch)
tree35e05b156eba47efcd7b0a69ba0740dc9a20b44c /kde2
parentc6175786a87c8a244d80352658d95a321571469f (diff)
downloadplptools-5ab6d90452fcfe15d6aaafc599c5467d3c05552a.tar.gz
plptools-5ab6d90452fcfe15d6aaafc599c5467d3c05552a.tar.bz2
plptools-5ab6d90452fcfe15d6aaafc599c5467d3c05552a.zip
Added check for unsupported operation.
Diffstat (limited to 'kde2')
-rw-r--r--kde2/klipsi/main.cpp13
-rw-r--r--kde2/klipsi/toplevel.cpp37
-rw-r--r--kde2/klipsi/toplevel.h1
3 files changed, 40 insertions, 11 deletions
diff --git a/kde2/klipsi/main.cpp b/kde2/klipsi/main.cpp
index e0cbd71..1cfa271 100644
--- a/kde2/klipsi/main.cpp
+++ b/kde2/klipsi/main.cpp
@@ -55,11 +55,16 @@ int main(int argc, char *argv[])
TopLevel *toplevel = new TopLevel();
- KWin::setSystemTrayWindowFor(toplevel->winId(), 0);
- toplevel->setGeometry(-100, -100, 42, 42 );
- toplevel->show();
+ if (toplevel->isNotSupported())
+ app.quit();
+ else {
+ KWin::setSystemTrayWindowFor(toplevel->winId(), 0);
+ toplevel->setGeometry(-100, -100, 42, 42 );
+ toplevel->show();
- return app.exec();
+ return app.exec();
+ }
+ return 0;
}
/*
* Local variables:
diff --git a/kde2/klipsi/toplevel.cpp b/kde2/klipsi/toplevel.cpp
index 92a685d..92dc2ed 100644
--- a/kde2/klipsi/toplevel.cpp
+++ b/kde2/klipsi/toplevel.cpp
@@ -34,6 +34,7 @@
#include <kiconloader.h>
#include <knotifyclient.h>
#include <kdebug.h>
+#include <kmessagebox.h>
#define QUIT_ITEM 50
@@ -89,18 +90,23 @@ TopLevel::TopLevel()
setBackgroundMode(X11ParentRelative);
int interval = checkConnection() ? 500 : 5000;
- timer->start(interval, true);
-
-
+ if (timer)
+ timer->start(interval, true);
}
TopLevel::~TopLevel()
{
closeConnection();
- delete timer;
+ if (timer)
+ delete timer;
delete menu;
}
+bool TopLevel::
+isNotSupported() {
+ return (timer == NULL);
+}
+
void TopLevel::
closeConnection() {
if (rf)
@@ -155,7 +161,10 @@ slotTimer()
}
if (!checkConnection()) {
- timer->start(5000, true);
+ if (timer)
+ timer->start(5000, true);
+ else
+ kapp->quit();
return;
}
@@ -709,13 +718,27 @@ checkConnection() {
if (rf) {
if (!rc) {
rc = new rclip(rclipSocket);
- if (rc->initClipbd() == rfsv::E_PSI_GEN_NONE) {
+ Enum<rfsv::errs> ret;
+
+ if ((ret = rc->initClipbd()) == rfsv::E_PSI_GEN_NONE) {
KNotifyClient::event("connected");
constate = CONNECTED;
repaint();
return true;
- } else
+ } else {
closeConnection();
+ if (ret == rfsv::E_PSI_GEN_NSUP) {
+ KMessageBox::error(NULL, i18n(
+ "<QT>Your Psion does not support the remote clipboard "
+ "protocol.<BR/>The reason for that is usually a missing "
+ "server library on your Psion.<BR/>Make shure, that "
+ "<B>C:\\System\\Libs\\clipsvr.rsy</B> exists.<BR/>"
+ "<B>Klipsi</B> will now terminate.</QT>"),
+ i18n("Protocol not supported"));
+ delete timer;
+ timer = NULL;
+ }
+ }
}
}
return false;
diff --git a/kde2/klipsi/toplevel.h b/kde2/klipsi/toplevel.h
index 31f5040..1f7ef1a 100644
--- a/kde2/klipsi/toplevel.h
+++ b/kde2/klipsi/toplevel.h
@@ -48,6 +48,7 @@ class TopLevel : public KMainWindow
public:
TopLevel();
~TopLevel();
+ bool isNotSupported();
protected:
void paintEvent(QPaintEvent *);