[Freeciv-Dev] Re: cleanup to id_to_info_row (PR#1292)
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Sat, Mar 02, 2002 at 02:00:27AM -0800, jdorje@xxxxxxxxxxxxxxxxxxxxx wrote:
> The primary purpose of this patch is to add special-case handling for
> "999" turns to build for the id_to_info_row function (which is used to
> assemble worklist and production selection list entries in the city
> dialog for both GTK and Win32).
>
> But in the process, I've done some other cleanups as well. The changes are:
>
> - I moved id_to_info_row out of common/city.[ch] and into
> client/citydlg_common.[ch], where it (more) rightfully belongs. AFAICT
> this function has no potential use on the server.
At the time I created id_to_info_row there was no
client/citydlg_common ;)
> - I renamed it from id_to_info_row to get_city_dialog_production_row.
> Although much longer, this is somewhat more informative and is also
> consistent with the adjacent function get_city_dialog_production. I did
> _not_ change the order of the arguments, although this is inconsistent
> between the two functions: one has pcity listed first, the other lists
> it last.
>
> - I slightly changed handling of the capitalization case. Now instead
> of being getting "---" for the turns to build it shows up as "N/turn",
> where N is the amount of gold produced per turn (note, this assumes a
> 1-1 shield-gold conversion).
>
> - I slightly changed handling of the pcity=NULL case. I'm don't think
> this actually ever happens in practice, but when it does we set the
> turns to "---" now. Note, the turns-to-build was previously set to
> "---" for capitalization or "" for everything else in this (pcity==NULL)
> case.
>
>
> Issues: the only issue I can see is that the "N/turn" or "never" entries
> could be too long for some languages. In English, they fit into the GTK
> Clist areas with about 33% of the room to spare. A workaround would be
> to translate both to "---" (although this might necessitate
> context-dependent strings for translating).
>
> Xaw and Mui do not use this function; both assemble their text entries
> individually. Mui I can't quite figure out - I could change the code to
> use "never" when appropriate, but I doubt I could make any good
> structural changes. Xaw is pretty simple, but it shouldn't use this
> function in any case because it doesn't use a table-based layout; the
> entry is just one long string. However, I think this string should be
> assembled in client-common code also, perhaps in
> get_city_dialog_production_text() or some such (this would allow future
> guis to use the same assembly). Either way, it will be pretty easy to
> make the s/999/never/ change - which is preferred?
Is it possible to merge get_city_mapview_production,
get_city_dialog_production, cr_entry_building and this proposed
get_city_dialog_production_text?
Raimar
--
email: rf13@xxxxxxxxxxxxxxxxx
"#!/usr/bin/perl -w
if ( `date +%w` != 1 ) {
die "This script only works on Mondays." ;
}"
-- from chkars.pl by Cornelius Krasel in de.comp.os.linux.misc
|
|