łň ëEc@s0dZddklZdefd„ƒYZdS(s This module documents a class that creates the spell check button for the text editor's preference dialog. @author: Lateef Alabi-Oki @organization: The Scribes Project @copyright: Copyright Š 2005 Lateef Alabi-Oki @license: GNU GPLv2 or Later @contact: mystilleef@gmail.com i˙˙˙˙(t CheckButtontSpellCheckButtoncBsDeZdZd„Zd„Zd„Zd„Zd„Zd„ZRS(s“ This class creates a check button for the text editor's preference dialog. The check button allows users to enable or disable spell checking. cCstti|ƒ|i||ƒ|iƒ|iid|iƒ|id|iƒ|_ |i id|i ƒ|_ dS(sŮ Initialize the check button. @param self: Reference to the SpellCheckButton instance. @type self: A SpellCheckButton object. @param editor: Reference to the text editor. @type editor: An Editor object. s/apps/scribes/spell_checkttoggledtdestroyN( Rt__init__t"_SpellCheckButton__init_attributest!_SpellCheckButton__set_propertiest_SpellCheckButton__clientt notify_addt$_SpellCheckButton__check_spelling_cbtconnectt_SpellCheckButton__toggled_cbt_SpellCheckButton__signal_id_1t_SpellCheckButton__managert_SpellCheckButton__destroy_cbt_SpellCheckButton__signal_id_2(tselftmanagerteditor((s'plugins/Preferences/SpellCheckButton.pyR)s  cCs2||_||_|i|_d|_|_dS(sĺ Initialize the button's data attributes. @param self: Reference to the SpellCheckButton instance. @type self: A SpellCheckButton object. @param editor: Reference to the text editor. @type editor: An Editor object. N(t_SpellCheckButton__editorR t gconf_clientRtNoneR R(RRR((s'plugins/Preferences/SpellCheckButton.pyt__init_attributes:s   cCsŹt}|iidƒ}ddkl}||ƒo|iidƒ}n|i|ƒddkl}|i |ƒ|i t ƒddk l }|iii||ƒdS(s• Define the default behavior of the button. @param self: Reference to the SpellCheckButton instance. @type self: A SpellCheckButton object. s/apps/scribes/spell_checki˙˙˙˙(ttruth(tmsg0022(tspell_check_button_tipN(tFalseRtgettoperatorRtget_boolt set_activeti18nRt set_labeltset_use_underlinetTruetSCRIBES.tooltipsRRttiptset_tip(Rtcheck_spellingtvalueRRR((s'plugins/Preferences/SpellCheckButton.pyt__set_propertiesJs    c Csît}|iidƒ}ddkl}||ƒo|iidƒ}n|oQ|iƒtjo|itƒnddk l }|i i i |ddƒnH|iƒo|itƒnddk l} |i i i | ddƒdS( sŁ Handles callback when spell checking properties change. @param self: Reference to the SpellCheckButton instance. @type self: A SpellCheckButton object. s/apps/scribes/spell_checki˙˙˙˙(R(tmsg0023tsucceedi(tmsg0024N(RRRRRRt get_activeRR"RR)Rtfeedbacktupdate_status_messageR+( Rtclienttcnxn_idtentrytdataR&R'RR)R+((s'plugins/Preferences/SpellCheckButton.pyt__check_spelling_cb^s  cCs…|iƒ}|o4|iidƒtjo|iidtƒqqn+|iidƒo|iidtƒn|iidƒtS(sU Handles callback when the "toggled" signal is emitted. @param self: Reference to the SpellCheckButton instance. @type self: A SpellCheckButton object. @param button: Reference to the SpellCheckButton. @type button: A SpellCheckButton object. @return: True to propagate signals to parent widgets. @type: A Boolean Object. s/apps/scribes/spell_check(R,RRRtset_boolR"tnotify(RtbuttonR&((s'plugins/Preferences/SpellCheckButton.pyt __toggled_cbvs cCsZddkl}l}||i|ƒ||i|iƒ|iƒ||ƒ~d}dS(s Handles callback when the "destroy" signal is emitted. @param self: Reference to the SpellCheckButton instance. @type self: A SpellCheckButton object. @param manager: Reference to the PreferencesManager instance. @type manager: A PreferencesManager object. i˙˙˙˙(tdisconnect_signaltdelete_attributesN(t SCRIBES.utilsR8R9R RR RR(RRR8R9((s'plugins/Preferences/SpellCheckButton.pyt __destroy_cbs   ( t__name__t __module__t__doc__RRRR R R(((s'plugins/Preferences/SpellCheckButton.pyR"s     N(R>tgtkRR(((s'plugins/Preferences/SpellCheckButton.pyss