Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

AppLauncher Class Reference

#include </home/clem/local/src/opie/core/launcher/applauncher.h>

Collaboration diagram for AppLauncher:

Collaboration graph
[legend]
List of all members.

Signals

void launched (int pid, const QString &app)
void terminated (int pid, const QString &app)
void connected (const QString &app)

Public Member Functions

 AppLauncher (QObject *parent=0, const char *name=0)
 ~AppLauncher ()
bool isRunning (const QString &app)
const QMap< int, QString > & runningApplications ()

Static Public Attributes

static const int RAISE_TIMEOUT_MS = 5000

Protected Slots

void sigStopped (int sigPid, int sigStatus)
void received (const QCString &msg, const QByteArray &data)
void newQcopChannel (const QString &channel)
void removedQcopChannel (const QString &channel)
void createQuickLauncher ()
void processExited ()

Protected Member Functions

bool event (QEvent *)
void timerEvent (QTimerEvent *)

Private Member Functions

bool executeBuiltin (const QString &c, const QString &document)
bool execute (const QString &c, const QString &document, bool noRaise=FALSE)
void kill (int pid)
int pidForName (const QString &)

Static Private Member Functions

static void signalHandler (int sig)

Private Attributes

QMap< int, QStringrunningApps
QMap< QString, int > waitingHeartbeat
int qlPid
bool qlReady
QMessageBox * appKillerBox
QString appKillerName

Constructor & Destructor Documentation

AppLauncher::AppLauncher QObject *  parent = 0,
const char *  name = 0
 

Definition at line 80 of file applauncher.cpp.

References channel, createQuickLauncher(), QString::findRev(), QString::mid(), newQcopChannel(), pos, qApp, received(), removedQcopChannel(), runningApps, signalHandler(), and TRUE.

AppLauncher::~AppLauncher  ) 
 

Definition at line 110 of file applauncher.cpp.

References kill(), and qlPid.


Member Function Documentation

void AppLauncher::connected const QString app  )  [signal]
 

Referenced by newQcopChannel().

void AppLauncher::createQuickLauncher  )  [protected, slot]
 

Definition at line 637 of file applauncher.cpp.

References FALSE, qlPid, qlReady, QPEApplication::qpeDir(), and TRUE.

Referenced by AppLauncher(), execute(), and sigStopped().

bool AppLauncher::event QEvent *   )  [protected]
 

Definition at line 249 of file applauncher.cpp.

References appStopEventID, AppStoppedEvent::pid(), sigStopped(), AppStoppedEvent::status(), and TRUE.

bool AppLauncher::execute const QString c,
const QString document,
bool  noRaise = FALSE
[private]
 

Definition at line 479 of file applauncher.cpp.

References QProcess::addArgument(), QPtrList< type >::append(), QValueList< T >::append(), appKillerName, QPtrList< type >::at(), QValueList< T >::begin(), channel, QMap< Key, T >::contains(), QPtrList< type >::count(), QValueList< T >::count(), createQuickLauncher(), QValueList< T >::end(), QFile::exists(), f, FALSE, QString::fromLatin1(), QFile::handle(), i, QMap< Key, T >::insert(), IO_Append, IO_WriteOnly, QString::isEmpty(), QCopChannel::isRegistered(), isRunning(), launched(), list, NULL, QString::number(), odebug, oendl, QFile::open(), owarn, pid, processExited(), qlPid, qlReady, QPEApplication::qpeDir(), RAISE_TIMEOUT_MS, runningApps, QCopChannel::send(), QStringList::split(), tr, TRUE, waitingHeartbeat, and warning().

Referenced by received().

bool AppLauncher::executeBuiltin const QString c,
const QString document
[private]
 

Definition at line 440 of file applauncher.cpp.

References Global::Command::documentary, FALSE, Global::Command::func, i, QString::isNull(), Qt::Key_F34, list, Global::setDocument(), QStringList::split(), and TRUE.

Referenced by received().

bool AppLauncher::isRunning const QString app  ) 
 

Definition at line 421 of file applauncher.cpp.

References QMap< Key, T >::begin(), QString::data(), QMap< Key, T >::end(), FALSE, odebug, oendl, QMap< Key, T >::remove(), runningApps, t, and TRUE.

Referenced by execute(), FirstUse::nextDialog(), and received().

void AppLauncher::kill int  pid  )  [private]
 

Definition at line 608 of file applauncher.cpp.

Referenced by timerEvent(), and ~AppLauncher().

void AppLauncher::launched int  pid,
const QString app
[signal]
 

Referenced by execute().

void AppLauncher::newQcopChannel const QString channel  )  [protected, slot]
 

Definition at line 125 of file applauncher.cpp.

References connected(), QString::length(), QString::mid(), odebug, oendl, pid, qlPid, qlReady, QString::startsWith(), and TRUE.

