コード例 #1
0
        protected virtual void OnButtonEditRemoteClicked(object sender, System.EventArgs e)
        {
            TreeIter it;

            if (!treeRemotes.Selection.GetSelected(out it))
            {
                return;
            }

            RemoteSource remote  = (RemoteSource)storeRemotes.GetValue(it, 0);
            string       oldName = remote.Name;

            var dlg = new EditRemoteDialog(remote, false);

            try
            {
                if (MessageService.RunCustomDialog(dlg) == (int)Gtk.ResponseType.Ok)
                {
                    if (remote.Name != oldName)
                    {
                        repo.RenameRemote(oldName, remote.Name);
                    }
                    repo.UpdateRemote(remote);
                    FillRemotes();
                }
            }
            finally
            {
                dlg.Destroy();
            }
        }
コード例 #2
0
        protected virtual void OnButtonAddRemoteClicked(object sender, EventArgs e)
        {
            var dlg = new EditRemoteDialog();

            try {
                if (MessageService.RunCustomDialog(dlg) == (int)ResponseType.Ok)
                {
                    repo.AddRemote(dlg.RemoteName, dlg.RemoteUrl, dlg.ImportTags);
                    FillRemotes();
                }
            } finally {
                dlg.Destroy();
                dlg.Dispose();
            }
        }
コード例 #3
0
        protected virtual void OnButtonAddRemoteClicked(object sender, System.EventArgs e)
        {
            var remote = new RemoteSource();
            var dlg    = new EditRemoteDialog(remote, true);

            try {
                if (MessageService.RunCustomDialog(dlg) == (int)Gtk.ResponseType.Ok)
                {
                    repo.AddRemote(remote, dlg.ImportTags);
                    FillRemotes();
                }
            } finally {
                dlg.Destroy();
            }
        }
コード例 #4
0
        protected virtual async void OnButtonEditRemoteClicked(object sender, EventArgs e)
        {
            TreeIter it;

            if (!treeRemotes.Selection.GetSelected(out it))
            {
                return;
            }

            var remote = (Remote)storeRemotes.GetValue(it, 0);

            if (remote == null)
            {
                return;
            }

            var dlg = new EditRemoteDialog(repo, remote);

            try {
                if (MessageService.RunCustomDialog(dlg) == (int)ResponseType.Ok)
                {
                    var token = destroyTokenSource.Token;
                    if (remote.Url != dlg.RemoteUrl)
                    {
                        await repo.ChangeRemoteUrlAsync(remote.Name, dlg.RemoteUrl);
                    }
                    if (remote.PushUrl != dlg.RemotePushUrl)
                    {
                        await repo.ChangeRemotePushUrlAsync(remote.Name, dlg.RemotePushUrl);
                    }

                    // Only do rename after we've done previous changes.
                    if (remote.Name != dlg.RemoteName)
                    {
                        await repo.RenameRemoteAsync(remote.Name, dlg.RemoteName);
                    }
                    if (!token.IsCancellationRequested)
                    {
                        FillRemotes();
                    }
                }
            } finally {
                dlg.Destroy();
                dlg.Dispose();
            }
        }
コード例 #5
0
        protected virtual async void OnButtonAddRemoteClicked(object sender, EventArgs e)
        {
            var dlg = new EditRemoteDialog(repo, null);

            try {
                if (MessageService.RunCustomDialog(dlg) == (int)ResponseType.Ok)
                {
                    var token = destroyTokenSource.Token;
                    await repo.AddRemoteAsync(dlg.RemoteName, dlg.RemoteUrl, dlg.ImportTags);

                    if (!token.IsCancellationRequested)
                    {
                        FillRemotes();
                    }
                }
            } finally {
                dlg.Destroy();
                dlg.Dispose();
            }
        }
コード例 #6
0
        protected virtual void OnButtonEditRemoteClicked(object sender, EventArgs e)
        {
            TreeIter it;

            if (!treeRemotes.Selection.GetSelected(out it))
            {
                return;
            }

            var remote = (Remote)storeRemotes.GetValue(it, 0);

            if (remote == null)
            {
                return;
            }

            var dlg = new EditRemoteDialog(remote);

            try {
                if (MessageService.RunCustomDialog(dlg) == (int)ResponseType.Ok)
                {
                    if (remote.Name != dlg.RemoteName)
                    {
                        repo.RenameRemote(remote.Name, dlg.RemoteName);
                    }
                    if (remote.Url != dlg.RemoteUrl)
                    {
                        repo.ChangeRemoteUrl(remote.Name, dlg.RemoteUrl);
                    }
                    if (remote.Url != dlg.RemotePushUrl)
                    {
                        repo.ChangeRemotePushUrl(remote.Name, dlg.RemotePushUrl);
                    }
                    FillRemotes();
                }
            } finally {
                dlg.Destroy();
                dlg.Dispose();
            }
        }
コード例 #7
0
		protected virtual void OnButtonEditRemoteClicked (object sender, System.EventArgs e)
		{
			TreeIter it;
			if (!treeRemotes.Selection.GetSelected (out it))
				return;
			
			RemoteSource remote = (RemoteSource) storeRemotes.GetValue (it, 0);
			if (remote == null)
				return;

			string oldName = remote.Name;
			
			var dlg = new EditRemoteDialog (remote, false);
			try {
				if (MessageService.RunCustomDialog (dlg) == (int) Gtk.ResponseType.Ok) {
					if (remote.Name != oldName)
						repo.RenameRemote (oldName, remote.Name);
					repo.UpdateRemote (remote);
					FillRemotes ();
				}
			} finally {
				dlg.Destroy ();
			}
		}
コード例 #8
0
		protected virtual void OnButtonAddRemoteClicked (object sender, System.EventArgs e)
		{
			var remote = new RemoteSource ();
			var dlg = new EditRemoteDialog (remote, true);
			try {
				if (MessageService.RunCustomDialog (dlg) == (int) Gtk.ResponseType.Ok) {
					repo.AddRemote (remote, dlg.ImportTags);
					FillRemotes ();
				}
			} finally {
				dlg.Destroy ();
			}
		}
コード例 #9
0
		protected virtual void OnButtonEditRemoteClicked (object sender, EventArgs e)
		{
			TreeIter it;
			if (!treeRemotes.Selection.GetSelected (out it))
				return;

			var remote = (Remote) storeRemotes.GetValue (it, 0);
			if (remote == null)
				return;

			var dlg = new EditRemoteDialog (remote);
			try {
				if (MessageService.RunCustomDialog (dlg) == (int) ResponseType.Ok) {
					if (remote.Url != dlg.RemoteUrl)
						repo.ChangeRemoteUrl (remote.Name, dlg.RemoteUrl);
					if (remote.PushUrl != dlg.RemotePushUrl)
						repo.ChangeRemotePushUrl (remote.Name, dlg.RemotePushUrl);

					// Only do rename after we've done previous changes.
					if (remote.Name != dlg.RemoteName)
						repo.RenameRemote (remote.Name, dlg.RemoteName);
					FillRemotes ();
				}
			} finally {
				dlg.Destroy ();
				dlg.Dispose ();
			}
		}
コード例 #10
0
		protected virtual void OnButtonAddRemoteClicked (object sender, EventArgs e)
		{
			var dlg = new EditRemoteDialog ();
			try {
				if (MessageService.RunCustomDialog (dlg) == (int) ResponseType.Ok) {
					repo.AddRemote (dlg.RemoteName, dlg.RemoteUrl, dlg.ImportTags);
					FillRemotes ();
				}
			} finally {
				dlg.Destroy ();
				dlg.Dispose ();
			}
		}