-
-
Notifications
You must be signed in to change notification settings - Fork 994
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
editor: Pick proper dir and filename in Save Map/Scenario As dialog #8911
Comments
On the directory aspect, #2807 seems related. |
@soliton- Please check if the latest commit in #8903 alleviates this somewhat?
Working on this part. Forbidding the extension completely should be much easier. Plus I can use my validation textbox idea (a textbox which shows check/cross marks based on whether the input is valid or not). |
Is Does the user see some feedback on what is wrong? Can they override it? Using the correct starting dir to save to is also important. I forgot if you already added that in a different commit. |
I'll check the last directory.
No. What the code does is check the (cached) path and if it is empty or has 'maps'/'scenarios', it opens the file dialog into the default directory (which is the addon's scenario/map directory) with a blank filename.
|
Ok, to pick the proper dir to start with I was just thinking to use The other logic would be to warn the user when they pick something that seems to make no sense. Like when they navigate to the scenarios dir from the Save Map As dialog, type in the file name and click |
This already exists in my PR.
Okay, will work on this one. |
I assume you mean in your PR. |
Saving in the wrong directory should be allowed. Saving with the wrong extension should be forbidden. |
This is what I added in 9c65d1e : The example is from |
692924b gives the user a warning the first they try to save a scenario in maps folder or vice versa. Pressing "Yes" saves anyway, "No" closes dialog. |
How do I deal with empty filenames? I see two approaches:
file dialog seems to use a different design pattern than other dialogs which is confusing to me. It could have used @irydacea Any thoughts on why you used a different pattern in |
Disabling saving until a name is given sounds good to me. I don't see a reason to auto generate a name. |
Anything else needs to be done as part of this issue? |
The extension is enforced now or can be overridden by the user? I think besides Otherwise I think this looks to be resolved if the code gets merged. |
Cannot be overridden, so file cannot be saved without correct extension. (The code calling the
For which dialog? |
Yes, when saving maps |
Implemented in b3128ff. File Dialog now has support for multiple extensions (previous commit). Extension validation only done when saving files. |
Map/Scenario Editor * Rename Load Map to Load Map/Scenario (since it can load both), Edit Scenario to Edit Scenario Settings, Save Map to just Save. * Rearrange menu order * Add icon for the preferences menu item (used the preexisting settings.png icon) * Open folder correctly at Add-on's scenario directory instead of editor/scenarios. (#8910) * Show Save Scenario As only for Scenarios * Use the settings.png icon for Preferences menu item * Add functionality to "Loyal" checkbox (Unit tool -> Place unit -> Right click menu) (#8445) * Show warning when maps are saved in scenarios folder or vice versa (#8911) * Unit List moved to Units menu from File menu to reduce some pressure from the latter. * Status Table menu item disabled since it does nothing. (Should be reenabled once the functionality has been added.) * Improve reload functionality in Editor (F5). Reload happens directly from memory and no temp files are needed. Also, the undo/redo stacks will be preserved. (#9024) Time Schedule Editor * Browse buttons now set wesnoth style paths instead of just pasting the absolute path returned by the file dialog * Change text boxes from inactive to uneditable. * Code generation improvements * Add copyright notice to tod_new_schedule * Confirmation messages * Preview buttons for image and sound files and new icons for the preview button (2 sets : preview image and preview sound) Unit Type Editor * Confirmation messages * New icons for the preview button (2 sets : preview image and preview sound) Add-on menu * Two new menu entries for (1) opening the Add-on selection dialog, (2) opening the folder corresponding to the Add-on The open add-on folder option shows a GUI2 file dialog at the add-on's folder which can be used to open any file. If it is a loadable map/scenario it will be opened in the editor, otherwise the OS's default application for that file will be opened. File Dialog * Redesigned with new icons * New Open External button that opens selected file/folder in the platform's default application (independently of what pressing Open would do). This could be used to quickly open a folder or preview the file before actually selecting it. * Extension checking and filename validation. (See #8911)
Describe the desired feature
Now you get the previous scenario filename in the dialog and if you do save you overwrite your scenario.
Similarly you get the map file name if you save as map first.
This is confusing and can lead to data loss if the user is not careful. Even if you change the filename you're saving to the wrong dir.
The save dialog should pick the proper dir to start with and even then it might be good to give an explicit warning if someone saves a map as .cfg or a scenario as .map and/or when they save them in the wrong dir (as much as the editor can tell, so just if the dir is named maps/scenarios). The wrong extension could perhaps even be completely forbidden.
The text was updated successfully, but these errors were encountered: