All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Small UI patches
@ 2011-08-27  1:48 Joshua Lock
  2011-08-27  1:48 ` [PATCH 1/2] ui/crumbs/tasklistmodel: don't add same item to binb column more than once Joshua Lock
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Joshua Lock @ 2011-08-27  1:48 UTC (permalink / raw)
  To: bitbake-devel

Most interesting is the second patch to add a Copy item to the right-click
menu for logs in RunningBuildTreeView.

This means users of hob and goggle can copy/paste the log contents right from
the GUI as well as submitting the log contents to pastebin.

The following changes since commit 0423587db09f6f28cf9d801f5657a84157f42dbe:

  hob: disable some menu entries whilst build is in progress (2011-08-24 19:32:42 -0700)

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

Joshua Lock (2):
  ui/crumbs/tasklistmodel: don't add same item to binb column more than
    once
  ui/crumbs/runningbuild: add a 'Copy' item to the messages right-click
    menu

 lib/bb/ui/crumbs/runningbuild.py  |   36 +++++++++++++++++++++++++++---------
 lib/bb/ui/crumbs/tasklistmodel.py |    5 +++--
 2 files changed, 30 insertions(+), 11 deletions(-)

-- 
1.7.6




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

* [PATCH 1/2] ui/crumbs/tasklistmodel: don't add same item to binb column more than once
  2011-08-27  1:48 [PATCH 0/2] Small UI patches Joshua Lock
@ 2011-08-27  1:48 ` Joshua Lock
  2011-08-27  1:48 ` [PATCH 2/2] ui/crumbs/runningbuild: add a 'Copy' item to the messages right-click menu Joshua Lock
  2011-08-29 12:50 ` [PATCH 0/2] Small UI patches Richard Purdie
  2 siblings, 0 replies; 4+ messages in thread
From: Joshua Lock @ 2011-08-27  1:48 UTC (permalink / raw)
  To: bitbake-devel

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

diff --git a/lib/bb/ui/crumbs/tasklistmodel.py b/lib/bb/ui/crumbs/tasklistmodel.py
index 5ff1f5a..cf9fc59 100644
--- a/lib/bb/ui/crumbs/tasklistmodel.py
+++ b/lib/bb/ui/crumbs/tasklistmodel.py
@@ -441,8 +441,9 @@ class TaskListModel(gtk.ListStore):
             self[item_path][self.COL_INC] = True
 
         bin = self[item_path][self.COL_BINB].split(', ')
-        bin.append(binb)
-        self[item_path][self.COL_BINB] = ', '.join(bin).lstrip(', ')
+        if not binb in bin:
+            bin.append(binb)
+            self[item_path][self.COL_BINB] = ', '.join(bin).lstrip(', ')
 
         # We want to do some magic with things which are brought in by the
         # base image so tag them as so
-- 
1.7.6




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

* [PATCH 2/2] ui/crumbs/runningbuild: add a 'Copy' item to the messages right-click menu
  2011-08-27  1:48 [PATCH 0/2] Small UI patches Joshua Lock
  2011-08-27  1:48 ` [PATCH 1/2] ui/crumbs/tasklistmodel: don't add same item to binb column more than once Joshua Lock
@ 2011-08-27  1:48 ` Joshua Lock
  2011-08-29 12:50 ` [PATCH 0/2] Small UI patches Richard Purdie
  2 siblings, 0 replies; 4+ messages in thread
From: Joshua Lock @ 2011-08-27  1:48 UTC (permalink / raw)
  To: bitbake-devel

Add another item to the right-click menu enabled for log messages to copy
the message to the clipboard.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
---
 lib/bb/ui/crumbs/runningbuild.py |   36 +++++++++++++++++++++++++++---------
 1 files changed, 27 insertions(+), 9 deletions(-)

diff --git a/lib/bb/ui/crumbs/runningbuild.py b/lib/bb/ui/crumbs/runningbuild.py
index d9e9f26..97d1ebd 100644
--- a/lib/bb/ui/crumbs/runningbuild.py
+++ b/lib/bb/ui/crumbs/runningbuild.py
@@ -306,31 +306,49 @@ class RunningBuildTreeView (gtk.TreeView):
 
         if event.button == 3:
             selection = super(RunningBuildTreeView, self).get_selection()
-            (model, iter) = selection.get_selected()
-            if iter is not None:
-                can_paste = model.get(iter, model.COL_LOG)[0]
+            (model, it) = selection.get_selected()
+            if it is not None:
+                can_paste = model.get(it, model.COL_LOG)[0]
                 if can_paste == 'pastebin':
                     # build a simple menu with a pastebin option
                     menu = gtk.Menu()
+                    menuitem = gtk.MenuItem("Copy")
+                    menu.append(menuitem)
+                    menuitem.connect("activate", self.copy_handler, (model, it))
+                    menuitem.show()
                     menuitem = gtk.MenuItem("Send log to pastebin")
                     menu.append(menuitem)
-                    menuitem.connect("activate", self.pastebin_handler, (model, iter))
+                    menuitem.connect("activate", self.pastebin_handler, (model, it))
                     menuitem.show()
                     menu.show()
                     menu.popup(None, None, None, event.button, event.time)
 
+    def _add_to_clipboard(self, clipping):
+        """
+        Add the contents of clipping to the system clipboard.
+        """
+        clipboard = gtk.clipboard_get()
+        clipboard.set_text(clipping)
+        clipboard.store()
+
     def pastebin_handler(self, widget, data):
         """
         Send the log data to pastebin, then add the new paste url to the
         clipboard.
         """
-        (model, iter) = data
-        paste_url = do_pastebin(model.get(iter, model.COL_MESSAGE)[0])
+        (model, it) = data
+        paste_url = do_pastebin(model.get(it, model.COL_MESSAGE)[0])
 
         # @todo Provide visual feedback to the user that it is done and that
         # it worked.
         print paste_url
 
-        clipboard = gtk.clipboard_get()
-        clipboard.set_text(paste_url)
-        clipboard.store()
+        self._add_to_clipboard(paste_url)
+
+    def clipboard_handler(self, widget, data):
+        """
+        """
+        (model, it) = data
+        message = model.get(it, model.COL_MESSAGE)[0]
+
+        self._add_to_clipboard(message)
-- 
1.7.6




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

* Re: [PATCH 0/2] Small UI patches
  2011-08-27  1:48 [PATCH 0/2] Small UI patches Joshua Lock
  2011-08-27  1:48 ` [PATCH 1/2] ui/crumbs/tasklistmodel: don't add same item to binb column more than once Joshua Lock
  2011-08-27  1:48 ` [PATCH 2/2] ui/crumbs/runningbuild: add a 'Copy' item to the messages right-click menu Joshua Lock
@ 2011-08-29 12:50 ` Richard Purdie
  2 siblings, 0 replies; 4+ messages in thread
From: Richard Purdie @ 2011-08-29 12:50 UTC (permalink / raw)
  To: Joshua Lock; +Cc: bitbake-devel

On Fri, 2011-08-26 at 18:48 -0700, Joshua Lock wrote:
> Most interesting is the second patch to add a Copy item to the right-click
> menu for logs in RunningBuildTreeView.
> 
> This means users of hob and goggle can copy/paste the log contents right from
> the GUI as well as submitting the log contents to pastebin.
> 
> The following changes since commit 0423587db09f6f28cf9d801f5657a84157f42dbe:
> 
>   hob: disable some menu entries whilst build is in progress (2011-08-24 19:32:42 -0700)
> 
> are available in the git repository at:
>   git://github.com/incandescant/bitbake hob
>   https://github.com/incandescant/bitbake/tree/hob
> 
> Joshua Lock (2):
>   ui/crumbs/tasklistmodel: don't add same item to binb column more than
>     once
>   ui/crumbs/runningbuild: add a 'Copy' item to the messages right-click
>     menu

Merged to master, thanks.

Richard




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

end of thread, other threads:[~2011-08-29 12:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-27  1:48 [PATCH 0/2] Small UI patches Joshua Lock
2011-08-27  1:48 ` [PATCH 1/2] ui/crumbs/tasklistmodel: don't add same item to binb column more than once Joshua Lock
2011-08-27  1:48 ` [PATCH 2/2] ui/crumbs/runningbuild: add a 'Copy' item to the messages right-click menu Joshua Lock
2011-08-29 12:50 ` [PATCH 0/2] Small UI patches 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.