示例#1
0
        static void OpenAddinManagerWindow()
        {
            if (!IdeApp.Workbench.RootWindow.Visible && WelcomePage.WelcomePageService.WelcomeWindow.nativeWidget is AppKit.NSWindow parentNsWindow)
            {
                var dlg = AddinManagerWindow.Create();

                EventHandler shownEvent = null;
                shownEvent = (s, e) => {
                    dlg.Shown -= shownEvent;
                    try {
                        var nativeWindow = Components.Mac.GtkMacInterop.GetNSWindow(dlg);
                        MessageService.CenterWindow(nativeWindow, parentNsWindow);
                        parentNsWindow.AddChildWindow(nativeWindow, AppKit.NSWindowOrderingMode.Above);
                    } catch (Exception ex) {
                        LoggingService.LogInternalError(ex);
                    }
                };

                dlg.Shown += shownEvent;
                try {
                    dlg.Run();
                } finally {
                    dlg.Destroy();
                }
            }
            else
            {
                AddinManagerWindow.Run(IdeApp.Workbench.RootWindow);
            }
        }
示例#2
0
 void OnUpdateClicked(object s, ButtonPressEventArgs args)
 {
     if (!args.Event.TriggersContextMenu() && args.Event.Button == 1)
     {
         HideAlert();
         AddinManagerWindow.Run(IdeApp.Workbench.RootWindow);
     }
 }
示例#3
0
 void OnUpdateClicked(object s, StatusBarIconClickedEventArgs args)
 {
     if (args.Button != Xwt.PointerButton.Right && args.Button == Xwt.PointerButton.Left)
     {
         HideAlert();
         AddinManagerWindow.Run(IdeApp.Workbench.RootWindow);
     }
 }
示例#4
0
        private void Activated(object sender, EventArgs e)
        {
            AddinManagerWindow.AllowInstall = false;

            AddinManagerWindow.Run(PintaCore.Chrome.MainWindow);

            //dlg.DeleteEvent += delegate { dlg.Destroy (); };
        }
示例#5
0
 void OpenAddinManager()
 {
     AddinManagerCommand = new CommandBase((parameter, command) =>
     {
         var form = new AddinManagerWindow
         {
             Owner = Model.Window
         };
         form.Show();
     });
 }
    public static void ShowManager ()
    {
        IProgressMonitor m = Instance != null ? Instance.updateMonitor : null;
        if (m != null && !m.AsyncOperation.IsCompleted)
        {
            AggregatedProgressMonitor monitor = new AggregatedProgressMonitor (m);
            monitor.AddSlaveMonitor (new MessageDialogProgressMonitor (true, true, false));
            monitor.AsyncOperation.WaitForCompleted ();
        }
        HideAlert ();

        AddinManagerWindow.Run (IdeApp.Workbench.RootWindow);
    }
示例#7
0
        private void Activated(object sender, EventArgs e)
        {
            // TODO-GTK3 (addins)
#if false
            AddinManagerWindow.AllowInstall = true;

            AddinManagerWindow.Run(PintaCore.Chrome.MainWindow);
#else
            throw new NotImplementedException();
#endif

            //dlg.DeleteEvent += delegate { dlg.Destroy (); };
        }
示例#8
0
        public async static void ShowManager()
        {
            Task t = Instance != null ? Instance.currentTask : null;

            if (t != null && t.IsCompleted)
            {
                AggregatedProgressMonitor monitor = new AggregatedProgressMonitor(Instance.updateMonitor);
                monitor.AddSlaveMonitor(new MessageDialogProgressMonitor(true, true, false));
                await t;
            }
            HideAlert();

            AddinManagerWindow.Run(IdeApp.Workbench.RootWindow);
        }
        public static void Main(string[] args)
        {
            Application.Init();
            AddinManager.Initialize();

            AddinManagerWindow.AllowInstall = false;
            Gtk.Window win = new Gtk.Window(Gtk.WindowType.Toplevel);
//			win.Show ();

            AddinManagerWindow.Run(win);

            win.DeleteEvent += (o, evArgs) => Application.Quit();

            Application.Run();
        }
