Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2002:
[Freeciv-Dev] Re: (PR#949) city report fields don't sort well
Home

[Freeciv-Dev] Re: (PR#949) city report fields don't sort well

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: markus.buechele@xxxxxx, flyguy@xxxxxxxx
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#949) city report fields don't sort well
From: "Raimar Falke via RT" <rt@xxxxxxxxxxxxxx>
Date: Thu, 14 Nov 2002 03:08:34 -0800
Reply-to: rt@xxxxxxxxxxxxxx

On Thu, Nov 14, 2002 at 12:24:56AM -0800, Jason Short via RT wrote:
> 
> Raimar told me not to overengineer on this one, but I really can't help
> myself...
> 
> The city report dialog is freeciv's best micro/macro management tool,
> yet it is IMO crippled in its current state.  This really needs to be
> addressed.
> 
> The problem with the patches provided so far is that they only try to
> treat the existing (text) fields of the city report as numerical fields,
> by scanning them for numerical data.  Worse still, they will only work
> for one GUI (gui-gtk).
> 
> One alternative is to take the existing patches, and use them to provide
> a GUI-independent comparison function.  The functions provided by the
> patches do essentially the same thing: provide a comparison function to
> compare two strings that may or may not be integers.  This function
> could be used by all GUIs (at their option) to implement better sorting.
>  A combination of the two existing patches (using Raimar's comparison
> code with Christian's GTK code) would be my preference.
> 
> This is probably a first step.  But a lot more is possible, IMO.

> The above design will allow sorting of simple numeric fields, and in
> conjunction with Tuomas Airaksinen's patch to give the city report more
> available fields (already applied), this may be sufficient.  But
> consider the "Surplus F/P/T" field.  Under the simple design above, this
> field will always be sorted by the F (food) category.  While this is an
> improvement on the current situation (sorting it alphabetically), it is
> not what we really want.  As a gamer, what _I_ would want is the ability
> to have this field be sorted (in either direction) according to either
> the F, P, or T fields, or (perhaps) according to their sum.  (Note that
> these fields can now be obtained as separate entries in the dialog, so I
> can already get the behavior I want - but it is not grouped as nicely.)
>  When I sort the "currently building" field I would like to see it
> sorted not alphabetically, but first by building type (alphabetically,
> or by type; whatever) and then by turns remaining to build.  When I sort
> the "best defenders" field (very slick idea, Tuomas) I would like to be
> able to sort by either the best unit, or the sum of the best two units,
> or the sum of the best three.

IIRC I made a patch which did exactly this. Multiple clicks on the
column changed the priority of the sub-column fields. The biggest
problem was how to provide a good user feedback. IIRC I prefixed the
current Field "P" for example with a "V" or a "^". The code was ugly
because it had to parse the column.

From the design point of view I would want each of the fields as a
seperate column and the ability to merge them to a column. So I take
the "F", "P" and "T" column and merge them to the "Surplus F/P/T"
column. So if this flexibility is even available to the user I think
everyone will be happy.

> With these abilities I think the city report dialog could be made both
> simpler and more powerful.
> 
> Doing all of this elegantly (note that the alternative solution is far
> from elegant, so the bar is pretty low) is not easy, but I think it is
> possible.  It is made more difficult because the different GUIs may have
> very different interfaces: even gui-gtk and gui-gtk-2.0 are quite different.
> 
> I've had some thoughts on how to do this, but I'd like to get others'
> opinions on it.  First of all: would these capabilities be a good thing?
>  Secondly: how would you go about implementing it?  (Or, better yet, can
> you provide a patch?).
> 
> In the meantime, the simple solution can move forward.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 A life? Cool! Where can I download one?



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