[Sugar-devel] [PATCH sugar] Add empty messages for empty devices and empty DOCUMENTS folders

2011-09-07 Thread Simon Schampijer
Currently the message will be the same for an empty Journal
or an empty external device or an empty documents folder. This
patch does distinguish between the different cases. In order to
get the path of the documents folder as well from the listview
the function has been moved to the model.

@design team: because I could not figure out an easy way to get
the volume's label in the listview I did change the text for an
empty device to: 'The device is empty'

This patch depends on the previous patch: Only show DOCUMENTS
folder when it is not $HOME

Signed-off-by: Simon Schampijer si...@laptop.org
---
 src/jarabe/journal/listview.py   |   27 ---
 src/jarabe/journal/model.py  |   23 +++
 src/jarabe/journal/volumestoolbar.py |   26 +-
 3 files changed, 36 insertions(+), 40 deletions(-)

diff --git a/src/jarabe/journal/listview.py b/src/jarabe/journal/listview.py
index a9f5a53..0d7e112 100644
--- a/src/jarabe/journal/listview.py
+++ b/src/jarabe/journal/listview.py
@@ -37,9 +37,6 @@ from jarabe.journal import misc
 
 UPDATE_INTERVAL = 300
 
-MESSAGE_EMPTY_JOURNAL = 0
-MESSAGE_NO_MATCH = 1
-
 
 class TreeView(gtk.TreeView):
 __gtype_name__ = 'JournalTreeView'
@@ -315,9 +312,16 @@ class BaseListView(gtk.Bin):
 
 if len(tree_model) == 0:
 if self._is_query_empty():
-self._show_message(MESSAGE_EMPTY_JOURNAL)
+if self._query['mountpoints'] == ['/']:
+self._show_message(_('Your Journal is empty'))
+elif self._query['mountpoints'] == \
+[model.get_documents_path()]:
+self._show_message(_('Your documents folder is empty'))
+else:
+self._show_message(_('The device is empty'))
 else:
-self._show_message(MESSAGE_NO_MATCH)
+self._show_message(_('No matching entries'),
+   show_clear_query=True)
 else:
 self._clear_message()
 
@@ -364,7 +368,7 @@ class BaseListView(gtk.Bin):
 self.add(self._scrolled_window)
 self._progress_bar = None
 
-def _show_message(self, message):
+def _show_message(self, message, show_clear_query=False):
 canvas = hippo.Canvas()
 self.remove(self.child)
 self.add(canvas)
@@ -383,20 +387,13 @@ class BaseListView(gtk.Bin):
   fill_color=style.COLOR_TRANSPARENT.get_svg())
 box.append(icon)
 
