public FormGerritPublish(IGitUICommands uiCommand) { _uiCommand = uiCommand; InitializeComponent(); Translate(); }
public void Register(IGitUICommands gitUiCommands) { Settings.AddSetting("Code files", "*.c;*.cpp;*.h;*.hpp;*.inl;*.idl;*.asm;*.inc;*.cs;*.xsd;*.wsdl;*.xml;*.htm;*.html;*.css;*.vbs;*.vb;*.sql;*.aspx;*.asp;*.php;*.nav;*.pas;*.py;*.rb"); Settings.AddSetting("Directories to ignore (EndsWith)", "\\Debug;\\Release;\\obj;\\bin;\\lib"); Settings.AddSetting("Ignore submodules (true/false)", "true"); }
public override void Register(IGitUICommands gitUiCommands) { //Connect to events -> connect to all main events because in theory the prebrowse //event can be missed since plugins are loaded asynchronous gitUiCommands.PreBrowse += GitUiCommandsPreBrowse; gitUiCommands.PreCommit += GitUiCommandsPreBrowse; }
private static IEnumerable<string> GetTfsRemotes(IGitUICommands commands) { var result = commands.GitCommand("config --get-regexp tfs-remote"); var matches = Regex.Matches(result, @"tfs-remote\.([^\.]+)"); return matches.Count > 0 ? matches.Cast<Match>().Select(g => g.Groups[1].Value).Distinct() : Enumerable.Empty<string>(); }
public ShelveDialog(IGitUICommands commands, ShelveSettingsContainer settings) { _commands = commands; _settings = settings; InitializeComponent(); InitializeFromSettings(); }
private static IEnumerable<string> GetTfsRemotes(IGitUICommands commands) { var result = commands.GitCommand("config --get-regexp tfs-remote"); var match = Regex.Match(result, @"tfs-remote\.([^\.]+)"); return match.Success ? match.Groups.Cast<Group>().Skip(1).Select(g => g.Value) : Enumerable.Empty<string>(); }
public override void Register(IGitUICommands gitUiCommands) { base.Register(gitUiCommands); currentGitUiCommands = gitUiCommands; currentGitUiCommands.PostSettings += OnPostSettings; RecreateObservable(); }
public GitTfsDialog(IGitUICommands commands, SettingsContainer settings, IEnumerable<string> tfsRemotes) { _commands = commands; _settings = settings; InitializeComponent(); TfsRemoteComboBox.DataSource = tfsRemotes.ToList(); InitializeFromSettings(); }
public void Register(IGitUICommands gitUiCommands) { // Register settings Settings.AddSetting("Enabled (true / false)", "false"); Settings.AddSetting("Path to msbuild.exe", FindMsBuild()); Settings.AddSetting("msbuild.exe arguments", "/p:Configuration=Debug"); // Connect to events gitUiCommands.PostUpdateSubmodules += GitUiCommandsPostUpdateSubmodules; }
public void Register(IGitUICommands gitUICommands) { //Register settings Settings.AddSetting("Enabled (true / false)", "true"); Settings.AddSetting("Check every # days", "7"); Settings.AddSetting("Last check (yyyy/M/dd)", new DateTime(2000, 1, 1).ToString("yyyy/M/dd", CultureInfo.InvariantCulture)); //Connect to events gitUICommands.PreBrowse += new GitUIEventHandler(gitUICommands_PreBrowse); }
public DeleteUnusedBranchesForm(int days, string referenceBranch, IGitModule gitCommands, IGitUICommands gitUICommands, IGitPlugin gitPlugin) { InitializeComponent(); this.referenceBranch = referenceBranch; this.days = days; this.gitCommands = gitCommands; _gitUICommands = gitUICommands; _gitPlugin = gitPlugin; instructionLabel.Text = "Choose branches to delete. Only branches that are fully merged in '" + referenceBranch + "' will be deleted."; }
public override void Unregister(IGitUICommands gitUiCommands) { CancelBackgroundOperation(); if (currentGitUiCommands != null) { currentGitUiCommands.PostSettings -= OnPostSettings; currentGitUiCommands = null; } base.Unregister(gitUiCommands); }
public DeleteUnusedBranchesForm(int days, string referenceBranch, IGitModule gitCommands, IGitUICommands gitUICommands, IGitPlugin gitPlugin) { InitializeComponent(); this.referenceBranch = referenceBranch; this.days = days; this.gitCommands = gitCommands; _gitUICommands = gitUICommands; _gitPlugin = gitPlugin; imgLoading.Image = IsMonoRuntime() ? Resources.loadingpanel_static : Resources.loadingpanel; RefreshObsoleteBranches(); }
public FormGitReview(IGitUICommands aUICommands) : base(true) { InitializeComponent(); Translate(); UICommands = (GitUICommands)aUICommands; if (UICommands != null) { LoadGitReview(); _NO_TRANSLATE_GitReviewEdit.TextLoaded += GitReviewFileLoaded; } }
public void Register(IGitUICommands gitUiCommands) { //Register settings Settings.AddSetting("Enabled (true / false)", "true"); Settings.AddSetting("Check every # days", "7"); Settings.AddSetting("Last check (yyyy/M/dd)", new DateTime(2000, 1, 1).ToString("yyyy/M/dd", CultureInfo.InvariantCulture)); //Connect to events -> connect to all main events because in theory the prebrowse //event can be missed since plugins are loaded asynchronous gitUiCommands.PreBrowse += GitUiCommandsPreBrowse; gitUiCommands.PreCommit += GitUiCommandsPreBrowse; }
public void Register(IGitUICommands gitUiCommands) { var existingKeys = Settings.GetAvailableSettings(); var settingsToAdd = from field in typeof(SettingKeys).GetFields(BindingFlags.Public | BindingFlags.Static) let key = (string)field.GetValue(null) where !existingKeys.Contains(key) select key; foreach (var settingToAdd in settingsToAdd) { Settings.AddSetting(settingToAdd, string.Empty); } }
public override void Unregister(IGitUICommands commands) { base.Unregister(commands); MenuStripEx mainMenu = FindMainMenu(commands); if (mainMenu != null) { SolutionListMenuItem mainMenuItem = FindMainMenuItem(commands, mainMenu); if (mainMenuItem != null) { mainMenu.Items.Remove(mainMenuItem); mainMenuItem.Dispose(); } } }
public override void Register(IGitUICommands commands) { base.Register(commands); Configuration = new PluginSettings(Settings); if (commands.GitModule.IsValidGitWorkingDir()) { MenuStripEx mainMenu = FindMainMenu(commands); if (mainMenu != null && FindMainMenuItem(commands, mainMenu) == null) { var provider = new GitSolutionFileProvider(commands.GitModule.WorkingDir, commands.GitModule.GitExecutable); mainMenu.Items.Add(new SolutionListMenuItem(provider, Configuration)); } } }
public GitTfsDialog(IGitUICommands commands, SettingsContainer settings, IEnumerable <string> tfsRemotes) { _commands = commands; _settings = settings; InitializeComponent(); TfsRemoteComboBox.DataSource = tfsRemotes.ToList(); InitializeFromSettings(); this.KeyDown += (o, e) => { if (e.KeyCode == Keys.Escape) { this.DialogResult = DialogResult.Cancel; this.Close(); } }; }
/// <summary> /// Is called when the plugin is loaded. This happens every time when a repository is opened. /// </summary> public override void Register(IGitUICommands gitUiCommands) { //OAuth2Handler.RegisterURIHandler(); currentGitUiCommands = gitUiCommands;; currentGitUiCommands.PostSettings += CurrentGitUiCommands_PostSettings; currentGitUiCommands.PostRegisterPlugin += GitUiCommands_PostRegisterPlugin; InitializeConfiguredParameters(gitUiCommands.GitModule); if (IsGitLabRepo(gitUiCommands)) { base.Register(gitUiCommands); GitLabPluginScriptManager.Initialize(); ForceRefreshGE(gitUiCommands); } else { GitLabPluginScriptManager.Clean(); ForceRefreshGE(gitUiCommands); } }
private bool IsGitLabRepo(IGitUICommands gitUiCommands) { if (repoType == null) { ExecutionResult result = gitUiCommands.GitModule.GitExecutable.Execute(cmdInfo); repoType = (result.ExitCode == 0) ? RepoType.git : RepoType.Unknown; } try { return(repoType == RepoType.git && GetHostedRemotesForModule().Count() > 0); } catch (UnauthorizedAccessException) { //if (dontAskForLoginAgain) //{ // return false; //} return(LoginGitLab()); } catch (Exception ex) { if (dontShowErrors) { return(false); } using (var mergeRequestformStatus = new MergeRequsetFormStatus( $"GitLab Plugin -{repoInitializationError.Text}", string.Empty, GitUI.Properties.Images.StatusBadgeError, true, ex.Message)) { mergeRequestformStatus.ShowDialog(); dontShowErrors = mergeRequestformStatus.DontShowAgain; } return(false); } }
public MainForm(IGitUICommands gitUiCommands) { InitializeComponent(); _gitUiCommands = gitUiCommands; _analyzier = new TicketsHistoryAnalyzer(_gitUiCommands.GitModule); _analyzier.ScanFinished += OnAnalyzerScanFinished; _analyzier.ProgressChanged += OnAnalyzerProgressChanged; _analyzier.ErrorOccured += OnErrorOccured; _searchPattern.Text = Properties.Settings.Default.SearchPattern; _outputFormat.Text = Properties.Settings.Default.OutputFormat; var uiCommandsSource = new UICommandsSource { UICommands = (GitUICommands)_gitUiCommands }; _lastCommitPicker.UICommandsSource = uiCommandsSource; _firstCommitPicker.UICommandsSource = uiCommandsSource; }
public override void Unregister(IGitUICommands gitUiCommands) { // Connect to events gitUiCommands.PostUpdateSubmodules -= GitUiCommandsPostUpdateSubmodules; }
public void Register(IGitUICommands gitUiCommands) { //Register settings Settings.AddSetting("Path to \"gource\"", ""); Settings.AddSetting("Arguments", "--hide filenames"); }
public override void Unregister(IGitUICommands gitUiCommands) { GitLabPluginScriptManager.Clean(); repoType = null; }
public DeleteUnusedBranchesForm(DeleteUnusedBranchesFormSettings settings, IGitModule gitCommands, IGitUICommands gitUiCommands, IGitPlugin gitPlugin) : this() { _settings = settings; _gitCommands = gitCommands; _gitUiCommands = gitUiCommands; _gitPlugin = gitPlugin; imgLoading.Image = Resources.loadingpanel; ThreadHelper.JoinableTaskFactory.RunAsync(() => RefreshObsoleteBranchesAsync()); }
public DeleteUnusedBranchesForm(DeleteUnusedBranchesFormSettings settings, IGitModule gitCommands, IGitUICommands gitUiCommands, IGitPlugin gitPlugin) : this() { _settings = settings; _gitCommands = gitCommands; _gitUiCommands = gitUiCommands; _gitPlugin = gitPlugin; imgLoading.Image = Resources.loadingpanel; RefreshObsoleteBranches(); }
public GitUIPostActionEventArgs(IWin32Window ownerForm, IGitUICommands gitUICommands, bool actionDone) : base(ownerForm, gitUICommands) { ActionDone = actionDone; }
public void Register(IGitUICommands gitUiCommands) { Settings.AddSetting("Find large files bigger than (Mb)", "1"); }
public static CommandStatus RunScript(IWin32Window owner, GitModule module, string scriptKey, IGitUICommands uiCommands, RevisionGridControl revisionGrid) { if (string.IsNullOrEmpty(scriptKey)) { return(false); } var script = ScriptManager.GetScript(scriptKey); if (script == null) { MessageBox.Show(owner, "Cannot find script: " + scriptKey, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return(false); } if (string.IsNullOrEmpty(script.Command)) { return(false); } string argument = script.Arguments; foreach (string option in ScriptOptionsParser.Options) { if (string.IsNullOrEmpty(argument) || !argument.Contains(option)) { continue; } if (!option.StartsWith("s")) { continue; } if (revisionGrid != null) { continue; } MessageBox.Show(owner, $"Option {option} is only supported when started from revision grid.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return(false); } return(RunScript(owner, module, script, uiCommands, revisionGrid)); }
public void Register(IGitUICommands gitUiCommands) { _gitUiCommands = gitUiCommands; gitUiCommands.PostBrowseInitialize += gitUiCommands_PostBrowseInitialize; }
public GitTagController(IGitUICommands uiCommands, IGitModule module) : this(uiCommands, module, new FileSystem()) { }
public void Register(IGitUICommands gitUiCommands) { Settings.AddSetting("OAuth Token", ""); if (GithubLoginInfo.OAuthToken.Length > 0) { github.setOAuth2Token(GithubLoginInfo.OAuthToken); } }
protected FormGerritBase(IGitUICommands agitUiCommands) : base(true) { UICommands = agitUiCommands; }
public override void Register(IGitUICommands gitUiCommands) { if (GithubLoginInfo.OAuthToken.Length > 0) { github.setOAuth2Token(GithubLoginInfo.OAuthToken); } }
public override void Register(IGitUICommands gitUiCommands) { _gitUiCommands = gitUiCommands; gitUiCommands.PostBrowseInitialize += UpdateGerritMenuItems; gitUiCommands.PostRegisterPlugin += UpdateGerritMenuItems; }
public override void Unregister(IGitUICommands gitUiCommands) { gitUiCommands.PostBrowseInitialize -= UpdateGerritMenuItems; gitUiCommands.PostRegisterPlugin -= UpdateGerritMenuItems; _gitUiCommands = null; }
public override void Register(IGitUICommands gitUiCommands) { _gitUiCommands = gitUiCommands; gitUiCommands.PostBrowseInitialize += gitUiCommands_PostBrowseInitialize; gitUiCommands.PostRegisterPlugin += gitUiCommands_PostRegisterPlugin; }
public override void Unregister(IGitUICommands gitUiCommands) { // Connect to events gitUiCommands.PostUpdateSubmodules -= GitUiCommandsPostUpdateSubmodules; }
protected GitUIBaseEventArgs(IGitUICommands gitUICommands) : this(null, gitUICommands) { }
public override void Register(IGitUICommands gitUiCommands) { base.Register(gitUiCommands); }
protected GitUIBaseEventArgs(object ownerForm, IGitUICommands gitUICommands) : base(false) { this.OwnerForm = ownerForm; this.GitUICommands = gitUICommands; }
protected GitUIBaseEventArgs(IGitUICommands gitUICommands, string arguments = null) : this(null, gitUICommands, arguments) { }
public void Register(IGitUICommands gitUiCommands) { _gitUiCommands = gitUiCommands; Settings.AddSetting("username", ""); Settings.AddSetting("password", ""); Settings.AddSetting("apitoken", ""); Settings.AddSetting("preferred access method", "https"); StartConfigtest(); }
private void ForceRefreshGE(IGitUICommands gitUiCommands) { gitUiCommands.RepoChangedNotifier.Notify(); }
public void Register(IGitUICommands gitUiCommands) { }
public GitUIBaseEventArgs(IGitUICommands gitUICommands) : base(false) { this.GitUICommands = gitUICommands; }
public void Register(IGitUICommands gitUiCommands) { Settings.AddSetting("Delete obsolete branches older than (days)", "30"); }
public GitTagController(IGitUICommands uiCommands, IGitModule module, IFileSystem fileSystem) { _module = module; _uiCommands = uiCommands; _fileSystem = fileSystem; }
protected GitUIBaseEventArgs(IWin32Window ownerForm, IGitUICommands gitUICommands) : base(false) { this.OwnerForm = ownerForm; this.GitUICommands = gitUICommands; }
public DeleteUnusedBranchesForm(DeleteUnusedBranchesFormSettings settings, IGitModule gitCommands, IGitUICommands gitUiCommands, IGitPlugin gitPlugin) { _settings = settings; _gitCommands = gitCommands; _gitUiCommands = gitUiCommands; _gitPlugin = gitPlugin; InitializeComponent(); _NO_TRANSLATE_deleteDataGridViewCheckBoxColumn.Width = DpiUtil.Scale(50); dateDataGridViewTextBoxColumn.Width = DpiUtil.Scale(175); Author.Width = DpiUtil.Scale(91); imgLoading.Image = Resources.loadingpanel; _NO_TRANSLATE_deleteDataGridViewCheckBoxColumn.DataPropertyName = nameof(Branch.Delete); nameDataGridViewTextBoxColumn.DataPropertyName = nameof(Branch.Name); dateDataGridViewTextBoxColumn.DataPropertyName = nameof(Branch.Date); Author.DataPropertyName = nameof(Branch.Author); Message.DataPropertyName = nameof(Branch.Message); InitializeComplete(); ThreadHelper.JoinableTaskFactory.RunAsync(() => RefreshObsoleteBranchesAsync()); }
protected GitUIBaseEventArgs(IGitUICommands gitUICommands) : this(null, gitUICommands) { }
/// <summary>Tries to run scripts identified by a <paramref name="command"/></summary> public static CommandStatus ExecuteScriptCommand(IWin32Window owner, GitModule module, int command, IGitUICommands uiCommands, RevisionGridControl revisionGrid = null) { var anyScriptExecuted = false; var needsGridRefresh = false; foreach (var script in ScriptManager.GetScripts()) { if (script.HotkeyCommandIdentifier == command) { var result = RunScript(owner, module, script.Name, uiCommands, revisionGrid); anyScriptExecuted = true; needsGridRefresh |= result.NeedsGridRefresh; } } return(new CommandStatus(anyScriptExecuted, needsGridRefresh)); }
public FormGerritDownload(IGitUICommands uiCommand) : base(uiCommand) { InitializeComponent(); Translate(); }
private static CommandStatus RunScript(IWin32Window owner, GitModule module, ScriptInfo scriptInfo, IGitUICommands uiCommands, RevisionGridControl revisionGrid) { if (scriptInfo.AskConfirmation && MessageBox.Show(owner, $"Do you want to execute '{scriptInfo.Name}'?", "Script", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) { return(false); } string originalCommand = scriptInfo.Command; (string argument, bool abort) = ScriptOptionsParser.Parse(scriptInfo.Arguments, module, owner, revisionGrid); if (abort) { return(false); } string command = OverrideCommandWhenNecessary(originalCommand); command = ExpandCommandVariables(command, module); if (scriptInfo.IsPowerShell) { PowerShellHelper.RunPowerShell(command, argument, module.WorkingDir, scriptInfo.RunInBackground); return(new CommandStatus(true, false)); } if (command.StartsWith(PluginPrefix)) { command = command.Replace(PluginPrefix, ""); foreach (var plugin in PluginRegistry.Plugins) { if (plugin.Description.ToLower().Equals(command, StringComparison.CurrentCultureIgnoreCase)) { var eventArgs = new GitUIEventArgs(owner, uiCommands); return(new CommandStatus(true, plugin.Execute(eventArgs))); } } return(false); } if (command.StartsWith(NavigateToPrefix)) { if (revisionGrid == null) { return(false); } command = command.Replace(NavigateToPrefix, string.Empty); if (!command.IsNullOrEmpty()) { var revisionRef = new Executable(command, module.WorkingDir).GetOutputLines(argument).FirstOrDefault(); if (revisionRef != null) { revisionGrid.GoToRef(revisionRef, true); } } return(new CommandStatus(true, false)); } if (!scriptInfo.RunInBackground) { FormProcess.ShowStandardProcessDialog(owner, command, argument, module.WorkingDir, null, true); } else { if (originalCommand.Equals("{openurl}", StringComparison.CurrentCultureIgnoreCase)) { Process.Start(argument); } else { new Executable(command, module.WorkingDir).Start(argument); } } return(new CommandStatus(true, !scriptInfo.RunInBackground)); }
public GitUIEventArgs(IGitUICommands gitUICommands) : base(gitUICommands) { }
public FormGerritDownload(IGitUICommands uiCommand) : base(uiCommand) { InitializeComponent(); Translate(); }
public virtual void Unregister(IGitUICommands gitUiCommands) { }
public override void Unregister(IGitUICommands gitUiCommands) { gitUiCommands.PostBrowseInitialize -= gitUiCommands_PostBrowseInitialize; gitUiCommands.PostRegisterPlugin -= gitUiCommands_PostRegisterPlugin; _gitUiCommands = null; }
public override void Register(IGitUICommands gitUiCommands) { if (!string.IsNullOrEmpty(GithubLoginInfo.OAuthToken)) { github.setOAuth2Token(GithubLoginInfo.OAuthToken); } }