Пример #1
0
        public ViewFactoriesCollection(GuiProvider guiProvider)
        {
            Verify.Argument.IsNotNull(guiProvider, nameof(guiProvider));

            _gui           = guiProvider;
            _viewFactories = new IViewFactory[]
            {
                GitViewFactory            = new GitViewFactory(guiProvider),
                HistoryViewFactory        = new HistoryViewFactory(guiProvider),
                PathHistoryViewFactory    = new PathHistoryViewFactory(guiProvider),
                ReferencesViewFactory     = new ReferencesViewFactory(guiProvider),
                CommitViewFactory         = new CommitViewFactory(guiProvider),
                StashViewFactory          = new StashViewFactory(guiProvider),
                RemotesViewFactory        = new RemotesViewFactory(guiProvider),
                RemoteViewFactory         = new RemoteViewFactory(guiProvider),
                WorkingTreeViewFactory    = new TreeViewFactory(guiProvider),
                SubmodulesViewFactory     = new SubmodulesViewFactory(guiProvider),
                ConfigurationViewFactory  = new ConfigViewFactory(guiProvider),
                UsersViewFactory          = new ContributorsViewFactory(guiProvider),
                DiffViewFactory           = new DiffViewFactory(guiProvider),
                BlameViewFactory          = new BlameViewFactory(guiProvider),
                ContextualDiffViewFactory = new ContextualDiffViewFactory(guiProvider),
                ReflogViewFactory         = new ReflogViewFactory(guiProvider),
            };

            if (guiProvider.Repository != null)
            {
                AttachToRepository(guiProvider.Repository);
            }
        }
Пример #2
0
        public ViewFactoriesCollection(GuiProvider guiProvider)
        {
            Verify.Argument.IsNotNull(guiProvider, "guiProvider");

            _gui           = guiProvider;
            _viewFactories = new IViewFactory[]
            {
                _viewGit            = new GitViewFactory(guiProvider),
                _viewHistory        = new HistoryViewFactory(guiProvider),
                _viewPathHistory    = new PathHistoryViewFactory(guiProvider),
                _viewReferences     = new ReferencesViewFactory(guiProvider),
                _viewCommit         = new CommitViewFactory(guiProvider),
                _viewStash          = new StashViewFactory(guiProvider),
                _viewRemotes        = new RemotesViewFactory(guiProvider),
                _viewRemote         = new RemoteViewFactory(guiProvider),
                _viewTree           = new TreeViewFactory(guiProvider),
                _viewSubmodules     = new SubmodulesViewFactory(guiProvider),
                _viewConfig         = new ConfigViewFactory(guiProvider),
                _viewUsers          = new ContributorsViewFactory(guiProvider),
                _viewDiff           = new DiffViewFactory(guiProvider),
                _viewBlame          = new BlameViewFactory(guiProvider),
                _viewContextualDiff = new ContextualDiffViewFactory(guiProvider),
                _viewReflog         = new ReflogViewFactory(guiProvider),
            };

            if (guiProvider.Repository != null)
            {
                AttachToRepository(guiProvider.Repository);
            }
        }
Пример #3
0
        public RepositoryExplorer(GuiProvider guiProvider)
        {
            Verify.Argument.IsNotNull(guiProvider, "guiProvider");

            _guiProvider = guiProvider;
            _rootItem    = new RepositoryRootItem(_guiProvider.Environment)
            {
                Repository = guiProvider.Repository,
            };
            _repository = guiProvider.Repository;

            _rootItem.IsExpanded = true;
        }
Пример #4
0
        public Statusbar(GuiProvider guiProvider)
        {
            Verify.Argument.IsNotNull(guiProvider, "guiProvider");

            _guiProvider      = guiProvider;
            _leftAlignedItems = new ToolStripItem[]
            {
                new ToolStripStatusLabel(Resources.StrHead.AddColon()),
                _headLabel = new ToolStripStatusLabel(Resources.StrNoBranch),
                new ToolStripSeparator(),
                _statusLabel = new ToolStripStatusLabel(Resources.StrStatus.AddColon()),
                _statusClean = new ToolStripStatusLabel(string.Empty, ImgClean)
                {
                    Available = false
                },
                _statusUnmerged = new ToolStripStatusLabel(string.Empty, FileStatusIcons.ImgUnmerged)
                {
                    Available = false, DoubleClickEnabled = true
                },
                _statusStagedAdded = new ToolStripStatusLabel(string.Empty, FileStatusIcons.ImgStagedAdded)
                {
                    Available = false, DoubleClickEnabled = true
                },
                _statusStagedModified = new ToolStripStatusLabel(string.Empty, FileStatusIcons.ImgStagedModified)
                {
                    Available = false, DoubleClickEnabled = true
                },
                _statusStagedRemoved = new ToolStripStatusLabel(string.Empty, FileStatusIcons.ImgStagedRemoved)
                {
                    Available = false, DoubleClickEnabled = true
                },
                _statusUnstagedUntracked = new ToolStripStatusLabel(string.Empty, FileStatusIcons.ImgUnstagedUntracked)
                {
                    Available = false, DoubleClickEnabled = true
                },
                _statusUnstagedModified = new ToolStripStatusLabel(string.Empty, FileStatusIcons.ImgUnstagedModified)
                {
                    Available = false, DoubleClickEnabled = true
                },
                _statusUnstagedRemoved = new ToolStripStatusLabel(string.Empty, FileStatusIcons.ImgUnstagedRemoved)
                {
                    Available = false, DoubleClickEnabled = true
                },

                _statusRepositoryState = new ToolStripStatusLabel(string.Empty, ImgMergeInProcess)
                {
                    Available = false, DoubleClickEnabled = true
                },

                _rebaseContinue = new ToolStripButton(Resources.StrContinue, CachedResources.Bitmaps["ImgRebaseContinue"], OnRebaseContinueClick)
                {
                    Available = false
                },
                _rebaseSkip = new ToolStripButton(Resources.StrSkip, CachedResources.Bitmaps["ImgRebaseSkip"], OnRebaseSkipClick)
                {
                    Available = false
                },
                _rebaseAbort = new ToolStripButton(Resources.StrAbort, CachedResources.Bitmaps["ImgRebaseAbort"], OnRebaseAbortClick)
                {
                    Available = false
                },

                _cherryPickContinue = new ToolStripButton(Resources.StrContinue, CachedResources.Bitmaps["ImgCherryPickContinue"], OnCherryPickContinueClick)
                {
                    Available = false, ToolTipText = Resources.TipCherryPickContinue
                },
                _cherryPickQuit = new ToolStripButton(Resources.StrQuit, CachedResources.Bitmaps["ImgCherryPickQuit"], OnCherryPickQuitClick)
                {
                    Available = false, ToolTipText = Resources.TipCherryPickQuit
                },
                _cherryPickAbort = new ToolStripButton(Resources.StrAbort, CachedResources.Bitmaps["ImgCherryPickAbort"], OnCherryPickAbortClick)
                {
                    Available = false, ToolTipText = Resources.TipCherryPickAbort
                },

                _revertContinue = new ToolStripButton(Resources.StrContinue, CachedResources.Bitmaps["ImgRevertContinue"], OnRevertContinueClick)
                {
                    Available = false, ToolTipText = Resources.TipRevertContinue
                },
                _revertQuit = new ToolStripButton(Resources.StrQuit, CachedResources.Bitmaps["ImgRevertQuit"], OnRevertQuitClick)
                {
                    Available = false, ToolTipText = Resources.TipRevertQuit
                },
                _revertAbort = new ToolStripButton(Resources.StrAbort, CachedResources.Bitmaps["ImgRevertAbort"], OnRevertAbortClick)
                {
                    Available = false, ToolTipText = Resources.TipRevertAbort
                },
            };

            _statusUnmerged.DoubleClick          += OnConflictsDoubleClick;
            _statusUnstagedModified.DoubleClick  += OnUnstagedDoubleClick;
            _statusUnstagedRemoved.DoubleClick   += OnUnstagedDoubleClick;
            _statusUnstagedUntracked.DoubleClick += OnUnstagedDoubleClick;

            _rightAlignedItems = new[]
            {
                _userLabel   = new ToolStripStatusLabel(string.Empty, null),
                _remoteLabel = new ToolStripStatusLabel(string.Empty, CachedResources.Bitmaps["ImgRemote"]),
            };

            _userLabel.MouseDown   += OnUserLabelMouseDown;
            _remoteLabel.MouseDown += OnRemoteLabelMouseDown;

            if (guiProvider.Repository != null)
            {
                AttachToRepository(guiProvider.Repository);
            }

            _statusToolTip                  = new StatusToolTip();
            _statusUnmergedToolTip          = new FileListToolTip();
            _statusStagedAddedToolTip       = new FileListToolTip();
            _statusStagedModifiedToolTip    = new FileListToolTip();
            _statusStagedRemovedToolTip     = new FileListToolTip();
            _statusUnstagedUntrackedToolTip = new FileListToolTip();
            _statusUnstagedModifiedToolTip  = new FileListToolTip();
            _statusUnstagedRemovedToolTip   = new FileListToolTip();

            SetToolTips();

            _headLabel.DoubleClickEnabled = true;
            _headLabel.DoubleClick       += OnHeadLabelDoubleClick;
            _headLabel.MouseDown         += OnHeadLabelMouseDown;

            _userLabel.DoubleClickEnabled = true;
            _userLabel.DoubleClick       += OnUserDoubleClick;
        }
