public ScheduleWindow(bool InEnabled, LatestChangeType InChange, TimeSpan InTime, bool AnyOpenProject, IEnumerable <UserSelectedProjectSettings> ScheduledProjects, IEnumerable <UserSelectedProjectSettings> OpenProjects)
        {
            InitializeComponent();

            EnableCheckBox.Checked       = InEnabled;
            ChangeComboBox.SelectedIndex = (int)InChange;

            DateTime CurrentTime = DateTime.Now;

            TimePicker.CustomFormat = CultureInfo.CurrentCulture.DateTimeFormat.ShortTimePattern;
            TimePicker.Value        = new DateTime(CurrentTime.Year, CurrentTime.Month, CurrentTime.Day, InTime.Hours, InTime.Minutes, InTime.Seconds);

            ProjectListBox.Items.Add("Any open projects", AnyOpenProject);

            Dictionary <string, UserSelectedProjectSettings> LocalFileToProject = new Dictionary <string, UserSelectedProjectSettings>(StringComparer.InvariantCultureIgnoreCase);

            AddProjects(ScheduledProjects, LocalFileToProject);
            AddProjects(OpenProjects, LocalFileToProject);

            foreach (UserSelectedProjectSettings Project in LocalFileToProject.Values.OrderBy(x => x.ToString()))
            {
                bool Enabled = ScheduledProjects.Any(x => x.LocalPath == Project.LocalPath);
                ProjectListBox.Items.Add(Project, Enabled);
            }

            UpdateEnabledControls();
        }
		public ScheduleWindow(bool InEnabled, LatestChangeType InChange, TimeSpan InTime)
		{
			InitializeComponent();

			EnableCheckBox.Checked = InEnabled;
			ChangeComboBox.SelectedIndex = (int)InChange;

			DateTime CurrentTime = DateTime.Now;
			TimePicker.Value = new DateTime(CurrentTime.Year, CurrentTime.Month, CurrentTime.Day, InTime.Hours, InTime.Minutes, InTime.Seconds);

			UpdateEnabledControls();
		}
