Merge improved dialogs.
[kdbg.git] / kdbg / procattach.h
blobe6997626dde349f31e1d533b6b9644bee306c36a
1 // $Id$
3 // Copyright by Johannes Sixt
4 // This file is under GPL, the GNU General Public Licence
6 #ifndef ProcAttach_included
7 #define ProcAttach_included
9 #include "procattachbase.h"
10 #include <qvaluevector.h>
11 #include <qdialog.h>
12 #include <qlabel.h>
13 #include <qlineedit.h>
14 #include <qpushbutton.h>
15 #include <qlayout.h>
18 class KProcess;
21 * This is the full-featured version of the dialog. It is used when the
22 * system features a suitable ps command.
25 class ProcAttachPS : public ProcAttachBase
27 Q_OBJECT
28 public:
29 ProcAttachPS(QWidget* parent);
30 ~ProcAttachPS();
32 QString text() const;
34 protected:
35 void runPS();
36 virtual void refresh();
37 virtual void filterEdited(const QString& text);
38 virtual void selectedChanged();
40 protected slots:
41 void slotTextReceived(KProcess* proc, char* buffer, int buflen);
42 void slotPSDone();
44 protected:
45 void pushLine();
46 bool setVisibility(QListViewItem* i, const QString& text);
48 KProcess* m_ps;
49 // parse state
50 int m_pidCol; //!< The PID column in the ps output
51 int m_ppidCol; //!< The parent-PID column in the ps output
52 QCString m_token;
53 QValueVector<QString> m_line;
58 * This is an extremely stripped down version of the dialog. It is used
59 * when there is no suitable ps command.
62 class ProcAttach : public QDialog
64 public:
65 ProcAttach(QWidget* parent);
66 virtual ~ProcAttach();
68 void setText(const char* text) { m_processId.setText(text); }
69 const char* text() const { return m_processId.text(); }
71 protected:
72 QLabel m_label;
73 QLineEdit m_processId;
74 QPushButton m_buttonOK;
75 QPushButton m_buttonCancel;
76 QVBoxLayout m_layout;
77 QHBoxLayout m_buttons;
80 #endif // ProcAttach_included