Пример #5
0
        public GitToolbar(GuiProvider guiProvider)
        {
            Verify.Argument.IsNotNull(guiProvider, nameof(guiProvider));

            _guiProvider = guiProvider;

            Text = Resources.StrGit;

            const TextImageRelation         tir = TextImageRelation.ImageAboveText;
            const ToolStripItemDisplayStyle ds  = ToolStripItemDisplayStyle.ImageAndText;

            Items.AddRange(new ToolStripItem[]
            {
                _fetchButton = new ToolStripSplitButton(Resources.StrFetch, CachedResources.Bitmaps["ImgFetch"])
                {
                    TextImageRelation = tir, DisplayStyle = ds, ToolTipText = Resources.TipFetch
                },
                _pullButton = new ToolStripSplitButton(Resources.StrPull, CachedResources.Bitmaps["ImgPull"])
                {
                    TextImageRelation = tir, DisplayStyle = ds, ToolTipText = Resources.TipPull
                },
                _pushButton = new ToolStripButton(Resources.StrPush, CachedResources.Bitmaps["ImgPush"])
                {
                    TextImageRelation = tir, DisplayStyle = ds, ToolTipText = Resources.TipPush
                },
                new ToolStripSeparator(),
                _historyButton = new ToolStripButton(Resources.StrHistory, CachedResources.Bitmaps["ImgHistory"], OnHistoryClick)
                {
                    TextImageRelation = tir, DisplayStyle = ds, ToolTipText = Resources.TipHistory
                },
                new ToolStripSeparator(),
                _commitButton = new ToolStripButton(Resources.StrCommit, CachedResources.Bitmaps["ImgCommit"], OnCommitClick)
                {
                    TextImageRelation = tir, DisplayStyle = ds, ToolTipText = Resources.TipCommit
                },
                _applyPatchButton = new ToolStripButton(Resources.StrPatch, CachedResources.Bitmaps["ImgPatchApply"], OnApplyPatchClick)
                {
                    TextImageRelation = tir, DisplayStyle = ds, ToolTipText = Resources.TipApplyPatches
                },
                _stashButton = new ToolStripSplitButton(Resources.StrStash, CachedResources.Bitmaps["ImgStash"])
                {
                    TextImageRelation = tir, DisplayStyle = ds, ToolTipText = Resources.TipStash
                },
                _cleanButton = new ToolStripButton(Resources.StrClean, CachedResources.Bitmaps["ImgClean"], OnCleanClick)
                {
                    TextImageRelation = tir, DisplayStyle = ds, ToolTipText = Resources.TipClean
                },
                new ToolStripSeparator(),
                _checkoutButton = new ToolStripButton(Resources.StrCheckout, CachedResources.Bitmaps["ImgCheckout"], OnCheckoutClick)
                {
                    TextImageRelation = tir, DisplayStyle = ds, ToolTipText = Resources.TipCheckoutBranch
                },
                _branchButton = new ToolStripButton(Resources.StrBranch, CachedResources.Bitmaps["ImgBranch"], OnBranchClick)
                {
                    TextImageRelation = tir, DisplayStyle = ds, ToolTipText = Resources.TipCreateBranch
                },
                _mergeButton = new ToolStripSplitButton(Resources.StrMerge, CachedResources.Bitmaps["ImgMerge"])
                {
                    TextImageRelation = tir, DisplayStyle = ds, ToolTipText = Resources.TipMerge
                },
                new ToolStripSeparator(),
                _tagButton = new ToolStripButton(Resources.StrTag, CachedResources.Bitmaps["ImgTag"], OnTagClick)
                {
                    TextImageRelation = tir, DisplayStyle = ds, ToolTipText = Resources.TipCreateTag
                },
                _noteButton = new ToolStripButton(Resources.StrNote, CachedResources.Bitmaps["ImgNote"], OnNoteClick)
                {
                    TextImageRelation = tir, DisplayStyle = ds, Available = false                               /* GitFeatures.AdvancedNotesCommands.IsAvailable */
                },
            });

            _fetchButton.ButtonClick += OnFetchClick;
            _pullButton.ButtonClick  += OnPullClick;
            _pushButton.Click        += OnPushClick;

            _mergeButton.ButtonClick += OnMergeClick;

            _mergeButton.DropDown.Items.Add(
                _mergeMultipleItem = new ToolStripMenuItem(Resources.StrMergeMultipleBranches, null, OnMultipleMergeClick));

            _stashButton.ButtonClick += OnStashClick;
            _stashButton.DropDown.Items.Add(
                _stashPopItem = new ToolStripMenuItem(Resources.StrSave, CachedResources.Bitmaps["ImgStashSave"], OnStashSaveClick));
            _stashButton.DropDown.Items.Add(
                _stashPopItem = new ToolStripMenuItem(Resources.StrPop, CachedResources.Bitmaps["ImgStashPop"], OnStashPopClick));
            _stashButton.DropDown.Items.Add(
                _stashApplyItem = new ToolStripMenuItem(Resources.StrApply, CachedResources.Bitmaps["ImgStashApply"], OnStashApplyClick));

            if (guiProvider.Repository != null)
            {
                AttachToRepository(guiProvider.Repository);
            }
        }
