コード例 #1
0
 public void OpenProjSel(bool config)
 {
     if (config)
     {
         Gconfig.configobj.SetActive(true);
         Gconfig.bigicon.text   = SaveSystemAlt.GetInt("Gconf_bi", 172).ToString();
         Gconfig.smallicon.text = SaveSystemAlt.GetInt("Gconf_si", 72).ToString();
         Gconfig.shutdown.isOn  = SaveSystemAlt.GetBool("Gconf_shd", true);
         Gconfig.reboot.isOn    = SaveSystemAlt.GetBool("Gconf_rb", true);
         Gconfig.exit.isOn      = SaveSystemAlt.GetBool("Gconf_ex", false);
     }
     else
     {
         newthemename.text = "";
         newtheme.SetActive(true);
     }
 }
コード例 #2
0
    /*
     * <<bi>> - big_icon_size
     * <<si>> - small_icon_size
     * <<st>> - showtools
     */

    public void Open()
    {
        sc.config.configobj.SetActive(true);
        int  bi = SaveSystemAlt.GetInt("Gconf_bi", 172);
        int  si = SaveSystemAlt.GetInt("Gconf_si", 72);
        bool st = SaveSystemAlt.GetBool("Gconf_shd", true);
        bool rb = SaveSystemAlt.GetBool("Gconf_rb", true);
        bool ex = SaveSystemAlt.GetBool("Gconf_ex", false);

        if (FilesSet.CheckFile(sc.curProj.dir + "/theme.conf", false))
        {
            List <string> conf = FilesSet.LoadStream(sc.curProj.dir + "/theme.conf", false).ToList();
            for (int c = 0; c < conf.Count; c++)
            {
                if (!((conf[c].IndexOf("#")) >= 0) && (conf[c].IndexOf("big_icon_size ") >= 0) && int.Parse(conf[c].Replace("big_icon_size ", "")) > 0)
                {
                    bi = int.Parse(conf[c].Replace("big_icon_size ", ""));
                }
                if (!((conf[c].IndexOf("#")) >= 0) && (conf[c].IndexOf("small_icon_size ") >= 0) && int.Parse(conf[c].Replace("small_icon_size ", "")) > 0)
                {
                    si = int.Parse(conf[c].Replace("small_icon_size ", ""));
                }
                if (!((conf[c].IndexOf("#")) >= 0) && (conf[c].IndexOf("showtools ") >= 0))
                {
                    string   work = conf[c].Replace("showtools ", "");
                    string[] works = work.Split(',');
                    bool     stch = false; bool rbch = false; bool exch = false;
                    for (int i = 0; i < works.Length; i++)
                    {
                        if (works[i] == "shutdown")
                        {
                            st = true; stch = true;
                        }
                        if (works[i] == "reboot")
                        {
                            rb = true; rbch = true;
                        }
                        if (works[i] == "exit")
                        {
                            ex = true; exch = true;
                        }
                    }
                    if (!stch)
                    {
                        st = false;
                    }
                    if (!rbch)
                    {
                        rb = false;
                    }
                    if (!exch)
                    {
                        ex = false;
                    }
                }
                else if (conf[c].IndexOf("#no showtools") >= 0)
                {
                    st = false;
                    rb = false;
                    ex = false;
                }
            }
        }

        sc.config.bigicon.text   = bi + "";
        sc.config.smallicon.text = si + "";
        sc.config.shutdown.isOn  = st;
        sc.config.reboot.isOn    = rb;
        sc.config.exit.isOn      = ex;
    }
コード例 #3
0
    public void CreateNewProject(bool cancel)
    {
        if (cancel)
        {
            newthemename.text = "";
            newtheme.SetActive(false);
        }
        else
        {
            if (!string.IsNullOrEmpty(newthemename.text))
            {
                FilesSet.CreateDirectory(FastFind.GetDefaultPath() + "/SLywnow/rEFInd theme editor/projects/" + newthemename.text);
                List <string> tosave = new List <string>();
                for (int i = 0; i < configsc.text.Count; i++)
                {
                    string save = "";
                    if (configsc.text[i] == "<<bi>>")
                    {
                        save = "big_icon_size " + SaveSystemAlt.GetInt("Gconf_bi", 172).ToString();
                    }
                    else if (configsc.text[i] == "<<si>>")
                    {
                        save = "small_icon_size " + SaveSystemAlt.GetInt("Gconf_si", 72).ToString();
                    }
                    else if (configsc.text[i] == "<<st>>")
                    {
                        if (SaveSystemAlt.GetBool("Gconf_shd", true) || SaveSystemAlt.GetBool("Gconf_rb", true) || SaveSystemAlt.GetBool("Gconf_ex", false))
                        {
                            save = "showtools ";
                            bool firsthave = false;
                            if (SaveSystemAlt.GetBool("Gconf_shd", true))
                            {
                                save     += "shutdown";
                                firsthave = true;
                            }
                            if (SaveSystemAlt.GetBool("Gconf_rb", true))
                            {
                                if (firsthave)
                                {
                                    save += ",";
                                }
                                save     += "reboot";
                                firsthave = true;
                            }
                            if (SaveSystemAlt.GetBool("Gconf_ex", false))
                            {
                                if (firsthave)
                                {
                                    save += ",";
                                }
                                save     += "exit";
                                firsthave = true;
                            }
                        }
                        else
                        {
                            save = "#no showtools";
                        }
                    }
                    else
                    {
                        save = configsc.text[i];
                    }
                    tosave.Add(save);
                }

                if (!FilesSet.CheckFile(FastFind.GetDefaultPath() + "/SLywnow/rEFInd theme editor/projects/" + newthemename.text + "/theme.conf"))
                {
                    FilesSet.SaveStream(FastFind.GetDefaultPath() + "/SLywnow/rEFInd theme editor/projects/" + newthemename.text + "/theme.conf", tosave.ToArray());
                }

                newthemename.text = "";
                newtheme.SetActive(false);
                GetProjects();
            }
        }
    }