Re: [Freeciv-Dev] (PR#39624) [Patch] group unit selection
http://bugs.freeciv.org/Ticket/Display.html?id=39624 > Per Inge Mathisen wrote: > Keeping fixed tickets open until release has never been done by anyone > around here before, and your fixed-but-open tickets really did confuse > me sometimes too, so please be civil on people who misunderstand your > new, until now unannounced way of working with the ticket system. > Oh? That's the way most every project I've participated in has always worked. But I have to admit, this project seems to work a bit differently. I've never been part of one that kept a release in beta for 2 years. Usually, patches are made to trunk, and then "pulled up" into a release. Admittedly, I was around when NetBSD releases were considered too slow, and Theo split off OpenBSD with regular 6 month releases. There can certainly be differences about how often to branch releases. But, as was the original topic, it is very, VERY bad form to close an active developer's tickets. And I've never heard of a non-developer closing tickets at all! ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
Re: [Freeciv-Dev] (PR#39624) [Patch] group unit selection
http://bugs.freeciv.org/Ticket/Display.html?id=39624 > On 10/18/07, William Allen Simpson <[EMAIL PROTECTED]> wrote: > Yes, it was. Thank you for making a note of it. However, it is > considered very, VERY bad form to close a developer's ticket. It > disappears off the list of open tickets, and thus is not there to > prompt the developer to test it upon a release. Hey, Keeping fixed tickets open until release has never been done by anyone around here before, and your fixed-but-open tickets really did confuse me sometimes too, so please be civil on people who misunderstand your new, until now unannounced way of working with the ticket system. - Per ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
Re: [Freeciv-Dev] (PR#39624) [Patch] group unit selection
http://bugs.freeciv.org/Ticket/Display.html?id=39624 > Pepeto _ wrote: > This had been commited at revision 13435 in trunk/ > Yes, it was. Thank you for making a note of it. However, it is considered very, VERY bad form to close a developer's ticket. It disappears off the list of open tickets, and thus is not there to prompt the developer to test it upon a release. It is much better to send a private message asking the developer to verify their own ticket Moreover, you apparently didn't like the patch. It is better to work out the details of a fix before closing a ticket. ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] (PR#39624) [Patch] group unit selection
http://bugs.freeciv.org/Ticket/Display.html?id=39624 > > [EMAIL PROTECTED] - Lun. Aoû. 27 14:17:04 2007]: > > This patch introduces two new simple feature for gtk2 client: > > * Select same type in tile: Select all units with same type as > selected units that has the same tile too > * Select all (in select unit dialog): Ability to select all units of > a tile at once > > Hope to be useful > > Regards > > Arman Ordookhani > > This had been commited at revision 13435 in trunk/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] (PR#39624) [Patch] group unit selection
http://bugs.freeciv.org/Ticket/Display.html?id=39624 > > [EMAIL PROTECTED] - Lun. Aoû. 27 14:17:04 2007]: > > This patch introduces two new simple feature for gtk2 client: > > * Select same type in tile: Select all units with same type as > selected units that has the same tile too > * Select all (in select unit dialog): Ability to select all units of > a tile at once > > Hope to be useful > > Regards > > Arman Ordookhani > > I think you should add a test: if (!punit->ai.control). And a thing more, to iterate all units on a tile, I think it's better to use: unit_list_iterate(punit->tile->units, punit2). ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] (PR#39624) [Patch] group unit selection
http://bugs.freeciv.org/Ticket/Display.html?id=39624 > This patch introduces two new simple feature for gtk2 client: * Select same type in tile: Select all units with same type as selected units that has the same tile too * Select all (in select unit dialog): Ability to select all units of a tile at once Hope to be useful Regards Arman Ordookhani Index: client/control.c === --- client/control.c (revision 13404) +++ client/control.c (working copy) @@ -1156,6 +1156,26 @@ } } +/ + Select all units of the same type as the given unit that have the same tile +/ +void request_unit_select_same_type_tile(struct unit_list *punits) +{ + if (can_client_change_view()) { +unit_list_iterate(punits, punit) { + unit_list_iterate(unit_owner(punit)->units, punit2) { + if (unit_type(punit2) == unit_type(punit) + && !unit_list_search(punits, punit2) + && punit2->activity == ACTIVITY_IDLE + && !unit_has_orders(punit2) + && punit->tile == punit2->tile) { + add_unit_focus(punit2); + } + } unit_list_iterate_end; +} unit_list_iterate_end; + } +} + /** Request a diplomat to do a specific action. - action : The action to be requested. Index: client/gui-gtk-2.0/menu.c === --- client/gui-gtk-2.0/menu.c (revision 13404) +++ client/gui-gtk-2.0/menu.c (working copy) @@ -147,6 +147,7 @@ MENU_ORDER_DIPLOMAT_DLG, MENU_ORDER_NUKE, MENU_ORDER_SELECT_SAME_TYPE, + MENU_ORDER_SELECT_SAME_TYPE_TILE, MENU_ORDER_WAIT, MENU_ORDER_DONE, @@ -407,6 +408,9 @@ case MENU_ORDER_SELECT_SAME_TYPE: request_unit_select_same_type(get_units_in_focus()); break; + case MENU_ORDER_SELECT_SAME_TYPE_TILE: +request_unit_select_same_type_tile(get_units_in_focus()); +break; case MENU_ORDER_BUILD_CITY: unit_list_iterate(get_units_in_focus(), punit) { /* FIXME: this can provide different actions for different units... @@ -917,6 +921,8 @@ NULL, 0, "" }, { "/" N_("Orders") "/" N_("Select same type"), "y", orders_menu_callback, MENU_ORDER_SELECT_SAME_TYPE }, + { "/" N_("Orders") "/" N_("Select same type in tile"), "y", +orders_menu_callback, MENU_ORDER_SELECT_SAME_TYPE_TILE }, { "/" N_("Orders") "/" N_("_Wait"), "w", orders_menu_callback, MENU_ORDER_WAIT }, { "/" N_("Orders") "/" N_("Done"), "space", Index: client/gui-gtk-2.0/dialogs.c === --- client/gui-gtk-2.0/dialogs.c (revision 13404) +++ client/gui-gtk-2.0/dialogs.c (working copy) @@ -71,6 +71,7 @@ /**/ #define SELECT_UNIT_READY 1 #define SELECT_UNIT_SENTRY 2 +#define SELECT_UNIT_ALL3 static GtkWidget *unit_select_dialog_shell; static GtkTreeStore *unit_select_store; @@ -491,6 +492,19 @@ } break; + case SELECT_UNIT_ALL: +{ + unit_list_iterate(ptile->units, punit) { +if (game.player_ptr == punit->owner) { + if (punit->activity == ACTIVITY_IDLE) { +/* Give focus to it */ +add_unit_focus(punit); + } +} + } unit_list_iterate_end; +} +break; + default: break; } @@ -508,7 +522,7 @@ if (!unit_select_dialog_shell) { GtkTreeStore *store; GtkWidget *shell, *view, *sw, *hbox; -GtkWidget *ready_cmd, *sentry_cmd, *close_cmd; +GtkWidget *ready_cmd, *sentry_cmd, *select_all_cmd, *close_cmd; static const char *titles[NUM_UNIT_SELECT_COLUMNS] = { N_("Unit"), @@ -601,6 +615,14 @@ GTK_BUTTON_BOX(GTK_DIALOG(shell)->action_area), sentry_cmd, TRUE); +select_all_cmd = +gtk_dialog_add_button(GTK_DIALOG(shell), + _("Select _all"), SELECT_UNIT_ALL); + +gtk_button_box_set_child_secondary( + GTK_BUTTON_BOX(GTK_DIALOG(shell)->action_area), + select_all_cmd, TRUE); + close_cmd = gtk_dialog_add_button(GTK_DIALOG(shell), GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE); Index: client/control.h === --- client/control.h (revision 13404) +++ client/control.h (working copy) @@ -91,6 +91,7 @@ void request_units_wait(struct unit_list *punits); void request_unit_wakeup(struct unit *punit); void request_unit_select_same_type(struct unit_list *punits); +void request_unit_select_same_type_tile(struct unit_list *punits); void request_diplomat_action(enum diplomat_actions action, int dipl_id, int target_id, int value); void request_toggle_city_outlines(void); ___ Freeciv-dev mailing list Fr