Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#3324 closed defect (fixed)

[PATCH] The cancel button in the options window does not cancel changes

Reported by: Mark Otaris Owned by: Itms
Priority: Should Have Milestone: Alpha 19
Component: UI & Simulation Keywords: patch
Cc: Patch:

Description

When changing an option in the options window and clicking on the cancel button, the change is not saved but still appears if the options window is reopened without restarting the game.

Steps to reproduce:

  1. Start 0 A.D.
  2. Open the options window.
  3. Change a setting (toggle one of the settings, for example).
  4. Click the cancel button.
  5. Reopen the settings window without restarting the game.

Expected result:

The change has been reverted, and the settings are in the state they were in when starting 0 A.D.

Actual result:

The change has not been reverted, and is still there.

However, if 0 A.D. is restarted and the options window is opened again, then it will in fact have been reverted, which is not the case if the button to save changes is clicked on.

Attachments (1)

patch_3324.patch (409 bytes ) - added by Stefan 9 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 by elexis, 9 years ago

However, if 0 A.D. is restarted and the options window is opened again, then it will in fact have been reverted

In that case the options just have to be reloaded each time the window is opened.

by Stefan, 9 years ago

Attachment: patch_3324.patch added

comment:2 by Stefan, 9 years ago

Keywords: review patch added
Milestone: BacklogAlpha 19
Summary: The cancel button in the options window does not cancel changes[PATCH] The cancel button in the options window does not cancel changes

comment:3 by Stefan, 9 years ago

The Patch fix the issue that changed settings are not reverted back to the old one. I think a better solution would be to seperate the cancel and the save_setting function for the option panel. In one function we only save the new settings to the file and in the other we only reload them again. Currently the settings are saved and after that reloaded again.

comment:4 by Itms, 9 years ago

Owner: set to Itms
Resolution: fixed
Status: newclosed

In 16930:

Revert changes when clicking "Cancel" in the options page.
Patch by Stefan, fixes #3324

comment:5 by Itms, 9 years ago

Keywords: review removed

Thanks for the patch.

I added a code comment and removed the tabulation you added on line 231.

Note: See TracTickets for help on using tickets.