Пример #1
0
        public cConfig(cConfigPlatform _cfgPlatform)
        {
            this.Build ();
            //First, tell the Terminus - Thread that a config tab is open
            cTerminus.isConfigTabOpen = true;

            //Set the values checked/not checked
            appendEvents (_cfgPlatform);

            //This is a workaround.
            //If Terminus is used out of a tarball, it uses a file called "Program.cfg" to load/save the configuration.
            //If Terminus is used out of a package, the path is another one.
            string path = string.Empty;
            path = new cPathEnvironment ().const_shemes_path;

            //Fill the combobox with values to change the template
            int i = 0;
            foreach (string st in System.IO.Directory.GetFiles(path,"*.config")) {
                combobox2.InsertText (i, new System.IO.FileInfo (st).Name.Replace (".config", ""));
                if (st.Contains (cTerminus.Configuration.Theme)) {
                    Gtk.TreeIter iter;
                    combobox2.Active = i;
                    combobox2.Model.IterNthChild (out iter, i);
                    combobox2.SetActiveIter (iter);
                }
                i++;
            }
        }
Пример #2
0
        public cConfig(cConfigPlatform _cfgPlatform)
        {
            this.Build();
            //First, tell the Terminus - Thread that a config tab is open
            cTerminus.isConfigTabOpen = true;

            //Set the values checked/not checked
            appendEvents(_cfgPlatform);

            //This is a workaround.
            //If Terminus is used out of a tarball, it uses a file called "Program.cfg" to load/save the configuration.
            //If Terminus is used out of a package, the path is another one.
            string path = string.Empty;

            path = new cPathEnvironment().const_shemes_path;

            //Fill the combobox with values to change the template
            int i = 0;

            foreach (string st in System.IO.Directory.GetFiles(path, "*.config"))
            {
                combobox2.InsertText(i, new System.IO.FileInfo(st).Name.Replace(".config", ""));
                if (st.Contains(cTerminus.Configuration.Theme))
                {
                    Gtk.TreeIter iter;
                    combobox2.Active = i;
                    combobox2.Model.IterNthChild(out iter, i);
                    combobox2.SetActiveIter(iter);
                }
                i++;
            }
        }
Пример #3
0
        /// <summary>
        /// Sets the tags.
        /// </summary>
        /// <param name='_textview'>
        /// _textview.
        /// </param>
        public static void setTags(ref TextView _textview, ref TextView _data)
        {
            try {
                //string path = new cPathEnvironment().const_settings_path.Replace("Program.cfg" ,"ColorShemes" + new cPathEnvironment().const_path_separator + cTerminus.Configuration.Theme + ".config") ;
                string path = new cPathEnvironment().const_shemes_path + cTerminus.Configuration.Theme + ".config";
                //Console.WriteLine (path);

                /*	if (new cPathEnvironment ().const_settings_path.Contains ("Program.cfg"))
                 *      path = new cPathEnvironment ().const_settings_path.Replace ("Program.cfg", "ColorShemes" + new cPathEnvironment ().const_path_separator + cTerminus.Configuration.Theme + ".config");
                 * else
                 *      path = @"/usr/share/terminus/Boot/Config/ColorShemes/" + cTerminus.Configuration.Theme + ".config";*/
                new cSyntax(path, ref _textview, false);
                if (_data != null)
                {
                    new cSyntax(path, ref _data, true);
                }
            } catch {
                TextTag   tagnone   = new TextTag("nosyntax");
                Gdk.Color nonecolor = new Gdk.Color();
                Gdk.Color.Parse("black", ref nonecolor);
                tagnone.ForegroundGdk = nonecolor;
                _textview.Buffer.TagTable.Add(tagnone);
                TextTag   tagcorrect   = new TextTag("backslashliteral");
                Gdk.Color colorcorrect = new Gdk.Color();
                Gdk.Color.Parse("darkblue", ref colorcorrect);
                tagcorrect.ForegroundGdk = colorcorrect;
                tagcorrect.FontDesc      = getBold();
                _textview.Buffer.TagTable.Add(tagcorrect);
                TextTag   edgedBrackets      = new TextTag("edgedBrackets");
                Gdk.Color coloredgetBrackets = new Gdk.Color();
                Gdk.Color.Parse("darkred", ref coloredgetBrackets);
                edgedBrackets.ForegroundGdk = coloredgetBrackets;
                _textview.Buffer.TagTable.Add(edgedBrackets);
                TextTag   roundBrackets      = new TextTag("roundBrackets");
                Gdk.Color colorroundbrackets = new Gdk.Color();
                Gdk.Color.Parse("darkviolet", ref colorroundbrackets);
                roundBrackets.ForegroundGdk = colorroundbrackets;
                _textview.Buffer.TagTable.Add(roundBrackets);
                TextTag   otherBrackets      = new TextTag("otherBrackets");
                Gdk.Color otherBracketsColor = new Gdk.Color();
                Gdk.Color.Parse("darkgreen", ref otherBracketsColor);
                otherBrackets.ForegroundGdk = otherBracketsColor;
                _textview.Buffer.TagTable.Add(otherBrackets);
                TextTag   constant      = new TextTag("constant");
                Gdk.Color constantcolor = new Gdk.Color();
                Gdk.Color.Parse("darkgrey", ref constantcolor);
                constant.ForegroundGdk = constantcolor;
                _textview.Buffer.TagTable.Add(constant);
                TextTag   quantifier      = new TextTag("quantifier");
                Gdk.Color quantifiercolor = new Gdk.Color();
                Gdk.Color.Parse("chocolate2", ref quantifiercolor);
                quantifier.ForegroundGdk = quantifiercolor;
                _textview.Buffer.TagTable.Add(quantifier);
                MessageBox.Show("Fehler beim Laden des Schema's.\nEs wurde das Standardschema geladen.", "Fehler", ButtonsType.Close, MessageType.Warning, null);
            }
        }
