summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/ui/crumbs/hig/settingsuihelper.py
diff options
context:
space:
mode:
authorCristiana Voicu <cristiana.voicu@intel.com>2013-01-28 15:33:39 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-01-31 12:46:20 +0000
commitb2ab771447d8d66c1ec43b7d509c1dcfa2e6cec2 (patch)
tree3196eb4b6f71d6ca07e280456e95f7ae93a72006 /bitbake/lib/bb/ui/crumbs/hig/settingsuihelper.py
parent785e1ba01260165b81cbf69d898830fb2bc4d4a6 (diff)
downloadpoky-b2ab771447d8d66c1ec43b7d509c1dcfa2e6cec2.tar.gz
bitbake: hob: Use a GtkTreeView to present and configure the sstate mirrors
After some discussions about the design of the Shared State Settings tab in Hob, we have decided that using a GtkTreeView to present and configure the sstate mirrors is probably the best solution. [YOCTO #3569] (Bitbake rev: 2ff636910b9cf3099e8d961f4bbe71512c015ecc) Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/ui/crumbs/hig/settingsuihelper.py')
-rw-r--r--bitbake/lib/bb/ui/crumbs/hig/settingsuihelper.py94
1 files changed, 0 insertions, 94 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/hig/settingsuihelper.py b/bitbake/lib/bb/ui/crumbs/hig/settingsuihelper.py
index e10dd064ab..e0285c93ce 100644
--- a/bitbake/lib/bb/ui/crumbs/hig/settingsuihelper.py
+++ b/bitbake/lib/bb/ui/crumbs/hig/settingsuihelper.py
@@ -120,97 +120,3 @@ class SettingsUIHelper():
120 120
121 hbox.show_all() 121 hbox.show_all()
122 return hbox, entry 122 return hbox, entry
123
124 def gen_mirror_entry_widget(self, content, index, match_content=""):
125 hbox = gtk.HBox(False)
126 entry = gtk.Entry()
127 content = content[:-2]
128 entry.set_text(content)
129 entry.set_size_request(350,30)
130
131 entry_match = gtk.Entry()
132 entry_match.set_text(match_content)
133 entry_match.set_size_request(100,30)
134
135 table = gtk.Table(2, 5, False)
136 table.set_row_spacings(12)
137 table.set_col_spacings(6)
138 hbox.pack_start(table, expand=True, fill=True)
139
140 label_configuration = gtk.Label("Configuration")
141 label_configuration.set_alignment(0.0,0.5)
142 label_mirror_url = gtk.Label("Mirror URL")
143 label_mirror_url.set_alignment(0.0,0.5)
144 label_match = gtk.Label("Match")
145 label_match.set_alignment(0.0,0.5)
146 label_replace_with = gtk.Label("Replace with")
147 label_replace_with.set_alignment(0.0,0.5)
148
149 combo = gtk.combo_box_new_text()
150 combo.append_text("Standard")
151 combo.append_text("Custom")
152 if match_content == "":
153 combo.set_active(0)
154 else:
155 combo.set_active(1)
156 combo.connect("changed", self.on_combo_changed, index)
157 combo.set_size_request(100,30)
158
159 delete_button = HobAltButton("Delete")
160 delete_button.connect("clicked", self.delete_cb, index, entry)
161 if content == "" and index == 0 and len(self.sstatemirrors_list) == 1:
162 delete_button.set_sensitive(False)
163 delete_button.set_size_request(100, 30)
164
165 entry_match.connect("changed", self.insert_entry_match_cb, index)
166 entry.connect("changed", self.insert_entry_cb, index, delete_button)
167
168 if match_content == "":
169 table.attach(label_configuration, 1, 2, 0, 1, xoptions=gtk.SHRINK|gtk.FILL)
170 table.attach(label_mirror_url, 2, 3, 0, 1, xoptions=gtk.SHRINK|gtk.FILL)
171 table.attach(combo, 1, 2, 1, 2, xoptions=gtk.SHRINK)
172 table.attach(entry, 2, 3, 1, 2, xoptions=gtk.SHRINK)
173 table.attach(delete_button, 3, 4, 1, 2, xoptions=gtk.SHRINK)
174 else:
175 table.attach(label_configuration, 1, 2, 0, 1, xoptions=gtk.SHRINK|gtk.FILL)
176 table.attach(label_match, 2, 3, 0, 1, xoptions=gtk.SHRINK|gtk.FILL)
177 table.attach(label_replace_with, 3, 4, 0, 1, xoptions=gtk.SHRINK|gtk.FILL)
178 table.attach(combo, 1, 2, 1, 2, xoptions=gtk.SHRINK)
179 table.attach(entry_match, 2, 3, 1, 2, xoptions=gtk.SHRINK)
180 table.attach(entry, 3, 4, 1, 2, xoptions=gtk.SHRINK)
181 table.attach(delete_button, 4, 5, 1, 2, xoptions=gtk.SHRINK)
182
183 hbox.show_all()
184 return hbox
185
186 def insert_entry_match_cb(self, entry_match, index):
187 self.sstatemirrors_list[index][2] = entry_match.get_text()
188
189 def insert_entry_cb(self, entry, index, button):
190 self.sstatemirrors_list[index][1] = entry.get_text()
191 if entry.get_text() == "" and index == 0:
192 button.set_sensitive(False)
193 else:
194 button.set_sensitive(True)
195
196 def on_combo_changed(self, combo, index):
197 if combo.get_active_text() == "Standard":
198 self.sstatemirrors_list[index][0] = 0
199 self.sstatemirrors_list[index][2] = "file://(.*)"
200 else:
201 self.sstatemirrors_list[index][0] = 1
202 self.refresh_shared_state_page()
203
204 def delete_cb(self, button, index, entry):
205 if index == 0 and len(self.sstatemirrors_list)==1:
206 entry.set_text("")
207 else:
208 self.sstatemirrors_list.pop(index)
209 self.refresh_shared_state_page()
210
211 def add_mirror(self, button):
212 tooltip = "Select the pre-built mirror that will speed your build"
213 index = len(self.sstatemirrors_list)
214 sm_list = [0, "", "file://(.*)"]
215 self.sstatemirrors_list.append(sm_list)
216 self.refresh_shared_state_page()