public override bool Execute(GitUIBaseEventArgs gitUIEventArgs)
        {
            if (string.IsNullOrEmpty(gitUIEventArgs.GitModule.WorkingDir))
                return false;

            using (var formGitStatistics =
                new FormGitStatistics(gitUIEventArgs.GitModule, CodeFiles[Settings])
                    {
                        DirectoriesToIgnore = IgnoreDirectories[Settings]
                    })
            {

                if (IgnoreSubmodules[Settings].Value)
                {
                    foreach (var submodule in gitUIEventArgs.GitModule.GetSubmodulesInfo())
                    {
                        formGitStatistics.DirectoriesToIgnore += ";";
                        formGitStatistics.DirectoriesToIgnore += Path.Combine(gitUIEventArgs.GitModule.WorkingDir, submodule.LocalPath);
                    }
                }

                formGitStatistics.DirectoriesToIgnore = formGitStatistics.DirectoriesToIgnore.Replace("/", "\\");
                formGitStatistics.WorkingDir = new DirectoryInfo(gitUIEventArgs.GitModule.WorkingDir);

                formGitStatistics.ShowDialog(gitUIEventArgs.OwnerForm);
            }
            return false;
        }
Ejemplo n.º 2
0
        public bool Execute(GitUIBaseEventArgs gitUiCommands)
        {
            if (string.IsNullOrEmpty(gitUiCommands.GitWorkingDir))
                return false;

            using (var formGitStatistics =
                new FormGitStatistics(Settings.GetSetting("Code files"))
                    {
                        DirectoriesToIgnore =
                            Settings.GetSetting("Directories to ignore (EndsWith)")
                    })
            {

                if (Settings.GetSetting("Ignore submodules (true/false)")
                    .Equals("true", StringComparison.InvariantCultureIgnoreCase))
                {
                    foreach (var submodule in gitUiCommands.GitCommands.GetSubmodules())
                    {
                        formGitStatistics.DirectoriesToIgnore += ";";
                        formGitStatistics.DirectoriesToIgnore += gitUiCommands.GitWorkingDir + submodule.LocalPath;
                    }
                }

                formGitStatistics.DirectoriesToIgnore = formGitStatistics.DirectoriesToIgnore.Replace("/", "\\");
                formGitStatistics.WorkingDir = new DirectoryInfo(gitUiCommands.GitWorkingDir);

                formGitStatistics.ShowDialog(gitUiCommands.OwnerForm as IWin32Window);
            }
            return false;
        }
        public CreateLocalBranchesForm(GitUIBaseEventArgs gitUiCommands)
        {
            InitializeComponent();
            Translate();

            m_gitUiCommands = gitUiCommands;
        }
        public ReleaseNotesGeneratorForm(GitUIBaseEventArgs gitUiCommands)
        {
            InitializeComponent();

            _gitUiCommands = gitUiCommands;
            Icon = _gitUiCommands.GitUICommands.FormIcon;
        }
Ejemplo n.º 5
0
        private void GitUiCommandsPreBrowse(object sender, GitUIBaseEventArgs e)
        {
            //Only check at startup when plugin is enabled
            if (!Settings.GetSetting("Enabled (true / false)").Equals("true", StringComparison.InvariantCultureIgnoreCase))
                return;

            int days;
            if (!int.TryParse(Settings.GetSetting("Check every # days"), out days))
                days = 7;

            try
            {
                if (DateTime.ParseExact(
                    Settings.GetSetting("Last check (yyyy/M/dd)"),
                    "yyyy/M/dd",
                    CultureInfo.InvariantCulture).AddDays(days) >= DateTime.Now)
                    return;
            }
            catch (FormatException)
            {
            }
            finally
            {
                Settings.SetSetting("Last check (yyyy/M/dd)",
                                    DateTime.Now.ToString("yyyy/M/dd", CultureInfo.InvariantCulture));
            }

            var updateForm = new Updates(e.GitVersion) {AutoClose = true};
            updateForm.ShowDialog();
        }
        public ReleaseNotesGeneratorForm(IGitPluginSettingsContainer settings, GitUIBaseEventArgs gitUiCommands)
        {
            InitializeComponent();

            _gitUiCommands = gitUiCommands;
            Icon = _gitUiCommands.GitUICommands.FormIcon;
        }