-if message == MESSAGE_EMPTY_JOURNAL:
-text = _('Your Journal is empty')
-elif message == MESSAGE_NO_MATCH:
-text = _('No matching entries')
-else:
-raise ValueError('Invalid message')
-
-text = hippo.CanvasText(text=text,
+text = hippo.CanvasText(text=message,
 xalign=hippo.ALIGNMENT_CENTER,
 font_desc=style.FONT_BOLD.get_pango_desc(),
 color=style.COLOR_BUTTON_GREY.get_int())
 box.append(text)
 
-if message == MESSAGE_NO_MATCH:
+if show_clear_query:
 button = gtk.Button(label=_('Clear search'))
 button.connect('clicked', self.__clear_button_clicked_cb)
 button.props.image = Icon(icon_name='dialog-cancel',
diff --git a/src/jarabe/journal/model.py b/src/jarabe/journal/model.py
index 1242787..c57dfc4 100644
--- a/src/jarabe/journal/model.py
+++ b/src/jarabe/journal/model.py
@@ -17,6 +17,7 @@
 import logging
 import os
 import errno
+import subprocess
 from datetime import datetime
 import time
 import shutil
@@ -794,3 +795,25 @@ def is_editable(metadata):
 return True
 else:
 return os.access(metadata['mountpoint'], os.W_OK)
+
+
+def get_documents_path():
+Gets the path of the DOCUMENTS folder
+
+If xdg-user-dir can not find the DOCUMENTS folder it will
+return the user directory instead. It also handles
+localization (i.e. translation) of the filenames.
+
+Returns: Path to $HOME/DOCUMENTS or None if an error occurs
+
+try:
+pipe = subprocess.Popen(['xdg-user-dir', 'DOCUMENTS'],
+stdout=subprocess.PIPE)
+documents_path = os.path.normpath(pipe.communicate()[0].strip())
+if os.path.exists(documents_path) and \
+os.environ.get('HOME') != documents_path:
+return documents_path
+except OSError, exception:
+if exception.errno != errno.ENOENT:
+logging.exception('Could not run xdg-user-dir')
+return None
diff --git a/src/jarabe/journal/volumestoolbar.py 
b/src/jarabe/journal/volumestoolbar.py
index 1cc764f..77bb955 100644
--- a/src/jarabe/journal/volumestoolbar.py
+++ b/src/jarabe/journal/volumestoolbar.py
@@ -16,8 +16,6 @@
 
 import logging
 import os
-import subprocess
-import errno
 import statvfs
 from gettext import gettext as _
 
@@ -55,28 +53,6 @@ def 

Re: [Sugar-devel] [PATCH sugar] Add empty messages for empty devices and empty DOCUMENTS folders

2011-09-07 Thread Simon Schampijer

On 09/06/2011 08:59 PM, Gonzalo Odiard wrote:

Tested and works ok.
IMHO, sending the constants had more sense when we only had two messages,
now should be more clear if we do:

 if len(tree_model) == 0:


 if self._is_query_empty():
-self._show_message(MESSAGE_EMPTY_JOURNAL)
+if self._query['mountpoints'] == ['/']:
+self._show_message(_('Your Journal is empty'))
+elif self._query['mountpoints'] == \
+[model.get_documents_path()]:
+self._show_message(_('Your documents folder is
empty'))
+else:
+self._show_message(_('The device is empty'))
 else:
 self._show_message(_('No matching
entries'),show_clear_query=True)
 else:
@@ -385,6 +393,10 @@ class BaseListView(gtk.Bin):




def _show_message(self, message, show_clear_query=False):

   .

   if show_clear_query:
 button = gtk.Button(label=_('Clear search'))
 button.connect('clicked', self.__clear_button_clicked_cb)
 button.props.image = Icon(icon_name='dialog-cancel',
   icon_size=gtk.ICON_SIZE_BUTTON)
 canvas_button = hippo.CanvasWidget(widget=button,

xalign=hippo.ALIGNMENT_CENTER)
 box.append(canvas_button)


... but is only me.
Regards,

Gonzalo


Thanks Gonzalo for the feedback. Addressed your suggestion in the 
follow-up patch. Can you retest before I push?


Regards,
   Simon



___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH sugar] Only show DOCUMENTS folder when it is not $HOME

2011-09-07 Thread Simon Schampijer

On 09/06/2011 08:10 PM, Gonzalo Odiard wrote:

Tested-by: Gonzalo Odiardgonz...@laptop.org

Acked-by: Gonzalo Odiardgonz...@laptop.org


Thanks Gonzalo for testing and the review, pushed as:

http://git.sugarlabs.org/sugar/mainline/commit/e4f7d81e73fe445f4d4d7b1b168855835fcc09ea

Sidenote: The guideline says that only a maintainer can acknowledge a 
patch. For a review it is 'Reviewed-by'.


Regards,
   Simon
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH] Change string Remove in device palette by Remove device

2011-09-07 Thread Simon Schampijer
Thanks for all the feedback! I pushed [1] now Sascha's patch which uses 
pgettext to give context for translators. Chris will be making sure the 
translators can pick those changes up.


Regards,
   Simon

[1] 
http://git.sugarlabs.org/sugar/mainline/commit/7e1fa4e984e00cfaaddb46d0c043bdf21ce09fd6

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Deprecating class and service_name in activity.info file

2011-09-07 Thread Simon Schampijer

On 09/01/2011 08:40 AM, Simon Schampijer wrote:

On 08/31/2011 04:33 PM, Gonzalo Odiard wrote:

In the ticket #2870 we tried to change all the activities included by
default to use
bundle_id and exec configuration due to deprecation of class and
service_name.
The only pending activity is Record
The change is simple and I have tested it:

[gonzalo@aronax mainline]$ git diff
diff --git a/activity/activity.info b/activity/activity.info
index 3b6b219..f3215a0 100644
--- a/activity/activity.info
+++ b/activity/activity.info
@@ -1,7 +1,7 @@
[Activity]
name = Record
bundle_id = org.laptop.RecordActivity
-class = record.Record
+exec = sugar-activity record.Record
icon = activity-record
activity_version = 93
show_launcher = yes

Thanks

Gonzalo


Looks good: Reviewed-by: Simon Schampijer si...@laptop.org

Regards,
Simon


Has this been pushed?

If yes, please mind to note the commit id and update patchwork 
accordingly: http://patchwork.sugarlabs.org/patch/950/


Regards,
   Simon

PS: Who is maintaining patchwork? What keywords does it look for to 
close tickets? Is a cron-job handling that? Works rather badly for me.

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [DESIGN] Stop start-up icon pulsing when an activity fails to start

2011-09-07 Thread Gary Martin
On 6 Sep 2011, at 18:48, Samuel Greenfeld greenf...@laptop.org wrote:

 I would like to propose that we stop pulsing the animated icons (in the main 
 screen area as well as the upper toolbar frame) when an activity fails to 
 start, and Sugar already knows to display a message stating this happened.

+1 for stopping the pulse animation on failure.

 
 When this happens the animated icons should either be switched to the highest 
 transparency/alpha state to indicate failure, or be made non-transparent.

Might also want to consider the icon switching to grey.

--Gary

 Otherwise, if a user is not actively watching the launcher screen, or the 
 activity started but Sugar failed to detect it, the pulsing icons will 
 continue to pulse using CPU cycles in the background until a users spots the 
 issue and presses the Stop button found on the failed launch screen.
 
 
 ___
 Sugar-devel mailing list
 Sugar-devel@lists.sugarlabs.org
 http://lists.sugarlabs.org/listinfo/sugar-devel
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [DESIGN] Stop start-up icon pulsing when an activity fails to start

2011-09-07 Thread Thomas C Gilliard

Sugar 0.93.3 [1] is now producing this Problem in default applications:

icon stays pulsing in top bar after closing these applications [2]:
record 93
clock 6

Plus
surf 115 None failed to start (STOP)
Error in log: cannot import name AddressEntry (webtoolbar)
icon stays pulsing in top bar [3]

Tom Gilliard
satellit

[1] 
http://wiki.sugarlabs.org/go/Community/Distributions/Fedora-SoaS#Fedora-16-Nightly-20110906.17-i686-Live-soas

(2] http://bugs.sugarlabs.org/ticket/3079
[3] http://bugs.sugarlabs.org/ticket/3055#comment:8


Gary Martin wrote:

On 6 Sep 2011, at 18:48, Samuel Greenfeld greenf...@laptop.org wrote:

  

I would like to propose that we stop pulsing the animated icons (in the main 
screen area as well as the upper toolbar frame) when an activity fails to 
start, and Sugar already knows to display a message stating this happened.



+1 for stopping the pulse animation on failure.

  

When this happens the animated icons should either be switched to the highest 
transparency/alpha state to indicate failure, or be made non-transparent.



Might also want to consider the icon switching to grey.

--Gary

  

Otherwise, if a user is not actively watching the launcher screen, or the activity 
started but Sugar failed to detect it, the pulsing icons will continue to pulse using CPU 
cycles in the background until a users spots the issue and presses the Stop 
button found on the failed launch screen.


___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel

  
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] [PATCH] Browse: tabs usability improved

2011-09-07 Thread Manuel Quiñones
The Add Tab button has been relocated next to the tab labels, allowing
more space for the URL entry.

Tabs are always shown.  There is at least one tab.  In that case, it
cannot be closed.  We prevent the closing by hidding the 'X' button.
Also, the close image was sugarized.

There is now a fixed width for tabs.  The label text does ellipsize.
The width depends on the amount of tabs.  There is a maximun size that
is used when there is extra space.  There is a minimun size to prevent
hiding the information.

When a new tab is opened, it now shows an empty page, not the default
page.  In the future, we will add a hint in this empty page, similar
to what we have for an empty Journal.

Added the option to follow link in new tab in the link's palette.
Added an icon for this item, and also the icon for follow link is
also updated.

When a new tab is opened via the '+' button, the focus goes to the URL
entry in the toolbar.

Signed-off-by: Manuel Quiñones ma...@laptop.org
---
 browser.py   |  144 +-
 icons/browse-close-tab.svg   |   27 +++
 icons/browse-follow-link-new-tab.svg |   43 ++
 icons/browse-follow-link.svg |   26 ++
 palettes.py  |   27 +--
 webactivity.py   |   35 ++--
 webtoolbar.py|   16 +
 widgets.py   |   88 +
 8 files changed, 336 insertions(+), 70 deletions(-)
 create mode 100644 icons/browse-close-tab.svg
 create mode 100644 icons/browse-follow-link-new-tab.svg
 create mode 100644 icons/browse-follow-link.svg
 create mode 100644 widgets.py

diff --git a/browser.py b/browser.py
index 96e6fb1..a387df3 100644
--- a/browser.py
+++ b/browser.py
@@ -18,9 +18,11 @@
 
 import os
 import time
+from gettext import gettext as _
 
 import gobject
 import gtk
+import pango
 import hulahop
 import xpcom
 from xpcom.nsError import *
@@ -31,13 +33,16 @@ from hulahop.webview import WebView
 from sugar import env
 from sugar.activity import activity
 from sugar.graphics import style
+from sugar.graphics.icon import Icon
 
 import sessionstore
 from palettes import ContentInvoker
 from sessionhistory import HistoryListener
 from progresslistener import ProgressListener
+from widgets import BrowserNotebook
 
 _ZOOM_AMOUNT = 0.1
+_LIBRARY_PATH = '/usr/share/library-common/index.html'
 
 
 class SaveListener(object):
@@ -93,9 +98,15 @@ class CommandListener(object):
 cert_exception.showDialog(self._window)
 
 
-class TabbedView(gtk.Notebook):
+class TabbedView(BrowserNotebook):
 __gtype_name__ = 'TabbedView'
 
+__gsignals__ = {
+'focus-url-entry': (gobject.SIGNAL_RUN_FIRST,
+gobject.TYPE_NONE,
+([])),
+}
+
 _com_interfaces_ = interfaces.nsIWindowCreator
 
 AGENT_SHEET = os.path.join(activity.get_bundle_path(),
@@ -104,7 +115,7 @@ class TabbedView(gtk.Notebook):
   'user-stylesheet.css')
 
 def __init__(self):
-gobject.GObject.__init__(self)
+BrowserNotebook.__init__(self)
 
 self.props.show_border = False
 self.props.scrollable = True
@@ -140,8 +151,13 @@ class TabbedView(gtk.Notebook):
  interfaces.nsIWindowCreator)
 window_watcher.setWindowCreator(window_creator)
 
-browser = Browser()
-self._append_tab(browser)
+self.connect('size-allocate', self.__size_allocate_cb)
+self.connect('page-added', self.__page_added_cb)
+self.connect('page-removed', self.__page_removed_cb)
+
+self.add_tab()
+self._update_closing_buttons()
+self._update_tab_sizes()
 
 def createChromeWindow(self, parent, flags):
 if flags  interfaces.nsIWebBrowserChrome.CHROME_OPENAS_CHROME:
@@ -160,25 +176,96 @@ class TabbedView(gtk.Notebook):
 
 return browser.containerWindow
 else:
-browser = Browser()
+browser = Browser(self)
 self._append_tab(browser)
 
 return browser.browser.containerWindow
 
+def __size_allocate_cb(self, widget, allocation):
+self._update_tab_sizes()
+
+def __page_added_cb(self, notebook, child, pagenum):
+self._update_closing_buttons()
+self._update_tab_sizes()
+
+def __page_removed_cb(self, notebook, child, pagenum):
+self._update_closing_buttons()
+self._update_tab_sizes()
+
+def add_tab(self, next_to_current=False):
+browser = Browser(self)
+if next_to_current:
+self._insert_tab_next(browser)
+else:
+self._append_tab(browser)
+return browser
+
+def _insert_tab_next(self, browser):
+label = TabLabel(browser)
+label.connect('tab-close', self.__tab_close_cb)
+
+self.insert_page(browser, label, self.get_current_page() + 1)
+

Re: [Sugar-devel] [PATCH] Browse: tabs usability improved

2011-09-07 Thread manuel quiñones
Hi,

El día 6 de septiembre de 2011 07:48, Simon Schampijer
si...@schampijer.de escribió:
 On 09/05/2011 08:44 PM, Manuel Quiñones wrote:

 The Add Tab button has been relocated next to the tab labels, allowing
 more space for the URL entry.

 Tabs are always shown.  There is at least one tab.  In that case, it
 cannot be closed.  We prevent the closing by hidding the 'X' button.
 Also, the close image was sugarized.

 There is now a fixed width for tabs.  The label text does ellipsize.
 The width depends on the amount of tabs.  There is a maximun size that
 is used when there is extra space.  There is a minimun size to prevent
 hiding the information.

 When a new tab is opened, it now shows an empty page, not the default
 page.  In the future, we will add a hint in this empty page, similar
 to what we have for an empty Journal.

 Added the option to follow link in new tab in the link's palette.
 Added an icon for this item, and also the icon for follow link is
 also updated.

 Wow, this is great stuff!

 As always, some small comments :)

Thanks for your detailed feedback and changes, I'm resending my patch
based on them:

 - when you open a new tab FF is setting the label to 'Untitled' (see patch
 untitled.patch)

Right! Added.

 - when we have a new tab open, enter a url and then load it we see a
 'about:blank' shortly, we can show 'Loading...' like FF there (see loading.
 patch (there might be better ways of doing it but the timing looks like it
 is the same as FF))

Added too.

 - 3 tabs open: when using the 'follow link in new tab' option in tab_index=1
 the new tab is appended to the list of open tabs - will be tab_index=3, in
 FF it will be the tab right next to tab_index=1 (tab_index=2) (maybe just
 try to open a link in a new tab from any tab in FF not the one a the right
 to see :)

Good.  I've implemented it.

 - when you select a tab, one gets the white ellipse. if you compare with the
 the old toolbar (you can see in Memorize) which is a notebook as well you do
 not get the ellipse when selecting with a single click, however you do get
 it when you double click once: I did try and looked through the properties
 (border, can-focus...) but no property does seem to fix it, what is funny if
 you change the BrowserNotebook to derive from a gtk.Notebook istead of the
 sugar.graphics.notebook.Notebook we get the same behavior as with the
 old-style toolbars, h

The same behaviour happens in Terminal.  I don't know what needs to be
changed.  Is there any problem with this behaviour?

 - coloring of the tabs: the currently selected one should maybe have the
 same color as the toolbar, we should maybe do similar than in the old-style
 toolbar?

I played with gtk styles but I didn't include that changes in my
resended patch.  Maybe it is better to do this in Sugar theme?

Regards,

-- 
.. manuq ..
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Deprecating class and service_name in activity.info file

2011-09-07 Thread Gonzalo Odiard
Looks like it was pushed.
I have changed patchwork state and closed the ticket.
Thanks to all the developers involved

Gonzalo


Has this been pushed?


 If yes, please mind to note the commit id and update patchwork accordingly:
 http://patchwork.sugarlabs.**org/patch/950/http://patchwork.sugarlabs.org/patch/950/

 Regards,
   Simon

 PS: Who is maintaining patchwork? What keywords does it look for to close
 tickets? Is a cron-job handling that? Works rather badly for me.

 __**_
 Sugar-devel mailing list
 Sugar-devel@lists.sugarlabs.**org Sugar-devel@lists.sugarlabs.org
 http://lists.sugarlabs.org/**listinfo/sugar-develhttp://lists.sugarlabs.org/listinfo/sugar-devel

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH] Browse: tabs usability improved

