All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Behavioural bug fixes for Hob
@ 2011-07-07 22:43 Joshua Lock
  2011-07-07 22:43 ` [PATCH 1/3] ui/crumbs/tasklistmodel: fix reset method Joshua Lock
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Joshua Lock @ 2011-07-07 22:43 UTC (permalink / raw)
  To: bitbake-devel

This is the first of no doubt many patch series to fix bugs in the hob ui now
that people have started trying to use it.

The following changes since commit c7a9ef70ba91d47d53074e8d78cbc52f396144a7:

  bitbake/process.py: Ensure queued UI events are queued right before we add our own handler (2011-07-07 10:57:05 +0100)

are available in the git repository at:
  git://github.com/incandescant/bitbake hob
  https://github.com/incandescant/bitbake/tree/hob

Joshua Lock (3):
  ui/crumbs/tasklistmodel: fix reset method
  lib/bb/hob: fix changing base image
  lib/bb/ui/hob: don't error when dismissing save as dialog

 lib/bb/ui/crumbs/tasklistmodel.py |   20 ++++++++++++++++----
 lib/bb/ui/hob.py                  |   30 +++++++++++++++++++-----------
 2 files changed, 35 insertions(+), 15 deletions(-)

-- 
1.7.6




^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/3] ui/crumbs/tasklistmodel: fix reset method
  2011-07-07 22:43 [PATCH 0/3] Behavioural bug fixes for Hob Joshua Lock
@ 2011-07-07 22:43 ` Joshua Lock
  2011-07-07 22:43 ` [PATCH 2/3] lib/bb/hob: fix changing base image Joshua Lock
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Joshua Lock @ 2011-07-07 22:43 UTC (permalink / raw)
  To: bitbake-devel

The reset() method only touched the contents sub-model, which does not
include the selected image(s). This patch ensures that reset correctly unsets
any image selection when called.

Further we re-initialise the COL_IMG column when resetting packages.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
---
 lib/bb/ui/crumbs/tasklistmodel.py |   20 ++++++++++++++++----
 1 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/lib/bb/ui/crumbs/tasklistmodel.py b/lib/bb/ui/crumbs/tasklistmodel.py
index d982986..5e979b7 100644
--- a/lib/bb/ui/crumbs/tasklistmodel.py
+++ b/lib/bb/ui/crumbs/tasklistmodel.py
@@ -429,12 +429,24 @@ class TaskListModel(gtk.ListStore):
     Empty self.contents by setting the include of each entry to None
     """
     def reset(self):
+        # Deselect images - slightly more complex logic so that we don't
+        # have to iterate all of the contents of the main model, instead
+        # just iterate the images model.
+        if self.selected_image:
+            iit = self.images.get_iter_first()
+            while iit:
+                pit = self.images.convert_iter_to_child_iter(iit)
+                self.set(pit, self.COL_INC, False)
+                iit = self.images.iter_next(iit)
+            self.selected_image = None
+
         it = self.contents.get_iter_first()
         while it:
-            path = self.contents.get_path(it)
-            opath = self.contents.convert_path_to_child_path(path)
-            self[opath][self.COL_INC] = False
-            self[opath][self.COL_BINB] = ""
+            oit = self.contents.convert_iter_to_child_iter(it)
+            self.set(oit,
+                     self.COL_INC, False,
+                     self.COL_BINB, "",
+                     self.COL_IMG, False)
             # As we've just removed the first item...
             it = self.contents.get_iter_first()
 
-- 
1.7.6




^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/3] lib/bb/hob: fix changing base image
  2011-07-07 22:43 [PATCH 0/3] Behavioural bug fixes for Hob Joshua Lock
  2011-07-07 22:43 ` [PATCH 1/3] ui/crumbs/tasklistmodel: fix reset method Joshua Lock
