private void ViewSelectedFileDiff() { using (WaitCursorScope.Enter()) { diffViewer.ViewChangesAsync(DiffFiles.SelectedItem); } }
private void RevisionGridSelectionChanged(object sender, EventArgs e) { using (WaitCursorScope.Enter()) { DiffFiles.SetDiffs(RevisionGrid.GetSelectedRevisions()); } }
private void RefreshAll() { using (WaitCursorScope.Enter()) { Initialize(); } }
private void SaveAs(string side) { using (WaitCursorScope.Enter()) { var conflictData = GetConflict(); string fileName = conflictData.Filename; fileName = PathUtil.GetFileName(fileName); using (var fileDialog = new SaveFileDialog { FileName = fileName, InitialDirectory = _fullPathResolver.Resolve(PathUtil.GetDirectoryName(conflictData.Filename)), AddExtension = true }) { var ext = PathUtil.GetFileExtension(fileDialog.FileName); fileDialog.DefaultExt = ext; fileDialog.Filter = string.Format(_currentFormatFilter.Text, ext) + "|*." + ext + "|" + _allFilesFilter.Text + "|*.*"; if (fileDialog.ShowDialog(this) == DialogResult.OK) { if (!Module.HandleConflictsSaveSide(conflictData.Filename, fileDialog.FileName, side)) { MessageBox.Show(this, _failureWhileSaveFile.Text); } } } } }
private void FormSettings_Shown(object sender, EventArgs e) { using (WaitCursorScope.Enter()) { LoadSettings(); } }
private void OpenMergetool_Click(object sender, EventArgs e) { using (WaitCursorScope.Enter()) { ConflictedFiles_DoubleClick(sender, e); } }
private void buttonApply_Click(object sender, EventArgs e) { using (WaitCursorScope.Enter()) { Save(); } }
private void buttonDiscard_Click(object sender, EventArgs e) { using (WaitCursorScope.Enter()) { LoadSettings(); } }
private void StashedSelectedIndexChanged(object sender, EventArgs e) { GitStash gitStash = Stashes.SelectedItem as GitStash; GitItemStatus stashedItem = Stashed.SelectedItem; EnablePartialStash(); using (WaitCursorScope.Enter()) { if (stashedItem != null && gitStash == _currentWorkingDirStashItem) { // current working directory View.ViewCurrentChanges(stashedItem); } else if (stashedItem != null) { if (stashedItem.IsNew) { if (!stashedItem.IsSubmodule) { View.ViewGitItemAsync(stashedItem.Name, stashedItem.TreeGuid); } else { View.ViewTextAsync( stashedItem.Name, LocalizationHelpers.GetSubmoduleText(Module, stashedItem.Name, stashedItem.TreeGuid)); } } else { string extraDiffArguments = View.GetExtraDiffArguments(); Encoding encoding = View.Encoding; View.ViewPatchAsync( () => { Patch patch = Module.GetSingleDiff(gitStash.Name + "^", gitStash.Name, stashedItem.Name, stashedItem.OldName, extraDiffArguments, encoding, true, stashedItem.IsTracked); if (patch == null) { return(text: string.Empty, openWithDifftool: null /* not applicable */); } if (stashedItem.IsSubmodule) { return(text: LocalizationHelpers.ProcessSubmodulePatch(Module, stashedItem.Name, patch), openWithDifftool: null /* not implemented */); } return(text: patch.Text, openWithDifftool: null /* not implemented */); }); } } else { View.ViewTextAsync(string.Empty, string.Empty); } } }
private void ContextMarkAsSolved_Click(object sender, EventArgs e) { using (WaitCursorScope.Enter()) { StageFile(GetFileName()); Initialize(); } }
private void Abort_Click(object sender, EventArgs e) { using (WaitCursorScope.Enter()) { FormProcess.ShowDialog(this, GitCommandHelpers.AbortCmd()); EnableButtons(); } }
private void UpdateSubmoduleClick(object sender, EventArgs e) { using (WaitCursorScope.Enter()) { FormProcess.ShowDialog(this, process: null, arguments: GitCommandHelpers.SubmoduleUpdateCmd(SubModuleLocalPath.Text), Module.WorkingDir, input: null, useDialogSettings: true); Initialize(); } }
private void Abort_Click(object sender, EventArgs e) { using (WaitCursorScope.Enter()) { FormProcess.ShowDialog(this, process: null, arguments: GitCommandHelpers.AbortCmd(), Module.WorkingDir, input: null, useDialogSettings: true); EnableButtons(); } }
private void Mergetool_Click(object sender, EventArgs e) { using (WaitCursorScope.Enter()) { Directory.SetCurrentDirectory(Module.WorkingDir); Module.RunMergeTool(); Initialize(); } }
private void Mergetool_Click(object sender, EventArgs e) { using (WaitCursorScope.Enter()) { Directory.SetCurrentDirectory(Module.WorkingDir); Module.RunExternalCmdShowConsole(AppSettings.GitCommand, "mergetool"); Initialize(); } }
private void SaveAndRescan_Click(object sender, EventArgs e) { using (WaitCursorScope.Enter()) { PageHost.SaveAll(); PageHost.LoadAll(); CheckSettings(); } }
private void Ok_Click(object sender, EventArgs e) { using (WaitCursorScope.Enter()) { if (Save()) { Close(); } } }
private void ViewSelectedFileDiff() { using (WaitCursorScope.Enter()) { var revisions = RevisionGrid.GetSelectedRevisions(); var selectedRev = revisions.FirstOrDefault(); var firstId = revisions.Skip(1).LastOrDefault()?.ObjectId ?? selectedRev?.FirstParentGuid; diffViewer.ViewChangesAsync(firstId, selectedRev, DiffFiles.SelectedItem); } }
private void Reset_Click(object sender, EventArgs e) { using (WaitCursorScope.Enter()) { if (ShowAbortMessage()) { Module.ResetHard(""); Close(); } } }
private void StashedSelectedIndexChanged(object sender, EventArgs e) { GitItemStatus stashedItem = Stashed.SelectedItem; EnablePartialStash(); using (WaitCursorScope.Enter()) { // Special revision handling, see LoadGitItemStatuses() View.ViewChangesAsync(null, Stashed.SelectedItemParent, stashedItem); } }
private void BranchesDropDown(object sender, EventArgs e) { if ((PullFromUrl.Checked && string.IsNullOrEmpty(comboBoxPullSource.Text)) && (PullFromRemote.Checked && string.IsNullOrEmpty(_NO_TRANSLATE_Remotes.Text))) { Branches.DataSource = null; return; } using (WaitCursorScope.Enter()) { LoadPuttyKey(); if (_heads == null) { if (PullFromUrl.Checked) { _heads = Module.GetRefs(false, true).ToList(); } else { // The line below is the most reliable way to get a list containing // all remote branches but it is also the slowest. // Heads = GitCommands.GitCommands.GetRemoteHeads(Remotes.Text, false, true); // The code below is a quick way to get a list contains all remote branches. // It only returns the heads that are already known to the repository. This // doesn't return heads that are new on the server. This can be updated using // update branch info in the manage remotes dialog. _heads = new List <IGitRef>(); foreach (var head in Module.GetRefs(true, true)) { if (!head.IsRemote || !head.Name.StartsWith(_NO_TRANSLATE_Remotes.Text, StringComparison.CurrentCultureIgnoreCase)) { continue; } _heads.Insert(0, head); } } } Branches.DisplayMember = nameof(IGitRef.LocalName); ////_heads.Insert(0, GitHead.AllHeads); --> disable this because it is only for expert users _heads.Insert(0, GitRef.NoHead(Module)); Branches.DataSource = _heads; Branches.ResizeDropDownWidth(AppSettings.BranchDropDownMinWidth, AppSettings.BranchDropDownMaxWidth); } }
private void ViewSelectedFileDiff() { if (DiffFiles.SelectedItem == null) { diffViewer.ViewPatch(""); return; } using (WaitCursorScope.Enter()) { diffViewer.ViewChangesAsync(RevisionGrid.GetSelectedRevisions(), DiffFiles.SelectedItem, string.Empty); } }
private void FormSettings_Shown(object sender, EventArgs e) { using (WaitCursorScope.Enter()) { LoadSettings(); if (_initialPage == null && _lastSelectedSettingsPageType != null) { _initialPage = new SettingsPageReferenceByType(_lastSelectedSettingsPageType); } settingsTreeView.GotoPage(_initialPage); } }
private void Skip_Click(object sender, EventArgs e) { using (WaitCursorScope.Enter()) { var applyingPatch = patchGrid1.PatchFiles.FirstOrDefault(p => p.IsNext); if (applyingPatch != null) { applyingPatch.IsSkipped = true; } FormProcess.ShowDialog(this, GitCommandHelpers.SkipCmd()); EnableButtons(); } }
private void Skip_Click(object sender, EventArgs e) { using (WaitCursorScope.Enter()) { var applyingPatch = patchGrid1.PatchFiles.FirstOrDefault(p => p.IsNext); if (applyingPatch != null) { applyingPatch.IsSkipped = true; } FormProcess.ShowDialog(this, process: null, arguments: GitCommandHelpers.SkipCmd(), Module.WorkingDir, input: null, useDialogSettings: true); EnableButtons(); } }
private void StashSelectedFiles_Click(object sender, EventArgs e) { if (chkIncludeUntrackedFiles.Checked && !GitVersion.Current.StashUntrackedFilesSupported) { MessageBox.Show(_stashUntrackedFilesNotSupported.Text, _stashUntrackedFilesNotSupportedCaption.Text, MessageBoxButtons.OK, MessageBoxIcon.Error); return; } using (WaitCursorScope.Enter()) { var msg = toolStripButton_customMessage.Checked ? " " + StashMessage.Text.Trim() : string.Empty; UICommands.StashSave(this, chkIncludeUntrackedFiles.Checked, StashKeepIndex.Checked, msg, Stashed.SelectedItems.Select(i => i.Name).ToList()); Initialize(); } }