2011-09-07 Thread Simon Schampijer

Hi Manuel,

the general approach looks really good, and the code has high quality, 
just a few nitpicks and suggestions:


On 09/07/2011 01:52 PM, Manuel Quiñones wrote:

The Add Tab button has been relocated next to the tab labels, allowing
more space for the URL entry.

Tabs are always shown.  There is at least one tab.  In that case, it
cannot be closed.  We prevent the closing by hidding the 'X' button.


s/hidding/hiding


Also, the close image was sugarized.

There is now a fixed width for tabs.  The label text does ellipsize.
The width depends on the amount of tabs.  There is a maximun size that
is used when there is extra space.  There is a minimun size to prevent
hiding the information.


s/maximun/maximum s/minimun/minimum


When a new tab is opened, it now shows an empty page, not the default
page.  In the future, we will add a hint in this empty page, similar
to what we have for an empty Journal.

Added the option to follow link in new tab in the link's palette.
Added an icon for this item, and also the icon for follow link is
also updated.

When a new tab is opened via the '+' button, the focus goes to the URL
entry in the toolbar.

Signed-off-by: Manuel Quiñonesma...@laptop.org
---
  browser.py   |  144 +-
  icons/browse-close-tab.svg   |   27 +++
  icons/browse-follow-link-new-tab.svg |   43 ++
  icons/browse-follow-link.svg |   26 ++
  palettes.py  |   27 +--
  webactivity.py   |   35 ++--
  webtoolbar.py|   16 +
  widgets.py   |   88 +
  8 files changed, 336 insertions(+), 70 deletions(-)
  create mode 100644 icons/browse-close-tab.svg
  create mode 100644 icons/browse-follow-link-new-tab.svg
  create mode 100644 icons/browse-follow-link.svg
  create mode 100644 widgets.py

diff --git a/browser.py b/browser.py
index 96e6fb1..a387df3 100644
--- a/browser.py
+++ b/browser.py
@@ -18,9 +18,11 @@

  import os
  import time
+from gettext import gettext as _

  import gobject
  import gtk
+import pango
  import hulahop
  import xpcom
  from xpcom.nsError import *
@@ -31,13 +33,16 @@ from hulahop.webview import WebView
  from sugar import env
  from sugar.activity import activity
  from sugar.graphics import style
+from sugar.graphics.icon import Icon

  import sessionstore
  from palettes import ContentInvoker
  from sessionhistory import HistoryListener
  from progresslistener import ProgressListener
