[nemiver: 6/6] Sort columns of process selection dialog displays
- From: Jonathon Jongsma <jjongsma src gnome org>
- To: svn-commits-list gnome org
- Subject: [nemiver: 6/6] Sort columns of process selection dialog displays
- Date: Mon, 9 Mar 2009 23:09:57 -0400 (EDT)
commit 39308efb8bf2c2101ec0be4540099da321361d9c
Author: Jonathon Jongsma <jonathon jongsma collabora co uk>
Date: Sat Mar 7 22:53:11 2009 -0600
Sort columns of process selection dialog displays warning (Closes: #534700)
* src/persp/dbgperspective/nmv-proc-list-dialog.cc: This seems rather hacky,
but I believe it's the 'proper' way to do it in GTK+: wrap the base
ListStore in a TreeModelFilter (which provides filtering capability but
removes sorting capability), and then wrap the TreeModelFilter in a
TreeModelSort, which adds sorting capability back...
---
src/persp/dbgperspective/nmv-proc-list-dialog.cc | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/persp/dbgperspective/nmv-proc-list-dialog.cc b/src/persp/dbgperspective/nmv-proc-list-dialog.cc
index 199ea7e..e4ff119 100644
--- a/src/persp/dbgperspective/nmv-proc-list-dialog.cc
+++ b/src/persp/dbgperspective/nmv-proc-list-dialog.cc
@@ -74,6 +74,7 @@ public:
Gtk::Entry *entry_filter;
Glib::RefPtr<Gtk::ListStore> proclist_store;
Glib::RefPtr<Gtk::TreeModelFilter> filter_store;
+ Glib::RefPtr<Gtk::TreeModelSort> sort_store;
IProcMgr::Process selected_process;
bool process_selected;
@@ -106,7 +107,8 @@ public:
filter_store = Gtk::TreeModelFilter::create (proclist_store);
filter_store->set_visible_func(sigc::mem_fun(*this,
&Priv::is_row_visible));
- proclist_view->set_model (filter_store);
+ sort_store = Gtk::TreeModelSort::create (filter_store);
+ proclist_view->set_model (sort_store);
proclist_view->set_search_column (ProcListCols::PROC_ARGS);
proclist_view->set_enable_search (true);
@@ -182,8 +184,8 @@ public:
if (!paths.empty ()) {
Gtk::TreeModel::const_iterator row_it =
- filter_store->get_iter (paths[0]);
- if (row_it != filter_store->children ().end ()
+ sort_store->get_iter (paths[0]);
+ if (row_it != sort_store->children ().end ()
&& is_row_visible(row_it)) {
selected_process = (*row_it)[columns ().process];
process_selected = true;
@@ -208,7 +210,7 @@ public:
THROW_IF_FAIL (okbutton);
- Gtk::TreeModel::iterator row_it = filter_store->get_iter (a_path);
+ Gtk::TreeModel::iterator row_it = sort_store->get_iter (a_path);
if (!row_it) {return;}
selected_process = (*row_it)[columns ().process];
process_selected = true;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]