Referenced by AppLauncher().

int AppLauncher::pidForName const QString  )  [private]
 

Definition at line 622 of file applauncher.cpp.

References QMap< Key, T >::begin(), QMap< Key, T >::end(), pid, and runningApps.

Referenced by timerEvent().

void AppLauncher::processExited  )  [protected, slot]
 

Definition at line 675 of file applauncher.cpp.

References appKillerBox, appKillerName, QProcess::arguments(), QMap< Key, T >::begin(), QMap< Key, T >::end(), FALSE, QMap< Key, T >::find(), QString::null, odebug, QMap< Key, T >::remove(), QString::remove(), runningApps, terminated(), TRUE, and waitingHeartbeat.

Referenced by execute().

void AppLauncher::received const QCString msg,
const QByteArray data
[protected, slot]
 

Definition at line 156 of file applauncher.cpp.

References QValueList< T >::append(), appKillerBox, appKillerName, QMap< Key, T >::begin(), channel, QMap< Key, T >::contains(), d, QMap< Key, T >::end(), execute(), executeBuiltin(), f, QMap< Key, T >::find(), QFile::handle(), QMap< Key, T >::insert(), IO_Append, IO_ReadOnly, IO_WriteOnly, isRunning(), QString::null, odebug, oendl, QFile::open(), RAISE_TIMEOUT_MS, QMap< Key, T >::remove(), runningApps, stream, t, TRUE, and waitingHeartbeat.

Referenced by AppLauncher().

void AppLauncher::removedQcopChannel const QString channel  )  [protected, slot]
 

Definition at line 148 of file applauncher.cpp.

Referenced by AppLauncher().

const QMap<int,QString>& AppLauncher::runningApplications  )  [inline]
 

Definition at line 42 of file applauncher.h.

References runningApps.

Referenced by Server::prepareDirectAccess().

void AppLauncher::signalHandler int  sig  )  [static, private]
 

Definition at line 234 of file applauncher.cpp.

References odebug, oendl, and pid.

Referenced by AppLauncher().

void AppLauncher::sigStopped int  sigPid,
int  sigStatus
[protected, slot]
 

Definition at line 300 of file applauncher.cpp.

References app, appKillerBox, appKillerName, DocumentList::appLnkSet, createQuickLauncher(), QMap< Key, T >::end(), AppLnk::exec(), QFileInfo::exists(), FALSE, QMap< Key, T >::find(), AppLnkSet::findExec(), QString::fromLatin1(), AppLnk::name(), QString::null, odebug, oendl, owarn, qlPid, qlReady, Config::readListEntry(), QValueList< T >::remove(), QMap< Key, T >::remove(), QFile::remove(), runningApps, Config::setGroup(), QFileInfo::size(), str, terminated(), tr, TRUE, waitingHeartbeat, and Config::writeEntry().

Referenced by event().

void AppLauncher::terminated int  pid,
const QString app
[signal]
 

Referenced by processExited(), and sigStopped().

void AppLauncher::timerEvent QTimerEvent *   )  [protected]
 

Definition at line 260 of file applauncher.cpp.

References appKillerBox, appKillerName, QMap< Key, T >::begin(), QMap< Key, T >::end(), kill(), QString::null, pid, pidForName(), QMap< Key, T >::remove(), tr, and waitingHeartbeat.


Member Data Documentation

QMessageBox* AppLauncher::appKillerBox [private]
 

Definition at line 78 of file applauncher.h.

Referenced by processExited(), received(), sigStopped(), and timerEvent().

QString AppLauncher::appKillerName [private]
 

Definition at line 79 of file applauncher.h.

Referenced by execute(), processExited(), received(), sigStopped(), and timerEvent().

int AppLauncher::qlPid [private]
 

Definition at line 76 of file applauncher.h.

Referenced by createQuickLauncher(), execute(), newQcopChannel(), sigStopped(), and ~AppLauncher().

bool AppLauncher::qlReady [private]
 

Definition at line 77 of file applauncher.h.

Referenced by createQuickLauncher(), execute(), newQcopChannel(), and sigStopped().

const int AppLauncher::RAISE_TIMEOUT_MS = 5000 [static]
 

Definition at line 59 of file applauncher.cpp.

Referenced by execute(), and received().

QMap<int,QString> AppLauncher::runningApps [private]
 

Definition at line 71 of file applauncher.h.

Referenced by AppLauncher(), execute(), isRunning(), pidForName(), processExited(), received(), runningApplications(), and sigStopped().

QMap<QString,int> AppLauncher::waitingHeartbeat [private]
 

Definition at line 72 of file applauncher.h.

Referenced by execute(), processExited(), received(), sigStopped(), and timerEvent().


The documentation for this class was generated from the following files:
Generated on Sat Nov 5 17:26:29 2005 for OPIE by  doxygen 1.4.2