예제 #3
0
        public ScheduleWindow(bool InEnabled, LatestChangeType InChange, TimeSpan InTime)
        {
            InitializeComponent();

            EnableCheckBox.Checked       = InEnabled;
            ChangeComboBox.SelectedIndex = (int)InChange;

            DateTime CurrentTime = DateTime.Now;

            TimePicker.Value = new DateTime(CurrentTime.Year, CurrentTime.Month, CurrentTime.Day, InTime.Hours, InTime.Minutes, InTime.Seconds);

            UpdateEnabledControls();
        }
        public void CopySettings(out bool OutEnabled, out LatestChangeType OutChange, out TimeSpan OutTime, out bool OutAnyOpenProject, out List <UserSelectedProjectSettings> OutScheduledProjects)
        {
            OutEnabled = EnableCheckBox.Checked;
            OutChange  = (LatestChangeType)ChangeComboBox.SelectedIndex;
            OutTime    = TimePicker.Value.TimeOfDay;

            OutAnyOpenProject = false;

            List <UserSelectedProjectSettings> ScheduledProjects = new List <UserSelectedProjectSettings>();

            foreach (int Index in ProjectListBox.CheckedIndices)
            {
                if (Index == 0)
                {
                    OutAnyOpenProject = true;
                }
                else
                {
                    ScheduledProjects.Add((UserSelectedProjectSettings)ProjectListBox.Items[Index]);
                }
            }
            OutScheduledProjects = ScheduledProjects;
        }
        public UserSettings(string InFileName)
        {
            FileName = InFileName;
            if (File.Exists(FileName))
            {
                ConfigFile.Load(FileName);
            }

            // General settings
            Version                = (UserSettingsVersion)ConfigFile.GetValue("General.Version", (int)UserSettingsVersion.Initial);
            bBuildAfterSync        = (ConfigFile.GetValue("General.BuildAfterSync", "1") != "0");
            bRunAfterSync          = (ConfigFile.GetValue("General.RunAfterSync", "1") != "0");
            bSyncPrecompiledEditor = (ConfigFile.GetValue("General.SyncPrecompiledEditor", "0") != "0");
            bOpenSolutionAfterSync = (ConfigFile.GetValue("General.OpenSolutionAfterSync", "0") != "0");
            bShowLogWindow         = (ConfigFile.GetValue("General.ShowLogWindow", false));
            bAutoResolveConflicts  = (ConfigFile.GetValue("General.AutoResolveConflicts", "1") != "0");
            bUseIncrementalBuilds  = ConfigFile.GetValue("General.IncrementalBuilds", true);
            bShowUnreviewedChanges = ConfigFile.GetValue("General.ShowUnreviewed", true);
            bShowAutomatedChanges  = ConfigFile.GetValue("General.ShowAutomated", false);
            bShowLocalTimes        = ConfigFile.GetValue("General.ShowLocalTimes", false);
            bKeepInTray            = ConfigFile.GetValue("General.KeepInTray", true);
            int.TryParse(ConfigFile.GetValue("General.FilterIndex", "0"), out FilterIndex);

            string LastProjectString = ConfigFile.GetValue("General.LastProject", null);

            if (LastProjectString != null)
            {
                UserSelectedProjectSettings.TryParseConfigEntry(LastProjectString, out LastProject);
            }
            else
            {
                string LastProjectFileName = ConfigFile.GetValue("General.LastProjectFileName", null);
                if (LastProjectFileName != null)
                {
                    LastProject = new UserSelectedProjectSettings(null, null, UserSelectedProjectType.Local, null, LastProjectFileName);
                }
            }

            OpenProjects   = ReadProjectList("General.OpenProjects", "General.OpenProjectFileNames");
            RecentProjects = ReadProjectList("General.RecentProjects", "General.OtherProjectFileNames");

            SyncView = ConfigFile.GetValues("General.SyncFilter", new string[0]);
            SyncExcludedCategories        = ConfigFile.GetGuidValues("General.SyncExcludedCategories", new Guid[0]);
            bSyncAllProjects              = ConfigFile.GetValue("General.SyncAllProjects", false);
            bIncludeAllProjectsInSolution = ConfigFile.GetValue("General.IncludeAllProjectsInSolution", false);
            if (!Enum.TryParse(ConfigFile.GetValue("General.SyncType", ""), out SyncType))
            {
                SyncType = LatestChangeType.Good;
            }

            // Build configuration
            string CompiledEditorBuildConfigName = ConfigFile.GetValue("General.BuildConfig", "");

            if (!Enum.TryParse(CompiledEditorBuildConfigName, true, out CompiledEditorBuildConfig))
            {
                CompiledEditorBuildConfig = BuildConfig.DebugGame;
            }

            // Tab names
            string TabLabelsValue = ConfigFile.GetValue("General.TabLabels", "");

            if (!Enum.TryParse(TabLabelsValue, true, out TabLabels))
            {
                TabLabels = TabLabels.Stream;
            }

            // Editor arguments
            string[] Arguments = ConfigFile.GetValues("General.EditorArguments", new string[] { "0:-log", "0:-fastload" });
            foreach (string Argument in Arguments)
            {
                if (Argument.StartsWith("0:"))
                {
                    EditorArguments.Add(new Tuple <string, bool>(Argument.Substring(2), false));
                }
                else if (Argument.StartsWith("1:"))
                {
                    EditorArguments.Add(new Tuple <string, bool>(Argument.Substring(2), true));
                }
                else
                {
                    EditorArguments.Add(new Tuple <string, bool>(Argument, true));
                }
            }
            bEditorArgumentsPrompt = ConfigFile.GetValue("General.EditorArgumentsPrompt", false);

            // Window settings
            bWindowVisible = ConfigFile.GetValue("Window.Visible", true);
            if (!Enum.TryParse(ConfigFile.GetValue("Window.State", ""), true, out WindowState))
            {
                WindowState = FormWindowState.Normal;
            }
            WindowBounds = ParseRectangleValue(ConfigFile.GetValue("Window.Bounds", ""));

            // Schedule settings
            bScheduleEnabled = ConfigFile.GetValue("Schedule.Enabled", false);
            if (!TimeSpan.TryParse(ConfigFile.GetValue("Schedule.Time", ""), out ScheduleTime))
            {
                ScheduleTime = new TimeSpan(6, 0, 0);
            }
            if (!Enum.TryParse(ConfigFile.GetValue("Schedule.Change", ""), out ScheduleChange))
            {
                ScheduleChange = LatestChangeType.Good;
            }
            ScheduleAnyOpenProject = ConfigFile.GetValue("Schedule.AnyOpenProject", true);
            ScheduleProjects       = ReadProjectList("Schedule.Projects", "Schedule.ProjectFileNames");

            // Notification settings
            NotifyUnassignedMinutes     = ConfigFile.GetValue("Notifications.NotifyUnassignedMinutes", -1);
            NotifyUnacknowledgedMinutes = ConfigFile.GetValue("Notifications.NotifyUnacknowledgedMinutes", -1);
            NotifyUnresolvedMinutes     = ConfigFile.GetValue("Notifications.NotifyUnresolvedMinutes", -1);

            // Perforce settings
            if (!int.TryParse(ConfigFile.GetValue("Perforce.NumRetries", "0"), out SyncOptions.NumRetries))
            {
                SyncOptions.NumRetries = 0;
            }
            if (!int.TryParse(ConfigFile.GetValue("Perforce.NumThreads", "0"), out SyncOptions.NumThreads))
            {
                SyncOptions.NumThreads = 0;
            }
            if (!int.TryParse(ConfigFile.GetValue("Perforce.TcpBufferSize", "0"), out SyncOptions.TcpBufferSize))
            {
                SyncOptions.TcpBufferSize = 0;
            }
        }
