Example #1
0
        public void Save(CollectionVM cvm)
        {
            if (cvm == null)
            {
                return;
            }

            ConfFileSaver s = new ConfFileSaver();

            if (!cvm.IsDefaultLayout)
            {
                s.AddOption("layout", cvm.Layout);
            }
            s.AddOption("launcher", (cvm.Launcher == null) ? "" : cvm.Launcher.Name);
            s.AddOption("list.path", cvm.ListPath);
            s.AddOption("list.extensions", cvm.FileExtensions);
            s.AddOption("media.box", cvm.MediaPathBox);
            s.AddOption("media.cart", cvm.MediaPathCart);
            s.AddOption("media.logo", cvm.MediaPathLogo);
            s.AddOption("media.snap", cvm.MediaPathSnap);
            s.AddOption("media.title", cvm.MediaPathTitle);
            s.AddOption("media.video", cvm.MediaPathVideo);

            //todo: change serverPath
            string path = RetroFE.GetAbsolutePath() + "/Collections/" + cvm.Name + "/Settings.conf";

            s.Save(path);
        }
Example #2
0
        private bool RemoveCollection()
        {
            //todo: change location
            string path = RetroFE.GetAbsolutePath() + "/Launchers/" + SelectedCollection.Name + ".conf";

            if (File.Exists(path))
            {
                File.Delete(path);
            }

            CollectionList.Remove(SelectedCollection);

            return(true);
        }
Example #3
0
        private void AddLauncher(object param)
        {
            LauncherVM l = new LauncherVM();

            l.Name = param as String;
            NotifyPropertyChanged("LauncherCollection");
            ConfFileSaver saver = new ConfFileSaver();

            //todo change path
            if (!File.Exists(RetroFE.GetAbsolutePath() + "/Launchers/" + l.Name + ".conf"))
            {
                LauncherCollection.Add(l);
                saver.Save(RetroFE.GetAbsolutePath() + "/Launchers/" + l.Name + ".conf");
            }
        }
Example #4
0
        public void Save(LauncherVM launcher)
        {
            if (launcher == null)
            {
                return;
            }

            ConfFileSaver s = new ConfFileSaver();

            s.AddOption("executable", launcher.ExecutablePath);
            s.AddOption("arguments", launcher.Arguments);

            //todo: change location
            string path = RetroFE.GetAbsolutePath() + "/Launchers/" + SelectedLauncher.Name + ".conf";

            s.Save(path);
        }
Example #5
0
        public void Save()
        {
            ConfFileSaver s = new ConfFileSaver();

            s.AddOption("previousItem", ScrollPrevious);
            s.AddOption("nextItem", ScrollNext);
            s.AddOption("pageUp", PageUp);
            s.AddOption("pageDown", PageDown);

            s.AddOption("select", SelectItem);
            s.AddOption("back", Back);
            s.AddOption("quit", Quit);

            //todo: change location
            string path = RetroFE.GetAbsolutePath() + "/Controls.conf";

            s.Save(path);
        }
Example #6
0
        public void Save()
        {
            ConfFileSaver s = new ConfFileSaver();

            if (IsVerticalStretch)
            {
                s.AddOption("vertical", "stretch");
            }
            else
            {
                s.AddOption("vertical", VerticalResolution);
            }

            if (IsHorizontalStretch)
            {
                s.AddOption("horizontal", "stretch");
            }
            else
            {
                s.AddOption("horizontal", HorizontalResolution);
            }

            s.AddOption("fullscreen", IsFullscreen);
            s.AddOption("layout", (Layout == null) ? "Default" : Layout);
            s.AddOption("hideMouse", IsMouseHidden);
            s.AddOption("showParenthesis", IsParenthesisVisible);
            s.AddOption("showSquareBrackets", IsBracesVisible);
            s.AddOption("firstCollection", (FirstCollection == null) ? "Main" : FirstCollection.Name);

            s.AddOption("videoEnable", IsVideoEnabled);
            s.AddOption("videoLoop", VideoLoop);
            s.AddOption("exitOnFirstPageBack", IsExitOnFirstBack);
            s.AddOption("attractModeTime", (IsAttractModeEnabled) ? AttractModeTime : 0);


            //todo: change location
            string path = RetroFE.GetAbsolutePath() + "/Settings.conf";

            s.Save(path);
        }
Example #7
0
        private void AddCollection(object param)
        {
            CollectionVM cvm = new CollectionVM();

            cvm.Name = param as String;
            NotifyPropertyChanged("CollectionList");

            ConfFileSaver settings = new ConfFileSaver();
            ConfFileSaver include  = new ConfFileSaver();
            ConfFileSaver exclude  = new ConfFileSaver();
            MenuParser    menu     = new MenuParser();

            //todo change path
            string path = RetroFE.GetAbsolutePath() + "/Collections/" + cvm.Name;

            if (!Directory.Exists(path))
            {
                Directory.CreateDirectory(path);
            }

            if (!File.Exists(path + "/Settings.conf"))
            {
                CollectionList.Add(cvm);
                settings.Save(path + "/Settings.conf");

                if (!File.Exists(path + "/Include.txt"))
                {
                    include.Save(path + "/Include.txt");
                }
                if (!File.Exists(path + "/Exclude.txt"))
                {
                    exclude.Save(path + "/Exclude.txt");
                }

                //menu.Save(path + "/Menu.xml");
            }
        }