[Sugar-devel] [PATCH] Added busy cursor when we open any section in control panel. (Ticket #245)

2010-09-22 Thread Ishan Bansal
The sections in control panel should activate busy cursor so that user
could be given a impression that their request is in progress.
---
 src/jarabe/controlpanel/gui.py |   15 ++-
 1 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/src/jarabe/controlpanel/gui.py b/src/jarabe/controlpanel/gui.py
index 51d9820..d793b92 100644
--- a/src/jarabe/controlpanel/gui.py
+++ b/src/jarabe/controlpanel/gui.py
@@ -214,11 +214,16 @@ class ControlPanel(gtk.Window):
  globals(), locals(), ['model'])
 model = ModelWrapper(mod)
 
-self._section_view = view_class(model,
-self._options[option]['alerts'])
-
-self._set_canvas(self._section_view)
-self._section_view.show()
+try:
+self.get_window().set_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH)) 
+self._section_view = view_class(model,
+self._options[option]['alerts'])
+
+self._set_canvas(self._section_view)
+self._section_view.show()
+finally:
+self.get_window().set_cursor(None)   
+  
 self._section_view.connect('notify::is-valid',
self.__valid_section_cb)
 self._section_view.connect('request-close',
-- 
1.7.0.4

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


Re: [Sugar-devel] [PATCH] Added busy cursor when we open any section in control panel. (Ticket #245)

2010-09-21 Thread Tomeu Vizoso
On Mon, Sep 20, 2010 at 22:33, Sascha Silbe
sascha-ml-reply-to-201...@silbe.org wrote:
 Excerpts from Ishan Bansal's message of Mon Sep 20 17:36:03 +0200 2010:

 The sections in control panel should activate busy cursor so that user could 
 be given a impression that their request is in progress.

 Like for the other patch, please wrap lines so they fit into 80 columns
 (70-75 for the subject).

 [src/jarabe/controlpanel/gui.py]
 @@ -214,11 +214,14 @@ class ControlPanel(gtk.Window):
                           globals(), locals(), ['model'])
          model = ModelWrapper(mod)


 +        self.get_window().set_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH))
 +
          self._section_view = view_class(model,
                                          self._options[option]['alerts'])

          self._set_canvas(self._section_view)
          self._section_view.show()
 +        self.get_window().set_cursor(None)

 The cursor shape is global state, so it should be reset in a finally:
 clause with everything between the two set_cursor() calls in the try:
 block.

There's also the question of which window we want the cursor to be
changed. As the CP is modal, would we want it to be on the whole
screen?

If so, we could add a public method on HomeWindow which would be used
here and in the other places where we are changing the cursor.

It could also prove handy in debugging wtf the cursor is not coming
back to the default shape in the future.

Regards,

Tomeu

 Sascha

 --
 http://sascha.silbe.org/
 http://www.infra-silbe.de/

 ___
 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] Added busy cursor when we open any section in control panel. (Ticket #245)

2010-09-21 Thread Sascha Silbe
Excerpts from Tomeu Vizoso's message of Tue Sep 21 09:58:38 +0200 2010:

 There's also the question of which window we want the cursor to be
 changed. As the CP is modal, would we want it to be on the whole
 screen?

We should bind the cursor to the CP window. In the long run I would like
to see the CP move to a non-modal, fullscreen window design. There's no
good reason for it to be modal and it currently prevents the user from
browsing documentation or asking a friend for help (using Chat) while
keeping the CP open.

Sascha

--
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] [PATCH] Added busy cursor when we open any section in control panel. (Ticket #245)

2010-09-20 Thread Ishan Bansal
The sections in control panel should activate busy cursor so that user could be 
given a impression that their request is in progress.
---
 src/jarabe/controlpanel/gui.py |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/jarabe/controlpanel/gui.py b/src/jarabe/controlpanel/gui.py
index 51d9820..91cee73 100644
--- a/src/jarabe/controlpanel/gui.py
+++ b/src/jarabe/controlpanel/gui.py
@@ -214,11 +214,14 @@ class ControlPanel(gtk.Window):
  globals(), locals(), ['model'])
 model = ModelWrapper(mod)
 
+self.get_window().set_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH)) 
+
 self._section_view = view_class(model,
 self._options[option]['alerts'])
 
 self._set_canvas(self._section_view)
 self._section_view.show()
+self.get_window().set_cursor(None)
 self._section_view.connect('notify::is-valid',
self.__valid_section_cb)
 self._section_view.connect('request-close',
-- 
1.7.0.4

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


Re: [Sugar-devel] [PATCH] Added busy cursor when we open any section in control panel. (Ticket #245)

2010-09-20 Thread Sascha Silbe
Excerpts from Ishan Bansal's message of Mon Sep 20 17:36:03 +0200 2010:

 The sections in control panel should activate busy cursor so that user could 
 be given a impression that their request is in progress.

Like for the other patch, please wrap lines so they fit into 80 columns
(70-75 for the subject).

[src/jarabe/controlpanel/gui.py]
 @@ -214,11 +214,14 @@ class ControlPanel(gtk.Window):
   globals(), locals(), ['model'])
  model = ModelWrapper(mod)
  

 +self.get_window().set_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH)) 
 +
  self._section_view = view_class(model,
  self._options[option]['alerts'])
  
  self._set_canvas(self._section_view)
  self._section_view.show()
 +self.get_window().set_cursor(None)

The cursor shape is global state, so it should be reset in a finally:
clause with everything between the two set_cursor() calls in the try:
block.

Sascha

--
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