gcompris r3698 - in branches/gcomprixogoo: . boards/skins/gartoon src/administration-activity/admin src/administration-activity/resources/administration src/login-activity



Author: bcoudoin
Date: Tue Jan 27 00:45:41 2009
New Revision: 3698
URL: http://svn.gnome.org/viewvc/gcompris?rev=3698&view=rev

Log:
	Reworked login to no more need button_large2.png. Removed
	this image as it is no more used.
	There is a bug in board_list.py, the login cannot be edited.



Removed:
   branches/gcomprixogoo/boards/skins/gartoon/button_large2.png
Modified:
   branches/gcomprixogoo/ChangeLog
   branches/gcomprixogoo/src/administration-activity/admin/board_list.py
   branches/gcomprixogoo/src/administration-activity/resources/administration/Makefile.am
   branches/gcomprixogoo/src/login-activity/login.py

Modified: branches/gcomprixogoo/src/administration-activity/admin/board_list.py
==============================================================================
--- branches/gcomprixogoo/src/administration-activity/admin/board_list.py	(original)
+++ branches/gcomprixogoo/src/administration-activity/admin/board_list.py	Tue Jan 27 00:45:41 2009
@@ -464,7 +464,7 @@
       box.show()
       symbols_box.pack_start(box, True, False, 0)
       self.stars[i] = gtk.Image()
-      self.stars[i].set_from_pixbuf(gcompris.skin.load_pixmap('difficulty_star%d.png' % (i)))
+      self.stars[i].set_from_pixbuf(gcompris.utils.load_pixmap('administration/difficulty%d.svgz' % (i)))
       self.stars[i].show()
       box.pack_start(self.stars[i], False, False, 0)
       i_label = gtk.Label()
@@ -669,6 +669,9 @@
 
   def ok_callback(self, dict):
 
+    if not dict:
+      return
+
     for key, value in dict.iteritems():
       if key in self.already_conf:
         req = 'UPDATE board_profile_conf SET conf_value=\'%s\' WHERE profile_id=%d AND board_id=-1 AND conf_key=\'%s\'' % (value, self.active_profile.profile_id, key)
@@ -696,10 +699,13 @@
 
 
   def login_configure(self, button):
+    print "debug: login_configure"
     board_log = self.get_board_by_name('/login/login', self.boards_list)
+    print board_log
+    # FIXME This call no more work
     gcompris.admin.board_config_start(board_log,
                                       self.active_profile)
-
+    print "debug: done"
 
 
   def wordlist(self, button):

Modified: branches/gcomprixogoo/src/administration-activity/resources/administration/Makefile.am
==============================================================================
--- branches/gcomprixogoo/src/administration-activity/resources/administration/Makefile.am	(original)
+++ branches/gcomprixogoo/src/administration-activity/resources/administration/Makefile.am	Tue Jan 27 00:45:41 2009
@@ -5,7 +5,13 @@
 	config_groups.svgz \
 	config_profiles.svgz \
 	config_reports.svgz \
-	config_users.svgz
+	config_users.svgz \
+	difficulty1.svgz \
+	difficulty2.svgz \
+	difficulty3.svgz \
+	difficulty4.svgz \
+	difficulty5.svgz \
+	difficulty6.svgz
 
 EXTRA_DIST = $(img_DATA) ${xml_in_files}
 CLEANFILES = $(xml_DATA)

Modified: branches/gcomprixogoo/src/login-activity/login.py
==============================================================================
--- branches/gcomprixogoo/src/login-activity/login.py	(original)
+++ branches/gcomprixogoo/src/login-activity/login.py	Tue Jan 27 00:45:41 2009
@@ -223,15 +223,6 @@
     x = gcompris.BOARD_WIDTH/2
     y = 20
 
