source: src-qt4/life-preserver/lp-tray/LPWatcher.h @ 6a2483b

9.2-releasereleng/10.0releng/10.0.1releng/10.0.2releng/10.0.3
Last change on this file since 6a2483b was 6a2483b, checked in by Ken Moore <ken@…>, 11 months ago

Remove the old life-preserver from the src-qt4/life-preserver dir, and replace it with src-qt4/life-preserver/lp-tray and src-qt4/life-preserver/lp-gui.

  • Property mode set to 100644
File size: 1.5 KB
Line 
1#ifndef _LP_WATCHER_H
2#define _LP_WATCHER_H
3
4#include <QCoreApplication>
5#include <QDir>
6#include <QObject>
7#include <QFileSystemWatcher>
8#include <QStringList>
9#include <QString>
10#include <QHash>
11#include <QTimer>
12#include <QFile>
13#include <QTextStream>
14#include <QDebug>
15#include <QProcess>
16
17class LPWatcher : public QObject{
18        Q_OBJECT
19public:
20        LPWatcher();
21        ~LPWatcher();
22
23        QStringList getMessages(QString type, QStringList msgList);
24        QStringList getAllCurrentMessages();
25        bool isRunning();
26        bool hasError();
27
28public slots:
29        void start();
30        void stop();
31        void refresh();
32
33private:
34        //Internal paths for the lpreserver output files
35        QString FILE_LOG, FILE_ERROR, FILE_REPLICATION;
36        //Internal message Logs
37        QHash<unsigned int,QString> LOGS;
38        //File system watcher
39        QFileSystemWatcher *watcher;
40        QTimer *timer;
41        int sysCheckTime;
42        QFile *logfile, *repfile;
43        QTextStream *LFSTREAM, *RFSTREAM;
44        //Replication size variables
45        QString repTotK, lastSize;
46
47        void readLogFile(bool quiet = false);
48        void readReplicationFile(); //always sends quiet signals
49
50        bool startRepFileWatcher();
51        void stopRepFileWatcher();
52
53        double displayToDoubleK(QString); // string->double conversion
54        bool isReplicationRunning(); //check for replication PID file
55       
56        QStringList listReplicatedPools();
57        QStringList getCmdOutput(QString cmd);
58       
59private slots:
60        void fileChanged(QString); //file system watcher saw a change
61        void checkPoolStatus(); //check for serious system errors
62
63signals:
64        void MessageAvailable(QString type);
65        void StatusUpdated();
66};
67
68#endif
Note: See TracBrowser for help on using the repository browser.