+from widgets import BrowserNotebook

  _ZOOM_AMOUNT = 0.1
+_LIBRARY_PATH = '/usr/share/library-common/index.html'


  class SaveListener(object):
@@ -93,9 +98,15 @@ class CommandListener(object):
  cert_exception.showDialog(self._window)


-class TabbedView(gtk.Notebook):
+class TabbedView(BrowserNotebook):
  __gtype_name__ = 'TabbedView'

+__gsignals__ = {
+'focus-url-entry': (gobject.SIGNAL_RUN_FIRST,
+gobject.TYPE_NONE,
+([])),
+}
+
  _com_interfaces_ = interfaces.nsIWindowCreator

  AGENT_SHEET = os.path.join(activity.get_bundle_path(),
@@ -104,7 +115,7 @@ class TabbedView(gtk.Notebook):
'user-stylesheet.css')

  def __init__(self):
-gobject.GObject.__init__(self)
+BrowserNotebook.__init__(self)

  self.props.show_border = False
  self.props.scrollable = True
@@ -140,8 +151,13 @@ class TabbedView(gtk.Notebook):
   interfaces.nsIWindowCreator)
  window_watcher.setWindowCreator(window_creator)

-browser = Browser()
-self._append_tab(browser)
+self.connect('size-allocate', self.__size_allocate_cb)
+self.connect('page-added', self.__page_added_cb)
+self.connect('page-removed', self.__page_removed_cb)
+
+self.add_tab()
+self._update_closing_buttons()
+self._update_tab_sizes()

  def createChromeWindow(self, parent, flags):
  if flags  interfaces.nsIWebBrowserChrome.CHROME_OPENAS_CHROME:
@@ -160,25 +176,96 @@ class TabbedView(gtk.Notebook):

  return browser.containerWindow
  else:
-browser = Browser()
+browser = Browser(self)
  self._append_tab(browser)

  return browser.browser.containerWindow

+def __size_allocate_cb(self, widget, allocation):
+self._update_tab_sizes()
+
+def __page_added_cb(self, notebook, child, pagenum):
+self._update_closing_buttons()
+self._update_tab_sizes()
+
+def __page_removed_cb(self, notebook, child, pagenum):
+self._update_closing_buttons()
+self._update_tab_sizes()
+
+def add_tab(self, next_to_current=False):
+browser = Browser(self)
+if next_to_current:
+self._insert_tab_next(browser)
+else:
+

Re: [Sugar-devel] [DESIGN] Stop start-up icon pulsing when an activity fails to start

2011-09-07 Thread Gonzalo Odiard
On Wed, Sep 7, 2011 at 5:29 AM, Thomas C Gilliard 
satel...@bendbroadband.com wrote:

 **
 Sugar 0.93.3 [1] is now producing this Problem in default applications:

 icon stays pulsing in top bar after closing these applications [2]:
 record 93
 clock 6


Probably related to http://dev.laptop.org/ticket/11201


 Plus
 surf 115 None failed to start (STOP)
 Error in log: cannot import name AddressEntry (webtoolbar)
 icon stays pulsing in top bar [3]


AddressEntry was deprecated in Sugar. Surf activity should be updated.
Look at commit 936588fccb392d6d9564484ddccbd01f322d0eaa in Browse activity

Gonzalo



 Tom Gilliard
 satellit

 [1]
 http://wiki.sugarlabs.org/go/Community/Distributions/Fedora-SoaS#Fedora-16-Nightly-20110906.17-i686-Live-soas
 (2] http://bugs.sugarlabs.org/ticket/3079
 [3] http://bugs.sugarlabs.org/ticket/3055#comment:8



 Gary Martin wrote:

 On 6 Sep 2011, at 18:48, Samuel Greenfeld greenf...@laptop.org 
 greenf...@laptop.org wrote:



  I would like to propose that we stop pulsing the animated icons (in the main 
 screen area as well as the upper toolbar frame) when an activity fails to 
 start, and Sugar already knows to display a message stating this happened.


  +1 for stopping the pulse animation on failure.



  When this happens the animated icons should either be switched to the 
 highest transparency/alpha state to indicate failure, or be made 
 non-transparent.


  Might also want to consider the icon switching to grey.

 --Gary



  Otherwise, if a user is not actively watching the launcher screen, or the 
 activity started but Sugar failed to detect it, the pulsing icons will 
 continue to pulse using CPU cycles in the background until a users spots the 
 issue and presses the Stop button found on the failed launch screen.


 ___
 Sugar-devel mailing 
 listSugar-devel@lists.sugarlabs.orghttp://lists.sugarlabs.org/listinfo/sugar-devel

  ___
 Sugar-devel mailing 
 listSugar-devel@lists.sugarlabs.orghttp://lists.sugarlabs.org/listinfo/sugar-devel


 ___
 Sugar-devel mailing list
 Sugar-devel@lists.sugarlabs.org
 http://lists.sugarlabs.org/listinfo/sugar-devel


___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH sugar] Add empty messages for empty devices and empty DOCUMENTS folders

2011-09-07 Thread Gonzalo Odiard
Retested!
Please push.

Gonzalo