-    # The shadow
-    goocanvas.Text(
-      parent = self.letter_rootitem,
-      x= x + 1.5,
-      y= y + 1.5,
-      text= _("Login: ") + start_filter + "...",
-      fill_color="black",
-      font=gcompris.skin.get_font("gcompris/board/huge"),
-      )
     # The text
     goocanvas.Text(
       parent = self.letter_rootitem,
@@ -264,20 +255,6 @@
       else:
         text = letter.upper() + letter.lower()
 
-      item = goocanvas.Svg(parent = self.rootitem,
-                           svg_handle = gcompris.skin.svg_get(),
-                           svg_id = "#OK"
-                           )
-      item.translate(item.get_bounds().x1 * -1
-                     + x - (item.get_bounds().x2 - item.get_bounds().x1) / 2,
-                     item.get_bounds().y1 * -1
-                     + y - (item.get_bounds().y2 - item.get_bounds().y1) / 2)
-
-      # This item is clickeable and it must be seen
-      gcompris.utils.item_focus_init(item, None)
-      item.connect("button_press_event", self.letter_click_event,
-                   (users, start_filter + letter))
-
       # The text
       item =goocanvas.Text(
         parent = self.letter_rootitem,
@@ -289,6 +266,29 @@
         )
       item.connect("button_press_event", self.letter_click_event,
                    (users, start_filter + letter))
+
+      gap = 10
+      bounds = item.get_bounds()
+      item_bg = \
+          goocanvas.Rect(
+          parent = self.letter_rootitem,
+          x = bounds.x1 - gap,
+          y = bounds.y1 - gap,
+          width = bounds.x2 - bounds.x1 + gap*2,
+          height = bounds.y2 - bounds.y1 + gap*2,
+          line_width=2.0,
+          fill_color_rgba=0x555555CAL,
+          stroke_color_rgba=0xFFFFFFFFL,
+          radius_x=5.0,
+          radius_y=5.0)
+      # This item is clickeable and it must be seen
+      gcompris.utils.item_focus_init(item, item_bg)
+      gcompris.utils.item_focus_init(item_bg, None)
+      item_bg.connect("button_press_event", self.letter_click_event,
+                      (users, start_filter + letter))
+      item.raise_(None)
+
+
       x += step_x
 
       i += 1
@@ -318,7 +318,6 @@
     x = gcompris.BOARD_WIDTH/4
     i = 0
     step_y = 90
-    button_pixbuf = gcompris.utils.load_pixmap(gcompris.skin.image_to_skin("button_large2.png"))
 
     for user in users:
       if eval(self.config_dict['uppercase_only']):
@@ -329,28 +328,38 @@
       if not login.startswith(start_filter):
         continue
 
-      item =goocanvas.Image(
-        parent = self.rootitem,
-        pixbuf = button_pixbuf,
-        x = x -  button_pixbuf.get_width()/2,
-        y = y -  button_pixbuf.get_height()/2,
-        )
-      # This item is clickeable and it must be seen
-      gcompris.utils.item_focus_init(item, None)
-      item.connect("button_press_event", self.name_click_event, user)
-
-
       # The text
       item = goocanvas.Text(
         parent = self.rootitem,
         x= x,
-        y= y - button_pixbuf.get_height()/2 + 5,
+        y= y,
         text= login,
         fill_color="white",
         font=gcompris.skin.get_font("gcompris/board/huge"),
+        anchor = gtk.ANCHOR_CENTER,
         )
       item.connect("button_press_event", self.name_click_event, user)
 
+      gap = 10
+      bounds = item.get_bounds()
+      item_bg = \
+          goocanvas.Rect(
+          parent = self.rootitem,
+          x = bounds.x1 - gap,
+          y = bounds.y1 - gap,
+          width = bounds.x2 - bounds.x1 + gap*2,
+          height = bounds.y2 - bounds.y1 + gap*2,
+          line_width=2.0,
+          fill_color_rgba=0x555555CAL,
+          stroke_color_rgba=0xFFFFFFFFL,
+          radius_x=5.0,
+          radius_y=5.0)
+      item_bg.connect("button_press_event", self.name_click_event, user)
+      item.raise_(item_bg)
+      # This item is clickeable and it must be seen
+      gcompris.utils.item_focus_init(item, item_bg)
+      gcompris.utils.item_focus_init(item_bg, None)
+
       y += step_y
       i += 1
 
@@ -364,7 +373,7 @@
   # Event when a click happen on a letter
   # data[0] is the user list we work on
   # data[1] is the start filter
-  def letter_click_event(self, widget, event, data):
+  def letter_click_event(self, widget, target, event, data):
     if event.type == gtk.gdk.BUTTON_PRESS:
       self.letter_rootitem.remove()
       self.display_user_by_letter(data[0], data[1])
@@ -453,6 +462,7 @@
       widget.set_text('')
 
   def config_start(self, profile):
+    print "debug login.py config_start"
     # keep profile in mind
     self.configuring_profile = profile
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]