Ejemplo n.º 1
0
        public void LaunchDialog_AutoWithMinimalUI()
        {
            using(var setup = new RepositorySetup("pedro"))
            {
                Application.EnableVisualStyles();
                var dlg = new SyncDialog(setup.ProjectFolderConfig,
                                         SyncUIDialogBehaviors.StartImmediatelyAndCloseWhenFinished,
                                         SyncUIFeatures.Minimal);

                dlg.ShowDialog();
            }
        }
Ejemplo n.º 2
0
 public void LaunchDialog_BogusTarget_AdmitsError()
 {
     using(var setup = new RepositorySetup("pedro"))
     {
         Application.EnableVisualStyles();
         using (var dlg = new SyncDialog(setup.ProjectFolderConfig,
                                         SyncUIDialogBehaviors.StartImmediatelyAndCloseWhenFinished,
                                         SyncUIFeatures.Minimal))
         {
             dlg.SyncOptions.RepositorySourcesToTry.Add(RepositoryAddress.Create("bogus", @"z:/"));
             dlg.ShowDialog();
             Assert.IsTrue(dlg.FinalStatus.WarningEncountered);
         }
     }
 }
Ejemplo n.º 3
0
        public void LaunchDialog_ExampleForBob()
        {
            using(var setup = new RepositorySetup("pedro"))
            {
                Application.EnableVisualStyles();

                setup.Repository.SetKnownRepositoryAddresses(new RepositoryAddress[]
                                                                 {
                                                                     RepositoryAddress.Create("language depot", "http://*****:*****@hg-public.languagedepot.org"),
                                                                 });
                setup.Repository.SetDefaultSyncRepositoryAliases(new[] {"language depot"});

                using (var dlg = new SyncDialog(setup.ProjectFolderConfig,
                                                SyncUIDialogBehaviors.StartImmediatelyAndCloseWhenFinished,
                                                SyncUIFeatures.Minimal))
                {
                    dlg.ShowDialog();
                }
            }
        }
Ejemplo n.º 4
0
        public void CheckPointWithDialog(string dialogTitle)
        {
            if (SendReceiveDisabled)
                return; //we don't do chorus on our source tree

            try
            {
                using (var dlg = new SyncDialog(_chorusSystem.ProjectFolderConfiguration,
                                                SyncUIDialogBehaviors.StartImmediatelyAndCloseWhenFinished,
                                                SyncUIFeatures.Minimal))
                {
                    dlg.Text = dialogTitle;
                    dlg.SyncOptions.DoMergeWithOthers = false;
                    dlg.SyncOptions.DoPullFromOthers = false;
                    dlg.SyncOptions.DoSendToOthers = false;
                    dlg.SyncOptions.RepositorySourcesToTry.Clear();
                    dlg.SyncOptions.CheckinDescription = string.Format(BloomLabelForCheckins+" auto");
                    dlg.UseTargetsAsSpecifiedInSyncOptions = true;

                    dlg.ShowDialog();

                    if (dlg.FinalStatus.WarningEncountered || //not finding the backup media only counts as a warning
                        dlg.FinalStatus.ErrorEncountered)
                    {
                        ErrorReport.NotifyUserOfProblem(dlg.FinalStatus.LastException,
                                                        "There was a problem  while storing history in repository. Chorus said:\r\n\r\n" +
                                                        dlg.FinalStatus.LastWarning + "\r\n" +
                                                        dlg.FinalStatus.LastError);
                    }
                }
            }
            catch (Exception error)
            {
                Palaso.Reporting.Logger.WriteEvent("Error while storing history in repository: {0}", error.Message);
                //TODO we need some passive way indicating the health of the backup system
            }
        }
Ejemplo n.º 5
0
        public void LaunchDialog_LazyWithAdvancedUI()
        {
            using(var setup = new RepositorySetup("pedro"))
            {
                Application.EnableVisualStyles();

                using (var dlg = new SyncDialog(setup.ProjectFolderConfig,
                                                SyncUIDialogBehaviors.Lazy,
                                                SyncUIFeatures.Advanced))
                {
                    //    dlg.SyncOptions.RepositorySourcesToTry.Add(RepositoryAddress.Create("bogus", @"z:/"));
                    dlg.ShowDialog();
                }

            }
        }
Ejemplo n.º 6
0
        public void LaunchDialog_GoodForCancelTesting()
        {
            using(var setup = new RepositorySetup("pedro"))
            {
                Application.EnableVisualStyles();

                setup.Repository.SetKnownRepositoryAddresses(new RepositoryAddress[]
                                                                 {
                                                                     RepositoryAddress.Create("language depot", "http://*****:*****@hg-public.languagedepot.org/tpi"),
                                                                 });
                setup.Repository.SetDefaultSyncRepositoryAliases(new[] { "language depot" });

                using (var dlg = new SyncDialog(setup.ProjectFolderConfig,
                                                SyncUIDialogBehaviors.StartImmediately,
                                                SyncUIFeatures.NormalRecommended))
                {
                    dlg.ShowDialog();
                }
            }
        }
Ejemplo n.º 7
0
        public void ShowSyncDialog_InternetAndNetworkPaths_WindowsStyle()
        {
            Application.EnableVisualStyles();

            using (var setup = new RepositorySetup("pedro"))
            {
                setup.Repository.SetKnownRepositoryAddresses(new RepositoryAddress[]
                                                                 {
                                                                     RepositoryAddress.Create("language depot", "http://hg-public.languagedepot.org"),
                                                                     RepositoryAddress.Create("joe's mac", "\\\\suzie-pc\\public\\chorusTest")
                                                                 });

                using (var dlg = new SyncDialog(setup.ProjectFolderConfig,
                                                SyncUIDialogBehaviors.Lazy,
                                                SyncUIFeatures.NormalRecommended))
                {
                    dlg.ShowDialog();
                }
            }
        }
Ejemplo n.º 8
0
        public void MinimalCodeToLaunchSendReceiveUI()
        {
            var projectConfig = new ProjectFolderConfiguration("c:\\TokPisin");
            projectConfig.IncludePatterns.Add("*.lift");

            using (var dlg = new SyncDialog(projectConfig,
                                            SyncUIDialogBehaviors.Lazy,
                                            SyncUIFeatures.NormalRecommended))
            {
                dlg.ShowDialog();
            }
        }
Ejemplo n.º 9
0
        public void LaunchDialog_LazyWithNormalUI()
        {
            Thread.CurrentThread.SetApartmentState(ApartmentState.STA);
            using(var setup = new RepositorySetup("pedro"))
            {
                Application.EnableVisualStyles();

                using (var dlg = new SyncDialog(setup.ProjectFolderConfig,
                                                SyncUIDialogBehaviors.Lazy,
                                                SyncUIFeatures.NormalRecommended))
                {
                    dlg.ShowDialog();
                }

            }
        }