Complete.Org: Mailing Lists: Archives: freeciv-dev: November 1998:
[Freeciv-Dev] patch to clear output window
Home

[Freeciv-Dev] patch to clear output window

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] patch to clear output window
From: David Pfitzner <dwp@xxxxxxxxxxxxxx>
Date: Sun, 8 Nov 1998 21:29:37 +1100

This patch adds a menu item to clear the output window.  Eg, this may
be useful during a games so that subsequent messages in the output
window are easier to scroll.

-- David
diff -u -r --exclude-from exclude freeciv-cvs/client/climisc.c 
freeciv-mod/client/climisc.c
--- freeciv-cvs/client/climisc.c        Sat Oct 24 10:28:10 1998
+++ freeciv-mod/client/climisc.c        Sun Nov  8 15:45:15 1998
@@ -137,6 +137,14 @@
   append_output_window("Export complete.");
 }
 
+/**************************************************************************
+...
+**************************************************************************/
+void clear_output_window(void)
+{
+  XtVaSetValues(outputwindow_text, XtNstring, "Cleared output window.", NULL);
+}
+
 struct city *find_city_by_id(int id)
 { /* no idea where this belongs either */
   return(game_find_city_by_id(id));
diff -u -r --exclude-from exclude freeciv-cvs/client/climisc.h 
freeciv-mod/client/climisc.h
--- freeciv-cvs/client/climisc.h        Mon May 11 15:37:54 1998
+++ freeciv-mod/client/climisc.h        Sun Nov  8 15:41:03 1998
@@ -6,6 +6,7 @@
 void client_remove_unit(int unit_id);
 char *datafilename(char *filename);
 void log_output_window(void);
+void clear_output_window(void);
 
 #endif
 
diff -u -r --exclude-from exclude freeciv-cvs/client/menu.c 
freeciv-mod/client/menu.c
--- freeciv-cvs/client/menu.c   Wed Oct 21 22:14:51 1998
+++ freeciv-mod/client/menu.c   Sun Nov  8 15:48:22 1998
@@ -51,6 +51,7 @@
   MENU_GAME_MESSAGES,
   MENU_GAME_SERVER_OPTIONS,
   MENU_GAME_OUTPUT_LOG,
+  MENU_GAME_CLEAR_OUTPUT,
   MENU_GAME_DISCONNECT,
   MENU_GAME_QUIT,
   
@@ -121,6 +122,7 @@
     { "Messages",       MENU_GAME_MESSAGES, 0 },
     { "Server options", MENU_GAME_SERVER_OPTIONS, 0 },
     { "Export log",     MENU_GAME_OUTPUT_LOG, 0 }, /* added by Syela */
+    { "Clear log",      MENU_GAME_CLEAR_OUTPUT, 0 },
     { "Disconnect",     MENU_GAME_DISCONNECT, 0 }, /* added by Syela */
     { "Quit",           MENU_GAME_QUIT, 0 },
     { 0, MENU_END_OF_LIST, 0 },
@@ -203,6 +205,7 @@
     menu_entry_sensitive(game_menu, MENU_GAME_MESSAGES, 0);
     menu_entry_sensitive(game_menu, MENU_GAME_SERVER_OPTIONS, 0);
     menu_entry_sensitive(game_menu, MENU_GAME_OUTPUT_LOG, 0);
+    menu_entry_sensitive(game_menu, MENU_GAME_CLEAR_OUTPUT, 0);
     menu_entry_sensitive(game_menu, MENU_GAME_FIND_CITY, 0);
   
   }
@@ -221,6 +224,7 @@
     menu_entry_sensitive(game_menu, MENU_GAME_MESSAGES, 1);
     menu_entry_sensitive(game_menu, MENU_GAME_SERVER_OPTIONS, 1);
     menu_entry_sensitive(game_menu, MENU_GAME_OUTPUT_LOG, 1);
+    menu_entry_sensitive(game_menu, MENU_GAME_CLEAR_OUTPUT, 1);
     menu_entry_sensitive(game_menu, MENU_GAME_DISCONNECT, 1);
     menu_entry_sensitive(game_menu, MENU_GAME_FIND_CITY, 1);
   
@@ -340,6 +344,9 @@
     break;
   case MENU_GAME_OUTPUT_LOG:
     log_output_window();
+    break;
+  case MENU_GAME_CLEAR_OUTPUT:
+    clear_output_window();
     break;
   case MENU_GAME_DISCONNECT:
     disconnect_from_server();

[Prev in Thread] Current Thread [Next in Thread]