Skip to content
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

Bug 512 - Autosave open files when committing. #328

Merged
merged 2 commits into from Jul 11, 2013

Conversation

Projects
None yet
2 participants
@Therzok
Copy link
Member

commented Jul 8, 2013

I've added a dialog for asking the user what to do with unsaved files.

In case we have open documents, ask the user if he wants to cancel the commit
operation, save the files or ignore local changes.

Bug 512 - Autosave open files when committing.
I've added a dialog for asking the user what to do with unsaved files.

In case we have open documents, ask the user if he wants to cancel the commit
operation, save the files or ignore local changes.
if (docList.Count != 0) {
AlertButton response = MessageService.GenericAlert (
MonoDevelop.Ide.Gui.Stock.Question,
GettextCatalog.GetString ("Files has unsaved changes"),

This comment has been minimized.

Copy link
@slluis

slluis Jul 9, 2013

Member

Let's use the following message: "You are trying to commit files which have unsaved changes. Do you want to save the changes before committing?"

MonoDevelop.Ide.Gui.Stock.Question,
GettextCatalog.GetString ("Files has unsaved changes"),
GettextCatalog.GetString ("Do you want to save before?"),
new AlertButton[] { AlertButton.Cancel, AlertButton.No, AlertButton.Yes });

This comment has been minimized.

Copy link
@slluis

slluis Jul 9, 2013

Member

Always use specific actions instead of yes/no. The buttons in this case should be Cancel, Don't Save, Save.


if (response == AlertButton.Yes)
foreach (var item in docList)
item.Save ();

This comment has been minimized.

Copy link
@slluis

slluis Jul 9, 2013

Member

You should check if IsDirty==false after saving. In some cases the save command may fail (for example, if the save would overwrite changes done outside MD). If a save fails, you should show a message to the user and cancel the commit.

slluis added a commit that referenced this pull request Jul 11, 2013

Merge pull request #328 from mono/autoSave
Bug 512 - Autosave open files when committing.

@slluis slluis merged commit a92bfa0 into master Jul 11, 2013

Therzok pushed a commit that referenced this pull request Mar 25, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.