You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
101 lines
2.1 KiB
101 lines
2.1 KiB
#ifndef EPT_NOTIFIER_H
|
|
#define EPT_NOTIFIER_H
|
|
|
|
#include <sys/types.h>
|
|
#include <ksystemtray.h>
|
|
#include <kuniqueapplication.h>
|
|
#include <kdirwatch.h>
|
|
#include <kprocess.h>
|
|
|
|
class TQWidget;
|
|
class TDEAction;
|
|
// class TDEGlobalAccel;
|
|
|
|
// the status indicator in system tray
|
|
class TrayWindow : public KSystemTray
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
TrayWindow(TQWidget *parent=0, const char *name=0);
|
|
void setAvailableUpdates( int n );
|
|
int updates() { return m_updates; }
|
|
void contextMenuAboutToShow ( TDEPopupMenu * );
|
|
signals:
|
|
void clicked();
|
|
void aboutSelected();
|
|
protected:
|
|
void mouseReleaseEvent( TQMouseEvent * );
|
|
void resizeEvent( TQResizeEvent * );
|
|
int m_updates;
|
|
TDEAction *m_quit, *m_about;
|
|
};
|
|
|
|
// the apport indicator in system tray
|
|
// gets shown where the app is started and
|
|
// existing apport reports are found.
|
|
// clicking starts apport-qt
|
|
class ApportTrayWindow : public KSystemTray
|
|
{
|
|
Q_OBJECT
|
|
|
|
signals:
|
|
void clicked();
|
|
protected:
|
|
void mousePressEvent(TQMouseEvent*);
|
|
void resizeEvent(TQResizeEvent *);
|
|
};
|
|
|
|
// used for the reboot notifier
|
|
class RebootTrayWindow : public KSystemTray
|
|
{
|
|
Q_OBJECT
|
|
|
|
signals:
|
|
void clicked();
|
|
protected:
|
|
void mousePressEvent(TQMouseEvent*);
|
|
void resizeEvent(TQResizeEvent *);
|
|
};
|
|
|
|
|
|
|
|
// application watching the current status
|
|
// it will update the icon and run
|
|
class NotifierApp : public KUniqueApplication
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
NotifierApp(bool allowStyles=true, bool GUIenabled=true);
|
|
~NotifierApp();
|
|
bool fileUpdated( const char *, time_t & );
|
|
int upgradable();
|
|
|
|
protected slots:
|
|
// void menuActivated(int id);
|
|
void clicked();
|
|
void checkUpdates();
|
|
void askQuit();
|
|
void about();
|
|
// for apport
|
|
void crashWatcher();
|
|
void apportCheckExited(TDEProcess*);
|
|
void rebootWatcher(const TQString& path);
|
|
void rebootClicked();
|
|
|
|
protected:
|
|
TrayWindow *m_tray;
|
|
TQTimer *m_timer;
|
|
time_t m_updateStamp, m_statusStamp;
|
|
bool m_okAutostart;
|
|
// for apport crash handler
|
|
KDirWatch* m_dirWatch;
|
|
KDirWatch* m_rebootDirWatch;
|
|
bool m_crashes;
|
|
bool m_rebootRequired;
|
|
bool m_rebootShown; //have we already shown the reboot notifier?
|
|
};
|
|
|
|
#endif
|