summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/ui/crumbs/hig.py
diff options
context:
space:
mode:
authorDongxiao Xu <dongxiao.xu@intel.com>2012-03-19 11:08:45 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-03-22 14:40:39 +0000
commit8683fa2d6302f37c12730ba872da778873939037 (patch)
treebef0cd55b63739f649be326b8de75d745d3bbffc /bitbake/lib/bb/ui/crumbs/hig.py
parente9a9422ec38a096ab64dd0b15382c1a40b7a1fc9 (diff)
downloadpoky-8683fa2d6302f37c12730ba872da778873939037.tar.gz
Hob: Remove split model in GTK Hob
Since the GTK Hob will not use the server/client split model, thus remove it from current Hob code. But we still keep the core mechanism in bitbake server. (From Poky rev: 983ea0265a53e0725dcbf9085ea767ebbc155ae5) (Bitbake rev: 8c129e05a94d457860d883c9b2934a5559de8d9b) Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/ui/crumbs/hig.py')
-rw-r--r--bitbake/lib/bb/ui/crumbs/hig.py103
1 files changed, 35 insertions, 68 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/hig.py b/bitbake/lib/bb/ui/crumbs/hig.py
index baad7b8271..bd27375ea5 100644
--- a/bitbake/lib/bb/ui/crumbs/hig.py
+++ b/bitbake/lib/bb/ui/crumbs/hig.py
@@ -170,23 +170,20 @@ class AdvancedSettingDialog (CrumbsDialog):
170 170
171 dialog.destroy() 171 dialog.destroy()
172 172
173 def gen_entry_widget(self, split_model, content, parent, tooltip=""): 173 def gen_entry_widget(self, content, parent, tooltip=""):
174 hbox = gtk.HBox(False, 12) 174 hbox = gtk.HBox(False, 12)
175 entry = gtk.Entry() 175 entry = gtk.Entry()
176 entry.set_text(content) 176 entry.set_text(content)
177 177
178 if split_model: 178 table = gtk.Table(1, 10, True)
179 hbox.pack_start(entry, expand=True, fill=True) 179 hbox.pack_start(table, expand=True, fill=True)
180 else: 180 table.attach(entry, 0, 9, 0, 1)
181 table = gtk.Table(1, 10, True) 181 image = gtk.Image()
182 hbox.pack_start(table, expand=True, fill=True) 182 image.set_from_stock(gtk.STOCK_OPEN,gtk.ICON_SIZE_BUTTON)
183 table.attach(entry, 0, 9, 0, 1) 183 open_button = gtk.Button()
184 image = gtk.Image() 184 open_button.set_image(image)
185 image.set_from_stock(gtk.STOCK_OPEN,gtk.ICON_SIZE_BUTTON) 185 open_button.connect("clicked", self.entry_widget_select_path_cb, parent, entry)
186 open_button = gtk.Button() 186 table.attach(open_button, 9, 10, 0, 1)
187 open_button.set_image(image)
188 open_button.connect("clicked", self.entry_widget_select_path_cb, parent, entry)
189 table.attach(open_button, 9, 10, 0, 1)
190 187
191 info = HobInfoButton(tooltip, self) 188 info = HobInfoButton(tooltip, self)
192 hbox.pack_start(info, expand=False, fill=False) 189 hbox.pack_start(info, expand=False, fill=False)
@@ -421,7 +418,7 @@ class AdvancedSettingDialog (CrumbsDialog):
421 418
422 def __init__(self, title, configuration, all_image_types, 419 def __init__(self, title, configuration, all_image_types,
423 all_package_formats, all_distros, all_sdk_machines, 420 all_package_formats, all_distros, all_sdk_machines,
424 max_threads, split_model, parent, flags, buttons): 421 max_threads, parent, flags, buttons):
425 super(AdvancedSettingDialog, self).__init__(title, parent, flags, buttons) 422 super(AdvancedSettingDialog, self).__init__(title, parent, flags, buttons)
426 423
427 # class members from other objects 424 # class members from other objects
@@ -432,7 +429,6 @@ class AdvancedSettingDialog (CrumbsDialog):
432 self.all_distros = all_distros 429 self.all_distros = all_distros
433 self.all_sdk_machines = all_sdk_machines 430 self.all_sdk_machines = all_sdk_machines
434 self.max_threads = max_threads 431 self.max_threads = max_threads
435 self.split_model = split_model
436 432
437 # class members for internal use 433 # class members for internal use
438 self.pkgfmt_store = None 434 self.pkgfmt_store = None
@@ -586,7 +582,7 @@ class AdvancedSettingDialog (CrumbsDialog):
586 advanced_vbox.pack_start(sub_vbox, expand=False, fill=False) 582 advanced_vbox.pack_start(sub_vbox, expand=False, fill=False)
587 label = self.gen_label_widget("<span weight=\"bold\">Set Download Directory:</span>") 583 label = self.gen_label_widget("<span weight=\"bold\">Set Download Directory:</span>")
588 tooltip = "Select a folder that caches the upstream project source code" 584 tooltip = "Select a folder that caches the upstream project source code"
589 dldir_widget, self.dldir_text = self.gen_entry_widget(self.split_model, self.configuration.dldir, self, tooltip) 585 dldir_widget, self.dldir_text = self.gen_entry_widget(self.configuration.dldir, self, tooltip)
590 sub_vbox.pack_start(label, expand=False, fill=False) 586 sub_vbox.pack_start(label, expand=False, fill=False)
591 sub_vbox.pack_start(dldir_widget, expand=False, fill=False) 587 sub_vbox.pack_start(dldir_widget, expand=False, fill=False)
592 588
@@ -594,7 +590,7 @@ class AdvancedSettingDialog (CrumbsDialog):
594 advanced_vbox.pack_start(sub_vbox, expand=False, fill=False) 590 advanced_vbox.pack_start(sub_vbox, expand=False, fill=False)
595 label = self.gen_label_widget("<span weight=\"bold\">Select SSTATE Directory:</span>") 591 label = self.gen_label_widget("<span weight=\"bold\">Select SSTATE Directory:</span>")
596 tooltip = "Select a folder that caches your prebuilt results" 592 tooltip = "Select a folder that caches your prebuilt results"
597 sstatedir_widget, self.sstatedir_text = self.gen_entry_widget(self.split_model, self.configuration.sstatedir, self, tooltip) 593 sstatedir_widget, self.sstatedir_text = self.gen_entry_widget(self.configuration.sstatedir, self, tooltip)
598 sub_vbox.pack_start(label, expand=False, fill=False) 594 sub_vbox.pack_start(label, expand=False, fill=False)
599 sub_vbox.pack_start(sstatedir_widget, expand=False, fill=False) 595 sub_vbox.pack_start(sstatedir_widget, expand=False, fill=False)
600 596
@@ -602,7 +598,7 @@ class AdvancedSettingDialog (CrumbsDialog):
602 advanced_vbox.pack_start(sub_vbox, expand=False, fill=False) 598 advanced_vbox.pack_start(sub_vbox, expand=False, fill=False)
603 label = self.gen_label_widget("<span weight=\"bold\">Select SSTATE Mirror:</span>") 599 label = self.gen_label_widget("<span weight=\"bold\">Select SSTATE Mirror:</span>")
604 tooltip = "Select the prebuilt mirror that will fasten your build speed" 600 tooltip = "Select the prebuilt mirror that will fasten your build speed"
605 sstatemirror_widget, self.sstatemirror_text = self.gen_entry_widget(self.split_model, self.configuration.sstatemirror, self, tooltip) 601 sstatemirror_widget, self.sstatemirror_text = self.gen_entry_widget(self.configuration.sstatemirror, self, tooltip)
606 sub_vbox.pack_start(label, expand=False, fill=False) 602 sub_vbox.pack_start(label, expand=False, fill=False)
607 sub_vbox.pack_start(sstatemirror_widget, expand=False, fill=False) 603 sub_vbox.pack_start(sstatemirror_widget, expand=False, fill=False)
608 604
@@ -850,7 +846,7 @@ class LayerSelectionDialog (CrumbsDialog):
850 layer_store.remove(iter) 846 layer_store.remove(iter)
851 847
852 848
853 def gen_layer_widget(self, split_model, layers, layers_avail, window, tooltip=""): 849 def gen_layer_widget(self, layers, layers_avail, window, tooltip=""):
854 hbox = gtk.HBox(False, 6) 850 hbox = gtk.HBox(False, 6)
855 851
856 layer_tv = gtk.TreeView() 852 layer_tv = gtk.TreeView()
@@ -874,57 +870,36 @@ class LayerSelectionDialog (CrumbsDialog):
874 table_layer = gtk.Table(2, 10, False) 870 table_layer = gtk.Table(2, 10, False)
875 hbox.pack_start(table_layer, expand=True, fill=True) 871 hbox.pack_start(table_layer, expand=True, fill=True)
876 872
877 if split_model: 873 table_layer.attach(scroll, 0, 10, 0, 1)
878 table_layer.attach(scroll, 0, 10, 0, 2)
879 874
880 layer_store = gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_BOOLEAN) 875 layer_store = gtk.ListStore(gobject.TYPE_STRING)
881 for layer in layers: 876 for layer in layers:
882 layer_store.set(layer_store.append(), 0, layer, 1, True) 877 layer_store.set(layer_store.append(), 0, layer)
883 for layer in layers_avail:
884 if layer not in layers:
885 layer_store.set(layer_store.append(), 0, layer, 1, False)
886 878
887 col1 = gtk.TreeViewColumn('Included') 879 image = gtk.Image()
888 layer_tv.append_column(col1) 880 image.set_from_stock(gtk.STOCK_ADD,gtk.ICON_SIZE_MENU)
889 881 add_button = gtk.Button()
890 cell1 = gtk.CellRendererToggle() 882 add_button.set_image(image)
891 cell1.connect("toggled", self.layer_widget_toggled_cb, layer_store) 883 add_button.connect("clicked", self.layer_widget_add_clicked_cb, layer_store, window)
892 col1.pack_start(cell1, True) 884 table_layer.attach(add_button, 0, 5, 1, 2, gtk.EXPAND | gtk.FILL, 0, 0, 6)
893 col1.set_attributes(cell1, active=1) 885 image = gtk.Image()
894 886 image.set_from_stock(gtk.STOCK_REMOVE,gtk.ICON_SIZE_MENU)
895 else: 887 del_button = gtk.Button()
896 table_layer.attach(scroll, 0, 10, 0, 1) 888 del_button.set_image(image)
897 889 del_button.connect("clicked", self.layer_widget_del_clicked_cb, tree_selection, layer_store)
898 layer_store = gtk.ListStore(gobject.TYPE_STRING) 890 table_layer.attach(del_button, 5, 10, 1, 2, gtk.EXPAND | gtk.FILL, 0, 0, 6)
899 for layer in layers:
900 layer_store.set(layer_store.append(), 0, layer)
901
902 image = gtk.Image()
903 image.set_from_stock(gtk.STOCK_ADD,gtk.ICON_SIZE_MENU)
904 add_button = gtk.Button()
905 add_button.set_image(image)
906 add_button.connect("clicked", self.layer_widget_add_clicked_cb, layer_store, window)
907 table_layer.attach(add_button, 0, 5, 1, 2, gtk.EXPAND | gtk.FILL, 0, 0, 6)
908 image = gtk.Image()
909 image.set_from_stock(gtk.STOCK_REMOVE,gtk.ICON_SIZE_MENU)
910 del_button = gtk.Button()
911 del_button.set_image(image)
912 del_button.connect("clicked", self.layer_widget_del_clicked_cb, tree_selection, layer_store)
913 table_layer.attach(del_button, 5, 10, 1, 2, gtk.EXPAND | gtk.FILL, 0, 0, 6)
914 layer_tv.set_model(layer_store) 891 layer_tv.set_model(layer_store)
915 892
916 hbox.show_all() 893 hbox.show_all()
917 894
918 return hbox, layer_store 895 return hbox, layer_store
919 896
920 def __init__(self, title, layers, all_layers, split_model, 897 def __init__(self, title, layers, all_layers, parent, flags, buttons):
921 parent, flags, buttons):
922 super(LayerSelectionDialog, self).__init__(title, parent, flags, buttons) 898 super(LayerSelectionDialog, self).__init__(title, parent, flags, buttons)
923 899
924 # class members from other objects 900 # class members from other objects
925 self.layers = layers 901 self.layers = layers
926 self.all_layers = all_layers 902 self.all_layers = all_layers
927 self.split_model = split_model
928 self.layers_changed = False 903 self.layers_changed = False
929 904
930 # class members for internal use 905 # class members for internal use
@@ -938,17 +913,14 @@ class LayerSelectionDialog (CrumbsDialog):
938 hbox_top = gtk.HBox() 913 hbox_top = gtk.HBox()
939 self.vbox.pack_start(hbox_top, expand=False, fill=False) 914 self.vbox.pack_start(hbox_top, expand=False, fill=False)
940 915
941 if self.split_model: 916 label = self.gen_label_widget("<b>Select Layers:</b>")
942 label = self.gen_label_widget("<b>Select Layers:</b>\n(Available layers under '${COREBASE}/layers/' directory)")
943 else:
944 label = self.gen_label_widget("<b>Select Layers:</b>")
945 hbox_top.pack_start(label, expand=False, fill=False) 917 hbox_top.pack_start(label, expand=False, fill=False)
946 918
947 tooltip = "Layer is a collection of bb files and conf files" 919 tooltip = "Layer is a collection of bb files and conf files"
948 info = HobInfoButton(tooltip, self) 920 info = HobInfoButton(tooltip, self)
949 hbox_top.pack_end(info, expand=False, fill=False) 921 hbox_top.pack_end(info, expand=False, fill=False)
950 922
951 layer_widget, self.layer_store = self.gen_layer_widget(self.split_model, self.layers, self.all_layers, self, None) 923 layer_widget, self.layer_store = self.gen_layer_widget(self.layers, self.all_layers, self, None)
952 layer_widget.set_size_request(-1, 180) 924 layer_widget.set_size_request(-1, 180)
953 self.vbox.pack_start(layer_widget, expand=True, fill=True) 925 self.vbox.pack_start(layer_widget, expand=True, fill=True)
954 926
@@ -963,12 +935,7 @@ class LayerSelectionDialog (CrumbsDialog):
963 it = model.get_iter_first() 935 it = model.get_iter_first()
964 layers = [] 936 layers = []
965 while it: 937 while it:
966 if self.split_model: 938 layers.append(model.get_value(it, 0))
967 inc = model.get_value(it, 1)
968 if inc:
969 layers.append(model.get_value(it, 0))
970 else:
971 layers.append(model.get_value(it, 0))
972 it = model.iter_next(it) 939 it = model.iter_next(it)
973 940
974 self.layers_changed = (self.layers != layers) 941 self.layers_changed = (self.layers != layers)