summaryrefslogtreecommitdiff
authorkergoth <kergoth>2003-04-19 22:07:06 (UTC)
committer kergoth <kergoth>2003-04-19 22:07:06 (UTC)
commit29c556ffc9b1497cd996ceb46d646b1eaf1288be (patch) (side-by-side diff)
treeb89c424de93f541bc80908c93172eb4e601e8c02
parentc502394063598e63591e06072802f1c5a9e0c266 (diff)
downloadopie-29c556ffc9b1497cd996ceb46d646b1eaf1288be.zip
opie-29c556ffc9b1497cd996ceb46d646b1eaf1288be.tar.gz
opie-29c556ffc9b1497cd996ceb46d646b1eaf1288be.tar.bz2
Split calibrate out as a standalone application, and ensure taskbar depends
on it. This makes ts debugging easier, having a seperate calibration tool around, and as a side affect fixes calibration on the C700, which previously required a reboot to take effect.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/apps/calibrate/main.cpp20
-rw-r--r--core/apps/calibrate/opie-calibrate.control8
-rw-r--r--core/launcher/desktop.cpp2
-rw-r--r--core/launcher/launcher.pro4
-rw-r--r--core/launcher/main.cpp15
-rw-r--r--core/launcher/opie-taskbar.control4
-rw-r--r--core/launcher/taskbar.cpp17
-rw-r--r--core/launcher/taskbar.h2
8 files changed, 32 insertions, 40 deletions
diff --git a/core/apps/calibrate/main.cpp b/core/apps/calibrate/main.cpp
index d1ad083..1c295eb 100644
--- a/core/apps/calibrate/main.cpp
+++ b/core/apps/calibrate/main.cpp
@@ -23,20 +23,24 @@
#include <qfile.h>
#include <qpe/qpeapplication.h>
+#ifdef QWS
+#include <qwindowsystem_qws.h>
+#endif
+
int main( int argc, char ** argv )
{
QPEApplication a( argc, argv );
int retval = 0;
-#if defined(QT_QWS_CASSIOPEIA) || defined(QT_QWS_IPAQ) || defined(QT_QWS_SL5XXX)
- if ( !QFile::exists( "/etc/pointercal" ) ) {
+#ifdef QWS
+ if ( QWSServer::mouseHandler() ->inherits("QCalibratedMouseHandler") ) {
+#endif
// Make sure calibration widget starts on top.
- Calibrate *cal = new Calibrate;
- a.setMainWidget(cal);
- a.showMainWidget(cal);
- retval = a.exec();
- delete cal;
+ Calibrate cal;
+ a.setMainWidget(&cal);
+ a.showMainWidget(&cal);
+ return a.exec();
+#ifdef QWS
}
#endif
- return retval;
}
diff --git a/core/apps/calibrate/opie-calibrate.control b/core/apps/calibrate/opie-calibrate.control
new file mode 100644
index 0000000..6eafb94
--- a/dev/null
+++ b/core/apps/calibrate/opie-calibrate.control
@@ -0,0 +1,8 @@
+Files: bin/calibrate apps/Settings/Calibrate.desktop
+Priority: required
+Section: opie/system
+Maintainer: Project Opie <opie@handhelds.org>
+Architecture: arm
+Version: $QPE_VERSION-$SUB_VERSION.3
+Depends: libqpe1, libqt2-emb
+Description: Opie calibration tool
diff --git a/core/launcher/desktop.cpp b/core/launcher/desktop.cpp
index 6def126..ef0bf4c 100644
--- a/core/launcher/desktop.cpp
+++ b/core/launcher/desktop.cpp
@@ -98,7 +98,6 @@ static int loggedin = 0;
static void login( bool at_poweron )
{
if ( !loggedin ) {
- Global::terminateBuiltin( "calibrate" );
Password::authenticate( at_poweron );
loggedin = 1;
QCopEnvelope e( "QPE/Desktop", "unlocked()" );
@@ -622,7 +621,6 @@ void Desktop::executeOrModify( const QString& appLnkFile )
AppLnk lnk( MimeType::appsFolderName() + "/" + appLnkFile );
if ( lnk.isValid() ) {
QCString app = lnk.exec().utf8();
- Global::terminateBuiltin( "calibrate" );
if ( QCopChannel::isRegistered( "QPE/Application/" + app ) ) {
// MRUList::addTask( &lnk );
if ( hasVisibleWindow( app ) )
diff --git a/core/launcher/launcher.pro b/core/launcher/launcher.pro
index d0a573b..007e48c 100644
--- a/core/launcher/launcher.pro
+++ b/core/launcher/launcher.pro
@@ -17,7 +17,6 @@ HEADERS = background.h \
shutdownimpl.h \
launcher.h \
launcherview.h \
- ../../core/apps/calibrate/calibrate.h \
startmenu.h \
transferserver.h \
qcopbridge.h \
@@ -58,7 +57,6 @@ SOURCES = background.cpp \
shutdownimpl.cpp \
launcher.cpp \
launcherview.cpp \
- ../../core/apps/calibrate/calibrate.cpp \
transferserver.cpp \
packageslave.cpp \
irserver.cpp \
@@ -94,8 +92,6 @@ SOURCES = background.cpp \
INTERFACES = syncdialog.ui
INCLUDEPATH += ../../include
DEPENDPATH += ../../include .
-INCLUDEPATH += ../../core/apps/calibrate
-DEPENDPATH += ../../core/apps/calibrate
INCLUDEPATH += ../../rsync
DEPENDPATH += ../../rsync
TARGET = qpe
diff --git a/core/launcher/main.cpp b/core/launcher/main.cpp
index 20a1ecd..e96eeae 100644
--- a/core/launcher/main.cpp
+++ b/core/launcher/main.cpp
@@ -30,6 +30,7 @@
#endif
#include <opie/odevice.h>
+#include <opie/oprocess.h>
#include <qmessagebox.h>
#include <qfile.h>
@@ -44,8 +45,6 @@
#include <signal.h>
#include <unistd.h>
-#include "../calibrate/calibrate.h"
-
using namespace Opie;
void initEnvironment()
@@ -118,10 +117,14 @@ int initApplication( int argc, char ** argv )
if ( QWSServer::mouseHandler() ->inherits("QCalibratedMouseHandler") ) {
if ( !QFile::exists( "/etc/pointercal" ) ) {
- // Make sure calibration widget starts on top.
- Calibrate *cal = new Calibrate;
- cal->exec();
- delete cal;
+ OProcess cal;
+ cal << "calibrate";
+
+ if ( ! cal.start(OProcess::Block, OProcess::NoCommunication) ) {
+ QMessageBox::warning( 0, "Unable to calibrate",
+ "Failed to start the calibration tool.\n"
+ );
+ }
}
}
diff --git a/core/launcher/opie-taskbar.control b/core/launcher/opie-taskbar.control
index c0430b7..db66a05 100644
--- a/core/launcher/opie-taskbar.control
+++ b/core/launcher/opie-taskbar.control
@@ -1,9 +1,9 @@
-Files: bin/qpe apps/Settings/Calibrate.desktop pics/launcher pics/devicebuttons/*.png plugins/applets/libsuspendapplet.so* plugins/applets/libhomeapplet.so* plugins/applets/liblogoutapplet.so* plugins/applets/librotateapplet.so* root/etc/init.d/opie
+Files: bin/qpe pics/launcher pics/devicebuttons/*.png plugins/applets/libsuspendapplet.so* plugins/applets/libhomeapplet.so* plugins/applets/liblogoutapplet.so* plugins/applets/librotateapplet.so* root/etc/init.d/opie
Priority: required
Section: opie/system
Maintainer: Project Opie <opie@handhelds.org>
Architecture: arm
Version: $QPE_VERSION-$SUB_VERSION.3
-Depends: opie-base
+Depends: opie-base, opie-calibrate
Replaces: opie-rotation
Description: Launcher for Opie
diff --git a/core/launcher/taskbar.cpp b/core/launcher/taskbar.cpp
index 8af568d..8158128 100644
--- a/core/launcher/taskbar.cpp
+++ b/core/launcher/taskbar.cpp
@@ -22,7 +22,6 @@
#include "inputmethods.h"
#include "runningappbar.h"
#include "systray.h"
-#include "calibrate.h"
#include "wait.h"
#include "appicons.h"
@@ -82,15 +81,12 @@ static Global::Command builtins[] = {
#undef APP
#endif
-#if defined(QT_QWS_IPAQ) || defined(QT_QWS_CASSIOPEIA) || defined(QT_QWS_SL5XXX)
- { "calibrate", TaskBar::calibrate, 1, 0 },
-#endif
#if !defined(QT_QWS_CASSIOPEIA)
{ "shutdown", Global::shutdown, 1, 0 },
// { "run", run, 1, 0 },
#endif
- { 0, TaskBar::calibrate, 0, 0 },
+ { 0, 0, 0, 0 },
};
static bool initNumLock()
@@ -306,17 +302,6 @@ void TaskBar::receive( const QCString &msg, const QByteArray &data )
}
}
-QWidget *TaskBar::calibrate(bool)
-{
-#ifdef Q_WS_QWS
- Calibrate *c = new Calibrate;
- c->show();
- return c;
-#else
- return 0;
-#endif
-}
-
void TaskBar::toggleNumLockState()
{
if ( lockState ) lockState->toggleNumLockState();
diff --git a/core/launcher/taskbar.h b/core/launcher/taskbar.h
index a0bf395..575a8c9 100644
--- a/core/launcher/taskbar.h
+++ b/core/launcher/taskbar.h
@@ -42,8 +42,6 @@ public:
TaskBar();
~TaskBar();
- static QWidget *calibrate( bool );
-
bool recoverMemory();
StartMenu *startMenu() const { return sm; }