Example #1
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();
        }
Example #2
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();
        }
Example #3
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();
            }
        }
Example #4
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 ();
			}
		}
Example #5
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 ();
		}
Example #6
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 ();
		}