On Wed, Sep 7, 2011 at 3:07 AM, Simon Schampijer si...@schampijer.dewrote:

 On 09/06/2011 08:59 PM, Gonzalo Odiard wrote:

 Tested and works ok.
 IMHO, sending the constants had more sense when we only had two messages,
 now should be more clear if we do:

 if len(tree_model) == 0:

  if self._is_query_empty():
 -self._show_message(MESSAGE_**EMPTY_JOURNAL)
 +if self._query['mountpoints'] == ['/']:
 +self._show_message(_('Your Journal is empty'))
 +elif self._query['mountpoints'] == \
 +[model.get_documents_path()]:
 +self._show_message(_('Your documents folder is
 empty'))
 +else:
 +self._show_message(_('The device is empty'))
 else:
 self._show_message(_('No matching
 entries'),show_clear_query=**True)
 else:
 @@ -385,6 +393,10 @@ class BaseListView(gtk.Bin):



def _show_message(self, message, show_clear_query=False):

   .

   if show_clear_query:
 button = gtk.Button(label=_('Clear search'))
 button.connect('clicked', self.__clear_button_clicked_**cb)
 button.props.image = Icon(icon_name='dialog-cancel'**,
   icon_size=gtk.ICON_SIZE_**BUTTON)
 canvas_button = hippo.CanvasWidget(widget=**button,

 xalign=hippo.ALIGNMENT_CENTER)
 box.append(canvas_button)


 ... but is only me.
 Regards,

 Gonzalo


 Thanks Gonzalo for the feedback. Addressed your suggestion in the follow-up
 patch. Can you retest before I push?

 Regards,
   Simon




___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] [ASLO] Release GeoGebra-5

2011-09-07 Thread Sugar Labs Activities
Activity Homepage:
http://activities.sugarlabs.org/addon/4284

Sugar Platform:
0.82 - 0.92

Download Now:
http://activities.sugarlabs.org/downloads/file/27559/geogebra-5.xo

Release notes:
* GeoGebra 3.2.47.0 release


Sugar Labs Activities
http://activities.sugarlabs.org

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH] Browse: tabs usability improved

2011-09-07 Thread Simon Schampijer

On 09/07/2011 03:03 PM, Simon Schampijer wrote:

Hi Manuel,


[..]

There are as well two errors in the logs we need to address:

1315401901.466328 DEBUG web-activity: Starting the web activity
Traceback (most recent call last):
  File /home/erikos/Activities/Browse.activity/widgets.py, line 73, 
in __on_switch_page

self.set_current_page(-1)
  File /home/erikos/Activities/Browse.activity/widgets.py, line 88, 
in set_current_page

return Notebook.set_current_page(self, number)
RuntimeError: maximum recursion depth exceeded while calling a Python 
object


and

RuntimeError: maximum recursion depth exceeded
RuntimeError: maximum recursion depth exceeded
Traceback (most recent call last):
  File /home/erikos/Activities/Browse.activity/browser.py, line 192, 
in __page_removed_cb

self._update_closing_buttons()
  File /home/erikos/Activities/Browse.activity/browser.py, line 258, 
in _update_closing_buttons

first_label.show_close_button()
AttributeError: 'TabAdd' object has no attribute 'show_close_button'


Regards,
   Simon
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH] Browse: tabs usability improved

2011-09-07 Thread Simon Schampijer

On 09/07/2011 03:37 PM, Simon Schampijer wrote:

On 09/07/2011 03:03 PM, Simon Schampijer wrote:

Hi Manuel,


[..]

There are as well two errors in the logs we need to address:

1315401901.466328 DEBUG web-activity: Starting the web activity
Traceback (most recent call last):
File /home/erikos/Activities/Browse.activity/widgets.py, line 73, in
__on_switch_page
self.set_current_page(-1)
File /home/erikos/Activities/Browse.activity/widgets.py, line 88, in
set_current_page
return Notebook.set_current_page(self, number)
RuntimeError: maximum recursion depth exceeded while calling a Python
object

and

RuntimeError: maximum recursion depth exceeded
RuntimeError: maximum recursion depth exceeded
Traceback (most recent call last):
File /home/erikos/Activities/Browse.activity/browser.py, line 192, in
__page_removed_cb
self._update_closing_buttons()
File /home/erikos/Activities/Browse.activity/browser.py, line 258, in
_update_closing_buttons
first_label.show_close_button()
AttributeError: 'TabAdd' object has no attribute 'show_close_button'


Regards,
Simon


Two more issues:

* the focus-url-entry does only work when we use the 'add-tab' button 
but not when we use the keyboard shortcut 'ctrl+t'


Seems to work with the following:

diff --git a/browser.py b/browser.py
index a387df3..dec7d1d 100644
--- a/browser.py
+++ b/browser.py
@@ -198,6 +198,7 @@ class TabbedView(BrowserNotebook):
 self._insert_tab_next(browser)
 else:
 self._append_tab(browser)
+self.emit('focus-url-entry')
 return browser

 def _insert_tab_next(self, browser):
@@ -218,7 +219,6 @@ class TabbedView(BrowserNotebook):

 def on_add_tab(self, gobject):
 self.add_tab()
-self.emit('focus-url-entry')

* when you resume a session that contains an empty tab we get an error, 
steps to reproduce:

   - open a new Browse session
   - add one tab
   - without typing in an url close the session
   - resume it

you will get the following error:

1315403227.280123 DEBUG root: nsIEmbeddingSiteWindow.get_visibility: False
1315403227.284243 DEBUG root: OnHistoryGotoIndex: 0 
file:///home/erikos/Activities/Browse.activity/data/index.html

Traceback (most recent call last):
  File 
/home/erikos/sugar-jhbuild/install/lib/python2.7/site-packages/sugar/activity/activity.py, 
line 506, in __canvas_map_cb

self.read_file(self._jobject.file_path)
  File /home/erikos/Activities/Browse.activity/webactivity.py, line 
452, in read_file

browser.set_history_index(tab['history_index'])
  File /home/erikos/Activities/Browse.activity/browser.py, line 461, 
in set_history_index

self.web_navigation.gotoIndex(index)
  File XPCOMObject method 'gotoIndex', line 3, in gotoIndex
xpcom.Exception: -2147467259 (NS_ERROR_FAILURE)
1315403227.291903 DEBUG root: ActivityService.set_active: 1.
1315403227.305870 DEBUG root: nsIEmbeddingSiteWindow.get_visibility: False

Regards,
   Simon
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH] Browse: tabs usability improved

2011-09-07 Thread Martin Langhoff
Hi Manuel,

happy with this overall -- one comment...

On Wed, Sep 7, 2011 at 7:52 AM, Manuel Quiñones ma...@laptop.org wrote:
 When a new tab is opened, it now shows an empty page, not the default
 page.  In the future, we will add a hint in this empty page, similar
 to what we have for an empty Journal.

Instead of adding a hint, can I suggest you look at what the Chrome
browser does? It shows a recent pages and most visited pages.

If it is too late for this dev cycle, I am still interested in having
this functionality, even for the next dev cycle :-)

cheers,



m
-- 
 martin.langh...@gmail.com
 mar...@laptop.org -- Software Architect - OLPC
 - ask interesting questions
 - don't get distracted with shiny stuff  - working code first
 - http://wiki.laptop.org/go/User:Martinlanghoff
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH sugar] Add empty messages for empty devices and empty DOCUMENTS folders

2011-09-07 Thread Simon Schampijer

On 09/07/2011 03:20 PM, Gonzalo Odiard wrote:

Retested!
Please push.

Gonzalo


Pushed as: 
http://git.sugarlabs.org/sugar/mainline/commit/b644c5e097b14810336da85c9669559d55fd7f60


Regards,
   Simon
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH sugar] Only consider the exact same version of a bundle as installed (fixes SL#3081)

2011-09-07 Thread Simon Schampijer

On 09/04/2011 10:52 PM, Sascha Silbe wrote:

49232e55 introduced a typo that caused a bundle to be considered installed
even if it contained an older version than what was actually installed. This
is turn triggered the upgrade logic in jarabe.journal.misc.resume().

The result was that activities got downgraded without asking the user for
confirmation.

Signed-off-by: Sascha Silbesi...@activitycentral.com
---
  src/jarabe/model/bundleregistry.py |2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/jarabe/model/bundleregistry.py 
b/src/jarabe/model/bundleregistry.py
index 63308bb..26e719f 100644
--- a/src/jarabe/model/bundleregistry.py
+++ b/src/jarabe/model/bundleregistry.py
@@ -360,7 +360,7 @@ def is_installed(self, bundle):

  for installed_bundle in self._bundles:
  if bundle.get_bundle_id() == installed_bundle.get_bundle_id() and 
\
-NormalizedVersion(bundle.get_activity_version())= \
+NormalizedVersion(bundle.get_activity_version()) == \
  
NormalizedVersion(installed_bundle.get_activity_version()):
  return True
  return False


Thanks for the patch, acked and pushed as: 
http://git.sugarlabs.org/sugar/mainline/commit/69d7d6e675659a52152f4fe3692614ed63a4be21


Regards,
   Simon
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH] Jukebox: restore activity subtoolbar

2011-09-07 Thread Simon Schampijer

Hi Manuel,

looks good.

Reviewed-By: Simon Schampijer si...@laptop.org

Regards,
   Simon

PS: there seem to be an issue with the subtoolbar: when you click on it 
(lock it in) and click again on it it does not go away anymore. For both 
the activity and the view toolbar


On 09/02/2011 03:02 PM, Manuel Quiñones wrote:

For new style of toolbars, the activity subtoolbar was missing.  It
has the activity title entry and the share button disabled.  Set max
participants to one.

Signed-off-by: Manuel Quiñonesma...@laptop.org
---
  jukeboxactivity.py |   13 +++--
  1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/jukeboxactivity.py b/jukeboxactivity.py
index 0ba3f4c..53539db 100644
--- a/jukeboxactivity.py
+++ b/jukeboxactivity.py
@@ -27,6 +27,7 @@ from gettext import gettext as _
  import os

  from sugar.activity import activity
