diff -ruN -X /home/jjm/cvs/no.freeciv FreecivCVS/client/gui-gtk/dialogs.c freeciv/client/gui-gtk/dialogs.c --- FreecivCVS/client/gui-gtk/dialogs.c Sat Aug 7 10:30:51 1999 +++ freeciv/client/gui-gtk/dialogs.c Wed Aug 11 11:17:25 1999 @@ -119,7 +119,7 @@ /**************************************************************** ... *****************************************************************/ -void popup_notify_dialog(char *headline, char *lines) +void popup_notify_dialog(char *caption, char *headline, char *lines) { GtkWidget *notify_dialog_shell, *notify_command; GtkWidget *notify_label, *notify_headline, *notify_scrolled; @@ -130,7 +130,7 @@ GTK_SIGNAL_FUNC(deleted_callback),NULL ); gtk_accel_group_attach(accel, GTK_OBJECT(notify_dialog_shell)); - gtk_window_set_title( GTK_WINDOW( notify_dialog_shell ), "Notify dialog" ); + gtk_window_set_title( GTK_WINDOW( notify_dialog_shell ), caption ); gtk_container_border_width( GTK_CONTAINER(GTK_DIALOG(notify_dialog_shell)->vbox), 5 ); @@ -269,7 +269,7 @@ GtkWidget *notify_label; if (x == 0 && y == 0) { - popup_notify_dialog(headline, lines); + popup_notify_dialog("Message:", headline, lines); return; } notify_dialog_shell = gtk_dialog_new(); diff -ruN -X /home/jjm/cvs/no.freeciv FreecivCVS/client/gui-gtk/repodlgs.c freeciv/client/gui-gtk/repodlgs.c --- FreecivCVS/client/gui-gtk/repodlgs.c Sat Aug 7 10:30:51 1999 +++ freeciv/client/gui-gtk/repodlgs.c Wed Aug 11 11:16:07 1999 @@ -639,7 +639,7 @@ sprintf(str,"No %s could be sold",get_improvement_name(i)); }; gtk_clist_unselect_row(GTK_CLIST(trade_list),row,0); - popup_notify_dialog("Sell-Off Results",str); + popup_notify_dialog("Sell-Off:","Results",str); } return; } diff -ruN -X /home/jjm/cvs/no.freeciv FreecivCVS/client/gui-xaw/dialogs.c freeciv/client/gui-xaw/dialogs.c --- FreecivCVS/client/gui-xaw/dialogs.c Sat Aug 7 10:30:52 1999 +++ freeciv/client/gui-xaw/dialogs.c Wed Aug 11 11:09:07 1999 @@ -146,13 +146,13 @@ /**************************************************************** ... *****************************************************************/ -void popup_notify_dialog(char *headline, char *lines) +void popup_notify_dialog(char *caption, char *headline, char *lines) { Widget notify_dialog_shell, notify_form, notify_command; Widget notify_headline, notify_label; Dimension width, width2; - notify_dialog_shell = XtCreatePopupShell(headline, + notify_dialog_shell = XtCreatePopupShell(caption, transientShellWidgetClass, toplevel, NULL, 0); @@ -274,10 +274,10 @@ Dimension width, width2, width_1, width_2; if (x == 0 && y == 0) { - popup_notify_dialog(headline, lines); + popup_notify_dialog("Message:", headline, lines); return; } - notify_dialog_shell = XtCreatePopupShell(headline, + notify_dialog_shell = XtCreatePopupShell("Message:", transientShellWidgetClass, toplevel, NULL, 0); diff -ruN -X /home/jjm/cvs/no.freeciv FreecivCVS/client/gui-xaw/repodlgs.c freeciv/client/gui-xaw/repodlgs.c --- FreecivCVS/client/gui-xaw/repodlgs.c Wed Jul 21 07:55:19 1999 +++ freeciv/client/gui-xaw/repodlgs.c Wed Aug 11 10:42:50 1999 @@ -742,7 +742,7 @@ } else { sprintf(str,"No %s could be sold",get_improvement_name(i)); }; - popup_notify_dialog("Sell-Off Results",str); + popup_notify_dialog("Sell-Off:","Results",str); return; } diff -ruN -X /home/jjm/cvs/no.freeciv FreecivCVS/client/include/dialogs_g.h freeciv/client/include/dialogs_g.h --- FreecivCVS/client/include/dialogs_g.h Wed Jul 21 07:55:21 1999 +++ freeciv/client/include/dialogs_g.h Wed Aug 11 10:40:06 1999 @@ -18,7 +18,7 @@ struct city; void popup_notify_goto_dialog(char *headline, char *lines, int x, int y); -void popup_notify_dialog(char *headline, char *lines); +void popup_notify_dialog(char *caption, char *headline, char *lines); void popup_races_dialog(void); void popdown_races_dialog(void); diff -ruN -X /home/jjm/cvs/no.freeciv FreecivCVS/client/packhand.c freeciv/client/packhand.c --- FreecivCVS/client/packhand.c Sun Aug 8 19:44:07 1999 +++ freeciv/client/packhand.c Wed Aug 11 11:26:35 1999 @@ -12,6 +12,7 @@ ***********************************************************************/ #include #include +#include #include #include "capability.h" @@ -331,16 +332,28 @@ **************************************************************************/ void handle_page_msg(struct packet_generic_message *packet) { - int i; - char title[512]; - - for(i=0; packet->message[i]!='\n'; i++) - title[i]=packet->message[i]; - title[i]='\0'; - + char *caption; + char *headline; + char *lines; + + caption = packet->message; + headline = strchr (caption, '\n'); + if (headline) { + *(headline++) = '\0'; + lines = strchr (headline, '\n'); + if (lines) { + *(lines++) = '\0'; + } else { + lines = ""; + } + } else { + headline = ""; + lines = ""; + } + if (!game.player_ptr->ai.control || ai_popup_windows || packet->event != BROADCAST_EVENT) - popup_notify_dialog(title, packet->message+i+1); + popup_notify_dialog(caption, headline, lines); } /************************************************************************** diff -ruN -X /home/jjm/cvs/no.freeciv FreecivCVS/server/plrhand.c freeciv/server/plrhand.c --- FreecivCVS/server/plrhand.c Sun Aug 8 09:14:25 1999 +++ freeciv/server/plrhand.c Wed Aug 11 10:37:09 1999 @@ -122,7 +122,7 @@ strcat(buffer,buf2); } free(size); - page_player_generic(0,historian_message[which_news], + page_player_generic(0,"Historian Publishes!",historian_message[which_news], buffer, BROADCAST_EVENT); } @@ -170,7 +170,8 @@ } } free(size); - page_player(pplayer, "The Five Greatest Cities in the World!", buffer); + page_player(pplayer, "Traveler's Report:", + "The Five Greatest Cities in the World!", buffer); } void wonders_of_the_world(struct player *pplayer) @@ -193,7 +194,8 @@ strcat(buffer, buf2); } } - page_player(pplayer, "Wonders of the World", buffer); + page_player(pplayer, "Traveler's Report:", + "Wonders of the World", buffer); } static int rank_calc_research(struct player *pplayer) @@ -319,10 +321,15 @@ void demographics_report(struct player *pplayer) { + char civbuf[1024]; char buffer[4096]; char buf2[4096]; buffer[0]=0; + sprintf(civbuf,"The %s of the %s", + get_government_name(pplayer->government), + get_race_name_plural(pplayer->race)); + sprintf(buf2, "%-20s:%d%% (%s)\n", "Research Speed", rank_calc_research(pplayer), number_to_string(rank_research(pplayer))); strcat(buffer, buf2); @@ -339,7 +346,8 @@ sprintf(buf2, "%-20s:%d Tons (%s)\n", "Pollution", pplayer->score.pollution, number_to_string(rank_pollution(pplayer))); strcat(buffer, buf2); - page_player(pplayer, "Demographics Report", buffer); + page_player(pplayer, "Demographics Report:", + civbuf, buffer); } /* create a log file of the civilizations so you can see what was happening */ @@ -471,7 +479,8 @@ strcat(buffer,buf2); } free(size); - page_player(0, "The Greatest Civilizations in the world.", buffer); + page_player(0, "Final Report:", + "The Greatest Civilizations in the world.", buffer); } @@ -972,8 +981,9 @@ /************************************************************************** This function pops up a non-modal message dialog on the player's desktop **************************************************************************/ -void page_player(struct player *pplayer, char *headline, char *lines) { - page_player_generic(pplayer,headline,lines,-1); +void page_player(struct player *pplayer, char *caption, char *headline, + char *lines) { + page_player_generic(pplayer,caption,headline,lines,-1); } @@ -986,16 +996,20 @@ players with ai_popup_windows off. For example: Herodot's report... and similar messages. **************************************************************************/ -void page_player_generic(struct player *pplayer, char *headline, char *lines, int event) +void page_player_generic(struct player *pplayer, char *caption, char *headline, + char *lines, int event) { int i; struct packet_generic_message genmsg; - if(strlen(headline)+1+strlen(lines) >= sizeof(genmsg.message)) { + if(strlen(caption)+1+strlen(headline)+1+strlen(lines) >= + sizeof(genmsg.message)) { freelog(LOG_NORMAL, "Message too long in page_player_generic!!"); return; } - strcpy(genmsg.message, headline); + strcpy(genmsg.message, caption); + strcat(genmsg.message, "\n"); + strcat(genmsg.message, headline); strcat(genmsg.message, "\n"); strcat(genmsg.message, lines); genmsg.event = event; diff -ruN -X /home/jjm/cvs/no.freeciv FreecivCVS/server/plrhand.h freeciv/server/plrhand.h --- FreecivCVS/server/plrhand.h Wed Jul 21 07:59:15 1999 +++ freeciv/server/plrhand.h Wed Aug 11 10:31:28 1999 @@ -31,8 +31,9 @@ void send_player_info(struct player *src, struct player *dest); -void page_player(struct player *pplayer, char *headline, char *lines); -void page_player_generic(struct player *pplayer, char *headline, +void page_player(struct player *pplayer, char *caption, char *headline, + char *lines); +void page_player_generic(struct player *pplayer, char *caption, char *headline, char *lines, int event); void notify_player(struct player *pplayer, char *format, ...) fc__attribute((format (printf, 2, 3))); diff -ruN -X /home/jjm/cvs/no.freeciv FreecivCVS/server/stdinhand.c freeciv/server/stdinhand.c --- FreecivCVS/server/stdinhand.c Wed Jul 28 11:13:38 1999 +++ freeciv/server/stdinhand.c Wed Aug 11 10:31:28 1999 @@ -1286,8 +1286,12 @@ char buffer[4096]; char buf2[4096]; char title[128]; + char *caption; buffer[0]=0; sprintf(title, "%-20svalue (min , max)", "Option"); + caption = (which == 1) ? + "Server Options (initial)" : + "Server Options (ongoing)"; for (i=0;settings[i].name;i++) { struct settings_s *op = &settings[i]; @@ -1308,7 +1312,7 @@ i = strlen(buffer); assert(i