コード例 #1
0
ファイル: NoteEditor.cs プロジェクト: shubhtr/tomboy-1
 //
 // Update the search match highlight color based on the changed Preference dialog setting.
 //
 void OnSearchMatchColorSettingChanged(object sender, NotifyEventArgs args)
 {
     switch (args.Key)
     {
     case Preferences.ENABLE_CUSTOM_SEARCH_MATCH_COLOR:
     case Preferences.CUSTOM_SEARCH_MATCH_COLOR:
         UpdateSearchMatchColor();
         break;
     }
 }
コード例 #2
0
            public void HandleNotify(object sender, GConf.NotifyEventArgs args)
            {
                if (!enabled)
                {
                    return;
                }

                NotifyEventArgs newArgs = new NotifyEventArgs(args.Key, args.Value);

                notify(sender, newArgs);
            }
コード例 #3
0
			void BindingChanged (object sender, NotifyEventArgs args)
			{
				if (args.Key == pref_path) {
					Logger.Debug ("Binding for '{0}' changed to '{1}'!",
					            pref_path,
					            args.Value);

					UnsetBinding ();

					key_sequence = (string) args.Value;
					SetBinding ();
				}
			}
コード例 #4
0
ファイル: PrefsKeybinder.cs プロジェクト: shubhtr/tomboy-1
            void BindingChanged(object sender, NotifyEventArgs args)
            {
                if (args.Key == pref_path)
                {
                    Logger.Debug("Binding for '{0}' changed to '{1}'!",
                                 pref_path,
                                 args.Value);

                    UnsetBinding();

                    key_sequence = (string)args.Value;
                    SetBinding();
                }
            }
コード例 #5
0
ファイル: Watchers.cs プロジェクト: shubhtr/tomboy-1
        void OnEnableSpellcheckChanged(object sender, NotifyEventArgs args)
        {
            if (args.Key != Preferences.ENABLE_SPELLCHECKING)
            {
                return;
            }

            if ((bool)args.Value)
            {
                Attach();
            }
            else
            {
                Detach();
            }
        }
コード例 #6
0
ファイル: NoteEditor.cs プロジェクト: MatteoNardi/Tomboy
		//
		// Update the font based on the changed Preference dialog setting.
		// Also update the font based on the changed GConf GNOME document font setting.
		//
		void OnFontSettingChanged (object sender, NotifyEventArgs args)
		{
			switch (args.Key) {
			case Preferences.ENABLE_CUSTOM_FONT:
				UpdateCustomFontSetting ();
				break;
			case Preferences.CUSTOM_FONT_FACE:
				UpdateCustomFontSetting ();
				break;

			case GNOME_DOCUMENT_FONT_KEY:
				if (!(bool) Preferences.Get (Preferences.ENABLE_CUSTOM_FONT))
					ModifyFontFromString ((string) args.Value);
				break;
			}
		}
コード例 #7
0
		public void Set (string key, object value)
		{
			try {
				CreatePath (key);
				prefsDoc.SelectSingleNode (key).InnerText = System.Convert.ToString(value);
				prefsDoc.Save(fileName);
				foreach (string nkey in events.Keys) {
					NotifyEventHandler handler = events [nkey] as NotifyEventHandler;
					if (handler != null && key.StartsWith (nkey))
					{
						NotifyEventArgs args = new NotifyEventArgs (key, value);
						handler (this, args);
					}
				}
			}
			catch {}
		}
コード例 #8
0
 public void Set(string key, object value)
 {
     try {
         CreatePath(key);
         prefsDoc.SelectSingleNode(key).InnerText = System.Convert.ToString(value);
         prefsDoc.Save(fileName);
         foreach (string nkey in events.Keys)
         {
             NotifyEventHandler handler = events [nkey] as NotifyEventHandler;
             if (handler != null && key.StartsWith(nkey))
             {
                 NotifyEventArgs args = new NotifyEventArgs(key, value);
                 handler(this, args);
             }
         }
     }
     catch {}
 }