예제 #6
0
		public UserSettings(string InFileName)
		{
			FileName = InFileName;
			if(File.Exists(FileName))
			{
				ConfigFile.Load(FileName);
			}

			// General settings
			bBuildAfterSync = (ConfigFile.GetValue("General.BuildAfterSync", "1") != "0");
			bRunAfterSync = (ConfigFile.GetValue("General.RunAfterSync", "1") != "0");
			bSyncPrecompiledEditor = (ConfigFile.GetValue("General.SyncPrecompiledEditor", "0") != "0");
			bOpenSolutionAfterSync = (ConfigFile.GetValue("General.OpenSolutionAfterSync", "0") != "0");
			bShowLogWindow = (ConfigFile.GetValue("General.ShowLogWindow", false));
			bAutoResolveConflicts = (ConfigFile.GetValue("General.AutoResolveConflicts", "1") != "0");
			bUseIncrementalBuilds = ConfigFile.GetValue("General.IncrementalBuilds", true);
			bShowLocalTimes = ConfigFile.GetValue("General.ShowLocalTimes", false);
			bKeepInTray = ConfigFile.GetValue("General.KeepInTray", true);
			LastProjectFileName = ConfigFile.GetValue("General.LastProjectFileName", null);
			OtherProjectFileNames = ConfigFile.GetValues("General.OtherProjectFileNames", new string[0]);
			SyncFilter = ConfigFile.GetValues("General.SyncFilter", new string[0]);
			if(!Enum.TryParse(ConfigFile.GetValue("General.SyncType", ""), out SyncType))
			{
				SyncType = LatestChangeType.Good;
			}

			// Build configuration
			string CompiledEditorBuildConfigName = ConfigFile.GetValue("General.BuildConfig", "");
			if(!Enum.TryParse(CompiledEditorBuildConfigName, true, out CompiledEditorBuildConfig))
			{
				CompiledEditorBuildConfig = BuildConfig.DebugGame;
			}

			// Editor arguments
			string[] Arguments = ConfigFile.GetValues("General.EditorArguments", new string[]{ "0:-log", "0:-fastload" });
			foreach(string Argument in Arguments)
			{
				if(Argument.StartsWith("0:"))
				{
					EditorArguments.Add(new Tuple<string,bool>(Argument.Substring(2), false));
				}
				else if(Argument.StartsWith("1:"))
				{
					EditorArguments.Add(new Tuple<string,bool>(Argument.Substring(2), true));
				}
				else
				{
					EditorArguments.Add(new Tuple<string,bool>(Argument, true));
				}
			}

			// Window settings
			ConfigSection WindowSection = ConfigFile.FindSection("Window");
			if(WindowSection != null)
			{
				bHasWindowSettings = true;

				int X = WindowSection.GetValue("X", -1);
				int Y = WindowSection.GetValue("Y", -1);
				int Width = WindowSection.GetValue("Width", -1);
				int Height = WindowSection.GetValue("Height", -1);
				WindowRectangle = new Rectangle(X, Y, Width, Height);

				ConfigObject ColumnWidthObject = new ConfigObject(WindowSection.GetValue("ColumnWidths", ""));
				foreach(KeyValuePair<string, string> ColumnWidthPair in ColumnWidthObject.Pairs)
				{
					int Value;
					if(int.TryParse(ColumnWidthPair.Value, out Value))
					{
						ColumnWidths[ColumnWidthPair.Key] = Value;
					}
				}

				bWindowVisible = WindowSection.GetValue("Visible", true);
			}

			// Schedule settings
			bScheduleEnabled = ConfigFile.GetValue("Schedule.Enabled", false);
			if(!TimeSpan.TryParse(ConfigFile.GetValue("Schedule.Time", ""), out ScheduleTime))
			{
				ScheduleTime = new TimeSpan(6, 0, 0);
			}
			if(!Enum.TryParse(ConfigFile.GetValue("Schedule.Change", ""), out ScheduleChange))
			{
				ScheduleChange = LatestChangeType.Good;
			}
		}
        public UserSettings(string InFileName)
        {
            FileName = InFileName;
            if (File.Exists(FileName))
            {
                ConfigFile.Load(FileName);
            }

            // General settings
            bBuildAfterSync        = (ConfigFile.GetValue("General.BuildAfterSync", "1") != "0");
            bRunAfterSync          = (ConfigFile.GetValue("General.RunAfterSync", "1") != "0");
            bSyncPrecompiledEditor = (ConfigFile.GetValue("General.SyncPrecompiledEditor", "0") != "0");
            bOpenSolutionAfterSync = (ConfigFile.GetValue("General.OpenSolutionAfterSync", "0") != "0");
            bShowLogWindow         = (ConfigFile.GetValue("General.ShowLogWindow", false));
            bAutoResolveConflicts  = (ConfigFile.GetValue("General.AutoResolveConflicts", "1") != "0");
            bUseIncrementalBuilds  = ConfigFile.GetValue("General.IncrementalBuilds", true);
            bShowLocalTimes        = ConfigFile.GetValue("General.ShowLocalTimes", false);
            bShowAllStreams        = ConfigFile.GetValue("General.ShowAllStreams", false);
            bKeepInTray            = ConfigFile.GetValue("General.KeepInTray", true);
            int.TryParse(ConfigFile.GetValue("General.FilterIndex", "0"), out FilterIndex);
            LastProjectFileName = ConfigFile.GetValue("General.LastProjectFileName", null);

            OpenProjectFileNames = ConfigFile.GetValues("General.OpenProjectFileNames", new string[0]);
            if (LastProjectFileName != null && !OpenProjectFileNames.Any(x => x.Equals(LastProjectFileName, StringComparison.InvariantCultureIgnoreCase)))
            {
                OpenProjectFileNames = OpenProjectFileNames.Concat(new string[] { LastProjectFileName }).ToArray();
            }

            OtherProjectFileNames = ConfigFile.GetValues("General.OtherProjectFileNames", new string[0]);
            SyncView = ConfigFile.GetValues("General.SyncFilter", new string[0]);
            SyncExcludedCategories = ConfigFile.GetGuidValues("General.SyncExcludedCategories", new Guid[0]);
            if (!Enum.TryParse(ConfigFile.GetValue("General.SyncType", ""), out SyncType))
            {
                SyncType = LatestChangeType.Good;
            }

            // Build configuration
            string CompiledEditorBuildConfigName = ConfigFile.GetValue("General.BuildConfig", "");

            if (!Enum.TryParse(CompiledEditorBuildConfigName, true, out CompiledEditorBuildConfig))
            {
                CompiledEditorBuildConfig = BuildConfig.DebugGame;
            }

            // Tab names
            string TabNamesValue = ConfigFile.GetValue("General.TabNames", "");

            if (!Enum.TryParse(TabNamesValue, true, out TabLabels))
            {
                TabLabels = TabLabels.ProjectFile;
            }

            // Editor arguments
            string[] Arguments = ConfigFile.GetValues("General.EditorArguments", new string[] { "0:-log", "0:-fastload" });
            foreach (string Argument in Arguments)
            {
                if (Argument.StartsWith("0:"))
                {
                    EditorArguments.Add(new Tuple <string, bool>(Argument.Substring(2), false));
                }
                else if (Argument.StartsWith("1:"))
                {
                    EditorArguments.Add(new Tuple <string, bool>(Argument.Substring(2), true));
                }
                else
                {
                    EditorArguments.Add(new Tuple <string, bool>(Argument, true));
                }
            }

            // Window settings
            ConfigSection WindowSection = ConfigFile.FindSection("Window");

            if (WindowSection != null)
            {
                bHasWindowSettings = true;

                int X      = WindowSection.GetValue("X", -1);
                int Y      = WindowSection.GetValue("Y", -1);
                int Width  = WindowSection.GetValue("Width", -1);
                int Height = WindowSection.GetValue("Height", -1);
                WindowRectangle = new Rectangle(X, Y, Width, Height);

                ConfigObject ColumnWidthObject = new ConfigObject(WindowSection.GetValue("ColumnWidths", ""));
                foreach (KeyValuePair <string, string> ColumnWidthPair in ColumnWidthObject.Pairs)
                {
                    int Value;
                    if (int.TryParse(ColumnWidthPair.Value, out Value))
                    {
                        ColumnWidths[ColumnWidthPair.Key] = Value;
                    }
                }

                bWindowVisible = WindowSection.GetValue("Visible", true);
            }

            // Schedule settings
            bScheduleEnabled = ConfigFile.GetValue("Schedule.Enabled", false);
            if (!TimeSpan.TryParse(ConfigFile.GetValue("Schedule.Time", ""), out ScheduleTime))
            {
                ScheduleTime = new TimeSpan(6, 0, 0);
            }
            if (!Enum.TryParse(ConfigFile.GetValue("Schedule.Change", ""), out ScheduleChange))
            {
                ScheduleChange = LatestChangeType.Good;
            }

            // Perforce settings
            if (!int.TryParse(ConfigFile.GetValue("Perforce.NumRetries", "0"), out SyncOptions.NumRetries))
            {
                SyncOptions.NumRetries = 0;
            }
            if (!int.TryParse(ConfigFile.GetValue("Perforce.NumThreads", "0"), out SyncOptions.NumThreads))
            {
                SyncOptions.NumThreads = 0;
            }
            if (!int.TryParse(ConfigFile.GetValue("Perforce.TcpBufferSize", "0"), out SyncOptions.TcpBufferSize))
            {
                SyncOptions.TcpBufferSize = 0;
            }
        }
