00001 /* ============================================================ 00002 * This program is free software; you can redistribute it 00003 * and/or modify it under the terms of the GNU General 00004 * Public License as published bythe Free Software Foundation; 00005 * either version 2, or (at your option) 00006 * any later version. 00007 * 00008 * This program is distributed in the hope that it will be useful, 00009 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00011 * GNU General Public License for more details. 00012 * 00013 * ============================================================ */ 00014 00015 #ifndef ZMCONSOLE_H 00016 #define ZMCONSOLE_H 00017 00018 // qt 00019 #include <QKeyEvent> 00020 00021 // libmythui 00022 #include <mythuibuttonlist.h> 00023 #include <mythuibutton.h> 00024 #include <mythuicheckbox.h> 00025 #include <mythscreentype.h> 00026 #include <mythdialogbox.h> 00027 00028 // zm 00029 #include "zmdefines.h" 00030 00031 class FunctionDialog : public MythScreenType 00032 { 00033 Q_OBJECT 00034 00035 public: 00036 FunctionDialog(MythScreenStack *parent, Monitor *monitor); 00037 00038 bool Create(); 00039 00040 signals: 00041 void haveResult(bool); 00042 00043 private slots: 00044 void setMonitorFunction(void); 00045 00046 private: 00047 Monitor *m_monitor; 00048 MythUIText *m_captionText; 00049 MythUIButtonList *m_functionList; 00050 MythUICheckBox *m_enabledCheck; 00051 MythUIButton *m_okButton; 00052 }; 00053 00054 class ZMConsole : public MythScreenType 00055 { 00056 Q_OBJECT 00057 00058 public: 00059 ZMConsole(MythScreenStack *parent); 00060 ~ZMConsole(); 00061 00062 bool Create(void); 00063 bool keyPressEvent(QKeyEvent *); 00064 00065 private slots: 00066 void updateTime(); 00067 void updateStatus(); 00068 void getDaemonStatus(); 00069 void getMonitorStatus(void); 00070 void showEditFunctionPopup(); 00071 void functionChanged(bool changed); 00072 00073 private: 00074 void updateMonitorList(); 00075 void setMonitorFunction(const QString &function, int enabled); 00076 00077 int m_currentMonitor; 00078 int m_monitorListSize; 00079 std::vector<Monitor *> *m_monitorList; 00080 00081 MythUIButtonList *m_monitor_list; 00082 MythUIText *m_running_text; 00083 MythUIText *m_status_text; 00084 MythUIText *m_time_text; 00085 MythUIText *m_date_text; 00086 MythUIText *m_load_text; 00087 MythUIText *m_disk_text; 00088 00089 FunctionDialog *m_functionDialog; 00090 MythScreenStack *m_popupStack; 00091 00092 QTimer *m_timeTimer; 00093 QString m_timeFormat; 00094 00095 QString m_daemonStatus; 00096 QString m_cpuStat; 00097 QString m_diskStat; 00098 00099 QTimer *m_updateTimer; 00100 }; 00101 00102 #endif
1.6.3