Beispiel #1
0
        public void CloneRepository(string path)
        {
            RepositoryClosed();
            TabManager.AddMainTab();
            var v = LibGitService.GetInstance().IsValidRepository(path);

            if (v != RepositoryValidation.Invalid)
            {
                TabManager.CloseAll();
                MessageBox.Show("There is already a repository", "", MessageBoxButton.OK, MessageBoxImage.Error);
                return;
            }
            var dialog = new InputDialog()
            {
                Text = "Enter clone url", Validator = text => true, Owner = Application.Current.MainWindow
            };
            var ans = dialog.ShowDialog();

            if (ans == null || ans == false)
            {
                return;
            }
            v = RepositoryManager.Clone(path, dialog.ResponseText);
            if (v != RepositoryValidation.Valid)
            {
                TabManager.CloseAll();
            }
            else
            {
                Graph.GetInstance().ResetTranslate();
            }
        }
Beispiel #2
0
 void EditCommit()
 {
     if (_conflict)
     {
         TabManager.NewConflictEditor();
     }
     else
     {
         TabManager.NewCommitEditor();
     }
 }
Beispiel #3
0
 void OpenRepository(Func <bool> func)
 {
     RepositoryClosed();
     TabManager.AddMainTab();
     if (!func())
     {
         TabManager.CloseAll();
     }
     else
     {
         Graph.GetInstance().ResetTranslate();
     }
 }
Beispiel #4
0
 public void CheckConflicts()
 {
     _conflict = LibGitService.GetInstance().IsInConflictState;
     if (_conflict)
     {
         ActionsManager.TurnConflictState();
         TabManager.TurnConflictState();
     }
     else
     {
         ActionsManager.TurnNoConflictState();
         TabManager.TurnNoConflictState();
     }
 }
Beispiel #5
0
        public void CreateRepository(string path)
        {
            RepositoryClosed();
            TabManager.AddMainTab();
            var v = RepositoryManager.Create(path);

            if (v != RepositoryValidation.Invalid)
            {
                TabManager.CloseAll();
                MessageBox.Show("There is already a repository", "", MessageBoxButton.OK, MessageBoxImage.Error);
            }
            else
            {
                Graph.GetInstance().ResetTranslate();
            }
        }
Beispiel #6
0
 void CreateManagers(ActionPanelModel localAM, ActionPanelModel remoteLeftAM, ActionPanelModel remoteRightAM)
 {
     ActionsManager = new ActionsManager();
     ActionsManager.LocalRepoPanel            = localAM;
     ActionsManager.RemoteRepoLeftGroupPanel  = remoteLeftAM;
     ActionsManager.RemoteRepoRightGroupPanel = remoteRightAM;
     TabManager = new TabManager(Data.MainWindowModel, localAM);
     TabManager.CommitRequested += Commit;
     TabManager.AbortRequested  += AbortMerge;
     TabManager.CanvasMouseDown += OnMouseDown;
     TabManager.CanvasMouseUp   += OnMouseUp;
     SubscribeActionsManager();
     CommitManager     = CommitManager.GetInstance();
     RepositoryManager = new RepositoryManager(_dataFolder);
     UserManager       = new UserManager(_dataFolder);
     StashingManager   = new StashingManager(_dataFolder);
     RemoteManager     = new RemoteManager(_dataFolder);
 }
Beispiel #7
0
 public void CloseCurrentRepository()
 {
     TabManager.CloseAll();
     RepositoryManager.CloseCurrent();
 }
Beispiel #8
0
 void OnShowChanges(CommitNodeModel m)
 {
     TabManager.NewCommitViewer(m);
 }
Beispiel #9
0
 public void Show(GraphItemModel item)
 {
     CommitManager.Mark(item);
     TabManager.ShowItem(item);
     ActionsManager.OnMarkedItem(item != null);
 }
Beispiel #10
0
 private void Commit(string message, IEnumerable <string> stagedFiles, IEnumerable <string> unstagedFiles)
 {
     CommitManager.Commit(null, message, stagedFiles, unstagedFiles);
     TabManager.CloseCommitEditorTab();
 }
Beispiel #11
0
 void RepositoryClosed()
 {
     TabManager.CloseAll();
 }