Пример #4
0
        /// <summary>
        /// Sets the tags.
        /// </summary>
        /// <param name='_textview'>
        /// _textview.
        /// </param>
        public static void setTags(ref TextView _textview, ref TextView _data)
        {
            try {
                //string path = new cPathEnvironment().const_settings_path.Replace("Program.cfg" ,"ColorShemes" + new cPathEnvironment().const_path_separator + cTerminus.Configuration.Theme + ".config") ;
                string path = new cPathEnvironment ().const_shemes_path + cTerminus.Configuration.Theme + ".config";
                //Console.WriteLine (path);
                /*	if (new cPathEnvironment ().const_settings_path.Contains ("Program.cfg"))
                    path = new cPathEnvironment ().const_settings_path.Replace ("Program.cfg", "ColorShemes" + new cPathEnvironment ().const_path_separator + cTerminus.Configuration.Theme + ".config");
                else
                    path = @"/usr/share/terminus/Boot/Config/ColorShemes/" + cTerminus.Configuration.Theme + ".config";*/
                new cSyntax (path, ref _textview, false);
                if (_data != null)
                    new cSyntax (path, ref _data, true);
            } catch {

                TextTag tagnone = new TextTag ("nosyntax");
                Gdk.Color nonecolor = new Gdk.Color();
                Gdk.Color.Parse ("black", ref nonecolor);
                tagnone.ForegroundGdk = nonecolor;
                _textview.Buffer.TagTable.Add (tagnone);
                TextTag tagcorrect = new TextTag ("backslashliteral");
                Gdk.Color colorcorrect = new Gdk.Color();
                Gdk.Color.Parse ("darkblue", ref colorcorrect);
                tagcorrect.ForegroundGdk = colorcorrect;
                tagcorrect.FontDesc = getBold ();
                _textview.Buffer.TagTable.Add (tagcorrect);
                TextTag edgedBrackets = new TextTag ("edgedBrackets");
                Gdk.Color coloredgetBrackets = new Gdk.Color();
                Gdk.Color.Parse ("darkred", ref coloredgetBrackets);
                edgedBrackets.ForegroundGdk = coloredgetBrackets;
                _textview.Buffer.TagTable.Add (edgedBrackets);
                TextTag roundBrackets = new TextTag ("roundBrackets");
                Gdk.Color colorroundbrackets = new Gdk.Color();
                Gdk.Color.Parse ("darkviolet", ref colorroundbrackets);
                roundBrackets.ForegroundGdk = colorroundbrackets;
                _textview.Buffer.TagTable.Add (roundBrackets);
                TextTag otherBrackets = new TextTag ("otherBrackets");
                Gdk.Color otherBracketsColor = new Gdk.Color();
                Gdk.Color.Parse ("darkgreen", ref otherBracketsColor);
                otherBrackets.ForegroundGdk = otherBracketsColor;
                _textview.Buffer.TagTable.Add (otherBrackets);
                TextTag constant = new TextTag ("constant");
                Gdk.Color constantcolor= new Gdk.Color();
                Gdk.Color.Parse ("darkgrey", ref constantcolor);
                constant.ForegroundGdk = constantcolor;
                _textview.Buffer.TagTable.Add (constant);
                TextTag quantifier = new TextTag ("quantifier");
                Gdk.Color quantifiercolor = new Gdk.Color();
                Gdk.Color.Parse ("chocolate2", ref quantifiercolor);
                quantifier.ForegroundGdk = quantifiercolor;
                _textview.Buffer.TagTable.Add (quantifier);
                MessageBox.Show ("Fehler beim Laden des Schema's.\nEs wurde das Standardschema geladen.", "Fehler", ButtonsType.Close, MessageType.Warning, null);
            }
        }