Update of /cvsroot/netrek/client/netrekxp/src
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv5463/src

Modified Files:
	dashboard.c parsemeta.c 
Log Message:
Bug fix to timer display, remove zeroes.
Add fuse to metaserver lookup so it doesn't loop forever.
Add control-R (refresh) and q (quit) keys to metaserver window.

Index: parsemeta.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/parsemeta.c,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -d -r1.43 -r1.44
--- parsemeta.c	8 Jul 2008 02:00:53 -0000	1.43
+++ parsemeta.c	16 Jul 2008 23:23:07 -0000	1.44
@@ -1278,6 +1278,8 @@
  * used in newwin() to set the height of the meta-server window.
  */
 {
+    int fuse = 3;
+  	
     /* host names of metaservers, default in data.c, comma delimited */
     if ((stringDefault("metaServer")) != NULL)
         metaServer = stringDefault("metaServer");
@@ -1308,7 +1310,11 @@
         case 1:
 	    ReadMetasSend();
 	    LoadMetasCache();
-	    if (num_servers == 0) ReadMetasRecv(-1);
+	    while (num_servers < 2) {
+		ReadMetasRecv(-1);
+		sleep(1);
+		if (!fuse--) break;
+	    }
 	    if (num_servers != 0) {
 	    	/* Allocate 4 spots for header/refresh/quit/link */
 	        metaHeight = num_servers + 4;
@@ -1629,10 +1635,10 @@
 
     /* Add refresh option */
     if (type == 1)
-        W_WriteText(metaWin, 0, metaHeight-3, W_Yellow, "Refresh", 7, 0);
+        W_WriteText(metaWin, 0, metaHeight-3, W_Yellow, "Refresh (Ctrl-R)", 16, 0);
 
     /* Add quit option */
-    W_WriteText (metaWin, 0, metaHeight-2, W_Yellow, "Quit", 4, 0);
+    W_WriteText (metaWin, 0, metaHeight-2, W_Yellow, "Quit (q)", 8, 0);
 
     /* Additional Help Options */
     W_WriteText (metaWin, 0, metaHeight-1, W_Yellow, 
@@ -1792,8 +1798,16 @@
         switch ((int) data.type)
         {
         case W_EV_KEY:
-            if (data.Window == metaWin)
-                metaaction (&data);
+            if (data.key == 113 || data.key == 196) { /* q or ^d */
+                metadone();
+                terminate (0);
+            }
+            else if (data.key == 114 || data.key == 210) { /* r or ^r */
+                W_WriteText(metaWin, 0, metaHeight-3, W_Red, "Asking for refresh from metaservers and nearby servers", 54, 0);
+                ReadMetasSend();
+            }
+            else if (data.Window == metaWin)
+                metaaction(&data);
             break;
         case W_EV_BUTTON:
             if (data.Window == metaWin)

Index: dashboard.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/dashboard.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- dashboard.c	16 Jul 2008 00:16:10 -0000	1.29
+++ dashboard.c	16 Jul 2008 23:23:07 -0000	1.30
@@ -245,13 +245,13 @@
                 break;
             case T_UTIL:
                 if (context->tournament_remain)
-                    sprintf(timer, "   %03d %c", context->tournament_remain, context->tournament_remain_units);
+                    sprintf(timer, "   %3d %c", context->tournament_remain, context->tournament_remain_units);
                 else if (context->team_remain)
-                    sprintf(timer, "   %03d s", context->team_remain);
+                    sprintf(timer, "   %3d s", context->team_remain);
                 else if (context->starbase_remain)
-                    sprintf(timer, "   %03d m", context->starbase_remain);
+                    sprintf(timer, "   %3d m", context->starbase_remain);
                 else if (context->tournament_age)
-                    sprintf(timer, "   %03d %c", context->tournament_age, context->tournament_age_units);
+                    sprintf(timer, "   %3d %c", context->tournament_age, context->tournament_age_units);
                 else
                     timer = timeString(now - timeBank[timerType]);
                 break;