Don't start with a tiny window when started for the first time.
[kdbg.git] / kdbg / procattach.h
blob9d6b4b199a25ead0821ce99e65631dd2234271fe
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 { return pidEdit->text(); }
34 protected:
35 void runPS();
36 virtual void processSelected(QListViewItem*);
37 virtual void refresh();
38 virtual void pidEdited(const QString& text);
40 protected slots:
41 void slotTextReceived(KProcess* proc, char* buffer, int buflen);
43 protected:
44 void pushLine();
46 KProcess* m_ps;
47 // parse state
48 int m_pidCol; //!< The PID column in the ps output
49 int m_ppidCol; //!< The parent-PID column in the ps output
50 QCString m_token;
51 QValueVector<QString> m_line;
56 * This is an extremely stripped down version of the dialog. It is used
57 * when there is no suitable ps command.
60 class ProcAttach : public QDialog
62 public:
63 ProcAttach(QWidget* parent);
64 virtual ~ProcAttach();
66 void setText(const char* text) { m_processId.setText(text); }
67 const char* text() const { return m_processId.text(); }
69 protected:
70 QLabel m_label;
71 QLineEdit m_processId;
72 QPushButton m_buttonOK;
73 QPushButton m_buttonCancel;
74 QVBoxLayout m_layout;
75 QHBoxLayout m_buttons;
78 #endif // ProcAttach_included