Beispiel #1
0
        public static async Task <bool> FasterFetch(String repo)
        {
            if (Settings.Default.ConfirmFasterFetch)
            {
                using ConfirmationDialog dialog = new ConfirmationDialog("Faster Fetch", "Faster Fetch uses settings previously configured in the Fast Fetch dialog.\n\nDo you want to continue?");
                if (dialog.ShowDialog() == DialogResult.Yes)
                {
                    if (dialog.DoNotAskAgain)
                    {
                        Settings.Default.ConfirmFasterFetch = false;
                        Settings.Default.Save();
                    }
                }
                else
                {
                    return(false);
                }
            }

            bool tags         = Settings.Default.FastFetchTagsChecked;
            bool prune        = Settings.Default.FastFetchPruneChecked;
            bool progress     = Settings.Default.FastFetchShowProgress;
            int  maxProcesses = Settings.Default.FastFetchMaxProcesses;

            await FastFetchDialog.Fetch(repo + " - " + "Faster Fetch", "Faster Fetch Completed", repo, tags, prune, progress, maxProcesses);

            return(true);
        }
Beispiel #2
0
        public static ProgressDialog PrepareBackgroundFasterFetch(String repo)
        {
            bool tags         = Settings.Default.FastFetchTagsChecked;
            bool prune        = Settings.Default.FastFetchPruneChecked;
            bool progress     = Settings.Default.FastFetchShowProgress;
            int  maxProcesses = Settings.Default.FastFetchMaxProcesses;

            return(FastFetchDialog.PrepareFetch(repo + " - " + "Faster Fetch", "Faster Fetch Completed", repo, tags, prune, progress, maxProcesses));
        }
Beispiel #3
0
        private static Task Fetch(String title, String completedText, String repo, bool tags, bool prune, bool progress, int maxProcesses)
        {
            ProgressDialog dialog = FastFetchDialog.PrepareFetch(title, completedText, repo, tags, prune, progress, maxProcesses);

            dialog.Show();
            dialog.DoProgress();

            return(dialog.WaitForClose());
        }
        public static async Task <bool> FastFetch(String path)
        {
            String          repo   = Git.GetBaseRepoDirectoryOrError(path);
            FastFetchDialog dialog = new FastFetchDialog(repo);

            dialog.Show();
            await dialog.WaitForClose();

            return(dialog.DialogResult == DialogResult.OK);
        }
Beispiel #5
0
        private async Task Fetch()
        {
            this.Hide();

            bool tags         = TagsCheck.Checked;
            bool prune        = PruneCheck.Checked;
            bool progress     = ShowProgressCheck.Checked;
            int  maxProcesses = (int)MaxProcessesNumeric.Value;

            await FastFetchDialog.Fetch(this.Text, "Fast Fetch Completed", Repo, tags, prune, progress, maxProcesses);

            this.DialogResult = DialogResult.OK;
            this.Close();
        }
Beispiel #6
0
        private void BackgroundFasterFetch_Click(object?sender, EventArgs e)
        {
            TabControllerTag?controller = this.LogTabs.SelectedTab?.Controller();

            if (controller != null)
            {
                if (controller.BackgroundFasterFetchDialog?.Completed == true)
                {
                    controller.BackgroundFasterFetchDialog.Close();
                    controller.BackgroundFasterFetchDialog = null;
                }

                if (controller.BackgroundFasterFetchDialog != null)
                {
                    return;
                }

                String repo = Git.GetBaseRepoDirectoryOrError(controller.RepoItem);

                ProgressDialog dialog = FastFetchDialog.PrepareBackgroundFasterFetch(repo);
                controller.BackgroundFasterFetchDialog = dialog;

                dialog.ProgressCompleted += delegate(object?sender2, EventArgs e2)
                {
                    if (!controller.Process.HasExited)
                    {
                        Native.SendKeyDown(controller.Process.MainWindowHandle, Keys.F5);
                    }

                    if (!dialog.Visible)
                    {
                        dialog.Close();
                    }
                };

                dialog.FormClosed += delegate(object?sender2, FormClosedEventArgs e2)
                {
                    controller.BackgroundFasterFetchDialog = null;

                    UpdateToolStripFasterFetch();
                };

                dialog.ProgressChanged   += BackgroundFasterFetchDialog_ProgressChanged;
                dialog.ProgressCompleted += BackgroundFasterFetchDialog_ProgressChanged;

                dialog.DoProgress();

                UpdateToolStripFasterFetch();
            }
        }
        public static Task <bool> FasterFetch(String path)
        {
            String repo = Git.GetBaseRepoDirectoryOrError(path);

            return(FastFetchDialog.FasterFetch(repo));
        }