Пример #6
0
        public MainGitMenus(GuiProvider guiProvider)
        {
            Verify.Argument.IsNotNull(guiProvider, "guiProvider");

            _guiProvider = guiProvider;

            var repository = guiProvider.Repository;

            _menus = new ToolStripMenuItem[]
            {
                _gitMenu = new ToolStripMenuItem(
                    Resources.StrGit),
            };

            //_gitMenu.DropDownItems.Add(new ToolStripMenuItem(
            //    Resources.StrCheckout.AddEllipsis(), CachedResources.Bitmaps["ImgCheckout"], OnCheckoutClick));
            //_gitMenu.DropDownItems.Add(new ToolStripMenuItem(
            //    Resources.StrAddRemote.AddEllipsis(), CachedResources.Bitmaps["ImgRemoteAdd"], OnAddRemoteClick));
            _gitMenu.DropDownItems.Add(new ToolStripMenuItem(
                                           Resources.StrCreateBranch.AddEllipsis(), CachedResources.Bitmaps["ImgBranchAdd"], OnCreateBranchClick)
            {
                ShortcutKeys = Keys.Control | Keys.B,
            });
            _gitMenu.DropDownItems.Add(new ToolStripMenuItem(
                                           Resources.StrCreateTag.AddEllipsis(), CachedResources.Bitmaps["ImgTagAdd"], OnCreateTagClick)
            {
                ShortcutKeys = Keys.Control | Keys.T,
            });

            _gitMenu.DropDownItems.Add(new ToolStripSeparator());

            _gitMenu.DropDownItems.Add(
                new ToolStripMenuItem(Resources.StrlGui, CachedResources.Bitmaps["ImgGit"], OnGitGuiClick)
            {
                ShortcutKeys = Keys.F5,
            });
            _gitMenu.DropDownItems.Add(
                new ToolStripMenuItem(Resources.StrlGitk, CachedResources.Bitmaps["ImgGit"], OnGitGitkClick)
            {
                Enabled      = StandardTools.CanStartGitk,
                ShortcutKeys = Keys.F6,
            });
            _gitMenu.DropDownItems.Add(
                new ToolStripMenuItem(Resources.StrlBash, CachedResources.Bitmaps["ImgTerminal"], OnGitBashClick)
            {
                Enabled      = StandardTools.CanStartBash,
                ShortcutKeys = Keys.F7,
            });
            _gitMenu.DropDownItems.Add(
                new ToolStripMenuItem(Resources.StrlCmd, CachedResources.Bitmaps["ImgTerminal"], OnCmdClick)
            {
                ShortcutKeys = Keys.F8,
            });

            _viewMenuItems = new List <ToolStripMenuItem>();
            foreach (var factory in Gui.ViewFactories)
            {
                if (factory.IsSingleton)
                {
                    var item = new ToolStripMenuItem(factory.Name, factory.Image, OnShowViewItemClick)
                    {
                        Tag = factory.Guid
                    };
                    _viewMenuItems.Add(item);
                }
            }

            if (repository != null)
            {
                AttachToRepository(repository);
            }
        }
