Exemplo n.º 1
0
        public static void ResetCurrent(string schemeId)
        {
            if (schemeId != null)
            {
                KeyBindingScheme scheme = GetScheme(schemeId);
                if (scheme != null)
                {
                    current = scheme.GetKeyBindingSet().Clone();
                    return;
                }
            }

            current.ClearBindings();
        }
Exemplo n.º 2
0
 void SelectCurrentScheme()
 {
     try {
         internalUpdate = true;
         for (int n = 0; n < schemes.Count; n++)
         {
             KeyBindingScheme s = schemes [n];
             if (currentBindings.Equals(s.GetKeyBindingSet()))
             {
                 schemeCombo.Active = n + 1;
                 return;
             }
         }
         schemeCombo.Active = 0;
     } finally {
         internalUpdate = false;
     }
 }
Exemplo n.º 3
0
        void OnKeyBindingSchemeChanged(object sender, EventArgs e)
        {
            if (internalUpdate)
            {
                return;
            }

            if (schemeCombo.Active == 0)
            {
                return;
            }

            Command  command;
            string   binding;
            TreeIter iter;

            if (!keyStore.GetIterFirst(out iter))
            {
                return;
            }

            // Load a key binding template
            KeyBindingScheme scheme = KeyBindingService.GetSchemeByName(schemeCombo.ActiveText);

            currentBindings = scheme.GetKeyBindingSet().Clone();

            do
            {
                TreeIter citer;
                keyStore.IterChildren(out citer, iter);
                do
                {
                    command = (Command)keyStore.GetValue(citer, commandCol);
                    binding = currentBindings.GetBinding(command);
                    keyStore.SetValue(citer, bindingCol, binding);
                } while (keyStore.IterNext(ref citer));
            } while (keyStore.IterNext(ref iter));

            UpdateGlobalWarningLabel();
        }
Exemplo n.º 4
0
 public override KeyBindingScheme Load()
 {
     return(KeyBindingScheme.LoadFromFile(FileLocation));
 }