Ejemplo n.º 7
0
        void gitUiCommands_PostRegisterPlugin(object sender, GitUIBaseEventArgs e)
        {
            if (!_initialized)
                _initialized = _phabricatorMenus.Initialize((Form)e.OwnerForm);

            _phabricatorMenus.Update(e);
        }
Ejemplo n.º 8
0
        public void Execute(GitUIBaseEventArgs gitUiCommands)
        {
            if (string.IsNullOrEmpty(gitUiCommands.GitWorkingDir))
                return;

            FormImpact form = new FormImpact();
            form.ShowDialog();
        }
Ejemplo n.º 9
0
 public override bool Execute(GitUIBaseEventArgs gitUiCommands)
 {
     using (var frm = new GitFlowForm(gitUiCommands))
     {
         frm.ShowDialog(gitUiCommands.OwnerForm);
         return frm.IsRefreshNeeded;
     }
 }
Ejemplo n.º 10
0
        public void Execute(GitUIBaseEventArgs gitUiCommands)
        {
            float threshold;
            if (!float.TryParse(Settings.GetSetting("Find large files bigger than (Mb)"), out threshold))
                threshold = 1;

            new FindLargeFilesForm(threshold, gitUiCommands).ShowDialog();
        }
        public ReleaseNotesGeneratorForm(GitUIBaseEventArgs gitUiCommands)
        {
            InitializeComponent();
            Translate();

            _gitUiCommands = gitUiCommands;
            Icon = _gitUiCommands != null ? _gitUiCommands.GitUICommands.FormIcon : null;
        }
Ejemplo n.º 12
0
 public override bool Execute(GitUIBaseEventArgs gitUiCommands)
 {
     using (var form = new ProxySwitcherForm(this, Settings, gitUiCommands))
     {
         form.ShowDialog(gitUiCommands.OwnerForm);
     }
     return false;
 }
        public void Execute(GitUIBaseEventArgs gitUiCommands)
        {
            int days;
            if (!int.TryParse(Settings.GetSetting("Delete obsolete branches older than (days)"), out days))
                days = 30;

            new DeleteUnusedBranchesForm(days, gitUiCommands.GitCommands).ShowDialog();
        }
        public ProxySwitcherForm(IGitPluginSettingsContainer settings, GitUIBaseEventArgs gitUiCommands)
        {
            InitializeComponent();

            this.Text = _pluginDescription.Text;
            this.settings = settings;
            this.gitCommands = gitUiCommands.GitModule;
        }
        public StashPullRequestForm(GitUIBaseEventArgs gitUiCommands,
            ISettingsSource settings)
        {
            InitializeComponent();

            _gitUiCommands = gitUiCommands;
            _settingsContainer = settings;
        }
Ejemplo n.º 16
0
        public FindLargeFilesForm(float threshold, GitUIBaseEventArgs gitUiEventArgs)
        {
            InitializeComponent();

            this.threshold = threshold;
            this.gitUiCommands = gitUiEventArgs;
            this.gitCommands = gitUiEventArgs.GitModule;
        }
        public bool Execute(GitUIBaseEventArgs gitUiCommands)
        {
            int days;
            if (!int.TryParse(Settings.GetSetting("Delete obsolete branches older than (days)"), out days))
                days = 30;

            new DeleteUnusedBranchesForm(days, gitUiCommands.GitCommands).ShowDialog(gitUiCommands.OwnerForm as IWin32Window);
            return true;
        }
Ejemplo n.º 18
0
        public FindLargeFilesForm(float threshold, GitUIBaseEventArgs gitUiEventArgs)
        {
            InitializeComponent();
            Translate();

            this._threshold = threshold;
            this._gitUiCommands = gitUiEventArgs;
            this._gitCommands = gitUiEventArgs != null ? gitUiEventArgs.GitModule : null;
        }
Ejemplo n.º 19
0
        public override bool Execute(GitUIBaseEventArgs gitUIEventArgs)
        {
            if (string.IsNullOrEmpty(gitUIEventArgs.GitModule.GitWorkingDir))
                return false;

            using (FormImpact form = new FormImpact(gitUIEventArgs.GitModule))
                form.ShowDialog(gitUIEventArgs.OwnerForm as IWin32Window);
            return false;
        }
