Patchwork [bitbake-devel,10/32] Hob: add ignore_all_errors to avoid showing error dialog multiple times

login
register
mail settings
Submitter Shane Wang
Date Feb. 29, 2012, 2:15 p.m.
Message ID <36bbfae6e2a84015b39e4a7fa4ed6e0aff5036c0.1330523904.git.shane.wang@intel.com>
Download mbox | patch
Permalink /patch/22439/
State New
Headers show

Comments

Shane Wang - Feb. 29, 2012, 2:15 p.m.
when parsing recipes, if there are some errors, the error dialog will be shown again and again for each error, add "Ignore All" to allow users to ignore those errors.

Signed-off-by: Shane Wang <shane.wang@intel.com>
---
 bitbake/lib/bb/ui/crumbs/builder.py |   20 ++++++++++++++------
 1 files changed, 14 insertions(+), 6 deletions(-)
Joshua Lock - Feb. 29, 2012, 9:29 p.m.
On 29/02/12 06:15, Shane Wang wrote:
> when parsing recipes, if there are some errors, the error dialog will be shown again and again for each error, add "Ignore All" to allow users to ignore those errors.

I'm not so sure about this. I don't think ignoring all parse errors is 
the right thing, collecting them up into one dialogue seems like a 
better first step.

What if I add some layers which introduce different parsing errors after 
I've clicked 'Ignore All' once?

Cheers,
Joshua

>
> Signed-off-by: Shane Wang<shane.wang@intel.com>
> ---
>   bitbake/lib/bb/ui/crumbs/builder.py |   20 ++++++++++++++------
>   1 files changed, 14 insertions(+), 6 deletions(-)
>
> diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py
> index 819b79f..fc231ef 100755
> --- a/bitbake/lib/bb/ui/crumbs/builder.py
> +++ b/bitbake/lib/bb/ui/crumbs/builder.py
> @@ -178,6 +178,8 @@ class Builder(gtk.Window):
>
>           self.template = None
>
> +        self.ignore_all_errors = False
> +
>           # settings
>           params = self.handler.get_parameters()
>           self.configuration = Configuration(params)
> @@ -315,6 +317,8 @@ class Builder(gtk.Window):
>
>           elif next_step == self.RCPPKGINFO_POPULATING:
>               # MACHINE CHANGED action or SETTINGS CHANGED
> +            # reset the "ignore all errors" var
> +            self.ignore_all_errors = False
>               # show the progress bar
>               self.image_configuration_page.show_info_populating()
>               self.generate_recipes()
> @@ -440,12 +444,16 @@ class Builder(gtk.Window):
>                   self.switch_page(self.IMAGE_GENERATED)
>
>       def handler_command_failed_cb(self, handler, msg):
> -        lbl = "<b>Error</b>\n"
> -        lbl = lbl + "%s\n\n" % msg
> -        dialog = CrumbsDialog(self, lbl, gtk.STOCK_DIALOG_WARNING)
> -        dialog.add_button(gtk.STOCK_OK, gtk.RESPONSE_OK)
> -        response = dialog.run()
> -        dialog.destroy()
> +        if self.ignore_all_errors == False:
> +            lbl = "<b>Error</b>\n"
> +            lbl = lbl + "%s\n\n" % msg
> +            dialog = CrumbsDialog(self, lbl, gtk.STOCK_DIALOG_WARNING)
> +            dialog.add_button(gtk.STOCK_OK, gtk.RESPONSE_OK)
> +            dialog.add_button("Ignore All", gtk.RESPONSE_REJECT)
> +            response = dialog.run()
> +            if response == gtk.RESPONSE_REJECT:
> +                self.ignore_all_errors = True
> +            dialog.destroy()
>           self.handler.clear_busy()
>           self.configuration.curr_mach = None
>           self.image_configuration_page.switch_machine_combo()
Shane Wang - March 2, 2012, 7:31 a.m.
Joshua Lock wrote onĀ 2012-03-01:

> 
> 
> On 29/02/12 06:15, Shane Wang wrote:
>> when parsing recipes, if there are some errors, the error dialog will be
> shown again and again for each error, add "Ignore All" to allow users to
> ignore those errors.
> 
> I'm not so sure about this. I don't think ignoring all parse errors is
> the right thing, collecting them up into one dialogue seems like a
> better first step.
OK, UX improvement.

> 
> What if I add some layers which introduce different parsing errors after
> I've clicked 'Ignore All' once?
"Ignore All" can't be reset. It only takes effect on the parsing this time.
That is: if you change layers which causes different parsing errors, and you ignore all.
Next time, if you change some layers which also causes some parsing errors, the dialog will also show until you click "ignore all".

--
Shane

> 
> Cheers,
> Joshua

Patch

diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py
index 819b79f..fc231ef 100755
--- a/bitbake/lib/bb/ui/crumbs/builder.py
+++ b/bitbake/lib/bb/ui/crumbs/builder.py
@@ -178,6 +178,8 @@  class Builder(gtk.Window):
 
         self.template = None
 
+        self.ignore_all_errors = False
+
         # settings
         params = self.handler.get_parameters()
         self.configuration = Configuration(params)
@@ -315,6 +317,8 @@  class Builder(gtk.Window):
 
         elif next_step == self.RCPPKGINFO_POPULATING:
             # MACHINE CHANGED action or SETTINGS CHANGED
+            # reset the "ignore all errors" var
+            self.ignore_all_errors = False
             # show the progress bar
             self.image_configuration_page.show_info_populating()
             self.generate_recipes()
@@ -440,12 +444,16 @@  class Builder(gtk.Window):
                 self.switch_page(self.IMAGE_GENERATED)
 
     def handler_command_failed_cb(self, handler, msg):
-        lbl = "<b>Error</b>\n"
-        lbl = lbl + "%s\n\n" % msg
-        dialog = CrumbsDialog(self, lbl, gtk.STOCK_DIALOG_WARNING)
-        dialog.add_button(gtk.STOCK_OK, gtk.RESPONSE_OK)
-        response = dialog.run()
-        dialog.destroy()
+        if self.ignore_all_errors == False:
+            lbl = "<b>Error</b>\n"
+            lbl = lbl + "%s\n\n" % msg
+            dialog = CrumbsDialog(self, lbl, gtk.STOCK_DIALOG_WARNING)
+            dialog.add_button(gtk.STOCK_OK, gtk.RESPONSE_OK)
+            dialog.add_button("Ignore All", gtk.RESPONSE_REJECT)
+            response = dialog.run()
+            if response == gtk.RESPONSE_REJECT:
+                self.ignore_all_errors = True
+            dialog.destroy()
         self.handler.clear_busy()
         self.configuration.curr_mach = None
         self.image_configuration_page.switch_machine_combo()