summaryrefslogtreecommitdiff
path: root/core/launcher/desktop.cpp
Side-by-side diff
Diffstat (limited to 'core/launcher/desktop.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/desktop.cpp10
1 files changed, 6 insertions, 4 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" );