From: Andrey C. <sku...@us...> - 2007-03-12 17:14:27
|
Update of /cvsroot/eas-dev/eas/client In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv5417/client Modified Files: Makefile main.prg Log Message: Fix some bugs. Add sessions support Index: Makefile =================================================================== RCS file: /cvsroot/eas-dev/eas/client/Makefile,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Makefile 20 Nov 2006 12:57:55 -0000 1.6 +++ Makefile 12 Mar 2007 17:14:22 -0000 1.7 @@ -7,7 +7,7 @@ include ../Makefile.var CLIPINCLUDE= -I$(CLIPROOT)/include CLIP = $(CLIPROOT)/bin/clip -CLIPLIBS = -L$(CLIPROOT)/lib -lclip-codb -lcodb-query -lclip-ui -lclip-xml -lexpat +CLIPLIBS = -L../libeas -L$(CLIPROOT)/lib -lclip-codb -lcodb-query -lclip-ui -lclip-xml -lexpat -lclip-postscript EASLIBS = -leas CLIPFLAGS = -aObw $(BUILDFLAGS) ICONS = eas-logo.xpm eas.xpm @@ -20,16 +20,15 @@ OBJS = main.o -all: +all: $(PRG) clean: rm -f *.o core *.core $(PRG) *.log *.nm *.ex *.exe *.so $(PRG): $(OBJS) -# export LIBRARY_PATH= $(CLIP) $(CLIPFLAGS) -esl $(CLIPINCLUDE) -o $(PRG) $(OBJS) $(CLIPLIBS) $(EASLIBS) -install: all $(PRG) +install: all @../mkinstalldirs $(DESTDIR)$(EASBINDIR) @../mkinstalldirs $(DESTDIR)$(EASDATADIR)/client/icons $(CLIPROOT)/bin/clip_cp $(PRG) $(DESTDIR)$(EASBINDIR) Index: main.prg =================================================================== RCS file: /cvsroot/eas-dev/eas/client/main.prg,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- main.prg 20 Nov 2006 12:57:55 -0000 1.12 +++ main.prg 12 Mar 2007 17:14:22 -0000 1.13 @@ -18,6 +18,7 @@ // Default connection values #define C_HOST "localhost" #define C_PORT "3000" +#define SERVER_TICK 5 // 5 sec // Main form name #define EAS_MAIN_FORM "main" @@ -68,9 +69,13 @@ messages := EASMessageManager() // Run without parameters: client // Sets slots for client interrupts + /* Show connection dialog if transport settings doesn't exist */ setSlot(messages, 'sys.transport.failed', {|msg| connectionDialog( msg ) }) + /* Process server message */ + setSlot(messages, 'sys.transport.received', {|msg| processServerMessage( msg ) }) + // Open message manager loginInProgress := 0 messages:open() @@ -279,6 +284,41 @@ return +/* Process server message: show IM message or update lists */ +function processServerMessage( msg ) + local name, dt, text + + if valtype(msg) != "O" .or. .not. "TYPE" $ msg + return + endif + + eDebug( 21, "Server message:", msg ) + + if lower(msg:type) == "message" + + // Fill fields + name := iif("NAME" $ msg, msg:name, "") + dt := iif("CREATED" $ msg, msg:created, "") + text := iif("TEXT" $ msg, msg:text, "") + + eDebug( 22, "IM message from " + name + " (" + dt + ") " + text ) + + // Show dialog + if loginWindow != NIL + loginWindow:dialogBox(i18n("New message"), ; + i18n("From: ") + name + chr(10) + ; + i18n("Sent: ") + dt + chr(10) + chr(10) + ; + text ; + ,,, NIL, IMG_OK) + endif + + elseif lower(msg:type) == "update" + // TODO: update message + eDebug( 22, "update list" ) + endif + +return + /* Begin session based on connection dialog */ function sessionBegin(win) local cfg, cHost, cPort, cUser, cPass, conn:=map() |