Beispiel #1
0
        protected override void Run()
        {
            var dlg = new NewStashDialog();

            try {
                if (MessageService.RunCustomDialog(dlg) == (int)Gtk.ResponseType.Ok)
                {
                    string comment = dlg.Comment;
                    var    monitor = new MessageDialogProgressMonitor(true, false, false, true);
                    FileService.FreezeEvents();
                    ThreadPool.QueueUserWorkItem(delegate {
                        try {
                            Stash stash;
                            if (Repository.TryCreateStash(monitor, comment, out stash))
                            {
                                string msg;
                                if (stash != null)
                                {
                                    msg = GettextCatalog.GetString("Changes successfully stashed");
                                }
                                else
                                {
                                    msg = GettextCatalog.GetString("No changes were available to stash");
                                }

                                Runtime.RunInMainThread(delegate {
                                    IdeApp.Workbench.StatusBar.ShowMessage(msg);
                                });
                            }
                        } catch (Exception ex) {
                            MessageService.ShowError(GettextCatalog.GetString("Stash operation failed"), ex);
                        }
                        finally {
                            monitor.Dispose();
                            FileService.ThawEvents();
                        }
                    });
                }
            } finally {
                dlg.Destroy();
                dlg.Dispose();
            }
        }
Beispiel #2
0
		protected override void Run ()
		{
			var dlg = new NewStashDialog ();
			try {
				if (MessageService.RunCustomDialog (dlg) == (int) Gtk.ResponseType.Ok) {
					string comment = dlg.Comment;
					var monitor = new MessageDialogProgressMonitor (true, false, false, true);
					var statusTracker = IdeApp.Workspace.GetFileStatusTracker ();
					ThreadPool.QueueUserWorkItem (delegate {
						try {
							Stash stash;
							if (Repository.TryCreateStash (monitor, comment, out stash)) {
								string msg;
								if (stash != null) {
									msg = GettextCatalog.GetString ("Changes successfully stashed");
								} else {
									msg = GettextCatalog.GetString ("No changes were available to stash");
								}

								DispatchService.GuiDispatch (delegate {
									IdeApp.Workbench.StatusBar.ShowMessage (msg);
								});
							}

						} catch (Exception ex) {
							MessageService.ShowError (GettextCatalog.GetString ("Stash operation failed"), ex);
						}
						finally {
							monitor.Dispose ();
							statusTracker.Dispose ();
						}
					});
				}
			} finally {
				dlg.Destroy ();
				dlg.Dispose ();
			}
		}
Beispiel #3
0
		protected override void Run ()
		{
			var stashes = Repository.GetStashes ();
			NewStashDialog dlg = new NewStashDialog ();
			if (MessageService.RunCustomDialog (dlg) == (int) Gtk.ResponseType.Ok) {
				string comment = dlg.Comment;
				MessageDialogProgressMonitor monitor = new MessageDialogProgressMonitor (true, false, false, true);
				var statusTracker = IdeApp.Workspace.GetFileStatusTracker ();
				ThreadPool.QueueUserWorkItem (delegate {
					try {
						using (var gm = new GitMonitor (monitor))
							stashes.Create (gm, comment);
					} catch (Exception ex) {
						MessageService.ShowException (ex);
					}
					finally {
						monitor.Dispose ();
						statusTracker.NotifyChanges ();
					}
				});
			}
			dlg.Destroy ();
		}
Beispiel #4
0
		protected override void Run ()
		{
			var stashes = Repository.GetStashes ();
			NewStashDialog dlg = new NewStashDialog ();
			if (MessageService.RunCustomDialog (dlg) == (int) Gtk.ResponseType.Ok) {
				using (IdeApp.Workspace.GetFileStatusTracker ())
					stashes.Create (dlg.Comment);
			}
			dlg.Destroy ();
		}