Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog27
-rw-r--r--INSTALL1
-rw-r--r--boards/boardicons/chat.pngbin0 -> 5937 bytes
-rw-r--r--boards/chat.xml.in9
-rw-r--r--boards/skins/gartoon/cursor_circle.pngbin1485 -> 3203 bytes
-rw-r--r--boards/skins/gartoon/cursor_default.pngbin1586 -> 2184 bytes
-rw-r--r--boards/skins/gartoon/cursor_del.pngbin3139 -> 5170 bytes
-rw-r--r--boards/skins/gartoon/cursor_fill.pngbin1680 -> 2681 bytes
-rw-r--r--boards/skins/gartoon/cursor_fillcircle.pngbin1092 -> 2969 bytes
-rw-r--r--boards/skins/gartoon/cursor_fillrect.pngbin584 -> 2836 bytes
-rw-r--r--boards/skins/gartoon/cursor_line.pngbin758 -> 1683 bytes
-rw-r--r--boards/skins/gartoon/cursor_rect.pngbin701 -> 2598 bytes
-rw-r--r--boards/skins/gartoon/cursor_select.pngbin1245 -> 2378 bytes
-rw-r--r--po/POTFILES.in2
-rw-r--r--src/boards/clockgame.c1
-rw-r--r--src/boards/erase.c10
-rw-r--r--src/boards/python/Makefile.am1
-rw-r--r--src/boards/python/chat.py54
18 files changed, 84 insertions, 21 deletions
diff --git a/ChangeLog b/ChangeLog
index 7fb41eb..4a3ada7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,30 @@
+2006-12-11 Bruno coudoin <bruno.coudoin@free.fr>
+
+ - Moved chat out of experimental. It has an icon now
+ created from the xchat icon of the gartoon theme.
+ More help displayed.
+ Scrolling now follow the last text message
+ - Replaced cursors by a new cursor set from Franck.
+ - Now erase uses the sponge cursor.
+
+ * INSTALL:
+ * boards/boardicons/chat.png:
+ * boards/chat.xml.in:
+ * boards/skins/gartoon/cursor_circle.png:
+ * boards/skins/gartoon/cursor_default.png:
+ * boards/skins/gartoon/cursor_del.png:
+ * boards/skins/gartoon/cursor_fill.png:
+ * boards/skins/gartoon/cursor_fillcircle.png:
+ * boards/skins/gartoon/cursor_fillrect.png:
+ * boards/skins/gartoon/cursor_line.png:
+ * boards/skins/gartoon/cursor_rect.png:
+ * boards/skins/gartoon/cursor_select.png:
+ * po/POTFILES.in:
+ * src/boards/clockgame.c: (end_board):
+ * src/boards/erase.c: (start_board), (end_board):
+ * src/boards/python/Makefile.am:
+ * src/boards/python/chat.py:
+
2006-12-09 Bruno coudoin <bruno.coudoin@free.fr>
- Created a new activity, a mini local chat based on multicast.
diff --git a/INSTALL b/INSTALL
index e948447..3d0ce32 100644
--- a/INSTALL
+++ b/INSTALL
@@ -59,6 +59,7 @@ urpmi libtool
urpmi libsqlite3_0 libsqlite3_0-devel
urpmi python-sqlite2
urpmi libxxf86vm1-devel
+urpmi libpopt0-devel
WARNING
=======
diff --git a/boards/boardicons/chat.png b/boards/boardicons/chat.png
new file mode 100644
index 0000000..ab144e6
--- /dev/null
+++ b/boards/boardicons/chat.png
Binary files differ
diff --git a/boards/chat.xml.in b/boards/chat.xml.in
index 6de426d..2c2c6c2 100644
--- a/boards/chat.xml.in
+++ b/boards/chat.xml.in
@@ -3,13 +3,14 @@
<Board
name="chat"
type="python:chat"
- section="/experimental"
- icon="boardicons/python.png"
- difficulty="1"
+ section="/fun"
+ icon="boardicons/chat.png"
+ difficulty="3"
author="Bruno coudoin (bruno.coudoin@free.fr)"
boarddir="">
<_title>Chat with your friends</_title>
- <_description>Chat on the local network</_description>
+ <_description>This chat works only on the local network</_description>
+ <_manual>This chat activity only work with other GCompris user on your local network, not the Internet. To use it, just type in messages and hit enter. Your message is broacasted on the local network and any GCompris running the chat activity will receive and display the message.</_manual>
</Board>
<Data directory=""/>
</GCompris>
diff --git a/boards/skins/gartoon/cursor_circle.png b/boards/skins/gartoon/cursor_circle.png
index ca46a36..8f2f217 100644
--- a/boards/skins/gartoon/cursor_circle.png
+++ b/boards/skins/gartoon/cursor_circle.png
Binary files differ
diff --git a/boards/skins/gartoon/cursor_default.png b/boards/skins/gartoon/cursor_default.png
index 7710cde..b94dfcf 100644
--- a/boards/skins/gartoon/cursor_default.png
+++ b/boards/skins/gartoon/cursor_default.png
Binary files differ
diff --git a/boards/skins/gartoon/cursor_del.png b/boards/skins/gartoon/cursor_del.png
index 853bdb4..9d36598 100644
--- a/boards/skins/gartoon/cursor_del.png
+++ b/boards/skins/gartoon/cursor_del.png
Binary files differ
diff --git a/boards/skins/gartoon/cursor_fill.png b/boards/skins/gartoon/cursor_fill.png
index d7affda..51c59f3 100644
--- a/boards/skins/gartoon/cursor_fill.png
+++ b/boards/skins/gartoon/cursor_fill.png
Binary files differ
diff --git a/boards/skins/gartoon/cursor_fillcircle.png b/boards/skins/gartoon/cursor_fillcircle.png
index ab823d7..3890ce4 100644
--- a/boards/skins/gartoon/cursor_fillcircle.png
+++ b/boards/skins/gartoon/cursor_fillcircle.png
Binary files differ
diff --git a/boards/skins/gartoon/cursor_fillrect.png b/boards/skins/gartoon/cursor_fillrect.png
index 232ff6f..ae68f3c 100644
--- a/boards/skins/gartoon/cursor_fillrect.png
+++ b/boards/skins/gartoon/cursor_fillrect.png
Binary files differ
diff --git a/boards/skins/gartoon/cursor_line.png b/boards/skins/gartoon/cursor_line.png
index 5ba46fe..0bfd5c3 100644
--- a/boards/skins/gartoon/cursor_line.png
+++ b/boards/skins/gartoon/cursor_line.png
Binary files differ
diff --git a/boards/skins/gartoon/cursor_rect.png b/boards/skins/gartoon/cursor_rect.png
index 5784364..189d063 100644
--- a/boards/skins/gartoon/cursor_rect.png
+++ b/boards/skins/gartoon/cursor_rect.png
Binary files differ
diff --git a/boards/skins/gartoon/cursor_select.png b/boards/skins/gartoon/cursor_select.png
index 31d863e..96513f6 100644
--- a/boards/skins/gartoon/cursor_select.png
+++ b/boards/skins/gartoon/cursor_select.png
Binary files differ
diff --git a/po/POTFILES.in b/po/POTFILES.in
index b63ce1a..df13689 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -42,6 +42,7 @@ boards/ballcatch.xml.in
boards/bargame.xml.in
boards/billard.xml.in
boards/canal_lock.xml.in
+boards/chat.xml.in
boards/chess.xml.in
boards/chess_computer.xml.in
boards/chess_movelearn.xml.in
@@ -279,6 +280,7 @@ src/boards/railroad.c
src/boards/read_colors.c
src/boards/reading.c
src/boards/reversecount.c
+src/boards/scale.c
src/boards/shapegame.c
src/boards/smallnumbers.c
src/boards/submarine.c
diff --git a/src/boards/clockgame.c b/src/boards/clockgame.c
index 8e81183..6f5eba2 100644
--- a/src/boards/clockgame.c
+++ b/src/boards/clockgame.c
@@ -173,7 +173,6 @@ end_board ()
destroy_all_items();
}
gcomprisBoard = NULL;
- gc_cursor_set(GCOMPRIS_DEFAULT_CURSOR);
}
static void
diff --git a/src/boards/erase.c b/src/boards/erase.c
index 83aef08..174c0cb 100644
--- a/src/boards/erase.c
+++ b/src/boards/erase.c
@@ -178,9 +178,9 @@ static void start_board (GcomprisBoard *agcomprisBoard)
gcomprisBoard->sublevel=1;
gcomprisBoard->number_of_sublevel=10; /* Go to next level after this number of 'play' */
gc_score_start(SCORESTYLE_NOTE,
- gcomprisBoard->width - 220,
- gcomprisBoard->height - 50,
- gcomprisBoard->number_of_sublevel);
+ gcomprisBoard->width - 220,
+ gcomprisBoard->height - 50,
+ gcomprisBoard->number_of_sublevel);
gc_bar_set(GC_BAR_LEVEL);
if (strcmp(gcomprisBoard->mode,"double_clic")==0)
@@ -220,11 +220,15 @@ static void start_board (GcomprisBoard *agcomprisBoard)
/* initial state to restore */
sound_policy = gc_sound_policy_get();
gc_sound_policy_set(PLAY_AND_INTERRUPT);
+
+ gc_cursor_set(GCOMPRIS_DEL_CURSOR);
+
}
}
/* ======================================= */
static void end_board ()
{
+ gc_cursor_set(GCOMPRIS_DEFAULT_CURSOR);
if (board_mode == DOUBLECLIC){
gdk_display_set_double_click_time( gdk_display_get_default(),
DefaultDoubleClicDistance);
diff --git a/src/boards/python/Makefile.am b/src/boards/python/Makefile.am
index b22acab..ec770a3 100644
--- a/src/boards/python/Makefile.am
+++ b/src/boards/python/Makefile.am
@@ -8,6 +8,7 @@ dist_python_DATA= \
anim.py \
ballcatch.py \
bargame.py \
+ chat.py \
connect4.py \
electric.py \
followline.py \
diff --git a/src/boards/python/chat.py b/src/boards/python/chat.py
index 4a02143..e3e2891 100644
--- a/src/boards/python/chat.py
+++ b/src/boards/python/chat.py
@@ -16,6 +16,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
+from gettext import gettext as _
import gnomecanvas
import gcompris
import gcompris.utils
@@ -31,6 +32,8 @@ import socket
import struct
import sys
+from socket import gethostname
+
class Gcompris_chat:
"""The chat activity"""
@@ -38,6 +41,9 @@ class Gcompris_chat:
self.gcomprisBoard = gcomprisBoard
self.rootitem = None
+ # Randon adress
+ self.mcast_adress = "227.234.253.9"
+
# These are used to let us restart only after the bonus is displayed.
# When the bonus is displayed, it call us first with pause(1) and then with pause(0)
self.board_paused = 0;
@@ -70,7 +76,7 @@ class Gcompris_chat:
self.global_area_tv.set_editable(False)
self.global_area_sw.add(self.global_area_tv)
- self.global_area_tb.set_text("")
+ self.global_area_tb.set_text(_("All messages will be displayed here.\n"))
self.global_area_tv.set_wrap_mode(gtk.WRAP_CHAR)
self.rootitem.add(
@@ -117,6 +123,16 @@ class Gcompris_chat:
self.friend_area_tv.show()
self.friend_area_sw.show()
+ # A label for the friend area
+ self.rootitem.add(
+ gnomecanvas.CanvasText,
+ text=_("Your Friends"),
+ font = gcompris.skin.get_font("gcompris/board/medium"),
+ x=x+(w/2),
+ y=y+h+15,
+ anchor=gtk.ANCHOR_CENTER,
+ )
+
# the entry area
entry = gtk.Entry()
entry.connect("activate", self.enter_callback, entry)
@@ -136,12 +152,13 @@ class Gcompris_chat:
size_pixels=False)
entry.show()
+ entry.set_text(_("Type here you message to GCompris users in your local network."))
# Start the server
self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP)
self.sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
self.sock.bind(('', 6543))
- mreq = struct.pack('4sl', socket.inet_aton('225.100.100.100'), socket.INADDR_ANY)
+ mreq = struct.pack('4sl', socket.inet_aton(self.mcast_adress), socket.INADDR_ANY)
self.sock.setsockopt(socket.IPPROTO_IP, socket.IP_ADD_MEMBERSHIP, mreq)
self.sock.setblocking(0)
@@ -153,7 +170,7 @@ class Gcompris_chat:
self.cleanup()
def ok(self):
- print("Gcompris_minouche ok.")
+ print("Gcompris_chat ok.")
def key_press(self, keyval, commit_str, preedit_str):
#print("got key %i" % keyval)
@@ -187,6 +204,7 @@ class Gcompris_chat:
gobject.source_remove(self.mcast_timer)
self.mcast_timer = 0
+ self.sock.close()
# Remove the root item removes all the others inside it
if self.rootitem != None:
@@ -207,43 +225,53 @@ class Gcompris_chat:
text = ""
try:
text = self.sock.recv(10240)
- print "Received text: %s\n" % text
+ #print "Received text: %s\n" % text
except:
return
# Parse it
- textl = text.split(":", 2)
+ textl = text.split(":", 3)
+ # Is this a message for us
if(textl[0] != "GCOMPRIS"):
return
+ if(textl[1] != "CHAT"):
+ return
+
# Build the friend list
gotit = False
for name in self.friend_list:
- if name == textl[1]:
+ if name == textl[2]:
gotit = True
if not gotit:
- self.friend_list.append(textl[1])
+ self.friend_list.append(textl[2])
self.friend_list.sort()
friends="\n"
friends = friends.join(self.friend_list)
self.friend_area_tb.set_text(friends)
- # Disply the message
+ # Display the message
self.global_area_tb.insert(self.global_area_tb.get_end_iter(),
- textl[1] + " => " + textl[2] + "\n")
+ textl[2] + " => " + textl[3] + "\n")
+ self.global_area_tv.scroll_to_iter(self.global_area_tb.get_end_iter(),
+ 0.0,
+ True,
+ 0,
+ 0)
return False
def enter_callback(self, widget, entry):
- from socket import gethostname
entry_text = entry.get_text()
- sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP)
+ sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM,
+ socket.IPPROTO_UDP)
sock.setsockopt(socket.IPPROTO_IP, socket.IP_MULTICAST_TTL, 2)
# format the message
- entry_text = "GCOMPRIS:" + gethostname() + ":" + entry_text
- sock.sendto(entry_text, ('225.100.100.100', 6543))
+ entry_text = "GCOMPRIS:CHAT:" + gethostname() + ":" + entry_text
+ sock.sendto(entry_text, (self.mcast_adress, 6543))
entry.set_text("")
+ sock.close()