diff options
Diffstat (limited to 'bitbake/lib/bb/ui/crumbs/hig/settingsuihelper.py')
-rw-r--r-- | bitbake/lib/bb/ui/crumbs/hig/settingsuihelper.py | 94 |
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() | ||