Exemplo n.º 1
0
        protected void OnBtnAccelAply1Clicked(object sender, System.EventArgs e)
        {
            string active = cbKeyBinding.ActiveText;
            string file   = System.IO.Path.Combine(MainClass.Paths.SettingDir, "keybinding");

            switch (active)
            {
            case WIN: {
                KeyBindings.CreateKeyBindingsWin(file);
                break;
            }

            case MACOSX: {
                KeyBindings.CreateKeyBindingsMac(file);
                break;
            }

            case JAVA: {
                KeyBindings.CreateKeyBindingsJava(file);
                break;
            }

            case VisualC: {
                KeyBindings.CreateKeyBindingsVisualC(file);
                break;
            }

            default:
                break;
            }
            keyBindFile = MainClass.KeyBinding;

            curentBind = MainClass.Tools.Clone <KeyBindingSection>(keyBindFile.KeyBindingSection);
            keybStore.Clear();
            foreach (KeyBindingSection kbs in  curentBind)
            {
                TreeIter tiParent = keybStore.AppendValues(kbs.Name, "", "", (int)Pango.Weight.Bold, null);
                foreach (KeyBinding kb in kbs.KeyBinding)
                {
                    keybStore.AppendValues(tiParent, kb.Name, kb.Description, kb.Key, (int)Pango.Weight.Normal, kb);
                }
            }

            tvKeyBind.ExpandAll();
            tvKeyBind.ColumnsAutosize();
            //MainClass.Settings.SaveSettings();
        }
Exemplo n.º 2
0
        protected void OnButtonOkClicked(object sender, System.EventArgs e)
        {
            MainClass.Settings.BackgroundColor.Red   = (byte)cbBackground.Color.Red;
            MainClass.Settings.BackgroundColor.Green = (byte)cbBackground.Color.Green;
            MainClass.Settings.BackgroundColor.Blue  = (byte)cbBackground.Color.Blue;

            string active = cbKeyBinding.ActiveText;
            string file   = System.IO.Path.Combine(MainClass.Paths.SettingDir, "keybinding");

            switch (active)
            {
            case WIN: {
                KeyBindings.CreateKeyBindingsWin(file);
                break;
            }

            case MACOSX: {
                KeyBindings.CreateKeyBindingsMac(file);
                break;
            }

            case JAVA: {
                KeyBindings.CreateKeyBindingsJava(file);
                break;
            }

            case VisualC: {
                KeyBindings.CreateKeyBindingsVisualC(file);
                break;
            }

            default:
                break;
            }

            MainClass.Settings.SaveSettings();
            waitingSplash = false;
        }