Пример #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();
        }
Пример #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;
     }
 }
Пример #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();
        }