Ejemplo n.º 20
0
        public bool Execute(GitUIBaseEventArgs gitUiCommands)
        {
            if (string.IsNullOrEmpty(gitUiCommands.GitWorkingDir))
                return false;

            FormImpact form = new FormImpact();
            form.ShowDialog(gitUiCommands.OwnerForm as IWin32Window);
            return false;
        }
        public override bool Execute(GitUIBaseEventArgs gitUiArgs)
        {
            using (var frm = new DeleteUnusedBranchesForm(DaysOlderThan[Settings], MergedInBranch[Settings], gitUiArgs.GitModule, gitUiArgs.GitUICommands, this))
            {
                frm.ShowDialog(gitUiArgs.OwnerForm);
            }

            return true;
        }
Ejemplo n.º 22
0
        public ProxySwitcherForm(ISettingsSource settings, GitUIBaseEventArgs gitUiCommands)
        {
            InitializeComponent();
            Translate();

            this.Text = _pluginDescription.Text;
            this.settings = settings;
            this.gitCommands = gitUiCommands.GitModule;
        }
Ejemplo n.º 23
0
        public bool Execute(GitUIBaseEventArgs gitUiCommands)
        {
            float threshold;
            if (!float.TryParse(Settings.GetSetting("Find large files bigger than (Mb)"), out threshold))
                threshold = 1;

            using (var frm = new FindLargeFilesForm(threshold, gitUiCommands)) frm.ShowDialog(gitUiCommands.OwnerForm as IWin32Window);
            return true;
        }
Ejemplo n.º 24
0
        public ProxySwitcherForm(ProxySwitcherPlugin plugin, ISettingsSource settings, GitUIBaseEventArgs gitUiCommands)
        {
            InitializeComponent();
            Translate();

            Text = _pluginDescription.Text;
            _plugin = plugin;
            _settings = settings;
            _gitCommands = gitUiCommands.GitModule;
        }
        public override bool Execute(GitUIBaseEventArgs gitUiCommands)
        {
            int days;
            if (!int.TryParse(Settings.GetSetting("Delete obsolete branches older than (days)"), out days))
                days = 30;

            string referenceBranch = Settings.GetSetting("Branch where all branches should be merged in");
            using (var frm = new DeleteUnusedBranchesForm(days, referenceBranch, gitUiCommands.GitModule)) frm.ShowDialog(gitUiCommands.OwnerForm as IWin32Window);

            return true;
        }
Ejemplo n.º 26
0
 public bool Execute(GitUIBaseEventArgs gitUiCommands)
 {
     if (GithubLoginInfo.OAuthToken.Length == 0)
     {
         new OAuth().ShowDialog(gitUiCommands.OwnerForm as IWin32Window);
     }
     else
     {
         MessageBox.Show(gitUiCommands.OwnerForm as IWin32Window, "You already have an OAuth token. To get a new one, delete your old one in Plugins > Settings first.");
     }
     return false;
 }
        public override bool Execute(GitUIBaseEventArgs gitUiCommands)
        {
            using (var form = new ReleaseNotesGeneratorForm(gitUiCommands))
            {
                if (form.ShowDialog(gitUiCommands.OwnerForm) == DialogResult.OK)
                {
                    return true;
                }
            }

            return false;
        }
Ejemplo n.º 28
0
        public GourceStart(string pathToGource, GitUIBaseEventArgs gitUiCommands, string gourceArguments)
        {
            InitializeComponent();
            PathToGource = pathToGource;
            GitUIArgs = gitUiCommands;
            GitWorkingDir = gitUiCommands.GitWorkingDir;
            AvatarsDir = gitUiCommands.GravatarCacheDir;
            GourceArguments = gourceArguments;

            WorkingDir.Text = GitWorkingDir;
            GourcePath.Text = pathToGource;
            Arguments.Text = GourceArguments;
        }
Ejemplo n.º 29
0
 public override bool Execute(GitUIBaseEventArgs gitUiCommands)
 {
     if (string.IsNullOrEmpty(GithubLoginInfo.OAuthToken))
     {
         using (var frm = new OAuth())
             frm.ShowDialog(gitUiCommands.OwnerForm);
     }
     else
     {
         MessageBox.Show(gitUiCommands.OwnerForm, "You already have an OAuth token. To get a new one, delete your old one in Plugins > Settings first.");
     }
     return false;
 }
Ejemplo n.º 30
0
        public GitFlowForm(GitUIBaseEventArgs gitUiCommands)
        {
            InitializeComponent();

            m_gitUiCommands = gitUiCommands;

            Branches = new Dictionary<string, List<string>>();

            lblPrefixManage.Text = string.Empty;
            ttGitFlow.SetToolTip(lnkGitFlow, "A good branch model for your project with Git...");

            Init();
        }