コード例 #9
0
ファイル: Watchers.cs プロジェクト: shubhtr/tomboy-1
        void OnEnableWikiwordsChanged(object sender, NotifyEventArgs args)
        {
            if (args.Key != Preferences.ENABLE_WIKIWORDS)
            {
                return;
            }

            if ((bool)args.Value)
            {
                Buffer.InsertText  += OnInsertText;
                Buffer.DeleteRange += OnDeleteRange;
            }
            else
            {
                Buffer.InsertText  -= OnInsertText;
                Buffer.DeleteRange -= OnDeleteRange;
            }
        }
コード例 #10
0
ファイル: NoteEditor.cs プロジェクト: shubhtr/tomboy-1
        //
        // Update the font based on the changed Preference dialog setting.
        // Also update the font based on the changed GConf GNOME document font setting.
        //
        void OnFontSettingChanged(object sender, NotifyEventArgs args)
        {
            switch (args.Key)
            {
            case Preferences.ENABLE_CUSTOM_FONT:
                UpdateCustomFontSetting();
                break;

            case Preferences.CUSTOM_FONT_FACE:
                UpdateCustomFontSetting();
                break;

            case GNOME_DOCUMENT_FONT_KEY:
                if (!(bool)Preferences.Get(Preferences.ENABLE_CUSTOM_FONT))
                {
                    ModifyFontFromString((string)args.Value);
                }
                break;
            }
        }
コード例 #11
0
ファイル: Watchers.cs プロジェクト: MatteoNardi/Tomboy
		void OnEnableWikiwordsChanged (object sender, NotifyEventArgs args)
		{
			if (args.Key != Preferences.ENABLE_WIKIWORDS)
				return;

			if ((bool) args.Value) {
				Buffer.InsertText += OnInsertText;
				Buffer.DeleteRange += OnDeleteRange;
			} else {
				Buffer.InsertText -= OnInsertText;
				Buffer.DeleteRange -= OnDeleteRange;
			}
		}
コード例 #12
0
 private void OnPrefsChanged(object sender, NotifyEventArgs args)
 {
     if (args.Key == CalculatorAddin.CALCULATOR_AUTOMATIC_MODE)
         setUp();
 }
コード例 #13
0
			public void HandleNotify (object sender, GConf.NotifyEventArgs args)
			{
				if (!enabled)
					return;
				
				NotifyEventArgs newArgs = new NotifyEventArgs (args.Key, args.Value);
				notify (sender, newArgs);
			}
コード例 #14
0
		void EnableKeybindingsChanged (object sender, NotifyEventArgs args)
		{
			if (args.Key == Preferences.ENABLE_KEYBINDINGS) {
				bool enabled = (bool) args.Value;
				EnableDisable (enabled);
			}
		}
コード例 #15
0
		void HandlePreferencesSettingChanged (object sender, NotifyEventArgs args)
		{
			if (args.Key == Preferences.NOTE_RENAME_BEHAVIOR) {
				int rename_behavior = (int) args.Value;
				if (rename_behavior < 0 || rename_behavior > 2) {
					rename_behavior = 0;
					Preferences.Set (Preferences.NOTE_RENAME_BEHAVIOR, rename_behavior);
				}
				if (rename_behavior_combo.Active != rename_behavior)
					rename_behavior_combo.Active = rename_behavior;
			} else if (args.Key == Preferences.SYNC_AUTOSYNC_TIMEOUT) {
				int timeout = (int) args.Value;
				if (timeout <= 0 && autosyncCheck.Active)
					autosyncCheck.Active = false;
				else if (timeout > 0) {
					timeout = (timeout >= 5 && timeout < 1000) ? timeout : 5;
					if (!autosyncCheck.Active)
						autosyncCheck.Active = true;
					if ((int) autosyncSpinner.Value != timeout)
						autosyncSpinner.Value = timeout;
				}
			}
		}
コード例 #16
0
ファイル: Preferences.cs プロジェクト: MichaelAquilina/tomboy
		static void OnSettingChanged (object sender, NotifyEventArgs args)
		{
			if (SettingChanged != null) {
				SettingChanged (sender, args);
			}
		}
コード例 #17
0
ファイル: Watchers.cs プロジェクト: MatteoNardi/Tomboy
		void OnEnableSpellcheckChanged (object sender, NotifyEventArgs args)
		{
			if (args.Key != Preferences.ENABLE_SPELLCHECKING)
				return;

			if ((bool) args.Value) {
				Attach ();
			} else {
				Detach ();
			}
		}