diff options
author | Yader Velásquez <yajosev@gmail.com> | 2012-03-01 22:55:58 (GMT) |
---|---|---|
committer | Yader Velásquez <yajosev@gmail.com> | 2012-03-01 22:55:58 (GMT) |
commit | 2520a133c4312d7435a2f645dd4c13c55ce0d255 (patch) | |
tree | d2eaa103c459e487fd2bacd8c61da3b2c759b8b0 | |
parent | 2c635453caef0750bd63b9f2091fba909fccae23 (diff) |
combobox model for query and filter button
-rw-r--r-- | calendario.py | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/calendario.py b/calendario.py index 89d7b89..84e9232 100644 --- a/calendario.py +++ b/calendario.py @@ -67,12 +67,27 @@ class CalendarioActivity(activity.Activity): self.query_box = gtk.VBox() self.label_q_priority = gtk.Label(_("Priority")) self.label_q_category = gtk.Label(_("Category")) + + comboBoxModel = ComboBoxModel() + cat_model = comboBoxModel.get_category_model() + pri_model = comboBoxModel.get_priority_model() + cell = gtk.CellRendererText() + self.combobox_q_priority = gtk.ComboBox() + self.combobox_q_priority.pack_start(cell, True) + self.combobox_q_priority.add_attribute(cell, 'text', 0) self.combobox_q_category = gtk.ComboBox() + self.combobox_q_category.pack_start(cell, True) + self.combobox_q_category.add_attribute(cell, 'text', 0) + self.combobox_q_category.set_model(cat_model) + self.combobox_q_priority.set_model(pri_model) + self.filter_button = gtk.Button(_('Filter')) + self.query_box.pack_start(self.label_q_priority, False) self.query_box.pack_start(self.combobox_q_priority, False) self.query_box.pack_start(self.label_q_category, False) self.query_box.pack_start(self.combobox_q_category, False) + self.query_box.pack_start(self.filter_button, True, True, 5) self.query_expander.add(self.query_box) self.tool_box.pack_start(self.reminder_expander, False) @@ -96,23 +111,16 @@ class CalendarioActivity(activity.Activity): #options self.options_expander = gtk.Expander(_("Options")) self.options_box = gtk.HBox() - - cell = gtk.CellRendererText() self.label_b_priority = gtk.Label(_("Priority")) self.combobox_priority = gtk.ComboBox() self.combobox_priority.pack_start(cell, True) self.combobox_priority.add_attribute(cell, 'text', 0) - self.label_b_category = gtk.Label(_("Category")) self.combobox_category = gtk.ComboBox() self.combobox_category.pack_start(cell, True) self.combobox_category.add_attribute(cell, 'text', 0) - - comboBoxModel = ComboBoxModel() - model = comboBoxModel.get_category_model() - self.combobox_category.set_model(model) - model = comboBoxModel.get_priority_model() - self.combobox_priority.set_model(model) + self.combobox_category.set_model(cat_model) + self.combobox_priority.set_model(pri_model) self.priority_box = gtk.VBox() self.priority_box.pack_start(self.label_b_priority) |