diff options
author | Shane Wang <shane.wang@intel.com> | 2012-02-29 22:15:12 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-03-01 15:51:33 +0000 |
commit | 7ccdd2007b57628a25a28f8f69310b246bf539bb (patch) | |
tree | a1fab70e31b635f38a97df2b0ca6299f1439b227 | |
parent | ec1b95f27cfacbf8927ebbe7fd3a71e922e942bb (diff) | |
download | poky-7ccdd2007b57628a25a28f8f69310b246bf539bb.tar.gz |
crumbs: move towards more standard dialogue spacing
Inherit from the base CrumbsDialog class which implements standard border and spacing.
Switch all explicitly set dialogue spacings to 6 to converge towards GNOME HIG.
(Bitbake rev: bf938987a007c94fc4bbacb2b4741b7c18cb62ec)
Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Shane Wang <shane.wang@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | bitbake/lib/bb/ui/crumbs/hig.py | 66 |
1 files changed, 29 insertions, 37 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/hig.py b/bitbake/lib/bb/ui/crumbs/hig.py index 85efbe6908..fdff10b522 100644 --- a/bitbake/lib/bb/ui/crumbs/hig.py +++ b/bitbake/lib/bb/ui/crumbs/hig.py | |||
@@ -113,7 +113,7 @@ class BinbDialog(gtk.Dialog): | |||
113 | # | 113 | # |
114 | # AdvancedSettings Dialog | 114 | # AdvancedSettings Dialog |
115 | # | 115 | # |
116 | class AdvancedSettingDialog (gtk.Dialog): | 116 | class AdvancedSettingDialog (CrumbsDialog): |
117 | 117 | ||
118 | def gen_label_widget(self, content): | 118 | def gen_label_widget(self, content): |
119 | label = gtk.Label() | 119 | label = gtk.Label() |
@@ -311,7 +311,7 @@ class AdvancedSettingDialog (gtk.Dialog): | |||
311 | scroll.set_size_request(200,60) | 311 | scroll.set_size_request(200,60) |
312 | pkgfmt_hbox.pack_start(scroll, False, False, 0) | 312 | pkgfmt_hbox.pack_start(scroll, False, False, 0) |
313 | 313 | ||
314 | vbox = gtk.VBox(False, 5) | 314 | vbox = gtk.VBox(False, 6) |
315 | pkgfmt_hbox.pack_start(vbox, False, False, 15) | 315 | pkgfmt_hbox.pack_start(vbox, False, False, 15) |
316 | 316 | ||
317 | up = gtk.Button() | 317 | up = gtk.Button() |
@@ -483,8 +483,8 @@ class AdvancedSettingDialog (gtk.Dialog): | |||
483 | self.show_all() | 483 | self.show_all() |
484 | 484 | ||
485 | def create_image_types_page(self): | 485 | def create_image_types_page(self): |
486 | advanced_vbox = gtk.VBox(False, 15) | 486 | advanced_vbox = gtk.VBox(False, 6) |
487 | advanced_vbox.set_border_width(20) | 487 | advanced_vbox.set_border_width(6) |
488 | 488 | ||
489 | rows = (len(self.image_types)+1)/2 | 489 | rows = (len(self.image_types)+1)/2 |
490 | table = gtk.Table(rows + 1, 10, True) | 490 | table = gtk.Table(rows + 1, 10, True) |
@@ -515,10 +515,10 @@ class AdvancedSettingDialog (gtk.Dialog): | |||
515 | return advanced_vbox | 515 | return advanced_vbox |
516 | 516 | ||
517 | def create_output_page(self): | 517 | def create_output_page(self): |
518 | advanced_vbox = gtk.VBox(False, 15) | 518 | advanced_vbox = gtk.VBox(False, 6) |
519 | advanced_vbox.set_border_width(20) | 519 | advanced_vbox.set_border_width(6) |
520 | 520 | ||
521 | sub_vbox = gtk.VBox(False, 5) | 521 | sub_vbox = gtk.VBox(False, 6) |
522 | advanced_vbox.pack_start(sub_vbox, expand=False, fill=False) | 522 | advanced_vbox.pack_start(sub_vbox, expand=False, fill=False) |
523 | label = self.gen_label_widget("<span weight=\"bold\">Packaging Format:</span>") | 523 | label = self.gen_label_widget("<span weight=\"bold\">Packaging Format:</span>") |
524 | tooltip = "Select package formats that will be used. " | 524 | tooltip = "Select package formats that will be used. " |
@@ -527,7 +527,7 @@ class AdvancedSettingDialog (gtk.Dialog): | |||
527 | sub_vbox.pack_start(label, expand=False, fill=False) | 527 | sub_vbox.pack_start(label, expand=False, fill=False) |
528 | sub_vbox.pack_start(pkgfmt_widget, expand=False, fill=False) | 528 | sub_vbox.pack_start(pkgfmt_widget, expand=False, fill=False) |
529 | 529 | ||
530 | sub_vbox = gtk.VBox(False, 5) | 530 | sub_vbox = gtk.VBox(False, 6) |
531 | advanced_vbox.pack_start(sub_vbox, expand=False, fill=False) | 531 | advanced_vbox.pack_start(sub_vbox, expand=False, fill=False) |
532 | label = self.gen_label_widget("<span weight=\"bold\">Image Rootfs Size: (MB)</span>") | 532 | label = self.gen_label_widget("<span weight=\"bold\">Image Rootfs Size: (MB)</span>") |
533 | tooltip = "Sets the size of your target image.\nThis is the basic size of your target image, unless your selected package size exceeds this value, or you set value to \"Image Extra Size\"." | 533 | tooltip = "Sets the size of your target image.\nThis is the basic size of your target image, unless your selected package size exceeds this value, or you set value to \"Image Extra Size\"." |
@@ -535,7 +535,7 @@ class AdvancedSettingDialog (gtk.Dialog): | |||
535 | sub_vbox.pack_start(label, expand=False, fill=False) | 535 | sub_vbox.pack_start(label, expand=False, fill=False) |
536 | sub_vbox.pack_start(rootfs_size_widget, expand=False, fill=False) | 536 | sub_vbox.pack_start(rootfs_size_widget, expand=False, fill=False) |
537 | 537 | ||
538 | sub_vbox = gtk.VBox(False, 5) | 538 | sub_vbox = gtk.VBox(False, 6) |
539 | advanced_vbox.pack_start(sub_vbox, expand=False, fill=False) | 539 | advanced_vbox.pack_start(sub_vbox, expand=False, fill=False) |
540 | label = self.gen_label_widget("<span weight=\"bold\">Image Extra Size: (MB)</span>") | 540 | label = self.gen_label_widget("<span weight=\"bold\">Image Extra Size: (MB)</span>") |
541 | tooltip = "Sets the extra free space of your target image.\nDefaultly, system will reserve 30% of your image size as your free space. If your image contains zypper, it will bring in 50MB more space. The maximum free space is 1024MB." | 541 | tooltip = "Sets the extra free space of your target image.\nDefaultly, system will reserve 30% of your image size as your free space. If your image contains zypper, it will bring in 50MB more space. The maximum free space is 1024MB." |
@@ -551,7 +551,7 @@ class AdvancedSettingDialog (gtk.Dialog): | |||
551 | self.gplv3_checkbox.set_active(False) | 551 | self.gplv3_checkbox.set_active(False) |
552 | advanced_vbox.pack_start(self.gplv3_checkbox, expand=False, fill=False) | 552 | advanced_vbox.pack_start(self.gplv3_checkbox, expand=False, fill=False) |
553 | 553 | ||
554 | sub_hbox = gtk.HBox(False, 5) | 554 | sub_hbox = gtk.HBox(False, 6) |
555 | advanced_vbox.pack_start(sub_hbox, expand=False, fill=False) | 555 | advanced_vbox.pack_start(sub_hbox, expand=False, fill=False) |
556 | self.toolchain_checkbox = gtk.CheckButton("Build Toolchain") | 556 | self.toolchain_checkbox = gtk.CheckButton("Build Toolchain") |
557 | self.toolchain_checkbox.set_tooltip_text("Check this box to build the related toolchain with your image") | 557 | self.toolchain_checkbox.set_tooltip_text("Check this box to build the related toolchain with your image") |
@@ -565,10 +565,10 @@ class AdvancedSettingDialog (gtk.Dialog): | |||
565 | return advanced_vbox | 565 | return advanced_vbox |
566 | 566 | ||
567 | def create_build_environment_page(self): | 567 | def create_build_environment_page(self): |
568 | advanced_vbox = gtk.VBox(False, 15) | 568 | advanced_vbox = gtk.VBox(False, 6) |
569 | advanced_vbox.set_border_width(20) | 569 | advanced_vbox.set_border_width(6) |
570 | 570 | ||
571 | sub_vbox = gtk.VBox(False, 5) | 571 | sub_vbox = gtk.VBox(False, 6) |
572 | advanced_vbox.pack_start(sub_vbox, expand=False, fill=False) | 572 | advanced_vbox.pack_start(sub_vbox, expand=False, fill=False) |
573 | label = self.gen_label_widget("<span weight=\"bold\">Select Distro:</span>") | 573 | label = self.gen_label_widget("<span weight=\"bold\">Select Distro:</span>") |
574 | tooltip = "This is the Yocto distribution you would like to use" | 574 | tooltip = "This is the Yocto distribution you would like to use" |
@@ -576,7 +576,7 @@ class AdvancedSettingDialog (gtk.Dialog): | |||
576 | sub_vbox.pack_start(label, expand=False, fill=False) | 576 | sub_vbox.pack_start(label, expand=False, fill=False) |
577 | sub_vbox.pack_start(distro_widget, expand=False, fill=False) | 577 | sub_vbox.pack_start(distro_widget, expand=False, fill=False) |
578 | 578 | ||
579 | sub_vbox = gtk.VBox(False, 5) | 579 | sub_vbox = gtk.VBox(False, 6) |
580 | advanced_vbox.pack_start(sub_vbox, expand=False, fill=False) | 580 | advanced_vbox.pack_start(sub_vbox, expand=False, fill=False) |
581 | label = self.gen_label_widget("<span weight=\"bold\">BB_NUMBER_THREADS:</span>") | 581 | label = self.gen_label_widget("<span weight=\"bold\">BB_NUMBER_THREADS:</span>") |
582 | tooltip = "Sets the number of threads that bitbake tasks can run simultaneously" | 582 | tooltip = "Sets the number of threads that bitbake tasks can run simultaneously" |
@@ -584,7 +584,7 @@ class AdvancedSettingDialog (gtk.Dialog): | |||
584 | sub_vbox.pack_start(label, expand=False, fill=False) | 584 | sub_vbox.pack_start(label, expand=False, fill=False) |
585 | sub_vbox.pack_start(bbthread_widget, expand=False, fill=False) | 585 | sub_vbox.pack_start(bbthread_widget, expand=False, fill=False) |
586 | 586 | ||
587 | sub_vbox = gtk.VBox(False, 5) | 587 | sub_vbox = gtk.VBox(False, 6) |
588 | advanced_vbox.pack_start(sub_vbox, expand=False, fill=False) | 588 | advanced_vbox.pack_start(sub_vbox, expand=False, fill=False) |
589 | label = self.gen_label_widget("<span weight=\"bold\">PARALLEL_MAKE:</span>") | 589 | label = self.gen_label_widget("<span weight=\"bold\">PARALLEL_MAKE:</span>") |
590 | tooltip = "Sets the make parallism, as known as 'make -j'" | 590 | tooltip = "Sets the make parallism, as known as 'make -j'" |
@@ -592,7 +592,7 @@ class AdvancedSettingDialog (gtk.Dialog): | |||
592 | sub_vbox.pack_start(label, expand=False, fill=False) | 592 | sub_vbox.pack_start(label, expand=False, fill=False) |
593 | sub_vbox.pack_start(pmake_widget, expand=False, fill=False) | 593 | sub_vbox.pack_start(pmake_widget, expand=False, fill=False) |
594 | 594 | ||
595 | sub_vbox = gtk.VBox(False, 5) | 595 | sub_vbox = gtk.VBox(False, 6) |
596 | advanced_vbox.pack_start(sub_vbox, expand=False, fill=False) | 596 | advanced_vbox.pack_start(sub_vbox, expand=False, fill=False) |
597 | label = self.gen_label_widget("<span weight=\"bold\">Set Download Directory:</span>") | 597 | label = self.gen_label_widget("<span weight=\"bold\">Set Download Directory:</span>") |
598 | tooltip = "Select a folder that caches the upstream project source code" | 598 | tooltip = "Select a folder that caches the upstream project source code" |
@@ -600,7 +600,7 @@ class AdvancedSettingDialog (gtk.Dialog): | |||
600 | sub_vbox.pack_start(label, expand=False, fill=False) | 600 | sub_vbox.pack_start(label, expand=False, fill=False) |
601 | sub_vbox.pack_start(dldir_widget, expand=False, fill=False) | 601 | sub_vbox.pack_start(dldir_widget, expand=False, fill=False) |
602 | 602 | ||
603 | sub_vbox = gtk.VBox(False, 5) | 603 | sub_vbox = gtk.VBox(False, 6) |
604 | advanced_vbox.pack_start(sub_vbox, expand=False, fill=False) | 604 | advanced_vbox.pack_start(sub_vbox, expand=False, fill=False) |
605 | label = self.gen_label_widget("<span weight=\"bold\">Select SSTATE Directory:</span>") | 605 | label = self.gen_label_widget("<span weight=\"bold\">Select SSTATE Directory:</span>") |
606 | tooltip = "Select a folder that caches your prebuilt results" | 606 | tooltip = "Select a folder that caches your prebuilt results" |
@@ -608,7 +608,7 @@ class AdvancedSettingDialog (gtk.Dialog): | |||
608 | sub_vbox.pack_start(label, expand=False, fill=False) | 608 | sub_vbox.pack_start(label, expand=False, fill=False) |
609 | sub_vbox.pack_start(sstatedir_widget, expand=False, fill=False) | 609 | sub_vbox.pack_start(sstatedir_widget, expand=False, fill=False) |
610 | 610 | ||
611 | sub_vbox = gtk.VBox(False, 5) | 611 | sub_vbox = gtk.VBox(False, 6) |
612 | advanced_vbox.pack_start(sub_vbox, expand=False, fill=False) | 612 | advanced_vbox.pack_start(sub_vbox, expand=False, fill=False) |
613 | label = self.gen_label_widget("<span weight=\"bold\">Select SSTATE Mirror:</span>") | 613 | label = self.gen_label_widget("<span weight=\"bold\">Select SSTATE Mirror:</span>") |
614 | tooltip = "Select the prebuilt mirror that will fasten your build speed" | 614 | tooltip = "Select the prebuilt mirror that will fasten your build speed" |
@@ -619,10 +619,10 @@ class AdvancedSettingDialog (gtk.Dialog): | |||
619 | return advanced_vbox | 619 | return advanced_vbox |
620 | 620 | ||
621 | def create_others_page(self): | 621 | def create_others_page(self): |
622 | advanced_vbox = gtk.VBox(False, 15) | 622 | advanced_vbox = gtk.VBox(False, 6) |
623 | advanced_vbox.set_border_width(20) | 623 | advanced_vbox.set_border_width(6) |
624 | 624 | ||
625 | sub_vbox = gtk.VBox(False, 5) | 625 | sub_vbox = gtk.VBox(False, 6) |
626 | advanced_vbox.pack_start(sub_vbox, expand=True, fill=True) | 626 | advanced_vbox.pack_start(sub_vbox, expand=True, fill=True) |
627 | label = self.gen_label_widget("<span weight=\"bold\">Add your own variables:</span>") | 627 | label = self.gen_label_widget("<span weight=\"bold\">Add your own variables:</span>") |
628 | tooltip = "This is the key/value pair for your extra settings" | 628 | tooltip = "This is the key/value pair for your extra settings" |
@@ -687,7 +687,7 @@ class AdvancedSettingDialog (gtk.Dialog): | |||
687 | # | 687 | # |
688 | # DeployImageDialog | 688 | # DeployImageDialog |
689 | # | 689 | # |
690 | class DeployImageDialog (gtk.Dialog): | 690 | class DeployImageDialog (CrumbsDialog): |
691 | 691 | ||
692 | __dummy_usb__ = "--select a usb drive--" | 692 | __dummy_usb__ = "--select a usb drive--" |
693 | 693 | ||
@@ -700,7 +700,6 @@ class DeployImageDialog (gtk.Dialog): | |||
700 | self.connect("response", self.response_cb) | 700 | self.connect("response", self.response_cb) |
701 | 701 | ||
702 | def create_visual_elements(self): | 702 | def create_visual_elements(self): |
703 | self.set_border_width(20) | ||
704 | self.set_default_size(500, 250) | 703 | self.set_default_size(500, 250) |
705 | 704 | ||
706 | label = gtk.Label() | 705 | label = gtk.Label() |
@@ -807,7 +806,7 @@ class DeployImageDialog (gtk.Dialog): | |||
807 | # | 806 | # |
808 | # LayerSelectionDialog | 807 | # LayerSelectionDialog |
809 | # | 808 | # |
810 | class LayerSelectionDialog (gtk.Dialog): | 809 | class LayerSelectionDialog (CrumbsDialog): |
811 | 810 | ||
812 | def gen_label_widget(self, content): | 811 | def gen_label_widget(self, content): |
813 | label = gtk.Label() | 812 | label = gtk.Label() |
@@ -864,7 +863,7 @@ class LayerSelectionDialog (gtk.Dialog): | |||
864 | 863 | ||
865 | 864 | ||
866 | def gen_layer_widget(self, split_model, layers, layers_avail, window, tooltip=""): | 865 | def gen_layer_widget(self, split_model, layers, layers_avail, window, tooltip=""): |
867 | hbox = gtk.HBox(False, 10) | 866 | hbox = gtk.HBox(False, 6) |
868 | 867 | ||
869 | layer_tv = gtk.TreeView() | 868 | layer_tv = gtk.TreeView() |
870 | layer_tv.set_rules_hint(True) | 869 | layer_tv.set_rules_hint(True) |
@@ -917,13 +916,13 @@ class LayerSelectionDialog (gtk.Dialog): | |||
917 | add_button = gtk.Button() | 916 | add_button = gtk.Button() |
918 | add_button.set_image(image) | 917 | add_button.set_image(image) |
919 | add_button.connect("clicked", self.layer_widget_add_clicked_cb, layer_store, window) | 918 | add_button.connect("clicked", self.layer_widget_add_clicked_cb, layer_store, window) |
920 | table_layer.attach(add_button, 0, 5, 1, 2, gtk.EXPAND | gtk.FILL, 0, 0, 0) | 919 | table_layer.attach(add_button, 0, 5, 1, 2, gtk.EXPAND | gtk.FILL, 0, 0, 6) |
921 | image = gtk.Image() | 920 | image = gtk.Image() |
922 | image.set_from_stock(gtk.STOCK_REMOVE,gtk.ICON_SIZE_MENU) | 921 | image.set_from_stock(gtk.STOCK_REMOVE,gtk.ICON_SIZE_MENU) |
923 | del_button = gtk.Button() | 922 | del_button = gtk.Button() |
924 | del_button.set_image(image) | 923 | del_button.set_image(image) |
925 | del_button.connect("clicked", self.layer_widget_del_clicked_cb, tree_selection, layer_store) | 924 | del_button.connect("clicked", self.layer_widget_del_clicked_cb, tree_selection, layer_store) |
926 | table_layer.attach(del_button, 5, 10, 1, 2, gtk.EXPAND | gtk.FILL, 0, 0, 0) | 925 | table_layer.attach(del_button, 5, 10, 1, 2, gtk.EXPAND | gtk.FILL, 0, 0, 6) |
927 | layer_tv.set_model(layer_store) | 926 | layer_tv.set_model(layer_store) |
928 | 927 | ||
929 | hbox.show_all() | 928 | hbox.show_all() |
@@ -948,11 +947,8 @@ class LayerSelectionDialog (gtk.Dialog): | |||
948 | self.connect("response", self.response_cb) | 947 | self.connect("response", self.response_cb) |
949 | 948 | ||
950 | def create_visual_elements(self): | 949 | def create_visual_elements(self): |
951 | self.set_border_width(20) | ||
952 | self.set_default_size(400, 250) | 950 | self.set_default_size(400, 250) |
953 | |||
954 | hbox_top = gtk.HBox() | 951 | hbox_top = gtk.HBox() |
955 | self.set_border_width(12) | ||
956 | self.vbox.pack_start(hbox_top, expand=False, fill=False) | 952 | self.vbox.pack_start(hbox_top, expand=False, fill=False) |
957 | 953 | ||
958 | if self.split_model: | 954 | if self.split_model: |
@@ -1001,7 +997,7 @@ class LayerSelectionDialog (gtk.Dialog): | |||
1001 | self.layers_changed = (self.layers != layers) | 997 | self.layers_changed = (self.layers != layers) |
1002 | self.layers = layers | 998 | self.layers = layers |
1003 | 999 | ||
1004 | class ImageSelectionDialog (gtk.Dialog): | 1000 | class ImageSelectionDialog (CrumbsDialog): |
1005 | 1001 | ||
1006 | __columns__ = [{ | 1002 | __columns__ = [{ |
1007 | 'col_name' : 'Image name', | 1003 | 'col_name' : 'Image name', |
@@ -1034,11 +1030,7 @@ class ImageSelectionDialog (gtk.Dialog): | |||
1034 | self.fill_image_store() | 1030 | self.fill_image_store() |
1035 | 1031 | ||
1036 | def create_visual_elements(self): | 1032 | def create_visual_elements(self): |
1037 | self.set_border_width(20) | 1033 | hbox = gtk.HBox(False, 6) |
1038 | self.set_default_size(600, 300) | ||
1039 | self.vbox.set_spacing(10) | ||
1040 | |||
1041 | hbox = gtk.HBox(False, 10) | ||
1042 | self.vbox.pack_start(hbox, expand=False, fill=False) | 1034 | self.vbox.pack_start(hbox, expand=False, fill=False) |
1043 | 1035 | ||
1044 | entry = gtk.Entry() | 1036 | entry = gtk.Entry() |
@@ -1048,7 +1040,7 @@ class ImageSelectionDialog (gtk.Dialog): | |||
1048 | hbox.pack_start(table, expand=False, fill=False) | 1040 | hbox.pack_start(table, expand=False, fill=False) |
1049 | table.attach(entry, 0, 9, 0, 1) | 1041 | table.attach(entry, 0, 9, 0, 1) |
1050 | image = gtk.Image() | 1042 | image = gtk.Image() |
1051 | image.set_from_stock(gtk.STOCK_OPEN,gtk.ICON_SIZE_BUTTON) | 1043 | image.set_from_stock(gtk.STOCK_OPEN, gtk.ICON_SIZE_BUTTON) |
1052 | open_button = gtk.Button() | 1044 | open_button = gtk.Button() |
1053 | open_button.set_image(image) | 1045 | open_button.set_image(image) |
1054 | open_button.connect("clicked", self.select_path_cb, self, entry) | 1046 | open_button.connect("clicked", self.select_path_cb, self, entry) |