Пример #7
0
        public MainGitMenus(GuiProvider guiProvider)
        {
            Verify.Argument.IsNotNull(guiProvider, "guiProvider");

            _guiProvider = guiProvider;

            var repository = guiProvider.Repository;

            _menus = new ToolStripMenuItem[]
            {
                _gitMenu = new ToolStripMenuItem(
                    Resources.StrGit),
            };

            //_gitMenu.DropDownItems.Add(new ToolStripMenuItem(
            //    Resources.StrCheckout.AddEllipsis(), CachedResources.Bitmaps["ImgCheckout"], OnCheckoutClick));
            //_gitMenu.DropDownItems.Add(new ToolStripMenuItem(
            //    Resources.StrAddRemote.AddEllipsis(), CachedResources.Bitmaps["ImgRemoteAdd"], OnAddRemoteClick));
            _gitMenu.DropDownItems.Add(new ToolStripMenuItem(
                Resources.StrCreateBranch.AddEllipsis(), CachedResources.Bitmaps["ImgBranchAdd"], OnCreateBranchClick)
                {
                    ShortcutKeys = Keys.Control | Keys.B,
                });
            _gitMenu.DropDownItems.Add(new ToolStripMenuItem(
                Resources.StrCreateTag.AddEllipsis(), CachedResources.Bitmaps["ImgTagAdd"], OnCreateTagClick)
                {
                    ShortcutKeys = Keys.Control | Keys.T,
                });

            _gitMenu.DropDownItems.Add(new ToolStripSeparator());

            _gitMenu.DropDownItems.Add(
                new ToolStripMenuItem(Resources.StrlGui, CachedResources.Bitmaps["ImgGit"], OnGitGuiClick)
                {
                    ShortcutKeys = Keys.F5,
                });
            _gitMenu.DropDownItems.Add(
                new ToolStripMenuItem(Resources.StrlGitk, CachedResources.Bitmaps["ImgGit"], OnGitGitkClick)
                {
                    Enabled = StandardTools.CanStartGitk,
                    ShortcutKeys = Keys.F6,
                });
            _gitMenu.DropDownItems.Add(
                new ToolStripMenuItem(Resources.StrlBash, CachedResources.Bitmaps["ImgTerminal"], OnGitBashClick)
                {
                    Enabled = StandardTools.CanStartBash,
                    ShortcutKeys = Keys.F7,
                });
            _gitMenu.DropDownItems.Add(
                new ToolStripMenuItem(Resources.StrlCmd, CachedResources.Bitmaps["ImgTerminal"], OnCmdClick)
                {
                    ShortcutKeys = Keys.F8,
                });

            _viewMenuItems = new List<ToolStripMenuItem>();
            foreach(var factory in Gui.ViewFactories)
            {
                if(factory.IsSingleton)
                {
                    var item = new ToolStripMenuItem(factory.Name, factory.Image, OnShowViewItemClick) { Tag = factory.Guid };
                    _viewMenuItems.Add(item);
                }
            }

            if(repository != null)
            {
                AttachToRepository(repository);
            }
        }
