[jhbuild: 19/60] [gui] start with config.modules added to module combobox
- From: Frederic Peters <fpeters src gnome org>
- To: svn-commits-list gnome org
- Subject: [jhbuild: 19/60] [gui] start with config.modules added to module combobox
- Date: Sat, 6 Jun 2009 09:49:12 -0400 (EDT)
commit 9af95aa42521959055f8caa75cde3978727e9271
Author: Frédéric Péters <fpeters 0d be>
Date: Sun May 17 00:38:18 2009 +0200
[gui] start with config.modules added to module combobox
---
jhbuild/frontends/gtkui.py | 39 ++++++++++++++++++++++-----------------
1 files changed, 22 insertions(+), 17 deletions(-)
diff --git a/jhbuild/frontends/gtkui.py b/jhbuild/frontends/gtkui.py
index a4bd19b..04d508b 100644
--- a/jhbuild/frontends/gtkui.py
+++ b/jhbuild/frontends/gtkui.py
@@ -91,11 +91,30 @@ class AppWindow(gtk.Window, buildscript.BuildScript):
# skip the deprecation meta modules, nobody want them
continue
iter = self.modules_list_model.append((module.name, False))
- if module.name == self.config.modules[0]:
- self.default_module_iter = iter
self.modules_list_model.append(('', True))
self.modules_list_model.append((_('Others...'), False))
+ for module in self.config.modules:
+ iter = self.add_extra_module_to_model(module)
+ if not self.default_module_iter:
+ self.default_module_iter = iter
+
+ def add_extra_module_to_model(self, module):
+ # lookup selected module in current modules list
+ for row in self.modules_list_model:
+ row_value = self.modules_list_model.get(row.iter, 0)[0]
+ if row_value == module:
+ return row.iter
+
+ # add selected module in the list
+ if self.modules_list_model.get(self.modules_list_model[-3].iter, 1)[0] is False:
+ # there is no user-added modules at the moment, add a separator row
+ self.modules_list_model.insert_before(
+ self.modules_list_model[-2].iter, ('', True))
+ iter = self.modules_list_model.insert_before(
+ self.modules_list_model[-2].iter, (module, False))
+ return iter
+
def on_delete_event(self, *args):
gtk.main_quit()
if self.child_pid:
@@ -181,23 +200,9 @@ class AppWindow(gtk.Window, buildscript.BuildScript):
selected_module = dlg.selected_module
dlg.destroy()
- # lookup selected module in current modules list
- for row in self.modules_list_model:
- row_value = self.modules_list_model.get(row.iter, 0)[0]
- if row_value == selected_module:
- self.module_combo.set_active_iter(row.iter)
- return
-
- # add selected module in the list
- if self.modules_list_model.get(self.modules_list_model[-3].iter, 1)[0] is False:
- # there is no user-added modules at the moment, add a separator row
- self.modules_list_model.insert_before(
- self.modules_list_model[-2].iter, ('', True))
- iter = self.modules_list_model.insert_before(
- self.modules_list_model[-2].iter, (selected_module, False))
+ iter = self.add_extra_module_to_model(selected_module)
self.module_combo.set_active_iter(iter)
-
def is_build_paused(self):
return False
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]