+from sugar.activity.widgets import ActivityToolbarButton
  from sugar.graphics.objectchooser import ObjectChooser
  from sugar import mime

@@ -68,6 +69,9 @@ class JukeboxActivity(activity.Activity):

  def __init__(self, handle):
  activity.Activity.__init__(self, handle)
+
+self.max_participants = 1
+
  self._object_id = handle.object_id
  self.set_title(_('Jukebox Activity'))
  self.player = None
@@ -101,13 +105,10 @@ class JukeboxActivity(activity.Activity):

  else:
  toolbar_box = ToolbarBox()
-activity_button = ToolButton()
-color = XoColor(profile.get_color())
-bundle = ActivityBundle(activity.get_bundle_path())
-icon = Icon(file=bundle.get_icon(), xo_color=color)
-activity_button.set_icon_widget(icon)
-activity_button.show()
+
+activity_button = ActivityToolbarButton(self)
  toolbar_box.toolbar.insert(activity_button, 0)
+activity_button.show()

  _view_toolbar = ViewToolbar()
  _view_toolbar.connect('go-fullscreen',


___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH] Jukebox: restore activity subtoolbar

2011-09-07 Thread Gonzalo Odiard
Right now, jukebox is not saving anything useful in the journal, then I
don't see why we need this toolbar.
But this will change soon, because Manuel have a play list patch in the
works.
Then we can add this toolbar.

Gonzalo

2011/9/7 Simon Schampijer si...@schampijer.de

 Hi Manuel,

 looks good.

 Reviewed-By: Simon Schampijer si...@laptop.org

 Regards,
   Simon

 PS: there seem to be an issue with the subtoolbar: when you click on it
 (lock it in) and click again on it it does not go away anymore. For both the
 activity and the view toolbar


 On 09/02/2011 03:02 PM, Manuel Quiñones wrote:

 For new style of toolbars, the activity subtoolbar was missing.  It
 has the activity title entry and the share button disabled.  Set max
 participants to one.

 Signed-off-by: Manuel Quiñonesma...@laptop.org
 ---
  jukeboxactivity.py |   13 +++--
  1 files changed, 7 insertions(+), 6 deletions(-)

 diff --git a/jukeboxactivity.py b/jukeboxactivity.py
 index 0ba3f4c..53539db 100644
 --- a/jukeboxactivity.py
 +++ b/jukeboxactivity.py
 @@ -27,6 +27,7 @@ from gettext import gettext as _
  import os

  from sugar.activity import activity
 +from sugar.activity.widgets import ActivityToolbarButton
  from sugar.graphics.objectchooser import ObjectChooser
  from sugar import mime

 @@ -68,6 +69,9 @@ class JukeboxActivity(activity.**Activity):

  def __init__(self, handle):
  activity.Activity.__init__(**self, handle)
 +
 +self.max_participants = 1
 +
  self._object_id = handle.object_id
  self.set_title(_('Jukebox Activity'))
  self.player = None
 @@ -101,13 +105,10 @@ class JukeboxActivity(activity.**Activity):

  else:
  toolbar_box = ToolbarBox()
 -activity_button = ToolButton()
 -color = XoColor(profile.get_color())
 -bundle = ActivityBundle(activity.get_**bundle_path())
 -icon = Icon(file=bundle.get_icon(), xo_color=color)
 -activity_button.set_icon_**widget(icon)
 -activity_button.show()
 +
 +activity_button = ActivityToolbarButton(self)
  toolbar_box.toolbar.insert(**activity_button, 0)
 +activity_button.show()

  _view_toolbar = ViewToolbar()
  _view_toolbar.connect('go-**fullscreen',



___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] [RELEASE] sugar-toolkit-0.93.3

2011-09-07 Thread Simon Schampijer
== Source ==

http://download.sugarlabs.org/sources/sucrose/glucose/sugar-toolkit/sugar-toolkit-0.93.3.tar.bz2

== News ==

* Release 0.93.3 (Simon Schampijer)
* Some activities segfault when closing, OLPC #11201 (Simon Schampijer)
* Commit from Sugar Labs: Translation System by user ganesh.: 40 of 40 messages 
translated (0 fuzzy). (Pootle daemon)
* Commit from Sugar Labs: Translation System by user cjl.: 40 of 40 messages 
translated (0 fuzzy). (Pootle daemon)
* Commit from Sugar Labs: Translation System by user cjl.: 40 of 40 messages 
translated (0 fuzzy). (Pootle daemon)
* Commit from Sugar Labs: Translation System by user anderson861.: 40 of 40 
messages translated (0 fuzzy). (Pootle daemon)
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] [RELEASE] sugar-0.93.4

2011-09-07 Thread Simon Schampijer
== Source ==

http://download.sugarlabs.org/sources/sucrose/glucose/sugar/sugar-0.93.4.tar.bz2

== News ==

* Release 0.93.4 (Simon Schampijer)
* Update Sucrose version for upcoming 0.93.4 (Simon Schampijer)
* Pylint: remove unused import XoColor (Simon Schampijer)
* Adjust the docstring for get_documents_path (Simon Schampijer)
* Only consider the exact same version of a bundle as installed (fixes SL#3081) 
(Sascha Silbe)
* Add empty messages for empty devices and empty DOCUMENTS folders (Simon 
Schampijer)
* Only show DOCUMENTS folder when it is not $HOME (Simon Schampijer)
* Allow Remove in Clipboard resp. Volumes palette to be translated 
differently (Sascha Silbe)
* Commit from Sugar Labs: Translation System by user samybt.: 375 of 375 
messages translated (0 fuzzy). (Pootle daemon)
* Commit from Sugar Labs: Translation System by user anderson861.: 188 of 279 
messages translated (0 fuzzy). (Pootle daemon)
* Commit from Sugar Labs: Translation System by user cjl.: 375 of 375 messages 
translated (0 fuzzy). (Pootle daemon)
* Position DocumentsButton correctly in the VolumesToolbar (Simon Schampijer)
* Commit from Sugar Labs: Translation System by user cjl.: 374 of 375 messages 
translated (1 fuzzy). (Pootle daemon)
* Commit from Sugar Labs: Translation System by user aputsiaq.: 375 of 375 
messages translated (0 fuzzy). (Pootle daemon)
* Commit from Sugar Labs: Translation System by user cjl.: 375 of 375 messages 
translated (0 fuzzy). (Pootle daemon)
* Commit from Sugar Labs: Translation System by user mschlager.: 375 of 375 
messages translated (0 fuzzy). (Pootle daemon)
* Pushed by mistake (Simon Schampijer)
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] Patchwork (was: Re: Deprecating class and service_name in activity.info file)

2011-09-07 Thread Sascha Silbe
Excerpts from Simon Schampijer's message of Wed Sep 07 08:29:59 +0200 2011:

 PS: Who is maintaining patchwork? What keywords does it look for to 
 close tickets? Is a cron-job handling that? Works rather badly for me.

Nobody is actively maintaining Patchwork. Marco offered to do it [1,2],
but didn't follow up. I've been working on it from time to time to fix
the most important issues, but already have too many other things to
work on.