示例#10
0
        //this method is MIT/X11, 2009, Michael Hutchinson / (c) Novell
        public static async void OpenFiles(IEnumerable <FileOpenInformation> files)
        {
            if (!files.Any())
            {
                return;
            }

            if (!IsInitialized)
            {
                EventHandler onInit = null;
                onInit = delegate {
                    Initialized -= onInit;
                    OpenFiles(files);
                };
                Initialized += onInit;
                return;
            }

            var  filteredFiles = new List <FileOpenInformation> ();
            bool closeCurrent  = true;

            foreach (var file in files)
            {
                if (Services.ProjectService.IsWorkspaceItemFile(file.FileName) ||
                    Services.ProjectService.IsSolutionItemFile(file.FileName))
                {
                    try {
                        // Close the current solution, but only for the first solution we open.
                        // If more than one solution is specified in the list we want to open all them together.
                        await Workspace.OpenWorkspaceItem(file.FileName, closeCurrent);

                        closeCurrent = false;
                    } catch (Exception ex) {
                        MessageService.ShowError(GettextCatalog.GetString("Could not load solution: {0}", file.FileName), ex);
                    }
                }
                else if (file.FileName.HasExtension("mpack"))
                {
                    var service = new SetupService(AddinManager.Registry);
                    AddinManagerWindow.RunToInstallFile(Workbench.RootWindow,
                                                        service,
                                                        file.FileName.FullPath);
                }
                else
                {
                    filteredFiles.Add(file);
                }
            }

            // Wait for active load operations to be finished (there might be a solution already being loaded
            // when OpenFiles was called). This will ensure that files opened as part of the solution status
            // restoration won't steal the focus from the files we are explicitly loading here.
            await Workspace.CurrentWorkspaceLoadTask;

            foreach (var file in filteredFiles)
            {
                Workbench.OpenDocument(file.FileName, null, file.Line, file.Column, file.Options).ContinueWith(t => {
                    if (t.IsFaulted)
                    {
                        MessageService.ShowError(GettextCatalog.GetString("Could not open file: {0}", file.FileName), t.Exception);
                    }
                }, TaskScheduler.FromCurrentSynchronizationContext()).Ignore();
            }

            Workbench.Present();
        }
 public void Run()
 {
     AddinManagerWindow.Run(TextEditorApp.MainWindow);
 }
示例#12
0
 protected virtual void OnButton75Clicked(object sender, System.EventArgs e)
 {
     AddinManagerWindow.Run(this);
 }
 public int Run(string[] arguments)
 {
     Gtk.Application.Init();
     AddinManagerWindow.Run(null);
     return(0);
 }
示例#14
0
        //this method is MIT/X11, 2009, Michael Hutchinson / (c) Novell
        internal static async Task <bool> OpenFilesAsync(IEnumerable <FileOpenInformation> files, OpenWorkspaceItemMetadata metadata)
        {
            if (!files.Any())
            {
                return(false);
            }

            await initializationTask.Task;

            Workbench.Present();

            var filteredFiles = new List <FileOpenInformation> ();

            Gdk.ModifierType mtype        = Components.GtkWorkarounds.GetCurrentKeyModifiers();
            bool             closeCurrent = !mtype.HasFlag(Gdk.ModifierType.ControlMask);

            if (Platform.IsMac && closeCurrent)
            {
                closeCurrent = !mtype.HasFlag(Gdk.ModifierType.Mod2Mask);
            }

            foreach (var file in files)
            {
                if (Services.ProjectService.IsWorkspaceItemFile(file.FileName) ||
                    Services.ProjectService.IsSolutionItemFile(file.FileName))
                {
                    try {
                        // Close the current solution, but only for the first solution we open.
                        // If more than one solution is specified in the list we want to open all them together.
                        await Workspace.OpenWorkspaceItem(file.FileName, closeCurrent, true, metadata);

                        closeCurrent = false;
                    } catch (Exception ex) {
                        MessageService.ShowError(GettextCatalog.GetString("Could not load solution: {0}", file.FileName), ex);
                    }
                }
                else if (file.FileName.HasExtension("mpack"))
                {
                    var service = new SetupService(AddinManager.Registry);
                    AddinManagerWindow.RunToInstallFile(Workbench.RootWindow.Visible ? Workbench.RootWindow : null,
                                                        service,
                                                        file.FileName.FullPath);
                }
                else
                {
                    filteredFiles.Add(file);
                }
            }

            // Wait for active load operations to be finished (there might be a solution already being loaded
            // when OpenFiles was called). This will ensure that files opened as part of the solution status
            // restoration won't steal the focus from the files we are explicitly loading here.
            await Workspace.CurrentWorkspaceLoadTask;

            for (int n = 0; n < filteredFiles.Count; n++)
            {
                var file = filteredFiles [n];
                if (n == 0)
                {
                    file.Options |= OpenDocumentOptions.BringToFront;
                }
                else
                {
                    file.Options &= ~OpenDocumentOptions.BringToFront;
                }
                IdeServices.DocumentManager.OpenDocument(file).Ignore();
            }
            return(true);
        }
示例#15
0
 public Task <int> Run(string[] arguments)
 {
     Gtk.Application.Init();
     AddinManagerWindow.Run(null);
     return(Task.FromResult(0));
 }
示例#16
0
 protected virtual void OnAddinManagerActivated(object sender, System.EventArgs e)
 {
     AddinManagerWindow.Run(this);
 }