private void Initialize() { Cursor.Current = Cursors.WaitCursor; ConflictedFiles.MultiSelect = false; int oldSelectedRow = 0; if (ConflictedFiles.SelectedRows.Count > 0) { oldSelectedRow = ConflictedFiles.SelectedRows[0].Index; } ConflictedFiles.DataSource = Module.GetConflicts(); ConflictedFiles.Columns[0].DataPropertyName = "Filename"; if (ConflictedFiles.Rows.Count > oldSelectedRow) { ConflictedFiles.Rows[oldSelectedRow].Selected = true; if (oldSelectedRow < ConflictedFiles.FirstDisplayedScrollingRowIndex || oldSelectedRow > (ConflictedFiles.FirstDisplayedScrollingRowIndex + ConflictedFiles.DisplayedRowCount(false))) { ConflictedFiles.FirstDisplayedScrollingRowIndex = oldSelectedRow; } } InitMergetool(); ConflictedFilesContextMenu.Text = _conflictedFilesContextMenuText.Text; OpenMergetool.Text = _openMergeToolItemText.Text + " " + _mergetool; openMergeToolBtn.Text = _button1Text.Text + " " + _mergetool; if (Module.InTheMiddleOfRebase()) { Reset.Text = _resetItemRebaseText.Text; ContextChooseLocal.Text = _contextChooseLocalRebaseText.Text; ContextChooseRemote.Text = _contextChooseRemoteRebaseText.Text; } else { Reset.Text = _resetItemMergeText.Text; ContextChooseLocal.Text = _contextChooseLocalMergeText.Text; ContextChooseRemote.Text = _contextChooseRemoteMergeText.Text; } if (!Module.InTheMiddleOfConflictedMerge() && _thereWhereMergeConflicts) { UICommands.UpdateSubmodules(this); if (!Module.InTheMiddleOfPatch() && !Module.InTheMiddleOfRebase() && _offerCommit) { if (MessageBox.Show(this, allConflictsResolved.Text, allConflictsResolvedCaption.Text, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { UICommands.StartCommitDialog(this); } } Close(); } Cursor.Current = Cursors.Default; }
private void MergetoolClick(object sender, EventArgs e) { Module.RunExternalCmdShowConsole(AppSettings.GitCommand, "mergetool"); if (MessageBox.Show(this, _allMergeConflictSolvedQuestion.Text, _allMergeConflictSolvedQuestionCaption.Text, MessageBoxButtons.YesNo) != DialogResult.Yes) { return; } UICommands.StartCommitDialog(this); }
private void MergetoolClick(object sender, EventArgs e) { Module.RunMergeTool(); if (MessageBox.Show(this, _allMergeConflictSolvedQuestion.Text, _allMergeConflictSolvedQuestionCaption.Text, MessageBoxButtons.YesNo) != DialogResult.Yes) { return; } UICommands.StartCommitDialog(this); }
public EmptyRepoControl(bool isBareRepository) { InitializeComponent(); InitializeComplete(); lblEmptyRepository.Text = _repoHasNoCommits.Text; if (isBareRepository) { btnEditGitIgnore.Visible = false; btnOpenCommitForm.Visible = false; } else { btnEditGitIgnore.Click += (_, e) => UICommands.StartEditGitIgnoreDialog(this, localExcludes: false); btnOpenCommitForm.Click += (_, e) => UICommands.StartCommitDialog(this); } Dock = DockStyle.Fill; }
private void CommitButtonClick(object sender, EventArgs e) { UICommands.StartCommitDialog(this); EnableButtons(); }
private void Initialize() { Cursor.Current = Cursors.WaitCursor; int oldSelectedRow = 0; if (ConflictedFiles.SelectedRows.Count > 0) { oldSelectedRow = ConflictedFiles.SelectedRows[0].Index; } ConflictedFiles.DataSource = Module.GetConflicts(); ConflictedFiles.Columns[0].DataPropertyName = "Filename"; if (ConflictedFiles.Rows.Count > oldSelectedRow) { ConflictedFiles.Rows[oldSelectedRow].Selected = true; if (oldSelectedRow < ConflictedFiles.FirstDisplayedScrollingRowIndex || oldSelectedRow > (ConflictedFiles.FirstDisplayedScrollingRowIndex + ConflictedFiles.DisplayedRowCount(false))) { try { ConflictedFiles.FirstDisplayedScrollingRowIndex = oldSelectedRow; } catch (InvalidOperationException) { // ignore the exception - setting the row index is not so important to crash the app // see the #2975 issues for details } } } if (!InitMergetool()) { Close(); return; } ConflictedFilesContextMenu.Text = _conflictedFilesContextMenuText.Text; OpenMergetool.Text = _openMergeToolItemText.Text + " " + _mergetool; openMergeToolBtn.Text = _button1Text.Text + " " + _mergetool; if (Module.InTheMiddleOfRebase()) { Reset.Text = _resetItemRebaseText.Text; ContextChooseLocal.Text = _contextChooseLocalRebaseText.Text; ContextChooseRemote.Text = _contextChooseRemoteRebaseText.Text; } else { Reset.Text = _resetItemMergeText.Text; ContextChooseLocal.Text = _contextChooseLocalMergeText.Text; ContextChooseRemote.Text = _contextChooseRemoteMergeText.Text; } if (!Module.InTheMiddleOfConflictedMerge() && _thereWhereMergeConflicts) { UICommands.UpdateSubmodules(this); if (!Module.InTheMiddleOfPatch() && !Module.InTheMiddleOfRebase() && _offerCommit) { if (AppSettings.DontConfirmCommitAfterConflictsResolved || MessageBox.Show(this, _allConflictsResolved.Text, _allConflictsResolvedCaption.Text, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { UICommands.StartCommitDialog(this); } } Close(); } Cursor.Current = Cursors.Default; }