예제 #8
0
        public UserSettings(string InFileName)
        {
            FileName = InFileName;
            if (File.Exists(FileName))
            {
                ConfigFile.Load(FileName);
            }

            // General settings
            bBuildAfterSync        = (ConfigFile.GetValue("General.BuildAfterSync", "1") != "0");
            bRunAfterSync          = (ConfigFile.GetValue("General.RunAfterSync", "1") != "0");
            bSyncPrecompiledEditor = (ConfigFile.GetValue("General.SyncPrecompiledEditor", "0") != "0");
            bOpenSolutionAfterSync = (ConfigFile.GetValue("General.OpenSolutionAfterSync", "0") != "0");
            bShowLogWindow         = (ConfigFile.GetValue("General.ShowLogWindow", false));
            bAutoResolveConflicts  = (ConfigFile.GetValue("General.AutoResolveConflicts", "1") != "0");
            bUseIncrementalBuilds  = ConfigFile.GetValue("General.IncrementalBuilds", true);
            bShowLocalTimes        = ConfigFile.GetValue("General.ShowLocalTimes", false);
            bKeepInTray            = ConfigFile.GetValue("General.KeepInTray", true);
            LastProjectFileName    = ConfigFile.GetValue("General.LastProjectFileName", null);
            OtherProjectFileNames  = ConfigFile.GetValues("General.OtherProjectFileNames", new string[0]);
            SyncFilter             = ConfigFile.GetValues("General.SyncFilter", new string[0]);
            if (!Enum.TryParse(ConfigFile.GetValue("General.SyncType", ""), out SyncType))
            {
                SyncType = LatestChangeType.Good;
            }

            // Build configuration
            string CompiledEditorBuildConfigName = ConfigFile.GetValue("General.BuildConfig", "");

            if (!Enum.TryParse(CompiledEditorBuildConfigName, true, out CompiledEditorBuildConfig))
            {
                CompiledEditorBuildConfig = BuildConfig.DebugGame;
            }

            // Editor arguments
            string[] Arguments = ConfigFile.GetValues("General.EditorArguments", new string[] { "0:-log", "0:-fastload" });
            foreach (string Argument in Arguments)
            {
                if (Argument.StartsWith("0:"))
                {
                    EditorArguments.Add(new Tuple <string, bool>(Argument.Substring(2), false));
                }
                else if (Argument.StartsWith("1:"))
                {
                    EditorArguments.Add(new Tuple <string, bool>(Argument.Substring(2), true));
                }
                else
                {
                    EditorArguments.Add(new Tuple <string, bool>(Argument, true));
                }
            }

            // Window settings
            ConfigSection WindowSection = ConfigFile.FindSection("Window");

            if (WindowSection != null)
            {
                bHasWindowSettings = true;

                int X      = WindowSection.GetValue("X", -1);
                int Y      = WindowSection.GetValue("Y", -1);
                int Width  = WindowSection.GetValue("Width", -1);
                int Height = WindowSection.GetValue("Height", -1);
                WindowRectangle = new Rectangle(X, Y, Width, Height);

                ConfigObject ColumnWidthObject = new ConfigObject(WindowSection.GetValue("ColumnWidths", ""));
                foreach (KeyValuePair <string, string> ColumnWidthPair in ColumnWidthObject.Pairs)
                {
                    int Value;
                    if (int.TryParse(ColumnWidthPair.Value, out Value))
                    {
                        ColumnWidths[ColumnWidthPair.Key] = Value;
                    }
                }

                bWindowVisible = WindowSection.GetValue("Visible", true);
            }

            // Schedule settings
            bScheduleEnabled = ConfigFile.GetValue("Schedule.Enabled", false);
            if (!TimeSpan.TryParse(ConfigFile.GetValue("Schedule.Time", ""), out ScheduleTime))
            {
                ScheduleTime = new TimeSpan(6, 0, 0);
            }
            if (!Enum.TryParse(ConfigFile.GetValue("Schedule.Change", ""), out ScheduleChange))
            {
                ScheduleChange = LatestChangeType.Good;
            }
        }
