Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#3473 closed enhancement (fixed)

[PATCH] deleting a file in the replay menu should not reset the selection

Reported by: mimo Owned by: elexis
Priority: Nice to Have Milestone: Alpha 20
Component: UI & Simulation Keywords: patch
Cc: Patch:

Description

When deleting a file in the replay list, the selection is reset while it would be more practical to keep the previous value (or the previous value - 1 if we deleted the last entry). That would allow an easy removal of a bunch of consecutive entries which is presently quite laborious. The proposed approach is the one used in the load game panel.

Change History (12)

comment:1 by leper, 8 years ago

Keywords: simple added

comment:2 by Sergey Kushnirenko, 8 years ago

Keywords: review patch added
Milestone: BacklogAlpha 20
Summary: deleting a file in the replay menu should not reset the selection[PATCH] deleting a file in the replay menu should not reset the selection

comment:3 by elexis, 8 years ago

Keywords: review removed

Thanks for the patch, but it's not functionally complete yet.

  • The selected index is restored, but the sorting order is reset on init(), so that one has to be restored as well. If thats done, #3742 will be trivial to do as well.
  • When possible, use the name of the GUI object as variable name.
  • Whitespace issues, use tabs and follow the wiki:Coding_Conventions

comment:4 by Sergey Kushnirenko, 8 years ago

  1. The selected index is restored, but the sorting order is reset on init(), so that one has to be restored as well. I tested it on some orders, where i can get case that it broken?
  1. When possible, use the name of the GUI object as variable name. what means? create special variable for widget name?
  1. Ok, will do

comment:5 by elexis, 8 years ago

  1. Apparently it works if selected_column changed, but not when selected_column_order changed. For example if I click on "Map Name" once and then delete a replay, it changes the sorting order after deleting, invalidating the selected index too. However if I click on "Map Name" twice and then delete, it works.

I fear this might be a bug in the ordered list itself (not in your patch), but didn't investigate further yet.

For example the olist also has a different sorting bug: It should be sorted according to the date/time by default, but actually it sorts according to the directory name after init.

  1. Just saying that I didn't encounter the widget-name before. Mostly the following style is used in the GUI:
    var replaySelection = Engine.GetGUIObjectByName("replaySelection");
    

comment:6 by elexis, 8 years ago

In 17665:

Fix a bug in r16781 which prevented the replaylist from being sorted correclty on init, refs #2405, #3473.
The default column argument is given in XML and applied in COList::SetupText() but it hasn't been stored, preventing JS from knowing the selected column.

comment:7 by Sergey Kushnirenko, 8 years ago

Keywords: review added; simple removed

comment:8 by elexis, 8 years ago

Owner: set to elexis
Resolution: fixed
Status: newclosed

In 17672:

Restore the replay selection after deletion. Based on patch by dalerank, fixes #3473.

comment:9 by elexis, 8 years ago

Keywords: review removed
Type: defectenhancement
Note: See TracTickets for help on using tickets.