public FormAddFiles(GitUICommands aCommands, string addFile) : base(aCommands) { InitializeComponent(); Translate(); Filter.Text = addFile ?? "."; }
public FormCleanupRepository(GitUICommands aCommands) : base(aCommands) { InitializeComponent(); Translate(); PreviewOutput.ReadOnly = true; checkBoxPathFilter_CheckedChanged(null, null); }
public FormCommitCount(GitUICommands aCommands) : base(aCommands) { InitializeComponent(); this.Loading.Image = global::GitUI.Properties.Resources.loadingpanel; Translate(); }
public FormSubmodules(GitUICommands aCommands) : base(aCommands) { InitializeComponent(); Translate(); gitSubmoduleBindingSource.DataSource = modules; }
public FormDeleteBranch(GitUICommands aCommands, IEnumerable<string> defaultBranches) : base(aCommands) { InitializeComponent(); Translate(); _defaultBranches = defaultBranches; }
public FormSparseWorkingCopyViewModel([NotNull] GitUICommands gitcommands) { _gitcommands = gitcommands; if(gitcommands == null) throw new ArgumentNullException("gitcommands"); _isSparseCheckoutEnabled = _isSparseCheckoutEnabledAsSaved = GetCurrentSparseEnabledState(); }
public FormApplyPatch(GitUICommands aCommands) : base(true, aCommands) { InitializeComponent(); Translate(); if (aCommands != null) EnableButtons(); }
internal FormFileHistory(GitUICommands aCommands) : base(aCommands) { InitializeComponent(); _asyncLoader = new AsyncLoader(); // set tab page images { var imageList = new ImageList(); tabControl1.ImageList = imageList; imageList.ColorDepth = ColorDepth.Depth8Bit; imageList.Images.Add(global::GitUI.Properties.Resources.IconViewFile); imageList.Images.Add(global::GitUI.Properties.Resources.IconDiff); imageList.Images.Add(global::GitUI.Properties.Resources.IconBlame); tabControl1.TabPages[0].ImageIndex = 0; tabControl1.TabPages[1].ImageIndex = 1; tabControl1.TabPages[2].ImageIndex = 2; } _filterBranchHelper = new FilterBranchHelper(toolStripBranchFilterComboBox, toolStripBranchFilterDropDownButton, FileChanges); _filterRevisionsHelper = new FilterRevisionsHelper(toolStripRevisionFilterTextBox, toolStripRevisionFilterDropDownButton, FileChanges, toolStripRevisionFilterLabel, ShowFirstParent, form: this); _formBrowseMenus = new FormBrowseMenus(FileHistoryContextMenu); _formBrowseMenus.ResetMenuCommandSets(); _formBrowseMenus.AddMenuCommandSet(MainMenuItem.NavigateMenu, FileChanges.MenuCommands.GetNavigateMenuCommands()); _formBrowseMenus.AddMenuCommandSet(MainMenuItem.ViewMenu, FileChanges.MenuCommands.GetViewMenuCommands()); _formBrowseMenus.InsertAdditionalMainMenuItems(toolStripSeparator4); }
public FormDiff(GitUICommands aCommands, RevisionGrid revisionGrid, string baseCommitSha, string headCommitSha, string baseCommitDisplayStr, string headCommitDisplayStr) : base(aCommands) { RevisionGrid = revisionGrid; _baseCommitDisplayStr = baseCommitDisplayStr; _headCommitDisplayStr = headCommitDisplayStr; InitializeComponent(); Translate(); _toolTipControl.SetToolTip(btnAnotherBaseBranch, anotherBranchTooltip.Text); _toolTipControl.SetToolTip(btnAnotherHeadBranch, anotherBranchTooltip.Text); _toolTipControl.SetToolTip(btnAnotherBaseCommit, anotherCommitTooltip.Text); _toolTipControl.SetToolTip(btnAnotherHeadCommit, anotherCommitTooltip.Text); _toolTipControl.SetToolTip(btnSwap, btnSwapTooltip.Text); if (!IsUICommandsInitialized) {// UICommands is not initialized in translation unit test. return; } _baseRevision = new GitRevision(Module, baseCommitSha); _headRevision = new GitRevision(Module, headCommitSha); _mergeBase = new GitRevision(Module, Module.GetMergeBase(_baseRevision.Guid, _headRevision.Guid)); lblBaseCommit.BackColor = AppSettings.DiffRemovedColor; lblHeadCommit.BackColor = AppSettings.DiffAddedColor; DiffFiles.SelectedIndexChanged += DiffFiles_SelectedIndexChanged; DiffFiles.ContextMenuStrip = DiffContextMenu; this.Load += (sender, args) => PopulateDiffFiles(); }
internal FormCheckoutBranch(GitUICommands aCommands) : base(aCommands) { InitializeComponent(); Translate(); _rbResetBranchDefaultText = rbResetBranch.Text; }
public FormViewPatch(GitUICommands aCommands) : base(aCommands) { InitializeComponent(); Translate(); PatchManager = new PatchManager(); }
public FormPush(GitUICommands aCommands) : base(aCommands) { InitializeComponent(); Translate(); if (!GitCommandHelpers.VersionInUse.SupportPushForceWithLease) { ckForceWithLease.Visible = false; ForcePushTags.DataBindings.Add("Checked", ForcePushBranches, "Checked", formattingEnabled: false, updateMode: DataSourceUpdateMode.OnPropertyChanged); } else { ForcePushTags.DataBindings.Add("Checked", ckForceWithLease, "Checked", formattingEnabled: false, updateMode: DataSourceUpdateMode.OnPropertyChanged); toolTip1.SetToolTip(ckForceWithLease, _forceWithLeaseTooltips.Text); } //can't be set in OnLoad, because after PushAndShowDialogWhenFailed() //they are reset to false if (aCommands != null) { _gitRemoteController = new GitRemoteController(Module); Init(); } }
public FormFormatPatch(GitUICommands aCommands) : base(aCommands) { InitializeComponent(); Translate(); MailFrom.Text = Module.GetEffectiveSetting("user.email"); }
private FormRebase(GitUICommands aCommands) : base(aCommands) { InitializeComponent(); Translate(); helpImageDisplayUserControl1.Visible = !AppSettings.DontShowHelpImages; }
public FormSvnClone(GitUICommands aCommands, EventHandler<GitModuleEventArgs> GitModuleChanged) : base(aCommands) { this.GitModuleChanged = GitModuleChanged; InitializeComponent(); this.Translate(); }
public FormResetCurrentBranch(GitUICommands aCommands, GitRevision Revision) : base(aCommands) { this.Revision = Revision; InitializeComponent(); Translate(); }
public FormDeleteBranch(GitUICommands aCommands, string defaultBranch) : base(aCommands) { InitializeComponent(); Translate(); _defaultBranch = defaultBranch; }
public FormMergeSubmodule(GitUICommands aCommands, string filename) : base(aCommands) { InitializeComponent(); Translate(); lbSubmodule.Text = filename; this._filename = filename; }
public FormLog(GitUICommands aCommands) : base(true, aCommands) { InitializeComponent(); Translate(); diffViewer.ExtraDiffArgumentsChanged += DiffViewerExtraDiffArgumentsChanged; }
public FormFormatPatch(GitUICommands aCommands) : base(aCommands) { InitializeComponent(); Translate(); if (aCommands != null) MailFrom.Text = Module.GetEffectiveSetting(SettingKeyString.UserEmail); }
public FormRenameBranch(GitUICommands aCommands, string defaultBranch) : base(aCommands) { InitializeComponent(); Translate(); Branches.Text = defaultBranch; oldName = defaultBranch; }
public FormStash(GitUICommands aCommands) : base(aCommands) { InitializeComponent(); Loading.Image = global::GitUI.Properties.Resources.loadingpanel; Translate(); View.ExtraDiffArgumentsChanged += ViewExtraDiffArgumentsChanged; }
public FormGoToCommit(GitUICommands aCommands) : base(aCommands) { InitializeComponent(); Translate(); _tagsLoader = new AsyncLoader(); _branchesLoader = new AsyncLoader(); }
public FormRevertCommit(GitUICommands aCommands, GitRevision Revision) : base(aCommands) { this.Revision = Revision; InitializeComponent(); Translate(); }
public FormAddToGitIgnore(GitUICommands aCommands, params string[] filePatterns) : base(aCommands) { InitializeComponent(); Translate(); if (filePatterns != null) FilePattern.Text = string.Join(Environment.NewLine, filePatterns); }
public FormResetCurrentBranch(GitUICommands aCommands, GitRevision Revision) : base(aCommands) { this.Revision = Revision; InitializeComponent(); Translate(); this.checkNoAsk.Checked = false; // default }
public FormTag(GitUICommands aCommands) : base(aCommands) { InitializeComponent(); Translate(); tagMessage.MistakeFont = new Font(SystemFonts.MessageBoxFont, FontStyle.Underline); }
public FormCherryPick(GitUICommands aCommands, GitRevision revision) : base(aCommands) { Revision = revision; InitializeComponent(); Translate(); }
private FormCommitDiff(GitUICommands aCommands) : base(aCommands) { InitializeComponent(); Translate(); DiffText.ExtraDiffArgumentsChanged += DiffText_ExtraDiffArgumentsChanged; DiffFiles.Focus(); DiffFiles.GitItemStatuses = null; }
public FormVerify(GitUICommands aCommands) : base(aCommands) { InitializeComponent(); selectedItemsHeader.AttachTo(columnIsLostObjectSelected); Translate(); Warnings.AutoGenerateColumns = false; }
public FormCreateBranch(GitUICommands commands, ObjectId objectId, string newBranchNamePrefix = null) : base(commands) { InitializeComponent(); InitializeComplete(); groupBox1.AutoSize = true; if (objectId != null && objectId.IsArtificial) { objectId = null; } objectId = objectId ?? Module.GetCurrentCheckout(); if (objectId != null) { commitPickerSmallControl1.SetSelectedCommitHash(objectId.ToString()); } if (newBranchNamePrefix.IsNotNullOrWhitespace()) { BranchNameTextBox.Text = newBranchNamePrefix; } }
/// <summary>Initializes <see cref="FormMergeBranch"/>.</summary> /// <param name="defaultBranch">Branch to merge into the current branch.</param> public FormMergeBranch(GitUICommands commands, string defaultBranch) : base(commands) { InitializeComponent(); helpImageDisplayUserControl1.Image1 = Properties.Images.HelpCommandMerge.AdaptLightness(); helpImageDisplayUserControl1.Image2 = Properties.Images.HelpCommandMergeFastForward.AdaptLightness(); InitializeComplete(); currentBranchLabel.Font = new Font(currentBranchLabel.Font, FontStyle.Bold); noCommit.Checked = AppSettings.DontCommitMerge; helpImageDisplayUserControl1.IsOnHoverShowImage2NoticeText = _formMergeBranchHoverShowImageLabelText.Text; helpImageDisplayUserControl1.Visible = !AppSettings.DontShowHelpImages; _defaultBranch = defaultBranch; noFastForward.Checked = Module.EffectiveSettings.NoFastForwardMerge; addLogMessages.Checked = Module.EffectiveSettings.Detailed.AddMergeLogMessages.ValueOrDefault; nbMessages.Value = Module.EffectiveSettings.Detailed.MergeLogMessagesCount.ValueOrDefault; advanced.Checked = AppSettings.AlwaysShowAdvOpt; advanced_CheckedChanged(null, null); Branches.Select(); }
public FormDiff(GitUICommands aCommands, RevisionGrid revisionGrid, string baseCommitSha, string headCommitSha, string baseCommitDisplayStr, string headCommitDisplayStr) : base(aCommands) { RevisionGrid = revisionGrid; _baseCommitDisplayStr = baseCommitDisplayStr; _headCommitDisplayStr = headCommitDisplayStr; InitializeComponent(); Translate(); _toolTipControl.SetToolTip(btnAnotherBaseBranch, anotherBranchTooltip.Text); _toolTipControl.SetToolTip(btnAnotherHeadBranch, anotherBranchTooltip.Text); _toolTipControl.SetToolTip(btnAnotherBaseCommit, anotherCommitTooltip.Text); _toolTipControl.SetToolTip(btnAnotherHeadCommit, anotherCommitTooltip.Text); _toolTipControl.SetToolTip(btnSwap, btnSwapTooltip.Text); if (!IsUICommandsInitialized) {// UICommands is not initialized in translation unit test. return; } _baseRevision = new GitRevision(baseCommitSha); _headRevision = new GitRevision(headCommitSha); _mergeBase = new GitRevision(Module.GetMergeBase(_baseRevision.Guid, _headRevision.Guid)); _findFilePredicateProvider = new FindFilePredicateProvider(); lblBaseCommit.BackColor = AppSettings.DiffRemovedColor; lblHeadCommit.BackColor = AppSettings.DiffAddedColor; DiffFiles.SelectedIndexChanged += DiffFiles_SelectedIndexChanged; DiffFiles.ContextMenuStrip = DiffContextMenu; this.Load += (sender, args) => PopulateDiffFiles(); DiffText.ExtraDiffArgumentsChanged += DiffTextOnExtraDiffArgumentsChanged; }
public FormCreateTag([NotNull] GitUICommands commands, [CanBeNull] ObjectId objectId) : base(commands) { InitializeComponent(); InitializeComplete(); annotate.Items.AddRange(new object[] { _trsLightweight.Text, _trsAnnotated.Text, _trsSignDefault.Text, _trsSignSpecificKey.Text }); annotate.SelectedIndex = 0; tagMessage.MistakeFont = new Font(tagMessage.MistakeFont, FontStyle.Underline); if (objectId is not null && objectId.IsArtificial) { objectId = null; } objectId ??= Module.GetCurrentCheckout(); if (objectId is not null) { commitPickerSmallControl1.SetSelectedCommitHash(objectId.ToString()); } _gitTagController = new GitTagController(commands); }
public FormRemotes(GitUICommands commands) : base(commands) { InitializeComponent(); Translate(); // remove text from 'new' and 'delete' buttons because now they are represented by icons New.Text = string.Empty; Delete.Text = string.Empty; toolTip1.SetToolTip(New, _btnNewTooltip.Text); toolTip1.SetToolTip(Delete, _btnDeleteTooltip.Text); _lvgEnabled = new ListViewGroup(_lvgEnabledHeader.Text, HorizontalAlignment.Left); _lvgDisabled = new ListViewGroup(_lvgDisabledHeader.Text, HorizontalAlignment.Left); Remotes.Groups.AddRange(new[] { _lvgEnabled, _lvgDisabled }); Application.Idle += application_Idle; BranchName.DataPropertyName = nameof(IGitRef.LocalName); RemoteCombo.DataPropertyName = nameof(IGitRef.TrackingRemote); MergeWith.DataPropertyName = nameof(IGitRef.MergeWith); this.AdjustForDpiScaling(); }
public void SetUp() { _remoteReferenceRepository ??= new ReferenceRepository(); // we will be modifying .git/config and need to completely reset each time _referenceRepository = new ReferenceRepository(); _referenceRepository.Module.AddRemote(RemoteName, _remoteReferenceRepository.Module.WorkingDir); _referenceRepository.Fetch(RemoteName); _commands = new GitUICommands(_referenceRepository.Module); _referenceRepository.CreateCommit("Commit1", "Commit1"); _referenceRepository.CreateBranch("Branch1", _referenceRepository.CommitHash); _referenceRepository.CreateTag("Branch1", _referenceRepository.CommitHash); _referenceRepository.CreateCommit("Commit2", "Commit2"); _referenceRepository.CreateBranch("Branch2", _referenceRepository.CommitHash); _referenceRepository.CreateCommit("head commit"); ExportProvider mefExportProvider = _composition.ExportProviderFactory.CreateExportProvider(); ManagedExtensibility.SetTestExportProvider(mefExportProvider); }
public FormManageWorktree(GitUICommands commands) : base(commands) { InitializeComponent(); Path.Width = DpiUtil.Scale(35); Type.Width = DpiUtil.Scale(37); Branch.Width = DpiUtil.Scale(46); Sha1.Width = DpiUtil.Scale(37); IsDeleted.Width = DpiUtil.Scale(50); Open.Width = DpiUtil.Scale(39); Delete.Width = DpiUtil.Scale(44); Worktrees.AutoGenerateColumns = false; InitializeComplete(); Path.DataPropertyName = nameof(WorkTree.Path); Type.DataPropertyName = nameof(WorkTree.Type); Branch.DataPropertyName = nameof(WorkTree.Branch); Sha1.DataPropertyName = nameof(WorkTree.Sha1); IsDeleted.DataPropertyName = nameof(WorkTree.IsDeleted); bool light = ColorHelper.IsLightTheme(); Delete.Image = light ? Images.Delete : Images.Delete_inv; }
public FormDiff( GitUICommands commands, bool firstParentIsValid, ObjectId baseId, ObjectId headId, string baseCommitDisplayStr, string headCommitDisplayStr) : base(commands) { _baseCommitDisplayStr = baseCommitDisplayStr; _headCommitDisplayStr = headCommitDisplayStr; _firstParentIsValid = firstParentIsValid; InitializeComponent(); InitializeComplete(); _toolTipControl.SetToolTip(btnAnotherBaseBranch, _anotherBranchTooltip.Text); _toolTipControl.SetToolTip(btnAnotherHeadBranch, _anotherBranchTooltip.Text); _toolTipControl.SetToolTip(btnAnotherBaseCommit, _anotherCommitTooltip.Text); _toolTipControl.SetToolTip(btnAnotherHeadCommit, _anotherCommitTooltip.Text); _toolTipControl.SetToolTip(btnSwap, _btnSwapTooltip.Text); _baseRevision = new GitRevision(baseId); _headRevision = new GitRevision(headId); _mergeBase = new GitRevision(Module.GetMergeBase(_baseRevision.ObjectId, _headRevision.ObjectId)); ckCompareToMergeBase.Text += $" ({_mergeBase?.ObjectId.ToShortString()})"; _fullPathResolver = new FullPathResolver(() => Module.WorkingDir); _findFilePredicateProvider = new FindFilePredicateProvider(); _revisionTester = new GitRevisionTester(_fullPathResolver); _revisionDiffContextMenuController = new FileStatusListContextMenuController(); lblBaseCommit.BackColor = AppSettings.DiffRemovedColor; lblHeadCommit.BackColor = AppSettings.DiffAddedColor; DiffFiles.ContextMenuStrip = DiffContextMenu; DiffFiles.SelectedIndexChanged += delegate { ShowSelectedFileDiff(); }; DiffText.ExtraDiffArgumentsChanged += delegate { ShowSelectedFileDiff(); }; Load += delegate { PopulateDiffFiles(); }; }
public FormFileHistory(GitUICommands aCommands, string fileName, GitRevision revision, bool filterByRevision) : this(aCommands) { FileChanges.SetInitialRevision(revision); Translate(); FileName = fileName; SetTitle(string.Empty); Diff.ExtraDiffArgumentsChanged += DiffExtraDiffArgumentsChanged; FileChanges.SelectionChanged += FileChangesSelectionChanged; FileChanges.DisableContextMenu(); followFileHistoryToolStripMenuItem.Checked = AppSettings.FollowRenamesInFileHistory; fullHistoryToolStripMenuItem.Checked = AppSettings.FullHistoryInFileHistory; loadHistoryOnShowToolStripMenuItem.Checked = AppSettings.LoadFileHistoryOnShow; loadBlameOnShowToolStripMenuItem.Checked = AppSettings.LoadBlameOnShow; if (filterByRevision && revision != null && revision.Guid != null) { _filterBranchHelper.SetBranchFilter(revision.Guid, false); } }
public void LaunchGitExtensions() { GitUICommands.LaunchBrowse(workingDir: Info.Path.EnsureTrailingPathSeparator(), ObjectId.WorkTreeId, Info?.Detailed?.RawStatus?.OldCommit); }
public FormProcess(GitUICommands commands, string process, ArgumentString arguments, string workingDirectory, string input, bool useDialogSettings) : this(commands, outputControl : null, process, arguments, workingDirectory, input, useDialogSettings) { }
public FormRebase(GitUICommands commands, string defaultBranch) : this(commands) { _defaultBranch = defaultBranch; }
private static void RunApplication() { string[] args = Environment.GetCommandLineArgs(); // This form created to obtain UI synchronization context only using (new Form()) { // Store the shared JoinableTaskContext ThreadHelper.JoinableTaskContext = new JoinableTaskContext(); } AppSettings.LoadSettings(); if (EnvUtils.RunningOnWindows()) { WebBrowserEmulationMode.SetBrowserFeatureControl(); FormFixHome.CheckHomePath(); } if (string.IsNullOrEmpty(AppSettings.Translation)) { using (var formChoose = new FormChooseTranslation()) { formChoose.ShowDialog(); } } try { // Ensure we can find the git command to execute, // unless we are being instructed to uninstall, // or AppSettings.CheckSettings is set to false. if (!(args.Length >= 2 && args[1] == "uninstall")) { if (!CheckSettingsLogic.SolveGitCommand()) { if (!LocateMissingGit()) { Environment.Exit(-1); return; } } if (AppSettings.CheckSettings) { var uiCommands = new GitUICommands(""); var commonLogic = new CommonLogic(uiCommands.Module); var checkSettingsLogic = new CheckSettingsLogic(commonLogic); var fakePageHost = new SettingsPageHostMock(checkSettingsLogic); using (var checklistSettingsPage = SettingsPageBase.Create <ChecklistSettingsPage>(fakePageHost)) { if (!checklistSettingsPage.CheckSettings()) { if (!checkSettingsLogic.AutoSolveAllSettings()) { uiCommands.StartSettingsDialog(); } } } } } } catch { // TODO: remove catch-all } if (EnvUtils.RunningOnWindows()) { MouseWheelRedirector.Active = true; } var commands = new GitUICommands(GetWorkingDir(args)); if (args.Length <= 1) { commands.StartBrowseDialog(); } else { // if we are here args.Length > 1 commands.RunCommand(args); } AppSettings.SaveSettings(); }
public FormPush([NotNull] GitUICommands commands) : base(commands) { InitializeComponent(); NewColumn.Width = DpiUtil.Scale(97); PushColumn.Width = DpiUtil.Scale(36); ForceColumn.Width = DpiUtil.Scale(101); DeleteColumn.Width = DpiUtil.Scale(108); InitializeComplete(); if (!GitVersion.Current.SupportPushForceWithLease) { ckForceWithLease.Visible = false; ForcePushTags.DataBindings.Add("Checked", ForcePushBranches, "Checked", formattingEnabled: false, updateMode: DataSourceUpdateMode.OnPropertyChanged); } else { ForcePushTags.DataBindings.Add("Checked", ckForceWithLease, "Checked", formattingEnabled: false, updateMode: DataSourceUpdateMode.OnPropertyChanged); toolTip1.SetToolTip(ckForceWithLease, _forceWithLeaseTooltips.Text); } // can't be set in OnLoad, because after PushAndShowDialogWhenFailed() // they are reset to false _remoteManager = new GitRemoteManager(() => Module); Init(); void Init() { _gitRefs = Module.GetRefs(); if (GitVersion.Current.SupportPushWithRecursiveSubmodulesCheck) { RecursiveSubmodules.Enabled = true; RecursiveSubmodules.SelectedIndex = AppSettings.RecursiveSubmodules; if (!GitVersion.Current.SupportPushWithRecursiveSubmodulesOnDemand) { RecursiveSubmodules.Items.RemoveAt(2); } } else { RecursiveSubmodules.Enabled = false; RecursiveSubmodules.SelectedIndex = 0; } _currentBranchName = Module.GetSelectedBranch(); // refresh registered git remotes UserGitRemotes = _remoteManager.LoadRemotes(false).ToList(); BindRemotesDropDown(null); UpdateBranchDropDown(); UpdateRemoteBranchDropDown(); Push.Focus(); if (AppSettings.AlwaysShowAdvOpt) { ShowOptions_LinkClicked(null, null); } } }
private static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); if (!EnvUtils.IsMonoRuntime()) { try { NBug.Settings.UIMode = NBug.Enums.UIMode.Full; // Uncomment the following after testing to see that NBug is working as configured NBug.Settings.ReleaseMode = true; NBug.Settings.ExitApplicationImmediately = false; NBug.Settings.WriteLogToDisk = false; NBug.Settings.MaxQueuedReports = 10; NBug.Settings.StopReportingAfter = 90; NBug.Settings.SleepBeforeSend = 30; NBug.Settings.StoragePath = NBug.Enums.StoragePath.WindowsTemp; AppDomain.CurrentDomain.UnhandledException += NBug.Handler.UnhandledException; Application.ThreadException += NBug.Handler.ThreadException; } catch (TypeInitializationException tie) { // is this exception caused by the configuration? if (tie.InnerException != null && tie.InnerException.GetType() .IsSubclassOf(typeof(System.Configuration.ConfigurationException))) { HandleConfigurationException((System.Configuration.ConfigurationException)tie.InnerException); } } } string[] args = Environment.GetCommandLineArgs(); FormSplash.ShowSplash(); //Store here SynchronizationContext.Current, because later sometimes it can be null //see http://stackoverflow.com/questions/11621372/synchronizationcontext-current-is-null-in-continuation-on-the-main-ui-thread GitUIExtensions.UISynchronizationContext = SynchronizationContext.Current; AsyncLoader.DefaultContinuationTaskScheduler = TaskScheduler.FromCurrentSynchronizationContext(); Application.DoEvents(); AppSettings.LoadSettings(); if (EnvUtils.RunningOnWindows()) { WebBrowserEmulationMode.SetBrowserFeatureControl(); //Quick HOME check: FormSplash.SetAction("Checking home path..."); Application.DoEvents(); FormFixHome.CheckHomePath(); } //Register plugins FormSplash.SetAction("Loading plugins..."); Application.DoEvents(); if (string.IsNullOrEmpty(AppSettings.Translation)) { using (var formChoose = new FormChooseTranslation()) { formChoose.ShowDialog(); } } try { if (!(args.Length >= 2 && args[1].Equals("uninstall")) && (AppSettings.CheckSettings || string.IsNullOrEmpty(AppSettings.GitCommandValue) || !File.Exists(AppSettings.GitCommandValue))) { FormSplash.SetAction("Checking settings..."); Application.DoEvents(); GitUICommands uiCommands = new GitUICommands(string.Empty); var commonLogic = new CommonLogic(uiCommands.Module); var checkSettingsLogic = new CheckSettingsLogic(commonLogic); ISettingsPageHost fakePageHost = new SettingsPageHostMock(checkSettingsLogic); using (var checklistSettingsPage = SettingsPageBase.Create <ChecklistSettingsPage>(fakePageHost)) { if (!checklistSettingsPage.CheckSettings()) { if (!checkSettingsLogic.AutoSolveAllSettings()) { uiCommands.StartSettingsDialog(); } } } } } catch { // TODO: remove catch-all } FormSplash.HideSplash(); if (EnvUtils.RunningOnWindows()) { MouseWheelRedirector.Active = true; } GitUICommands uCommands = new GitUICommands(GetWorkingDir(args)); if (args.Length <= 1) { uCommands.StartBrowseDialog(); } else // if we are here args.Length > 1 { uCommands.RunCommand(args); } AppSettings.SaveSettings(); }
public FormFileHistory(GitUICommands aCommands, string fileName) : this(aCommands, fileName, null, false) { }
public ViewPullRequestsForm(GitUICommands aCommands, IRepositoryHostPlugin gitHoster) : this(aCommands) { _gitHoster = gitHoster; }
public FormGitAttributes(GitUICommands aCommands) : base(aCommands) { InitializeComponent(); Translate(); }
public StashNode(GitStash stash, GitUICommands uiCommands) : base(stash, null, uiCommands) { IsDraggable = true; }
private FormChooseCommit(GitUICommands aCommands) : base(aCommands) { InitializeComponent(); Translate(); }
public FormCheckoutRevision(GitUICommands commands) : base(commands) { InitializeComponent(); InitializeComplete(); }
public void StashSubmodule(IWin32Window owner, SubmoduleNode node) { var uiCmds = new GitUICommands(new GitModule(node.Info.Path)); uiCmds.StashSave(owner, AppSettings.IncludeUntrackedFilesInManualStash); }
public void CommitSubmodule(IWin32Window owner, SubmoduleNode node) { var submodulCommands = new GitUICommands(node.Info.Path.EnsureTrailingPathSeparator()); submodulCommands.StartCommitDialog(owner); }
public FormSettings(GitUICommands aCommands, SettingsPageReference initalPage = null) : base(aCommands) { InitializeComponent(); Translate(); settingsTreeView.SuspendLayout(); //if form is created for translation purpose if (aCommands == null) { return; } #if DEBUG buttonDiscard.Visible = true; #endif settingsTreeView.AddSettingsPage(new GitExtensionsSettingsGroup(), null); SettingsPageReference gitExtPageRef = GitExtensionsSettingsGroup.GetPageReference(); _commonLogic = new CommonLogic(Module); _checkSettingsLogic = new CheckSettingsLogic(_commonLogic, Module); var checklistSettingsPage = new ChecklistSettingsPage(_commonLogic, _checkSettingsLogic, Module, this); settingsTreeView.AddSettingsPage(checklistSettingsPage, gitExtPageRef, true); // as root settingsTreeView.AddSettingsPage(new GitSettingsPage(_checkSettingsLogic, this), gitExtPageRef); settingsTreeView.AddSettingsPage(new GitExtensionsSettingsPage(), gitExtPageRef); settingsTreeView.AddSettingsPage(new AppearanceSettingsPage(), gitExtPageRef); settingsTreeView.AddSettingsPage(new ColorsSettingsPage(), gitExtPageRef); settingsTreeView.AddSettingsPage(new StartPageSettingsPage(), gitExtPageRef); var globalSettingsSettingsPage = new GlobalSettingsSettingsPage(_commonLogic, _checkSettingsLogic, Module); settingsTreeView.AddSettingsPage(globalSettingsSettingsPage, gitExtPageRef); var localSettingsSettingsPage = new LocalSettingsSettingsPage(_commonLogic, _checkSettingsLogic, Module); settingsTreeView.AddSettingsPage(localSettingsSettingsPage, gitExtPageRef); var _sshSettingsPage = new SshSettingsPage(_commonLogic); settingsTreeView.AddSettingsPage(_sshSettingsPage, gitExtPageRef); checklistSettingsPage.SshSettingsPage = _sshSettingsPage; settingsTreeView.AddSettingsPage(new ScriptsSettingsPage(), gitExtPageRef); settingsTreeView.AddSettingsPage(new HotkeysSettingsPage(), gitExtPageRef); settingsTreeView.AddSettingsPage(new ShellExtensionSettingsPage(), gitExtPageRef); settingsTreeView.AddSettingsPage(new AdvancedSettingsPage(), gitExtPageRef); SettingsPageReference advancedPageRef = AdvancedSettingsPage.GetPageReference(); settingsTreeView.AddSettingsPage(new ConfirmationsSettingsPage(), advancedPageRef); settingsTreeView.AddSettingsPage(new PluginsSettingsGroup(), null); SettingsPageReference pluginsPageRef = PluginsSettingsGroup.GetPageReference(); settingsTreeView.AddSettingsPage(new PluginRootIntroductionPage(), pluginsPageRef, true); // as root foreach (var gitPlugin in LoadedPlugins.Plugins) { var settingsPage = PluginSettingsPage.CreateSettingsPageFromPlugin(gitPlugin); settingsTreeView.AddSettingsPage(settingsPage, pluginsPageRef); } settingsTreeView.GotoPage(initalPage); settingsTreeView.ResumeLayout(); }
public void TearDown() { _commands = null; }
private static void RunApplication() { string[] args = Environment.GetCommandLineArgs(); // This form created for obtain UI synchronization context only using (new Form()) { // Store here SynchronizationContext.Current, because later sometimes it can be null // see http://stackoverflow.com/questions/11621372/synchronizationcontext-current-is-null-in-continuation-on-the-main-ui-thread GitUIExtensions.UISynchronizationContext = SynchronizationContext.Current; AsyncLoader.DefaultContinuationTaskScheduler = TaskScheduler.FromCurrentSynchronizationContext(); } AppSettings.LoadSettings(); if (EnvUtils.RunningOnWindows()) { WebBrowserEmulationMode.SetBrowserFeatureControl(); FormFixHome.CheckHomePath(); } if (string.IsNullOrEmpty(AppSettings.Translation)) { using (var formChoose = new FormChooseTranslation()) { formChoose.ShowDialog(); } } try { if (!(args.Length >= 2 && args[1].Equals("uninstall")) && (AppSettings.CheckSettings || string.IsNullOrEmpty(AppSettings.GitCommandValue) || !File.Exists(AppSettings.GitCommandValue))) { GitUICommands uiCommands = new GitUICommands(string.Empty); var commonLogic = new CommonLogic(uiCommands.Module); var checkSettingsLogic = new CheckSettingsLogic(commonLogic); ISettingsPageHost fakePageHost = new SettingsPageHostMock(checkSettingsLogic); using (var checklistSettingsPage = SettingsPageBase.Create <ChecklistSettingsPage>(fakePageHost)) { if (!checklistSettingsPage.CheckSettings()) { if (!checkSettingsLogic.AutoSolveAllSettings()) { uiCommands.StartSettingsDialog(); } } } } } catch { // TODO: remove catch-all } if (EnvUtils.RunningOnWindows()) { MouseWheelRedirector.Active = true; } GitUICommands commands = new GitUICommands(GetWorkingDir(args)); if (args.Length <= 1) { commands.StartBrowseDialog(); } else { // if we are here args.Length > 1 commands.RunCommand(args); } AppSettings.SaveSettings(); }
void UICommandsSource_GitUICommandsChanged(IGitUICommandsSource sender, GitUICommands oldCommands) { Clear(); }
public FormCreateWorktree(GitUICommands commands) : base(commands) { InitializeComponent(); InitializeComplete(); }
public FormCheckoutRevision(GitUICommands aCommands) : base(true, aCommands) { InitializeComponent(); Translate(); }
public void SetUp() { _repo1 = new GitModuleTestHelper("repo1"); _commands = new GitUICommands(_repo1.Module); }