Пример #8
0
        public Statusbar(GuiProvider guiProvider)
        {
            Verify.Argument.IsNotNull(guiProvider, "guiProvider");

            _guiProvider = guiProvider;
            _leftAlignedItems = new ToolStripItem[]
            {
                new ToolStripStatusLabel(Resources.StrHead.AddColon()),
                _headLabel = new ToolStripStatusLabel(Resources.StrNoBranch),
                new ToolStripSeparator(),
                _statusLabel = new ToolStripStatusLabel(Resources.StrStatus.AddColon()),
                _statusClean = new ToolStripStatusLabel(string.Empty, ImgClean)
                    { Available = false },
                _statusUnmerged = new ToolStripStatusLabel(string.Empty, FileStatusIcons.ImgUnmerged)
                    { Available = false, DoubleClickEnabled = true },
                _statusStagedAdded = new ToolStripStatusLabel(string.Empty, FileStatusIcons.ImgStagedAdded)
                    { Available = false, DoubleClickEnabled = true },
                _statusStagedModified = new ToolStripStatusLabel(string.Empty, FileStatusIcons.ImgStagedModified)
                    { Available = false, DoubleClickEnabled = true },
                _statusStagedRemoved = new ToolStripStatusLabel(string.Empty, FileStatusIcons.ImgStagedRemoved)
                    { Available = false, DoubleClickEnabled = true },
                _statusUnstagedUntracked = new ToolStripStatusLabel(string.Empty, FileStatusIcons.ImgUnstagedUntracked)
                    { Available = false, DoubleClickEnabled = true },
                _statusUnstagedModified = new ToolStripStatusLabel(string.Empty, FileStatusIcons.ImgUnstagedModified)
                    { Available = false, DoubleClickEnabled = true },
                _statusUnstagedRemoved = new ToolStripStatusLabel(string.Empty, FileStatusIcons.ImgUnstagedRemoved)
                    { Available = false, DoubleClickEnabled = true },

                _statusRepositoryState = new ToolStripStatusLabel(string.Empty, ImgMergeInProcess)
                    { Available = false, DoubleClickEnabled = true },

                _rebaseContinue = new ToolStripButton(Resources.StrContinue, CachedResources.Bitmaps["ImgRebaseContinue"], OnRebaseContinueClick)
                    { Available = false },
                _rebaseSkip = new ToolStripButton(Resources.StrSkip, CachedResources.Bitmaps["ImgRebaseSkip"], OnRebaseSkipClick)
                    { Available = false },
                _rebaseAbort = new ToolStripButton(Resources.StrAbort, CachedResources.Bitmaps["ImgRebaseAbort"], OnRebaseAbortClick)
                    { Available = false },

                _cherryPickContinue = new ToolStripButton(Resources.StrContinue, CachedResources.Bitmaps["ImgCherryPickContinue"], OnCherryPickContinueClick)
                    { Available = false, ToolTipText = Resources.TipCherryPickContinue },
                _cherryPickQuit = new ToolStripButton(Resources.StrQuit, CachedResources.Bitmaps["ImgCherryPickQuit"], OnCherryPickQuitClick)
                    { Available = false, ToolTipText = Resources.TipCherryPickQuit },
                _cherryPickAbort = new ToolStripButton(Resources.StrAbort, CachedResources.Bitmaps["ImgCherryPickAbort"], OnCherryPickAbortClick)
                    { Available = false, ToolTipText = Resources.TipCherryPickAbort },

                _revertContinue = new ToolStripButton(Resources.StrContinue, CachedResources.Bitmaps["ImgRevertContinue"], OnRevertContinueClick)
                    { Available = false, ToolTipText = Resources.TipRevertContinue },
                _revertQuit = new ToolStripButton(Resources.StrQuit, CachedResources.Bitmaps["ImgRevertQuit"], OnRevertQuitClick)
                    { Available = false, ToolTipText = Resources.TipRevertQuit },
                _revertAbort = new ToolStripButton(Resources.StrAbort, CachedResources.Bitmaps["ImgRevertAbort"], OnRevertAbortClick)
                    { Available = false, ToolTipText = Resources.TipRevertAbort },
            };

            _statusUnmerged.DoubleClick				+= OnConflictsDoubleClick;
            _statusUnstagedModified.DoubleClick		+= OnUnstagedDoubleClick;
            _statusUnstagedRemoved.DoubleClick		+= OnUnstagedDoubleClick;
            _statusUnstagedUntracked.DoubleClick	+= OnUnstagedDoubleClick;

            _rightAlignedItems = new[]
            {
                _userLabel = new ToolStripStatusLabel(string.Empty, null),
                _remoteLabel = new ToolStripStatusLabel(string.Empty, CachedResources.Bitmaps["ImgRemote"]),
            };

            _userLabel.MouseDown += OnUserLabelMouseDown;
            _remoteLabel.MouseDown += OnRemoteLabelMouseDown;

            if(guiProvider.Repository != null)
            {
                AttachToRepository(guiProvider.Repository);
            }

            _statusToolTip					= new StatusToolTip();
            _statusUnmergedToolTip			= new FileListToolTip();
            _statusStagedAddedToolTip		= new FileListToolTip();
            _statusStagedModifiedToolTip	= new FileListToolTip();
            _statusStagedRemovedToolTip		= new FileListToolTip();
            _statusUnstagedUntrackedToolTip	= new FileListToolTip();
            _statusUnstagedModifiedToolTip	= new FileListToolTip();
            _statusUnstagedRemovedToolTip	= new FileListToolTip();

            SetToolTips();

            _headLabel.DoubleClickEnabled = true;
            _headLabel.DoubleClick += OnHeadLabelDoubleClick;
            _headLabel.MouseDown += OnHeadLabelMouseDown;

            _userLabel.DoubleClickEnabled = true;
            _userLabel.DoubleClick += OnUserDoubleClick;
        }
