summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bitbake/lib/bb/ui/crumbs/hig.py37
1 files changed, 21 insertions, 16 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/hig.py b/bitbake/lib/bb/ui/crumbs/hig.py
index 2ef8e36bf9..dc7dce3e6b 100644
--- a/bitbake/lib/bb/ui/crumbs/hig.py
+++ b/bitbake/lib/bb/ui/crumbs/hig.py
@@ -159,7 +159,7 @@ class SettingsUIHelper():
159 159
160 delete_button = HobAltButton("Delete") 160 delete_button = HobAltButton("Delete")
161 delete_button.connect("clicked", self.delete_cb, index, entry) 161 delete_button.connect("clicked", self.delete_cb, index, entry)
162 if content == "": 162 if content == "" and index == 0 and len(self.sstatemirrors_list) == 1:
163 delete_button.set_sensitive(False) 163 delete_button.set_sensitive(False)
164 164
165 entry_match.connect("changed", self.insert_entry_match_cb, index) 165 entry_match.connect("changed", self.insert_entry_match_cb, index)
@@ -188,7 +188,7 @@ class SettingsUIHelper():
188 188
189 def insert_entry_cb(self, entry, index, button): 189 def insert_entry_cb(self, entry, index, button):
190 self.sstatemirrors_list[index][1] = entry.get_text() 190 self.sstatemirrors_list[index][1] = entry.get_text()
191 if entry.get_text() == "": 191 if entry.get_text() == "" and index == 0:
192 button.set_sensitive(False) 192 button.set_sensitive(False)
193 else: 193 else:
194 button.set_sensitive(True) 194 button.set_sensitive(True)
@@ -196,6 +196,7 @@ class SettingsUIHelper():
196 def on_combo_changed(self, combo, index): 196 def on_combo_changed(self, combo, index):
197 if combo.get_active_text() == "Standard": 197 if combo.get_active_text() == "Standard":
198 self.sstatemirrors_list[index][0] = 0 198 self.sstatemirrors_list[index][0] = 0
199 self.sstatemirrors_list[index][2] = "file://(.*)"
199 else: 200 else:
200 self.sstatemirrors_list[index][0] = 1 201 self.sstatemirrors_list[index][0] = 1
201 self.refresh_shared_state_page() 202 self.refresh_shared_state_page()
@@ -450,7 +451,7 @@ class SimpleSettingsDialog (CrumbsDialog, SettingsUIHelper):
450 self.configuration.sstatedir = self.sstatedir_text.get_text() 451 self.configuration.sstatedir = self.sstatedir_text.get_text()
451 self.configuration.sstatemirror = "" 452 self.configuration.sstatemirror = ""
452 for mirror in self.sstatemirrors_list: 453 for mirror in self.sstatemirrors_list:
453 if mirror[1] != "" or len(self.sstatemirrors_list)==1: 454 if mirror[1] != "":
454 if mirror[1].endswith("\\1"): 455 if mirror[1].endswith("\\1"):
455 smirror = mirror[2] + " " + mirror[1] + " \\n " 456 smirror = mirror[2] + " " + mirror[1] + " \\n "
456 else: 457 else:
@@ -548,20 +549,24 @@ class SimpleSettingsDialog (CrumbsDialog, SettingsUIHelper):
548 if self.sstatemirrors_changed == 0: 549 if self.sstatemirrors_changed == 0:
549 self.sstatemirrors_changed = 1 550 self.sstatemirrors_changed = 1
550 sstatemirrors = self.configuration.sstatemirror 551 sstatemirrors = self.configuration.sstatemirror
551 while sstatemirrors.find(searched_string) != -1: 552 if sstatemirrors == "":
552 if sstatemirrors.find(searched_string,1) != -1: 553 sm_list = [ 0, "", "file://(.*)"]
553 sstatemirror = sstatemirrors[:sstatemirrors.find(searched_string,1)]
554 sstatemirrors = sstatemirrors[sstatemirrors.find(searched_string,1):]
555 else:
556 sstatemirror = sstatemirrors
557 sstatemirrors = sstatemirrors[1:]
558
559 sstatemirror_fields = [x for x in sstatemirror.split(' ') if x.strip()]
560 if sstatemirror_fields[0] == "file://(.*)":
561 sm_list = [ 0, sstatemirror_fields[1], "file://(.*)"]
562 else:
563 sm_list = [ 1, sstatemirror_fields[1], sstatemirror_fields[0]]
564 self.sstatemirrors_list.append(sm_list) 554 self.sstatemirrors_list.append(sm_list)
555 else:
556 while sstatemirrors.find(searched_string) != -1:
557 if sstatemirrors.find(searched_string,1) != -1:
558 sstatemirror = sstatemirrors[:sstatemirrors.find(searched_string,1)]
559 sstatemirrors = sstatemirrors[sstatemirrors.find(searched_string,1):]
560 else:
561 sstatemirror = sstatemirrors
562 sstatemirrors = sstatemirrors[1:]
563
564 sstatemirror_fields = [x for x in sstatemirror.split(' ') if x.strip()]
565 if sstatemirror_fields[0] == "file://(.*)":
566 sm_list = [ 0, sstatemirror_fields[1], "file://(.*)"]
567 else:
568 sm_list = [ 1, sstatemirror_fields[1], sstatemirror_fields[0]]
569 self.sstatemirrors_list.append(sm_list)
565 570
566 index = 0 571 index = 0
567 for mirror in self.sstatemirrors_list: 572 for mirror in self.sstatemirrors_list: