Merge branch 'maint'
[kdbg.git] / kdbg / procattach.h
blob6ee1e423e163b6e3213b9b6473f51870264a822d
1 /*
2 * Copyright Johannes Sixt
3 * This file is licensed under the GNU General Public License Version 2.
4 * See the file COPYING in the toplevel directory of the source directory.
5 */
7 #ifndef ProcAttach_included
8 #define ProcAttach_included
10 #include "procattachbase.h"
11 #include <qvaluevector.h>
12 #include <qdialog.h>
13 #include <qlabel.h>
14 #include <qlineedit.h>
15 #include <qpushbutton.h>
16 #include <qlayout.h>
19 class KProcess;
22 * This is the full-featured version of the dialog. It is used when the
23 * system features a suitable ps command.
26 class ProcAttachPS : public ProcAttachBase
28 Q_OBJECT
29 public:
30 ProcAttachPS(QWidget* parent);
31 ~ProcAttachPS();
33 QString text() const;
35 protected:
36 void runPS();
37 virtual void refresh();
38 virtual void filterEdited(const QString& text);
39 virtual void selectedChanged();
41 protected slots:
42 void slotTextReceived(KProcess* proc, char* buffer, int buflen);
43 void slotPSDone();
45 protected:
46 void pushLine();
47 bool setVisibility(QListViewItem* i, const QString& text);
49 KProcess* m_ps;
50 // parse state
51 int m_pidCol; //!< The PID column in the ps output
52 int m_ppidCol; //!< The parent-PID column in the ps output
53 QCString m_token;
54 QValueVector<QString> m_line;
59 * This is an extremely stripped down version of the dialog. It is used
60 * when there is no suitable ps command.
63 class ProcAttach : public QDialog
65 public:
66 ProcAttach(QWidget* parent);
67 virtual ~ProcAttach();
69 void setText(const QString& text) { m_processId.setText(text); }
70 QString text() const { return m_processId.text(); }
72 protected:
73 QLabel m_label;
74 QLineEdit m_processId;
75 QPushButton m_buttonOK;
76 QPushButton m_buttonCancel;
77 QVBoxLayout m_layout;
78 QHBoxLayout m_buttons;
81 #endif // ProcAttach_included