00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef _ProcessController_h_
00025 #define _ProcessController_h_
00026
00027 #include <tqdict.h>
00028 #include <tqwidget.h>
00029
00030 #include <kapplication.h>
00031
00032 #include <SensorDisplay.h>
00033
00034 #include "ProcessList.h"
00035
00036 class TQVBoxLayout;
00037 class TQHBoxLayout;
00038 class TQCheckBox;
00039 class TQComboBox;
00040 class KPushButton;
00041 class KListViewSearchLineWidget;
00042
00043 extern KApplication* Kapp;
00044
00052 class ProcessController : public KSGRD::SensorDisplay
00053 {
00054 Q_OBJECT
00055
00056 public:
00057 ProcessController(TQWidget* parent = 0, const char* name = 0, const TQString &title = TQString::null, bool nf = false);
00058 virtual ~ProcessController() { }
00059
00060 void resizeEvent(TQResizeEvent*);
00061
00062 bool restoreSettings(TQDomElement& element);
00063
00064 bool saveSettings(TQDomDocument& doc, TQDomElement& element, bool save = true);
00065
00066 void refreshList(void)
00067 {
00068 updateList();
00069 }
00070
00071 virtual void timerEvent(TQTimerEvent*)
00072 {
00073 updateList();
00074 }
00075
00076 virtual bool addSensor(const TQString&, const TQString&, const TQString&, const TQString&);
00077
00078 virtual void answerReceived(int id, const TQString& answer);
00079
00080 virtual void sensorError(int, bool err);
00081
00082 void configureSettings() { }
00083
00084 virtual bool hasSettingsDialog() const
00085 {
00086 return (false);
00087 }
00088
00089 public slots:
00090 void setSearchFocus();
00091 void fixTabOrder();
00092 void filterModeChanged(int filter)
00093 {
00094 pList->setFilterMode(filter);
00095 updateList();
00096 setModified(true);
00097 }
00098
00099 void setTreeView(bool tv)
00100 {
00101 pList->setTreeView(tv);
00102 updateList();
00103 setModified(true);
00104 }
00105
00106 virtual void setModified(bool mfd)
00107 {
00108 if (mfd != modified())
00109 {
00110 SensorDisplay::setModified( mfd );
00111 if (!mfd)
00112 pList->setModified(0);
00113 emit modified(modified());
00114 }
00115 }
00116
00117 void killProcess();
00118 void killProcess(int pid, int sig);
00119
00120 void reniceProcess(const TQValueList<int> &pids, int niceValue);
00121
00122 void updateList();
00123
00124 signals:
00125 void setFilterMode(int);
00126
00127 private:
00128 TQVBoxLayout* gm;
00129
00130 bool killSupported;
00131
00133 ProcessList* pList;
00135 TQHBoxLayout* gmSearch;
00136 KListViewSearchLineWidget *pListSearchLine;
00137
00138 TQHBoxLayout* gm1;
00139
00141 TQCheckBox* xbTreeView;
00142
00144 TQComboBox* cbFilter;
00145
00147 KPushButton* bRefresh;
00148 KPushButton* bKill;
00149
00151 TQDict<TQString> dict;
00152 };
00153
00154 #endif