summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/desktop.cpp2
-rw-r--r--core/launcher/desktop.h2
-rw-r--r--core/launcher/startmenu.cpp2
3 files changed, 3 insertions, 3 deletions
diff --git a/core/launcher/desktop.cpp b/core/launcher/desktop.cpp
index 34b52d2..6c67056 100644
--- a/core/launcher/desktop.cpp
+++ b/core/launcher/desktop.cpp
@@ -1,128 +1,128 @@
/**********************************************************************
** Copyright (C) 2000 Trolltech AS. All rights reserved.
**
** This file is part of Qtopia Environment.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** 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 "desktop.h"
#include "info.h"
#include "launcher.h"
#include "qcopbridge.h"
#include "shutdownimpl.h"
#include "startmenu.h"
#include "taskbar.h"
#include "transferserver.h"
#include "irserver.h"
#include "packageslave.h"
#include "screensaver.h"
-
+
#include <qpe/applnk.h>
#include <qpe/mimetype.h>
#include <qpe/password.h>
#include <qpe/config.h>
#include <qpe/power.h>
#include <qpe/timeconversion.h>
#include <qpe/qcopenvelope_qws.h>
#include <qpe/network.h>
#include <qpe/global.h>
#if defined( QT_QWS_SHARP ) || defined( QT_QWS_IPAQ )
#include <qpe/custom.h>
#endif
#include <opie/odevice.h>
#include <qgfx_qws.h>
#include <qmainwindow.h>
#include <qmessagebox.h>
#include <qtimer.h>
#include <qwindowsystem_qws.h>
#include <qvaluelist.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
using namespace Opie;
class QCopKeyRegister
{
public:
QCopKeyRegister() : keyCode( 0 )
{ }
QCopKeyRegister( int k, const QString &c, const QString &m )
: keyCode( k ), channel( c ), message( m )
{ }
int getKeyCode() const
{
return keyCode;
}
QString getChannel() const
{
return channel;
}
QString getMessage() const
{
return message;
}
private:
int keyCode;
QString channel, message;
};
typedef QValueList<QCopKeyRegister> KeyRegisterList;
KeyRegisterList keyRegisterList;
static Desktop* qpedesktop = 0;
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()" );
}
}
bool Desktop::screenLocked()
{
return loggedin == 0;
}
/*
Priority is number of alerts that are needed to pop up
alert.
*/
class DesktopPowerAlerter : public QMessageBox
{
public:
DesktopPowerAlerter( QWidget *parent, const char *name = 0 )
: QMessageBox( tr( "Battery Status" ), "Low Battery",
QMessageBox::Critical,
QMessageBox::Ok | QMessageBox::Default,
QMessageBox::NoButton, QMessageBox::NoButton,
parent, name, FALSE )
{
currentPriority = INT_MAX;
alertCount = 0;
}
void alert( const QString &text, int priority );
diff --git a/core/launcher/desktop.h b/core/launcher/desktop.h
index 13f28b3..1f8daa0 100644
--- a/core/launcher/desktop.h
+++ b/core/launcher/desktop.h
@@ -1,119 +1,119 @@
/**********************************************************************
** Copyright (C) 2000 Trolltech AS. All rights reserved.
**
** This file is part of Qtopia Environment.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** 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.
**
**********************************************************************/
#ifndef __DESKTOP_H__
#define __DESKTOP_H__
-
+
#include "shutdownimpl.h"
#include <qpe/qpeapplication.h>
#include <qwidget.h>
#include <qdatetime.h>
class Background;
class Launcher;
class TaskBar;
class PowerStatus;
class QCopBridge;
class TransferServer;
class DesktopPowerAlerter;
class PackageSlave;
class OpieScreenSaver;
class DesktopApplication : public QPEApplication
{
Q_OBJECT
public:
DesktopApplication( int& argc, char **argv, Type t );
~DesktopApplication();
static void switchLCD ( bool on ); // only for togglePower in Desktop
signals:
void menu();
void home();
void datebook();
void contacts();
void launch();
void email();
void backlight();
void power();
void symbol();
void numLockStateToggle();
void capsLockStateToggle();
void prepareForRestart();
protected:
#ifdef Q_WS_QWS
bool qwsEventFilter( QWSEvent * );
#endif
void shutdown();
void restart();
public slots:
virtual void desktopMessage ( const QCString &msg, const QByteArray &data );
virtual void systemMessage ( const QCString &msg, const QByteArray &data );
protected slots:
void shutdown( ShutdownImpl::Type );
void apmTimeout();
void sendCard();
private:
void reloadPowerWarnSettings();
DesktopPowerAlerter *pa;
PowerStatus *m_ps, *m_ps_last;
QTimer *cardSendTimer;
QCopChannel *channel;
OpieScreenSaver *m_screensaver;
QTimer * m_timer;
int m_powerVeryLow;
int m_powerCritical;
int m_currentPowerLevel;
};
class Desktop : public QWidget
{
Q_OBJECT
public:
Desktop();
~Desktop();
static bool screenLocked();
void show();
void checkMemory();
void keyClick();
void screenClick();
static void soundAlarm();
public slots:
void raiseDatebook();
void raiseContacts();
void raiseMenu();
void raiseLauncher();
void raiseEmail();
void execAutoStart();
void togglePower();
diff --git a/core/launcher/startmenu.cpp b/core/launcher/startmenu.cpp
index e663072..88c6219 100644
--- a/core/launcher/startmenu.cpp
+++ b/core/launcher/startmenu.cpp
@@ -1,118 +1,118 @@
/**********************************************************************
** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
**
** This file is part of the Qtopia Environment.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** 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.
**
**********************************************************************/
#define INCLUDE_MENUITEM_DEF
-
+
#include "startmenu.h"
#include "sidething.h"
//#include "mrulist.h"
#include "info.h"
#include <qpe/qpeapplication.h>
#include <qpe/config.h>
#include <qpe/applnk.h>
#include <qpe/global.h>
#include <qpe/resource.h>
#include <qpe/qlibrary.h>
#include <qintdict.h>
#include <qdir.h>
#include <stdlib.h>
// #define USE_CONFIG_FILE
StartMenu::StartMenu(QWidget *parent) : QLabel( parent )
{
loadOptions();
int sz = AppLnk::smallIconSize()+3;
QPixmap pm;
pm.convertFromImage(Resource::loadImage(startButtonPixmap).smoothScale(sz,sz));
setPixmap(pm);
setFocusPolicy( NoFocus );
//setFlat( startButtonIsFlat );
apps = 0;
launchMenu = 0;
applets. setAutoDelete ( true );
sepId = 0;
reloadApps ( );
reloadApplets ( );
}
void StartMenu::mousePressEvent( QMouseEvent * )
{
launch();
if (desktopInfo)
desktopInfo->menuClicked();
}
StartMenu::~StartMenu()
{
delete apps;
}
void StartMenu::loadOptions()
{
#ifdef USE_CONFIG_FILE
// Read configuration file
Config config("StartMenu");
config.setGroup( "StartMenu" );
QString tmpBoolString1 = config.readEntry( "UseWidePopupMenu", "FALSE" );
useWidePopupMenu = ( tmpBoolString1 == "TRUE" ) ? TRUE : FALSE;
QString tmpBoolString2 = config.readEntry( "StartButtonIsFlat", "TRUE" );
startButtonIsFlat = ( tmpBoolString2 == "TRUE" ) ? TRUE : FALSE;
QString tmpBoolString3 = config.readEntry( "UseMRUList", "TRUE" );
popupMenuSidePixmap = config.readEntry( "PopupMenuSidePixmap", "launcher/sidebar" );
startButtonPixmap = config.readEntry( "StartButtonPixmap", "launcher/start_button" );
#else
// Basically just #include the .qpe_menu.conf file settings
useWidePopupMenu = FALSE;
popupMenuSidePixmap = "launcher/sidebar";
startButtonIsFlat = TRUE;
startButtonPixmap = "launcher/start_button"; // No tr
#endif
}
void StartMenu::createMenu()
{
delete launchMenu;
if ( useWidePopupMenu )
launchMenu = new PopupWithLaunchSideThing( this, &popupMenuSidePixmap );
else
launchMenu = new StartPopupMenu( this );
loadMenu ( apps, launchMenu );
loadApplets ( );
connect( launchMenu, SIGNAL(activated(int)), SLOT(itemSelected(int)) );
}
void StartMenu::reloadApps()
{
Config cfg("StartMenu");