Пример #9
0
        public Notifications(GuiProvider guiProvider)
        {
            Verify.Argument.IsNotNull(guiProvider, nameof(guiProvider));

            _guiProvider = guiProvider;
        }
Пример #10
0
        public Notifications(GuiProvider guiProvider)
        {
            Verify.Argument.IsNotNull(guiProvider, "guiProvider");

            _guiProvider = guiProvider;
        }
Пример #11
0
        public GitToolbar(GuiProvider guiProvider)
        {
            Verify.Argument.IsNotNull(guiProvider, "guiProvider");

            _guiProvider = guiProvider;

            Text = Resources.StrGit;

            const TextImageRelation tir = TextImageRelation.ImageAboveText;
            const ToolStripItemDisplayStyle ds = ToolStripItemDisplayStyle.ImageAndText;

            Items.AddRange(new ToolStripItem[]
                {
                    _fetchButton = new ToolStripSplitButton(Resources.StrFetch, CachedResources.Bitmaps["ImgFetch"])
                        { TextImageRelation = tir, DisplayStyle = ds, ToolTipText = Resources.TipFetch },
                    _pullButton = new ToolStripSplitButton(Resources.StrPull, CachedResources.Bitmaps["ImgPull"])
                        { TextImageRelation = tir, DisplayStyle = ds, ToolTipText = Resources.TipPull },
                    _pushButton = new ToolStripButton(Resources.StrPush, CachedResources.Bitmaps["ImgPush"])
                        { TextImageRelation = tir, DisplayStyle = ds, ToolTipText = Resources.TipPush },
                    new ToolStripSeparator(),
                    _historyButton = new ToolStripButton(Resources.StrHistory, CachedResources.Bitmaps["ImgHistory"], OnHistoryClick)
                        { TextImageRelation = tir, DisplayStyle = ds, ToolTipText = Resources.TipHistory },
                    new ToolStripSeparator(),
                    _commitButton = new ToolStripButton(Resources.StrCommit, CachedResources.Bitmaps["ImgCommit"], OnCommitClick)
                        { TextImageRelation = tir, DisplayStyle = ds, ToolTipText = Resources.TipCommit },
                    _applyPatchButton = new ToolStripButton(Resources.StrPatch, CachedResources.Bitmaps["ImgPatchApply"], OnApplyPatchClick)
                        { TextImageRelation = tir, DisplayStyle = ds, ToolTipText = Resources.TipApplyPatches },
                    _stashButton = new ToolStripSplitButton(Resources.StrStash, CachedResources.Bitmaps["ImgStash"])
                        { TextImageRelation = tir, DisplayStyle = ds, ToolTipText = Resources.TipStash },
                    _cleanButton = new ToolStripButton(Resources.StrClean, CachedResources.Bitmaps["ImgClean"], OnCleanClick)
                        { TextImageRelation = tir, DisplayStyle = ds, ToolTipText = Resources.TipClean },
                    new ToolStripSeparator(),
                    _checkoutButton = new ToolStripButton(Resources.StrCheckout, CachedResources.Bitmaps["ImgCheckout"], OnCheckoutClick)
                        { TextImageRelation = tir, DisplayStyle = ds, ToolTipText = Resources.TipCheckoutBranch },
                    _branchButton = new ToolStripButton(Resources.StrBranch, CachedResources.Bitmaps["ImgBranch"], OnBranchClick)
                        { TextImageRelation = tir, DisplayStyle = ds, ToolTipText = Resources.TipCreateBranch },
                    _mergeButton = new ToolStripSplitButton(Resources.StrMerge, CachedResources.Bitmaps["ImgMerge"])
                        { TextImageRelation = tir, DisplayStyle = ds, ToolTipText = Resources.TipMerge },
                    new ToolStripSeparator(),
                    _tagButton = new ToolStripButton(Resources.StrTag, CachedResources.Bitmaps["ImgTag"], OnTagClick)
                        { TextImageRelation = tir, DisplayStyle = ds, ToolTipText = Resources.TipCreateTag },
                    _noteButton = new ToolStripButton(Resources.StrNote, CachedResources.Bitmaps["ImgNote"], OnNoteClick)
                        { TextImageRelation = tir, DisplayStyle = ds, Available = false /* GitFeatures.AdvancedNotesCommands.IsAvailable */ },
                });

            _fetchButton.ButtonClick += OnFetchClick;
            _pullButton.ButtonClick += OnPullClick;
            _pushButton.Click += OnPushClick;

            _mergeButton.ButtonClick += OnMergeClick;

            _mergeButton.DropDown.Items.Add(
                _mergeMultipleItem = new ToolStripMenuItem(Resources.StrMergeMultipleBranches, null, OnMultipleMergeClick));

            _stashButton.ButtonClick += OnStashClick;
            _stashButton.DropDown.Items.Add(
                _stashPopItem = new ToolStripMenuItem(Resources.StrSave, CachedResources.Bitmaps["ImgStashSave"], OnStashSaveClick));
            _stashButton.DropDown.Items.Add(
                _stashPopItem = new ToolStripMenuItem(Resources.StrPop, CachedResources.Bitmaps["ImgStashPop"], OnStashPopClick));
            _stashButton.DropDown.Items.Add(
                _stashApplyItem = new ToolStripMenuItem(Resources.StrApply, CachedResources.Bitmaps["ImgStashApply"], OnStashApplyClick));

            if(guiProvider.Repository != null)
            {
                AttachToRepository(guiProvider.Repository);
            }
        }