diff options
author | Tim Moore <timoore@redhat.com> | 2009-12-10 15:11:08 +0100 |
---|---|---|
committer | Tim Moore <timoore@redhat.com> | 2009-12-10 15:11:08 +0100 |
commit | b35632fd3d2547414c80023c5c60c847e3dc92ea (patch) | |
tree | 3f5e42adb8d38196422edfba163186f380ea8f5f /grapher/grapher.cxx | |
parent | f8e5918969fb63a6148c906025e4ec1f010ca6c6 (diff) | |
download | systemtap-steved-b35632fd3d2547414c80023c5c60c847e3dc92ea.tar.gz systemtap-steved-b35632fd3d2547414c80023c5c60c847e3dc92ea.tar.xz systemtap-steved-b35632fd3d2547414c80023c5c60c847e3dc92ea.zip |
grapher: more implementation stap process window
The process arguments are displayed, and the "kill" button is
insensitive when a process is dead or nothing is selected.
* grapher/grapher.cxx (ProcWindow _killButton, _restartButton,
_stapArgsLabel, _scriptArgsLabel): new members
(ProcWindow::ProcWindow): hook 'em up
(ProcWindow::onSelectionChanged): Enable / disable kill button and
display process arguments.
* grapher/processwindow.glade: Replace bizzare handle window with a
horizontal pane. Tweak various widget sizes.
Diffstat (limited to 'grapher/grapher.cxx')
-rw-r--r-- | grapher/grapher.cxx | 38 |
1 files changed, 34 insertions, 4 deletions
diff --git a/grapher/grapher.cxx b/grapher/grapher.cxx index 8e7a4dba..e3d5289a 100644 --- a/grapher/grapher.cxx +++ b/grapher/grapher.cxx @@ -335,6 +335,10 @@ public: Glib::RefPtr<Gnome::Glade::Xml> _xml; Gtk::Window* _window; Gtk::TreeView* _dataTreeView; + Gtk::Button* _killButton; + Gtk::Button* _restartButton; + Gtk::Label* _stapArgsLabel; + Gtk::Label* _scriptArgsLabel; Glib::RefPtr<Gtk::ListStore> _listStore; Glib::RefPtr<Gtk::TreeSelection> _listSelection; void onClose(); @@ -376,15 +380,19 @@ ProcWindow::ProcWindow() _xml->get_widget("button5", button); button->signal_clicked().connect(sigc::mem_fun(*this, &ProcWindow::onClose), false); - _xml->get_widget("button1", button); - button->signal_clicked().connect(sigc::mem_fun(*this, &ProcWindow::onKill), - false); + _xml->get_widget("button1", _killButton); + _killButton->signal_clicked() + .connect(sigc::mem_fun(*this, &ProcWindow::onKill), false); + _killButton->set_sensitive(false); + _xml->get_widget("button2", _restartButton); + _restartButton->set_sensitive(false); parserListChangedSignal() .connect(sigc::mem_fun(*this, &ProcWindow::onParserListChanged)); _listSelection = _dataTreeView->get_selection(); _listSelection->signal_changed() .connect(sigc::mem_fun(*this, &ProcWindow::onSelectionChanged)); - + _xml->get_widget("label7", _stapArgsLabel); + _xml->get_widget("label8", _scriptArgsLabel); } void ProcWindow::onClose() @@ -436,6 +444,28 @@ void ProcWindow::onParserListChanged() void ProcWindow::onSelectionChanged() { + Gtk::TreeModel::iterator itr = _listSelection->get_selected(); + shared_ptr<StapProcess> proc; + if (itr) + { + Gtk::TreeModel::Row row = *itr; + proc = row[_modelColumns._proc]; + } + if (proc) + { + if (proc->pid >= 0) + _killButton->set_sensitive(true); + else + _killButton->set_sensitive(false); + _stapArgsLabel->set_text(proc->stapArgs); + _scriptArgsLabel->set_text(proc->scriptArgs); + } + else + { + _killButton->set_sensitive(false); + _stapArgsLabel->set_text(""); + _scriptArgsLabel->set_text(""); + } } void ProcWindow::onKill() |