Convert KConfig related code to KDE4.
[kdbg.git] / kdbg / procattach.h
blob8baa56d26fd7b50de8f5f93fb7c47e32e4e23071
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 "ui_procattachbase.h"
11 #include <q3valuevector.h>
12 #include <qdialog.h>
13 #include <qlabel.h>
14 #include <qlineedit.h>
15 #include <qpushbutton.h>
16 #include <qlayout.h>
17 #include <Q3VBoxLayout>
18 #include <Q3CString>
19 #include <Q3HBoxLayout>
22 class K3Process;
25 * This is the full-featured version of the dialog. It is used when the
26 * system features a suitable ps command.
29 class ProcAttachPS : public ProcAttachBase
31 Q_OBJECT
32 public:
33 ProcAttachPS(QWidget* parent);
34 ~ProcAttachPS();
36 QString text() const;
38 protected:
39 void runPS();
40 virtual void refresh();
41 virtual void filterEdited(const QString& text);
42 virtual void selectedChanged();
44 protected slots:
45 void slotTextReceived(K3Process* proc, char* buffer, int buflen);
46 void slotPSDone();
48 protected:
49 void pushLine();
50 bool setVisibility(Q3ListViewItem* i, const QString& text);
52 K3Process* m_ps;
53 // parse state
54 int m_pidCol; //!< The PID column in the ps output
55 int m_ppidCol; //!< The parent-PID column in the ps output
56 Q3CString m_token;
57 Q3ValueVector<QString> m_line;
62 * This is an extremely stripped down version of the dialog. It is used
63 * when there is no suitable ps command.
66 class ProcAttach : public QDialog
68 public:
69 ProcAttach(QWidget* parent);
70 virtual ~ProcAttach();
72 void setText(const QString& text) { m_processId.setText(text); }
73 QString text() const { return m_processId.text(); }
75 protected:
76 QLabel m_label;
77 QLineEdit m_processId;
78 QPushButton m_buttonOK;
79 QPushButton m_buttonCancel;
80 Q3VBoxLayout m_layout;
81 Q3HBoxLayout m_buttons;
84 #endif // ProcAttach_included