[pitivi] Order preset alphabetically in the list store
- From: Thibault Saunier <tsaunier src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] Order preset alphabetically in the list store
- Date: Fri, 15 Dec 2017 18:17:02 +0000 (UTC)
commit 4a5844f578bc0b862062d844a9465d845564b531
Author: Thibault Saunier <tsaunier gnome org>
Date: Tue Oct 31 12:44:59 2017 -0300
Order preset alphabetically in the list store
Reviewed-by: Alex Băluț <<alexandru balut gmail com>>
Differential Revision: https://phabricator.freedesktop.org/D1872
pitivi/preset.py | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/pitivi/preset.py b/pitivi/preset.py
index ede73d0..8800a95 100644
--- a/pitivi/preset.py
+++ b/pitivi/preset.py
@@ -67,6 +67,17 @@ class PresetManager(GObject.Object, Loggable):
self.presets = {}
self.widget_map = {}
self.ordered = Gtk.ListStore(str, object)
+
+ def sortme(store, i1, i2, unused_udata):
+ name1 = store[i1][0]
+ name2 = store[i2][0]
+ if name1 > name2:
+ return 1
+
+ return -1
+
+ self.ordered.set_sort_func(0, sortme)
+ self.ordered.set_sort_column_id(0, Gtk.SortType.DESCENDING)
self.cur_preset = None
# Whether to ignore the updateValue calls.
self.ignore_update_requests = False
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]