예제 #9
0
 public void CopySettings(out bool OutEnabled, out LatestChangeType OutChange, out TimeSpan OutTime)
 {
     OutEnabled = EnableCheckBox.Checked;
     OutChange  = (LatestChangeType)ChangeComboBox.SelectedIndex;
     OutTime    = TimePicker.Value.TimeOfDay;
 }
예제 #10
0
		bool FindChangeToSync(LatestChangeType ChangeType, out int ChangeNumber)
		{
			for(int Idx = 0; Idx < BuildList.Items.Count; Idx++)
			{
				PerforceChangeSummary Change = (PerforceChangeSummary)BuildList.Items[Idx].Tag;
				if(ChangeType == LatestChangeType.Any)
				{
					if(CanSyncChange(Change.Number))
					{
						ChangeNumber = FindNewestGoodContentChange(Change.Number);
						return true;
					}
				}
				else if(ChangeType == LatestChangeType.Good)
				{
					EventSummary Summary = EventMonitor.GetSummaryForChange(Change.Number);
					if(Summary != null && Summary.Verdict == ReviewVerdict.Good && CanSyncChange(Change.Number))
					{
						ChangeNumber = FindNewestGoodContentChange(Change.Number);
						return true;
					}
				}
				else if(ChangeType == LatestChangeType.Starred)
				{
					EventSummary Summary = EventMonitor.GetSummaryForChange(Change.Number);
					if(((Summary != null && Summary.LastStarReview != null) || PromotedChangeNumbers.Contains(Change.Number)) && CanSyncChange(Change.Number))
					{
						ChangeNumber = FindNewestGoodContentChange(Change.Number);
						return true;
					}
				}
			}

			ChangeNumber = -1;
			return false;
		}
예제 #11
0
		public void CopySettings(out bool OutEnabled, out LatestChangeType OutChange, out TimeSpan OutTime)
		{
			OutEnabled = EnableCheckBox.Checked;
			OutChange = (LatestChangeType)ChangeComboBox.SelectedIndex;
			OutTime = TimePicker.Value.TimeOfDay;
		}