@ 2011-07-07 22:43 ` Joshua Lock
  2011-07-07 22:43 ` [PATCH 3/3] lib/bb/ui/hob: don't error when dismissing save as dialog Joshua Lock
  2011-07-08 16:30 ` [PATCH 0/3] Behavioural bug fixes for Hob Richard Purdie
  3 siblings, 0 replies; 5+ messages in thread
From: Joshua Lock @ 2011-07-07 22:43 UTC (permalink / raw)
  To: bitbake-devel

The path is not guaranteed to always point to the same value so do not rely
on it to change the image contents. Further, when changing the base image
we should maintain user selections.

Addresses [YOCTO #1225] and fixes [YOCTO #1226]

Signed-off-by: Joshua Lock <josh@linux.intel.com>
---
 lib/bb/ui/hob.py |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/lib/bb/ui/hob.py b/lib/bb/ui/hob.py
index fca41e4..7647d21 100644
--- a/lib/bb/ui/hob.py
+++ b/lib/bb/ui/hob.py
@@ -50,7 +50,6 @@ class MainWindow (gtk.Window):
         self.model = taskmodel
         self.model.connect("tasklist-populated", self.update_model)
         self.model.connect("image-changed", self.image_changed_string_cb)
-        self.curr_image_path = None
         self.handler = handler
         self.configurator = configurator
         self.prefs = prefs
@@ -133,12 +132,13 @@ class MainWindow (gtk.Window):
         if it:
             path = model.get_path(it)
             # Firstly, deselect the previous image
-            if self.curr_image_path:
-                self.toggle_package(self.curr_image_path, model)
+            userp, _ = self.model.get_selected_packages()
+            self.model.reset()
             # Now select the new image and save its path in case we
             # change the image later
-            self.curr_image_path = path
             self.toggle_package(path, model, image=True)
+            if len(userp):
+                self.model.set_selected_packages(userp)
 
     def reload_triggered_cb(self, handler, image, packages):
         if image:
@@ -463,8 +463,8 @@ class MainWindow (gtk.Window):
         return False
 
     def toggle_package(self, path, model, image=False):
-        # Warn user before removing packages
         inc = model[path][self.model.COL_INC]
+        # Warn user before removing included packages
         if inc:
             pn = model[path][self.model.COL_NAME]
             revdeps = self.model.find_reverse_depends(pn)
-- 
1.7.6




^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/3] lib/bb/ui/hob: don't error when dismissing save as dialog
  2011-07-07 22:43 [PATCH 0/3] Behavioural bug fixes for Hob Joshua Lock
  2011-07-07 22:43 ` [PATCH 1/3] ui/crumbs/tasklistmodel: fix reset method Joshua Lock
  2011-07-07 22:43 ` [PATCH 2/3] lib/bb/hob: fix changing base image Joshua Lock
@ 2011-07-07 22:43 ` Joshua Lock
  2011-07-08 16:30 ` [PATCH 0/3] Behavioural bug fixes for Hob Richard Purdie
  3 siblings, 0 replies; 5+ messages in thread
From: Joshua Lock @ 2011-07-07 22:43 UTC (permalink / raw)
  To: bitbake-devel

If the user decides to cancel the save as dialog we should not try and save
regardless.

Fixes [YOCTO #1220]

Signed-off-by: Joshua Lock <josh@linux.intel.com>
---
 lib/bb/ui/hob.py |   20 ++++++++++++++------
 1 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/lib/bb/ui/hob.py b/lib/bb/ui/hob.py
index 7647d21..06d936e 100644
--- a/lib/bb/ui/hob.py
+++ b/lib/bb/ui/hob.py
@@ -99,12 +99,15 @@ class MainWindow (gtk.Window):
             dialog.add_buttons(gtk.STOCK_NO, gtk.RESPONSE_NO,
                                gtk.STOCK_YES, gtk.RESPONSE_YES)
             resp = dialog.run()
+            dialog.destroy()
             if resp == gtk.RESPONSE_YES:
                 if not self.save_path:
                     self.get_save_path()
-                self.save_recipe_file()
-                rep = self.model.get_build_rep()
-                rep.writeRecipe(self.save_path, self.model)
+
+                if self.save_path:
+                    self.save_recipe_file()
+                    rep = self.model.get_build_rep()
+                    rep.writeRecipe(self.save_path, self.model)
 
         gtk.main_quit()
 
@@ -325,17 +328,22 @@ class MainWindow (gtk.Window):
         chooser.set_current_name("myimage.bb")
         response = chooser.run()
         if response == gtk.RESPONSE_OK:
-            self.save_path = chooser.get_filename()
+            save_path = chooser.get_filename()
+        else:
+            save_path = None
         chooser.destroy()
+        self.save_path = save_path
 
     def save_cb(self, action):
         if not self.save_path:
             self.get_save_path()
-        self.save_recipe_file()
+        if self.save_path:
+            self.save_recipe_file()
 
     def save_as_cb(self, action):
         self.get_save_path()
-        self.save_recipe_file()
+        if self.save_path:
+            self.save_recipe_file()
 
     def open_cb(self, action):
         chooser = gtk.FileChooserDialog(title=None, parent=self,
-- 
1.7.6




^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/3] Behavioural bug fixes for Hob
  2011-07-07 22:43 [PATCH 0/3] Behavioural bug fixes for Hob Joshua Lock
                   ` (2 preceding siblings ...)
  2011-07-07 22:43 ` [PATCH 3/3] lib/bb/ui/hob: don't error when dismissing save as dialog Joshua Lock
@ 2011-07-08 16:30 ` Richard Purdie
  3 siblings, 0 replies; 5+ messages in thread
From: Richard Purdie @ 2011-07-08 16:30 UTC (permalink / raw)
  To: Joshua Lock; +Cc: bitbake-devel

On Thu, 2011-07-07 at 15:43 -0700, Joshua Lock wrote:
> This is the first of no doubt many patch series to fix bugs in the hob ui now
> that people have started trying to use it.
> 
> The following changes since commit c7a9ef70ba91d47d53074e8d78cbc52f396144a7:
> 
>   bitbake/process.py: Ensure queued UI events are queued right before we add our own handler (2011-07-07 10:57:05 +0100)
> 
> are available in the git repository at:
>   git://github.com/incandescant/bitbake hob
>   https://github.com/incandescant/bitbake/tree/hob
> 
> Joshua Lock (3):
>   ui/crumbs/tasklistmodel: fix reset method
>   lib/bb/hob: fix changing base image
>   lib/bb/ui/hob: don't error when dismissing save as dialog

Merged to master, thanks.

Richard




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-07-08 16:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-07 22:43 [PATCH 0/3] Behavioural bug fixes for Hob Joshua Lock
2011-07-07 22:43 ` [PATCH 1/3] ui/crumbs/tasklistmodel: fix reset method Joshua Lock
2011-07-07 22:43 ` [PATCH 2/3] lib/bb/hob: fix changing base image Joshua Lock
2011-07-07 22:43 ` [PATCH 3/3] lib/bb/ui/hob: don't error when dismissing save as dialog Joshua Lock
2011-07-08 16:30 ` [PATCH 0/3] Behavioural bug fixes for Hob Richard Purdie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.