diff options
author | Chris Lumens <clumens@redhat.com> | 2008-09-16 16:50:02 -0400 |
---|---|---|
committer | Chris Lumens <clumens@redhat.com> | 2008-09-29 10:06:46 -0400 |
commit | 51a45ee6304376f9275f2c3b1220a6eb9d4f4afc (patch) | |
tree | e3ce54a8638e93ec81979f814b14d8acb029eff0 | |
parent | 539b92cce8f5a5c58908813182c2293b466cae4d (diff) | |
download | anaconda-51a45ee6304376f9275f2c3b1220a6eb9d4f4afc.tar.gz anaconda-51a45ee6304376f9275f2c3b1220a6eb9d4f4afc.tar.xz anaconda-51a45ee6304376f9275f2c3b1220a6eb9d4f4afc.zip |
Sort Installation Repo to the top of the repo list.
-rw-r--r-- | iw/task_gui.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/iw/task_gui.py b/iw/task_gui.py index 6b982f306..9a234eae2 100644 --- a/iw/task_gui.py +++ b/iw/task_gui.py @@ -561,11 +561,23 @@ class TaskWindow(InstallWindow): return tl + def __sortRepos(self, store, aIter, bIter): + aStr = store.get_value(aIter, 1) + bStr = store.get_value(bIter, 1) + + if aStr == "Installation Repo" or aStr < bStr: + return -1 + elif bStr == "Installation Repo" or bStr > aStr: + return 1 + elif aStr == bStr: + return 0 + def _createRepoStore(self): store = gtk.ListStore(gobject.TYPE_BOOLEAN, gobject.TYPE_STRING, gobject.TYPE_PYOBJECT) store.set_sort_column_id(1, gtk.SORT_ASCENDING) + store.set_sort_func(1, self.__sortRepos) tl = self.xml.get_widget("repoList") tl.set_model(store) |