diff options
author | iain holmes <iain@xamarin.com> | 2016-11-24 21:15:48 +0300 |
---|---|---|
committer | iain holmes <iain@xamarin.com> | 2016-11-24 21:15:48 +0300 |
commit | a1e91cdace47bc8d195e0a2b426db2548fd917f4 (patch) | |
tree | 31165ed2206a24c3cc745644e6600e9204f85842 /main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs | |
parent | 970ad75ca0bb50a94965951b70b47f37353b62d4 (diff) |
[A11y] Improve the accessibility of the dirty files dialog
Diffstat (limited to 'main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs')
-rw-r--r-- | main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/DirtyFilesDialog.cs | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/DirtyFilesDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/DirtyFilesDialog.cs index b1f1ac456b..8e8e88cb36 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/DirtyFilesDialog.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/DirtyFilesDialog.cs @@ -28,11 +28,24 @@ namespace MonoDevelop.Ide.Gui.Dialogs public DirtyFilesDialog (IReadOnlyList<Document> docs, bool closeWorkspace, bool groupByProject) : base (GettextCatalog.GetString ("Save Files"), IdeApp.Workbench.RootWindow, DialogFlags.Modal) { + Accessible.Name = "Dialog.DirtyFiles"; + + string description; + if (closeWorkspace) { + description = GettextCatalog.GetString ("Select which files should be saved before closing the workspace"); + } else { + description = GettextCatalog.GetString ("Select which files should be saved before quitting the application"); + } + Accessible.Description = description; + tsFiles = new TreeStore (typeof(string), typeof(bool), typeof(SdiWorkspaceWindow), typeof(bool)); tvFiles = new TreeView (tsFiles); TreeIter topCombineIter = TreeIter.Zero; Hashtable projectIters = new Hashtable (); - + + tvFiles.Accessible.Name = "Dialog.DirtyFiles.FileList"; + tvFiles.Accessible.SetAccessibilityLabel (GettextCatalog.GetString ("Dirty Files")); + tvFiles.Accessible.Description = GettextCatalog.GetString ("The list of files which have changes and need saving"); foreach (Document doc in docs) { if (!doc.IsDirty) continue; @@ -81,6 +94,7 @@ namespace MonoDevelop.Ide.Gui.Dialogs tvFiles.ExpandAll (); ScrolledWindow sc = new ScrolledWindow (); + sc.Accessible.SetAccessibilityShouldIgnore (true); sc.Add (tvFiles); sc.ShadowType = ShadowType.In; @@ -88,8 +102,32 @@ namespace MonoDevelop.Ide.Gui.Dialogs this.VBox.PackStart (sc, true, true, 6); btnSaveAndQuit = new Button (closeWorkspace ? GettextCatalog.GetString ("_Save and Quit") : GettextCatalog.GetString ("_Save and Close")); + btnSaveAndQuit.Accessible.Name = "Dialog.DirtyFiles.SaveAndQuit"; + + if (closeWorkspace) { + description = GettextCatalog.GetString ("Save the selected files and close the workspace"); + } else { + description = GettextCatalog.GetString ("Save the selected files and quit the application"); + } + btnSaveAndQuit.Accessible.Description = description; + btnQuit = new Button (closeWorkspace ? Gtk.Stock.Quit : Gtk.Stock.Close); + btnQuit.Accessible.Name = "Dialog.DirtyFiles.Quit"; + if (closeWorkspace) { + description = GettextCatalog.GetString ("Close the workspace"); + } else { + description = GettextCatalog.GetString ("Quit the application"); + } + btnQuit.Accessible.Description = description; + btnCancel = new Button (Gtk.Stock.Cancel); + btnCancel.Accessible.Name = "Dialog.DirtyFiles.Cancel"; + if (closeWorkspace) { + description = GettextCatalog.GetString ("Cancel closing the workspace"); + } else { + description = GettextCatalog.GetString ("Cancel quitting the application"); + } + btnCancel.Accessible.Description = description; btnSaveAndQuit.Clicked += SaveAndQuit; btnQuit.Clicked += Quit; |