[d-feet/pygi] Order bus name list
- From: Thomas Bechtold <toabctl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [d-feet/pygi] Order bus name list
- Date: Mon, 15 Oct 2012 15:46:11 +0000 (UTC)
commit 872b9296ef8013f2033af07f62116e788e5e828a
Author: Thomas Bechtold <thomasbechtold jpberlin de>
Date: Tue Oct 9 17:29:35 2012 +0200
Order bus name list
dfeet/bus_watch.py | 5 ++++-
ui/buswatch.ui | 11 +++++++----
2 files changed, 11 insertions(+), 5 deletions(-)
---
diff --git a/dfeet/bus_watch.py b/dfeet/bus_watch.py
index 93438b7..6b90706 100644
--- a/dfeet/bus_watch.py
+++ b/dfeet/bus_watch.py
@@ -56,6 +56,8 @@ class BusWatch:
self.liststore_model = ui.get_widget('liststore_buswatch')
self.treemodelfilter_buswatch = ui.get_widget('treemodelfilter_buswatch')
self.treemodelfilter_buswatch.set_visible_func(self.__treemodelfilter_buswatch_cb)
+ self.treemodelsort_buswatch = ui.get_widget("treemodelsort_buswatch")
+ self.treemodelsort_buswatch.set_sort_column_id(2, Gtk.SortType.DESCENDING)
self.treeview = ui.get_widget('treeview_buswatch')
self.entry_filter = ui.get_widget('entry_filter')
self.grid_bus_name_selected_info = ui.get_widget('grid_bus_name_info')
@@ -63,7 +65,7 @@ class BusWatch:
self.label_bus_name_selected_pid = ui.get_widget('label_bus_name_selected_pid')
self.label_bus_name_selected_cmdline = ui.get_widget('label_bus_name_selected_cmdline')
self.addr_info = None # hold the currently selected AddressInfo object
-
+
self.treeview.connect('cursor-changed',
self.__tree_view_cursor_changed_cb)
self.entry_filter.connect("changed",
@@ -94,6 +96,7 @@ class BusWatch:
result_handler=self.__list_names_handler,
error_handler=self.__list_names_error_handler)
+
def __treemodelfilter_buswatch_cb(self, model, iter, user_data):
#return model.get_value(iter, 1) in data
bus_name_obj = model.get(iter, 0)[0]
diff --git a/ui/buswatch.ui b/ui/buswatch.ui
index 31acc02..e6ca158 100644
--- a/ui/buswatch.ui
+++ b/ui/buswatch.ui
@@ -17,9 +17,6 @@
<column type="gchararray"/>
</columns>
</object>
- <object class="GtkTreeModelFilter" id="treemodelfilter_buswatch">
- <property name="child_model">liststore_buswatch</property>
- </object>
<object class="GtkPaned" id="paned_buswatch">
<property name="visible">True</property>
<property name="can_focus">True</property>
@@ -77,7 +74,7 @@
<property name="has_tooltip">True</property>
<property name="halign">start</property>
<property name="valign">start</property>
- <property name="model">treemodelfilter_buswatch</property>
+ <property name="model">treemodelsort_buswatch</property>
<property name="search_column">2</property>
<property name="tooltip_column">2</property>
<child internal-child="selection">
@@ -215,4 +212,10 @@
</packing>
</child>
</object>
+ <object class="GtkTreeModelFilter" id="treemodelfilter_buswatch">
+ <property name="child_model">liststore_buswatch</property>
+ </object>
+ <object class="GtkTreeModelSort" id="treemodelsort_buswatch">
+ <property name="model">treemodelfilter_buswatch</property>
+ </object>
</interface>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]