diff options
author | Dmytro Ovcharov <dmytro.ovcharov@globallogic.com> | 2017-07-31 15:54:48 +0300 |
---|---|---|
committer | Dmytro Ovcharov <dmytro.ovcharov@globallogic.com> | 2017-07-31 15:54:48 +0300 |
commit | 2921c7a8cc0ade9d9b4e6a9aebd354fe88a8f6c6 (patch) | |
tree | 6e6e1bdad764b63d963ced36cfdcf34c35115b50 /main/src | |
parent | 1af8735d73a07bcfb602ac257384c0527981b3ea (diff) |
BXC #53783
Diffstat (limited to 'main/src')
-rw-r--r-- | main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkNewProjectDialogBackend.cs | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkNewProjectDialogBackend.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkNewProjectDialogBackend.cs index dedb568c54..abff34f36a 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkNewProjectDialogBackend.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkNewProjectDialogBackend.cs @@ -34,7 +34,10 @@ using MonoDevelop.Components.AutoTest; using MonoDevelop.Components.Commands;
using MonoDevelop.Ide.Templates;
using MonoDevelop.Ide.Gui;
-
+using AppKit;
+using Foundation;
+using MonoDevelop.Core; + namespace MonoDevelop.Ide.Projects
{
partial class GtkNewProjectDialogBackend : INewProjectDialogBackend
@@ -59,7 +62,7 @@ namespace MonoDevelop.Ide.Projects templatesTreeView.Selection.SelectFunction = TemplatesTreeViewSelection;
templatesTreeView.RowActivated += TreeViewRowActivated;
cancelButton.Clicked += CancelButtonClicked;
- nextButton.Clicked += (sender, e) => MoveToNextPage ();
+ nextButton.Clicked += NextButtonClicked;
previousButton.Clicked += (sender, e) => MoveToPreviousPage ();
nextButton.CanDefault = true;
@@ -68,6 +71,37 @@ namespace MonoDevelop.Ide.Projects // Setup the treeview to be able to have a context menu
var actionHandler = new ActionDelegate (templatesTreeView);
actionHandler.PerformShowMenu += PerformShowMenu;
+ } + + void NextButtonClicked (object sender, EventArgs e)
+ {
+ bool isLastPage = controller.IsLastPage;
+ MoveToNextPage ();
+ if (isLastPage) {
+ var message = GenerateProjectCreatedMessage ();
+ ShowAccessibityNotification (message);
+ }
+ }
+
+ void ShowAccessibityNotification (string message)
+ {
+ var accessibleObject = this.Accessible;
+ if (accessibleObject == null)
+ return;
+ var nsObject = AtkCocoaMacExtensions.GetNSAccessibilityElement (accessibleObject) as NSObject;
+ if (nsObject == null)
+ return;
+ var dictionary =
+ new NSDictionary (NSAccessibilityNotificationUserInfoKeys.AnnouncementKey, new NSString (message),
+ NSAccessibilityNotificationUserInfoKeys.PriorityKey, NSAccessibilityPriorityLevel.High);
+ NSAccessibility.PostNotification (nsObject, NSAccessibilityNotifications.AnnouncementRequestedNotification, dictionary);
+ }
+
+ string GenerateProjectCreatedMessage ()
+ {
+ var message = GettextCatalog.GetString ("{0} successfully created");
+ var template = controller.SelectedTemplate;
+ return String.Format (message, template.Name);
}
public void ShowDialog ()
|