Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2004:
[Freeciv-Dev] Re: Extended connect dialog (PR#977)
Home

[Freeciv-Dev] Re: Extended connect dialog (PR#977)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] Re: Extended connect dialog (PR#977)
From: "Daniel L Speyer" <dspeyer@xxxxxxxxxxx>
Date: Tue, 23 Mar 2004 18:49:46 -0800
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=977 >

Jason Short wrote:

><URL: http://rt.freeciv.org/Ticket/Display.html?id=977 >
>
>Mike Kaufman wrote:
>  
>
>><URL: http://rt.freeciv.org/Ticket/Display.html?id=977 >
>>
>>here is what I hope is the ultimate version of the new connect dialog.
>>That's a lot of hope of course: there are probably still bugs lurking.
>>There _are_ a couple of niggling issues, but they should not stop a commit.
>>    
>>
>
>I get a compilation error:
>
>packets_gen.c: In function `dsend_packet_options_settable_control':
>packets_gen.c:24985: warning: passing arg 1 of `mystrlcpy' from 
>incompatible pointer type
>packets_gen.c: In function `dlsend_packet_options_settable_control':
>packets_gen.c:24996: warning: passing arg 1 of `mystrlcpy' from 
>incompatible pointer type
>
>Also skill_level_names_translated is still declared, although it's never 
>used.
>
>jason
>
>
>  
>
The compilation issues come from missing flags in packets.def.  Fix 
attached.

There are also a few bugs in the options-setting code.  This patch fixes 
them too.

--Daniel


diff -ur kaufman/client/gui-gtk-2.0/connectdlg.c 
speyer/client/gui-gtk-2.0/connectdlg.c
--- kaufman/client/gui-gtk-2.0/connectdlg.c     2004-03-23 21:37:31.608651032 
-0500
+++ speyer/client/gui-gtk-2.0/connectdlg.c      2004-03-23 16:03:01.000000000 
-0500
@@ -864,7 +864,7 @@
   button = gtk_button_new_with_label(_("Initial Server Options"));
   g_signal_connect_swapped(G_OBJECT(button), "clicked",
                           G_CALLBACK(send_report_request), 
-                          (gpointer)REPORT_SERVER_OPTIONS2);
+                          (gpointer)REPORT_SERVER_OPTIONS1);
   gtk_box_pack_end(GTK_BOX(hbox), button, TRUE, TRUE, 20);
 
 
diff -ur kaufman/client/gui-gtk-2.0/repodlgs.c 
speyer/client/gui-gtk-2.0/repodlgs.c
--- kaufman/client/gui-gtk-2.0/repodlgs.c       2004-03-23 21:37:31.724633400 
-0500
+++ speyer/client/gui-gtk-2.0/repodlgs.c        2004-03-23 16:59:44.000000000 
-0500
@@ -1406,12 +1406,21 @@
 {
   GtkWidget *dialog, *close, *label;
   int i = (int)g_object_get_data(G_OBJECT(w), "help");
+  PangoAttrList *pal;
+  PangoAttribute *pa;
 
   dialog = gtk_dialog_new();
   gtk_window_set_title(GTK_WINDOW(dialog), _("Help"));
 
   label = gtk_label_new(settable_options[i].help);
+  gtk_widget_set_size_request(label, 500, -1);
   gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
+  pal=pango_attr_list_new();
+  pa=pango_attr_family_new("Monospace");
+  pa->start_index=0;
+  pa->end_index=-1;
+  pango_attr_list_insert(pal,pa);
+  gtk_label_set_attributes(GTK_LABEL(label), pal);
 
   gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), label, FALSE, FALSE, 
5);
 
diff -ur kaufman/common/packets.def speyer/common/packets.def
--- kaufman/common/packets.def  2004-03-23 21:37:32.301545696 -0500
+++ speyer/common/packets.def   2004-03-23 15:01:51.000000000 -0500
@@ -1216,11 +1216,11 @@
 /*********************************************************
  Below are the packets that control single-player mode.  
 *********************************************************/
-PACKET_SINGLE_WANT_HACK_REQ=107;cs,handle-per-conn,no-handle
+PACKET_SINGLE_WANT_HACK_REQ=107;cs,handle-per-conn,no-handle,dsend
  UINT32 challenge;
 end
 
-PACKET_SINGLE_WANT_HACK_REPLY=108;sc, 
+PACKET_SINGLE_WANT_HACK_REPLY=108;sc,dsend 
  BOOL you_have_hack;
 end
 
diff -ur kaufman/server/stdinhand.c speyer/server/stdinhand.c
--- kaufman/server/stdinhand.c  2004-03-23 21:37:32.000000000 -0500
+++ speyer/server/stdinhand.c   2004-03-23 15:46:57.000000000 -0500
@@ -2815,10 +2815,16 @@
 
   /* count the number of settings */
   for (i = 0; settings[i].name; i++) {
-    if (which == 1 && sset_is_changeable(i)) {
+    if (!sset_is_to_client(i)) {
       continue;
     }
-    if (which == 2 && !sset_is_changeable(i)) {
+    if (which == 1 && settings[i].sclass > SSET_GAME_INIT) {
+      continue;
+    }
+    if (which == 2 && settings[i].sclass <= SSET_GAME_INIT) {
+      continue;
+    }
+    if (!sset_is_changeable(i)) {
       continue;
     }
     s++;
@@ -2836,10 +2842,16 @@
   send_packet_options_settable_control(dest, &control);
 
   for (s = 0, i = 0; settings[i].name; i++) {
-    if (which == 1 && sset_is_changeable(i)) {
+    if (!sset_is_to_client(i)) {
+      continue;
+    }
+    if (which == 1 && settings[i].sclass > SSET_GAME_INIT) {
+      continue;
+    }
+    if (which == 2 && settings[i].sclass <= SSET_GAME_INIT) {
       continue;
     }
-    if (which == 2 && !sset_is_changeable(i)) {
+    if (!sset_is_changeable(i)) {
       continue;
     }
 

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