git.sl.o has a custom module [3] (developed by me) to update patches in
Patchwork whenever it can find a match. It's based on existing Patchwork
functionality, so the diff portion must match exactly: changing the
commit message is fine, but if you change anything in the code it won't
update the patch in Patchwork (since there's no exact match).

Each package that has its own repository needs to be explicitly added to
the configuration file (besides other reasons because we don't want
commits to personal clones to remove the patch from the Patchwork
queue). Similarly, the subject prefix must mention the name of the
repository (again to prevent us from updating the wrong patch for
projects containing similar sources).

If patches that a) match exactly, b) are committed to a configured
repository (e.g. sugar, sugar-toolkit) and c) mentioned the module name in
the subject prefix don't get updated in Patchwork, please file a bug on
bugs.sl.o, mentioning a) the commit id in the git repository and b) the
patch id on Patchwork so that someone (maybe me) can investigate.

Sascha

[1] mid:3367c086-5c5c-4e87-9709-3023025ef...@marcopg.org
[2] http://lists.sugarlabs.org/archive/sugar-devel/2010-September/026466.html
[3] 
http://gitorious.org/~alsroot/gitorious/sugarlabs-org/blobs/master/lib/patchwork.rb
-- 
http://sascha.silbe.org/
http://www.infra-silbe.de/


signature.asc
Description: PGP signature
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] [ASLO] Release TurtleArt Butia-6

2011-09-07 Thread Sugar Labs Activities
Activity Homepage:
http://activities.sugarlabs.org/addon/4434

Sugar Platform:
0.82 - 0.92

Download Now:
http://activities.sugarlabs.org/downloads/file/27549/turtle_art_butia-6.xo

Release notes:
- Fix the translations
- Repainting eliminated
- Changes in the Lua compilation for the library search


Sugar Labs Activities
http://activities.sugarlabs.org

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] [ASLO] Release Ruler-12

2011-09-07 Thread Sugar Labs Activities
Activity Homepage:
http://activities.sugarlabs.org/addon/4192

Sugar Platform:
0.82 - 0.92

Download Now:
http://activities.sugarlabs.org/downloads/file/27560/ruler-12.xo

Release notes:
BUG FIX
* removed some untranslated languages that were causing problems when building 
the RPM


Sugar Labs Activities
http://activities.sugarlabs.org

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] New toolbar in Memorize

2011-09-07 Thread Gonzalo Odiard
I have played with all the ideas we talked, and have implemented the new
toolbar in Memorize.
The only missing piece is load in the combo the games present in the
Journal, and remove the load and save buttons,
but the present change is already big and I think this can be implemented
later.

I am interested in comments about the usability (and the code, of course).

The main change in the use, is now the activity do not have different Load
buttons to play and to creation modes,
then the user can modify any game, even the example games! The games are
saved ever in a new file,
then the user can't loose previous work.

I have separated the patches in two, one with the change on icons only,
and another with the changes in the code, to simplify the review.

If you want play with it and provide feedback, can download a testing
version from http://dev.laptop.org/~gonzalo/Memorize-37.xo

The patches will be sent to sugar-devel.

Gonzalo
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] [Memorize PATCH 2/2] Implement new toolbar in Memorize

2011-09-07 Thread godiard
From: Gonzalo Odiard godi...@gmail.com

Signed-off-by: Gonzalo Odiard gonz...@laptop.org
---
 activity.py|  127 +++--
 cardlist.py|2 +-
 createtoolbar.py   |  161 +---
 game.py|1 -
 memorizetoolbar.py |   49 +---
 5 files changed, 166 insertions(+), 174 deletions(-)

diff --git a/activity.py b/activity.py
index 81c36ae..4fcc2e4 100644
--- a/activity.py
+++ b/activity.py
@@ -33,6 +33,10 @@ import gtk
 import telepathy
 import telepathy.client
 
+from sugar.activity.widgets import ActivityToolbarButton
+from sugar.activity.widgets import StopButton
+from sugar.graphics.toolbarbox import ToolbarButton, ToolbarBox
+
 from sugar.activity.activity import Activity, ActivityToolbox
 from sugar.presence import presenceservice
 from sugar.presence.tubeconn import TubeConnection
@@ -52,34 +56,60 @@ SERVICE = 'org.laptop.Memorize'
 IFACE = SERVICE
 PATH = '/org/laptop/Memorize'
 
-_TOOLBAR_PLAY = 1
-_TOOLBAR_CREATE = 2
+_MODE_PLAY = 1
+_MODE_CREATE = 2
 
 class MemorizeActivity(Activity):
 
 def __init__(self, handle):
 Activity.__init__(self, handle)
 
-self.create_load = False
 self.play_mode = None
 
-toolbox = ActivityToolbox(self)
-activity_toolbar = toolbox.get_activity_toolbar()
-
-self._memorizeToolbar = memorizetoolbar.MemorizeToolbar(self)
-toolbox.add_toolbar(_('Play'), self._memorizeToolbar)
-self._memorizeToolbar.show()  
+toolbar_box = ToolbarBox()
+self.set_toolbar_box(toolbar_box)
+
+self.activity_button = ActivityToolbarButton(self)
+toolbar_box.toolbar.insert(self.activity_button, -1)
+
+self._memorizeToolbarBuilder = \
+memorizetoolbar.MemorizeToolbarBuilder(self)
+
+toolbar_box.toolbar.insert(gtk.SeparatorToolItem(), -1)
+
+self._createToolbarBuilder = \
+createtoolbar.CreateToolbarBuilder(self)
+
+separator = gtk.SeparatorToolItem()
+separator.set_expand(True)
+separator.set_draw(False)
+toolbar_box.toolbar.insert(separator, -1)
+
+toolbar_box.toolbar.insert(StopButton(self), -1)
 
-self._createToolbar = createtoolbar.CreateToolbar(self)
-toolbox.add_toolbar(_('Create'), self._createToolbar)
-self._createToolbar.show()
-
-self.set_toolbox(toolbox)
-toolbox.show()
-
 # Play game mode
 self.table = cardtable.CardTable()
 self.scoreboard = scoreboard.Scoreboard()
+self.cardlist = cardlist.CardList()
+self.createcardpanel = createcardpanel.CreateCardPanel()
+self.cardlist.connect('pair-selected',
+self.createcardpanel.pair_selected)
+self.cardlist.connect('update-create-toolbar',
+self._createToolbarBuilder.update_create_toolbar)
+self.cardlist.connect('update-create-buttons',
+self._createToolbarBuilder.update_buttons_status)
+self.createcardpanel.connect('add-pair',
+self.cardlist.add_pair)
+self.createcardpanel.connect('update-pair',
+self.cardlist.update_selected)
+self._createToolbarBuilder.connect('create_new_game',
+self.cardlist.clean_list)
+self._createToolbarBuilder.connect('create_new_game',
+self.createcardpanel.clean)
+self._createToolbarBuilder.connect('create_save_game',
+self.cardlist.save_game)
+self._createToolbarBuilder.connect('create_equal_pairs',
+self.createcardpanel.change_equal_pairs)
 self.game = game.MemorizeGame()
 
 self.table.connect('key-press-event', self.table.key_press_event)
@@ -107,10 +137,13 @@ class MemorizeActivity(Activity):
 
 self.game.connect('load_game', self.table.load_game)
 self.game.connect('change_game', self.table.change_game)
-self.game.connect('load_game', self._memorizeToolbar.update_toolbar)
-self.game.connect('change_game', self._memorizeToolbar.update_toolbar)
-
-self._memorizeToolbar.connect('game_changed', self.game.change_game)
+self.game.connect('load_game',
+self._memorizeToolbarBuilder.update_toolbar)
+self.game.connect('change_game',
+self._memorizeToolbarBuilder.update_toolbar)
+
+self._memorizeToolbarBuilder.connect('game_changed',
+self.change_game)
 
 self.hbox = gtk.HBox(False)
 self.set_canvas(self.hbox)
