summaryrefslogtreecommitdiff
path: root/core
Side-by-side diff
Diffstat (limited to 'core') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/desktop.cpp10
-rw-r--r--core/launcher/launcher.cpp2
-rw-r--r--core/launcher/main.cpp7
-rw-r--r--core/launcher/qcopbridge.cpp2
-rw-r--r--core/launcher/runningappbar.cpp2
-rw-r--r--core/launcher/transferserver.cpp2
6 files changed, 12 insertions, 13 deletions
diff --git a/core/launcher/desktop.cpp b/core/launcher/desktop.cpp
index d74b745..1fd3f6a 100644
--- a/core/launcher/desktop.cpp
+++ b/core/launcher/desktop.cpp
@@ -143,25 +143,24 @@ void DesktopPowerAlerter::alert( const QString &text, int priority )
setText( text );
show();
}
void DesktopPowerAlerter::hideEvent( QHideEvent *e )
{
QMessageBox::hideEvent( e );
alertCount = 0;
currentPriority = INT_MAX;
}
-
class QPEScreenSaver : public QWSScreenSaver
{
private:
int LcdOn;
public:
QPEScreenSaver()
{
m_disable_suspend = 100;
m_enable_dim = false;
m_enable_lightoff = false;
m_enable_onlylcdoff = false;
@@ -316,25 +315,24 @@ public:
private:
int m_disable_suspend;
bool m_enable_dim;
bool m_enable_lightoff;
bool m_enable_onlylcdoff;
bool m_lcd_status;
int m_backlight_bright;
bool m_backlight_forcedoff;
};
-
void DesktopApplication::switchLCD ( bool on )
{
if ( qApp ) {
DesktopApplication *dapp = (DesktopApplication *) qApp;
if ( dapp-> m_screensaver ) {
if ( on ) {
dapp-> m_screensaver-> setDisplayState ( true );
dapp-> m_screensaver-> setBacklight ( -3 );
}
else {
dapp-> m_screensaver-> setDisplayState ( false );
@@ -633,25 +631,25 @@ Desktop::Desktop() :
initMemalerter();
#endif
// start services
startTransferServer();
( void ) new IrServer( this );
rereadVolumes();
packageSlave = new PackageSlave( this );
connect( qApp, SIGNAL( volumeChanged( bool ) ), this, SLOT( rereadVolumes() ) );
qApp->installEventFilter( this );
-
+
qApp-> setMainWidget ( launcher );
}
void Desktop::show()
{
login( TRUE );
QWidget::show();
}
Desktop::~Desktop()
{
delete launcher;
@@ -700,61 +698,65 @@ void Desktop::checkMemory()
QMessageBox::critical( 0 , "Memory Status",
"The memory is very low. \n"
"Please end this application \n"
"immediately." );
recoverMemory();
}
existingMessage = FALSE;
#endif
}
static bool isVisibleWindow( int wid )
{
+#ifdef QWS
const QList<QWSWindow> &list = qwsServer->clientWindows();
QWSWindow* w;
for ( QListIterator<QWSWindow> it( list ); ( w = it.current() ); ++it ) {
if ( w->winId() == wid )
return !w->isFullyObscured();
}
+#endif
return FALSE;
}
static bool hasVisibleWindow( const QString& clientname )
{
+#ifdef QWS
const QList<QWSWindow> &list = qwsServer->clientWindows();
QWSWindow* w;
for ( QListIterator<QWSWindow> it( list ); ( w = it.current() ); ++it ) {
if ( w->client() ->identity() == clientname && !w->isFullyObscured() )
return TRUE;
}
+#endif
return FALSE;
}
void Desktop::raiseLauncher()
{
Config cfg( "qpe" ); //F12 'Home'
cfg.setGroup( "AppsKey" );
QString tempItem;
tempItem = cfg.readEntry( "Middle", "Home" );
if ( tempItem == "Home" || tempItem.isEmpty() ) {
home ( );
}
else {
QCopEnvelope e( "QPE/System", "execute(QString)" );
e << tempItem;
}
}
void Desktop::home ( )
-{
+{
if ( isVisibleWindow( launcher->winId() ) )
launcher->nextView();
else
launcher->raise();
}
void Desktop::executeOrModify( const QString& appLnkFile )
{
AppLnk lnk( MimeType::appsFolderName() + "/" + appLnkFile );
if ( lnk.isValid() ) {
QCString app = lnk.exec().utf8();
Global::terminateBuiltin( "calibrate" );
diff --git a/core/launcher/launcher.cpp b/core/launcher/launcher.cpp
index 66cc3e6..a5955a4 100644
--- a/core/launcher/launcher.cpp
+++ b/core/launcher/launcher.cpp
@@ -13,27 +13,25 @@
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
// WARNING: Do *NOT* define this yourself. The SL5xxx from SHARP does NOT
// have this class.
#define QTOPIA_INTERNAL_FSLP
-#ifdef QWS
#include <qpe/qcopenvelope_qws.h>
-#endif
#include <qpe/resource.h>
#include <qpe/applnk.h>
#include <qpe/config.h>
#include <qpe/global.h>
#include <qpe/qpeapplication.h>
#include <qpe/mimetype.h>
#include <qpe/storage.h>
#include <qpe/palmtoprecord.h>
#include <qpe/version.h>
#include <qdir.h>
diff --git a/core/launcher/main.cpp b/core/launcher/main.cpp
index 073e19a..762a596 100644
--- a/core/launcher/main.cpp
+++ b/core/launcher/main.cpp
@@ -23,46 +23,47 @@
#include "stabmon.h"
#include <qpe/qpeapplication.h>
#include <qpe/network.h>
#include <qpe/config.h>
#if defined( QT_QWS_CUSTOM ) || defined( QT_QWS_IPAQ )
#include <qpe/custom.h>
#endif
#include <opie/odevice.h>
#include <qfile.h>
+#include <qimage.h>
#include <qwindowsystem_qws.h>
#include <qpe/qcopenvelope_qws.h>
#include <qpe/alarmserver.h>
#include <stdlib.h>
#include <stdio.h>
#include <signal.h>
#include <unistd.h>
#if defined(QT_QWS_IPAQ) || defined(QT_QWS_EBX)
#include "../calibrate/calibrate.h"
#endif
using namespace Opie;
void initEnvironment()
{
Config config("locale");
config.setGroup( "Location" );
QString tz = config.readEntry( "Timezone", getenv("TZ") );
- // if not timezone set, pick New York
+ // if not timezone set, pick New York
if (tz.isNull())
tz = "America/New_York";
setenv( "TZ", tz, 1 );
config.writeEntry( "Timezone", tz);
config.setGroup( "Language" );
QString lang = config.readEntry( "Language", getenv("LANG") );
if ( !lang.isNull() )
setenv( "LANG", lang, 1 );
}
@@ -120,25 +121,25 @@ int initApplication( int argc, char ** argv )
delete d;
ODevice::inst ( )-> setSoftSuspend ( false );
return rv;
}
static const char *pidfile_path = "/var/run/opie.pid";
void create_pidfile ( )
{
FILE *f;
-
+
if (( f = ::fopen ( pidfile_path, "w" ))) {
::fprintf ( f, "%d", getpid ( ));
::fclose ( f );
}
}
void remove_pidfile ( )
{
::unlink ( pidfile_path );
}
void handle_sigterm ( int /* sig */ )
@@ -147,25 +148,25 @@ void handle_sigterm ( int /* sig */ )
qApp-> quit ( );
}
int main( int argc, char ** argv )
{
::signal ( SIGCHLD, SIG_IGN );
::signal ( SIGTERM, handle_sigterm );
::signal ( SIGINT, handle_sigterm );
::setsid ( );
::setpgid ( 0, 0 );
-
+
::atexit ( remove_pidfile );
create_pidfile ( );
int retVal = initApplication ( argc, argv );
// Kill them. Kill them all.
::kill ( 0, SIGTERM );
::sleep ( 1 );
::kill ( 0, SIGKILL );
return retVal;
}
diff --git a/core/launcher/qcopbridge.cpp b/core/launcher/qcopbridge.cpp
index 85993ee..6177a7c 100644
--- a/core/launcher/qcopbridge.cpp
+++ b/core/launcher/qcopbridge.cpp
@@ -12,27 +12,25 @@
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#include "qcopbridge.h"
#include "transferserver.h"
-#ifdef QWS
#include <qpe/qcopenvelope_qws.h>
-#endif
#include <qpe/qpeapplication.h>
#include <qpe/version.h>
#include <qdir.h>
#include <qfile.h>
#include <qtextstream.h>
#include <qdatastream.h>
#include <qstringlist.h>
#include <qfileinfo.h>
#include <qregexp.h>
#ifdef QWS
#include <qcopchannel_qws.h>
diff --git a/core/launcher/runningappbar.cpp b/core/launcher/runningappbar.cpp
index b830d1b..c8f45d5 100644
--- a/core/launcher/runningappbar.cpp
+++ b/core/launcher/runningappbar.cpp
@@ -35,26 +35,28 @@
#include <qpe/qcopenvelope_qws.h>
#include <qpe/global.h>
#include <qwindowsystem_qws.h>
#include "runningappbar.h"
RunningAppBar::RunningAppBar(QWidget* parent)
: QFrame(parent), m_AppLnkSet(0L), m_SelectedAppIndex(-1)
{
setBackgroundMode( PaletteBackground );
m_AppLnkSet = new AppLnkSet( QPEApplication::qpeDir() + "apps" );
+#ifdef QWS
connect(qwsServer, SIGNAL(newChannel(const QString&)), this, SLOT(newQcopChannel(const QString&)));
connect(qwsServer, SIGNAL(removedChannel(const QString&)), this, SLOT(removedQcopChannel(const QString&)));
+#endif
QCopChannel* channel = new QCopChannel( "QPE/System", this );
connect( channel, SIGNAL(received(const QCString&, const QByteArray&)),
this, SLOT(received(const QCString&, const QByteArray&)) );
spacing = AppLnk::smallIconSize()+3;
}
RunningAppBar::~RunningAppBar() {
}
void RunningAppBar::newQcopChannel(const QString& channelName) {
QString prefix("QPE/Application/");
diff --git a/core/launcher/transferserver.cpp b/core/launcher/transferserver.cpp
index d2f5501..dea140d 100644
--- a/core/launcher/transferserver.cpp
+++ b/core/launcher/transferserver.cpp
@@ -47,27 +47,25 @@ extern "C" {
#include <qdatastream.h>
#include <qmessagebox.h>
#include <qstringlist.h>
#include <qfileinfo.h>
#include <qregexp.h>
//#include <qpe/qcopchannel_qws.h>
#include <qpe/process.h>
#include <qpe/global.h>
#include <qpe/config.h>
#include <qpe/contact.h>
#include <qpe/quuid.h>
#include <qpe/version.h>
-#ifdef QWS
#include <qpe/qcopenvelope_qws.h>
-#endif
#include "transferserver.h"
#include "qprocess.h"
const int block_size = 51200;
TransferServer::TransferServer( Q_UINT16 port, QObject *parent ,
const char* name )
: QServerSocket( port, 1, parent, name )
{
if ( !ok() )
qWarning( "Failed to bind to port %d", port );