Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2002:
[Freeciv-Dev] Re: [patch] xaw citydlg: s/999/never/ (PR#1296)
Home

[Freeciv-Dev] Re: [patch] xaw citydlg: s/999/never/ (PR#1296)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jdorje@xxxxxxxxxxxxxxxxxxxxx
Cc: freeciv-dev@xxxxxxxxxxx, bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: [patch] xaw citydlg: s/999/never/ (PR#1296)
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 14 Mar 2002 21:45:53 +0100
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Mon, Mar 04, 2002 at 02:10:27AM -0800, jdorje@xxxxxxxxxxxxxxxxxxxxx wrote:
> The attached patch makes the s/999/never/ change for the xaw citydlg 
> worklist and selection windows.
> 
> In the process, I've done some additional cleanups:
> 
> - Created function get_city_dialog_production_full.  The name is less 
> than ideal.  I had the parameters match those from 
> get_city_dialog_production_row, which this function closely corresponds to.
> 
> - Moved the code from gui-xaw/citydlg.c to citydlg_common.c.  This 
> function can now be used by other GUI's that need this data.  In 
> general, a GUI can probably use either ***_row or ***_full.  Currently 
> mui and beos use neither.c
> 
> - Changed capitalization to say N/turn.
> 
> The difference between ***_full and ***_row is that ***_row creates an 
> array of text values for the name/info/cost/turns of the production, 
> while ***_full puts this all into one string.  The former is good for 
> "advanced" GUI frontends that use table structures to show the data 
> (like GTK), the latter for simpler GUI interfaces that prefer to use 
> straight text values.  Unfortunately, the two functions really can't be 
> combined because they use different syntax for the turns entry.
> 
> After this change (or one like it) the only code that does not 
> special-case 999 will be the some MUI code.  This code can probably use 
> one of these two functions, but I really can't figure it out enough to 
> tell how.  Therefore I sent another patch (separately) to change this to 
> just handle it locally.

In the long run it would be nice if this is replaced with something
similar to:

  cids_used = collect_cids3(cids);
  name_and_sort_items(cids, cids_used, items, TRUE, pdialog->pcity);

  for (item = 0; item < cids_used; item++) {
    cid cid = items[item].cid;
    int row_no;

    get_city_dialog_production_row(row, sizeof(buf[0]),
                                   cid_id(cid), cid_is_unit(cid),
                                   pdialog->pcity);
    row_no = gtk_clist_append(GTK_CLIST(pdialog->change_list), row);
    gtk_clist_set_row_data(GTK_CLIST(pdialog->change_list),
                           row_no, (gpointer) cid);
  }

This change_list_num_improvements field is just ugly.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "If at first you don't succeed... well so much for skydiving."


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