@@ -126,8 +159,10 @@ class MemorizeActivity(Activity):
 
 # start on the game toolbar, might change this
 # to the create toolbar later
-self.toolbox.connect('current-toolbar-changed', self.change_mode)
-self.toolbox.set_current_toolbar(_TOOLBAR_PLAY)
+# TODO:
+

Re: [Sugar-devel] Activities for teacher-oriented and mouse-based interactions?

2011-09-07 Thread Tabitha Roder
On 7 September 2011 03:23, Bastien b...@altern.org wrote:


 2) What set of meaningful activities would you pick up?


As well as what Walter has already suggested, I would think about the stable
activities that make almost all the builds so they have some tools that
almost always work whatever build -
* Memorize as it is easy to learn how to make your own activities, then
teachers can have the students make their own games for each other very
quickly (one of the activities that has very low barriers to entry). This
can be done as a class or group activity where students suggest the cards
and what matches them.
* Physics because it rocks. Actually, so does Measure.
* Record if you can get it working on their laptops easily (got to have
camera and microphone obviously). In my experience I have found that seeing
themselves on the screen fascinates teachers as much as kids and can lead
onto great activities for their students in exploring who they are and what
is around them.

Another one to consider is Infoslice as it can be a useful tool for teachers
to remix and create resources for their students from wikipedia pages
(assuming they have access to wikipedia) and this might lead to getting
students to remix and create resources like the teacher did (either on
teachers laptop, other laptop, or with newspapers and butchers paper). A bit
of modelling like this can be useful and can help with teaching how concepts
relate, accessing and analysing information, building on what they are
learning, ...

Tabitha
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH] Change string Remove in device palette by Remove device

2011-09-07 Thread Chris Leonard
This has been pulled to Pootle and all langs sugar.po have been refreshed.

Remove - clipboard
http://translate.sugarlabs.org/es/glucose/sugar.po?item=247view_mode=translate

Remove - volume
http://translate.sugarlabs.org/es/glucose/sugar.po?item=369view_mode=translate

cjl

On Wed, Sep 7, 2011 at 2:19 AM, Simon Schampijer si...@schampijer.de wrote:
 Thanks for all the feedback! I pushed [1] now Sascha's patch which uses
 pgettext to give context for translators. Chris will be making sure the
 translators can pick those changes up.

 Regards,
   Simon

 [1]
 http://git.sugarlabs.org/sugar/mainline/commit/7e1fa4e984e00cfaaddb46d0c043bdf21ce09fd6
 ___
 Sugar-devel mailing list
 Sugar-devel@lists.sugarlabs.org
 http://lists.sugarlabs.org/listinfo/sugar-devel

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH] Browse: tabs usability improved

2011-09-07 Thread manuel quiñones
Hi Simon,

Thank you very much for your insightful review, I welcome the changes
you proposed.  I did almost all of them, I'm still working in the
error that appear in the logs.  I fixed the one that raised maximum
recursion depth exceeded, but I'm following the others.

El día 7 de septiembre de 2011 10:52, Simon Schampijer
si...@schampijer.de escribió:
 On 09/07/2011 03:37 PM, Simon Schampijer wrote:

 On 09/07/2011 03:03 PM, Simon Schampijer wrote:

 Hi Manuel,

 [..]

 There are as well two errors in the logs we need to address:

 1315401901.466328 DEBUG web-activity: Starting the web activity
 Traceback (most recent call last):
 File /home/erikos/Activities/Browse.activity/widgets.py, line 73, in
 __on_switch_page
 self.set_current_page(-1)
 File /home/erikos/Activities/Browse.activity/widgets.py, line 88, in
 set_current_page
 return Notebook.set_current_page(self, number)
 RuntimeError: maximum recursion depth exceeded while calling a Python
 object

 and

 RuntimeError: maximum recursion depth exceeded
 RuntimeError: maximum recursion depth exceeded
 Traceback (most recent call last):
 File /home/erikos/Activities/Browse.activity/browser.py, line 192, in
 __page_removed_cb
 self._update_closing_buttons()
 File /home/erikos/Activities/Browse.activity/browser.py, line 258, in
 _update_closing_buttons
 first_label.show_close_button()
 AttributeError: 'TabAdd' object has no attribute 'show_close_button'
 

 Regards,
 Simon

 Two more issues:

 * the focus-url-entry does only work when we use the 'add-tab' button but
 not when we use the keyboard shortcut 'ctrl+t'

 Seems to work with the following:

 diff --git a/browser.py b/browser.py
 index a387df3..dec7d1d 100644
 --- a/browser.py
 +++ b/browser.py
 @@ -198,6 +198,7 @@ class TabbedView(BrowserNotebook):
             self._insert_tab_next(browser)
         else:
             self._append_tab(browser)
 +        self.emit('focus-url-entry')
         return browser

     def _insert_tab_next(self, browser):
 @@ -218,7 +219,6 @@ class TabbedView(BrowserNotebook):

     def on_add_tab(self, gobject):
         self.add_tab()
 -        self.emit('focus-url-entry')

 * when you resume a session that contains an empty tab we get an error,
 steps to reproduce:
   - open a new Browse session
   - add one tab
   - without typing in an url close the session
   - resume it

 you will get the following error:

 1315403227.280123 DEBUG root: nsIEmbeddingSiteWindow.get_visibility: False
 1315403227.284243 DEBUG root: OnHistoryGotoIndex: 0
 file:///home/erikos/Activities/Browse.activity/data/index.html
 Traceback (most recent call last):
  File
 /home/erikos/sugar-jhbuild/install/lib/python2.7/site-packages/sugar/activity/activity.py,
 line 506, in __canvas_map_cb
    self.read_file(self._jobject.file_path)
  File /home/erikos/Activities/Browse.activity/webactivity.py, line 452, in
 read_file
    browser.set_history_index(tab['history_index'])
  File /home/erikos/Activities/Browse.activity/browser.py, line 461, in
 set_history_index
    self.web_navigation.gotoIndex(index)
  File XPCOMObject method 'gotoIndex', line 3, in gotoIndex
 xpcom.Exception: -2147467259 (NS_ERROR_FAILURE)
 1315403227.291903 DEBUG root: ActivityService.set_active: 1.
 1315403227.305870 DEBUG root: nsIEmbeddingSiteWindow.get_visibility: False

 Regards,
   Simon




-- 
.. manuq ..
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] [SERVER] Sugar Server Kit v1.1 Roadmap

2011-09-07 Thread Aleksey Lim
Hi all,

The original url to that Todo is
http://wiki.sugarlabs.org/go/Sugar_Server_Kit/1.1/Todo

== New components ==

* http://wiki.sugarlabs.org/go/Sugar_Server_Kit/sugar-server-blacklist
* http://wiki.sugarlabs.org/go/Sugar_Server_Kit/sugar-client

== Documentation ==

* in-code documentation for sugar-server and sugar-server-templates

== Testing ==

* more system tests of SSK infra using sugaroid to cover various
  deployment workflows
* using sugaroid bots, stress test prosody to compare with ejabberd
* the basis for regression tests to keep 1.x branch out of regressions

== New templates ==

* squidGuard
* Monitoring (?) Munin

== Roadmap ==

2011-10-09 Start pilot program in Paraguay using SSK-1.1 based solution.
   http://wiki.paraguayeduca.org/index.php/School_Server
2011-12-01 Successful pilot program. SSK-1.1 release. 

== Looking forward ==

The key features of
http://wiki.sugarlabs.org/go/Sugar_Server_Kit/1.2/Todo
will be (at least):

* Collect statistics of XO usage on school servers

-- 
Aleksey
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel