internal bool SaveSettings()
        {
            if (!ValidateSettings())
            {
                return(false);
            }

            Sys.Settings.Subscriptions = GetUpdatedSubscriptions();
            Sys.Settings.ExtraFolders  = ExtraFolderList.Distinct().ToList();

            // ensure required folders are always in ExtraFolders list
            if (!Sys.Settings.ExtraFolders.Contains("direct", StringComparer.InvariantCultureIgnoreCase))
            {
                Sys.Settings.ExtraFolders.Add("direct");
            }

            if (!Sys.Settings.ExtraFolders.Contains("music", StringComparer.InvariantCultureIgnoreCase))
            {
                Sys.Settings.ExtraFolders.Add("music");
            }

            if (!Sys.Settings.ExtraFolders.Contains("sfx", StringComparer.InvariantCultureIgnoreCase))
            {
                Sys.Settings.ExtraFolders.Add("sfx");
            }

            if (!Sys.Settings.ExtraFolders.Contains("voice", StringComparer.InvariantCultureIgnoreCase))
            {
                Sys.Settings.ExtraFolders.Add("voice");
            }

            if (!Sys.Settings.ExtraFolders.Contains("ambient", StringComparer.InvariantCultureIgnoreCase))
            {
                Sys.Settings.ExtraFolders.Add("ambient");
            }

            Sys.Settings.FF7Exe            = FF7ExePathInput;
            Sys.Settings.LibraryLocation   = LibraryPathInput;
            Sys.Settings.MovieFolder       = MoviesPathInput;
            Sys.Settings.AaliFolder        = TexturesPathInput;
            Sys.Settings.FFNxUpdateChannel = FFNxUpdateChannel;
            Sys.Settings.AppUpdateChannel  = AppUpdateChannel;


            Sys.Settings.Options = GetUpdatedOptions();

            ApplyOptions();

            Directory.CreateDirectory(Sys.Settings.LibraryLocation);

            Sys.Message(new WMessage(ResourceHelper.Get(StringKey.GeneralSettingsHaveBeenUpdated)));

            return(true);
        }
示例#2
0
        internal bool SaveSettings()
        {
            if (!ValidateSettings())
            {
                return(false);
            }

            Sys.Settings.Subscriptions = GetUpdatedSubscriptions();
            Sys.Settings.ExtraFolders  = ExtraFolderList.Distinct().ToList();

            // ensure 'direct' and 'music' folders are always in ExtraFolders list
            if (!Sys.Settings.ExtraFolders.Contains("direct", StringComparer.InvariantCultureIgnoreCase))
            {
                Sys.Settings.ExtraFolders.Add("direct");
            }

            if (!Sys.Settings.ExtraFolders.Contains("music", StringComparer.InvariantCultureIgnoreCase))
            {
                Sys.Settings.ExtraFolders.Add("music");
            }

            Sys.Settings.FF7Exe          = FF7ExePathInput;
            Sys.Settings.LibraryLocation = LibraryPathInput;
            Sys.Settings.MovieFolder     = MoviesPathInput;
            Sys.Settings.AaliFolder      = TexturesPathInput;


            Sys.Settings.Options = GetUpdatedOptions();

            ApplyOptions();

            Directory.CreateDirectory(Sys.Settings.LibraryLocation);

            Sys.Message(new WMessage()
            {
                Text = "General settings have been updated!"
            });

            return(true);
        }
        internal bool SaveSettings()
        {
            if (!ValidateSettings())
            {
                return(false);
            }

            Sys.Settings.Subscriptions = GetUpdatedSubscriptions();
            Sys.Settings.ExtraFolders  = ExtraFolderList.Distinct().ToList();

            // ensure required folders are always in ExtraFolders list
            if (!Sys.Settings.ExtraFolders.Contains("direct", StringComparer.InvariantCultureIgnoreCase))
            {
                Sys.Settings.ExtraFolders.Add("direct");
            }

            if (!Sys.Settings.ExtraFolders.Contains("music", StringComparer.InvariantCultureIgnoreCase))
            {
                Sys.Settings.ExtraFolders.Add("music");
            }

            if (!Sys.Settings.ExtraFolders.Contains("sfx", StringComparer.InvariantCultureIgnoreCase))
            {
                Sys.Settings.ExtraFolders.Add("sfx");
            }

            if (!Sys.Settings.ExtraFolders.Contains("voice", StringComparer.InvariantCultureIgnoreCase))
            {
                Sys.Settings.ExtraFolders.Add("voice");
            }

            if (!Sys.Settings.ExtraFolders.Contains("ambient", StringComparer.InvariantCultureIgnoreCase))
            {
                Sys.Settings.ExtraFolders.Add("ambient");
            }

            Sys.Settings.FF7Exe            = FF7ExePathInput;
            Sys.Settings.LibraryLocation   = LibraryPathInput;
            Sys.Settings.MovieFolder       = MoviesPathInput;
            Sys.Settings.AaliFolder        = TexturesPathInput;
            Sys.Settings.FFNxUpdateChannel = FFNxUpdateChannel;
            Sys.Settings.UpdateChannel     = UpdateChannel;

            Sys.Settings.Options = GetUpdatedOptions();

            ApplyOptions();

            Directory.CreateDirectory(Sys.Settings.LibraryLocation);

            Sys.Message(new WMessage(ResourceHelper.Get(StringKey.GeneralSettingsHaveBeenUpdated)));

            if (reload && UpdateChannel != Updater.GitHub.Releases.Channel.Locked)
            {
                MessageDialogWindow.Show("You have just changed the release version, just going to update and restart.", "Change of Release Version");
                Sys.Message(new WMessage()
                {
                    Text = "Sarting updater application"
                });
                ProcessStartInfo startInfo = new ProcessStartInfo();
                startInfo.UseShellExecute  = false;
                startInfo.WorkingDirectory = Environment.CurrentDirectory;
                startInfo.FileName         = "updater.exe";
                startInfo.Arguments        = "\"" + System.AppDomain.CurrentDomain.BaseDirectory + "\\\" " + UpdateChannel.ToString();
                Process proc = Process.Start(startInfo);
                IntPtr  hWnd = proc.MainWindowHandle;
                if (hWnd != IntPtr.Zero)
                {
                    SetForegroundWindow(hWnd);
                    ShowWindow(hWnd, int.Parse("9"));
                }
                App.ShutdownApp();
            }

            return(true);
        }