łň 2ëEc@s0dZddklZdefd„ƒYZdS(s This module documents a class that creates the font 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 FontButtontPreferencesFontButtoncBsDeZdZd„Zd„Zd„Zd„Zd„Zd„ZRS(sN This class creates a font button for the text editor's preference dialog. cCstti|ƒ|i||ƒ|iƒ|iid|iƒ|id|iƒ|_ |i id|i ƒ|_ dS(s Initialize the font button. @param self: Reference to the PreferencesFontButton instance. @type self: A PreferencesFontButton object. s/apps/scribes/fontsfont-settdestroyN( Rt__init__t'_PreferencesFontButton__init_attributest&_PreferencesFontButton__set_propertiest_PreferencesFontButton__clientt notify_addt'_PreferencesFontButton__font_changed_cbtconnectt#_PreferencesFontButton__font_set_cbt#_PreferencesFontButton__signal_id_1t_PreferencesFontButton__managert"_PreferencesFontButton__destroy_cbt#_PreferencesFontButton__signal_id_2(tselftmanagerteditor((s!plugins/Preferences/FontButton.pyR(s   cCs2||_||_|i|_d|_|_dS(s Initialize the button's data attributes. @param self: Reference to the PreferencesFontButton instance. @type self: A PreferencesFontButton object. N(t_PreferencesFontButton__editorR t gconf_clientRtNoneR R(RRR((s!plugins/Preferences/FontButton.pyt__init_attributes6s    cCs‚d}|iidƒ}ddkl}||ƒo|iidƒ}n|i|ƒddkl}|ii i ||ƒdS(sŸ Define the default behavior of the button. @param self: Reference to the PreferencesFontButton instance. @type self: A PreferencesFontButton object. s Monospace 12s/apps/scribes/fonti˙˙˙˙(ttruth(tfont_button_tipN( RtgettoperatorRt get_stringt set_font_nametSCRIBES.tooltipsRRttiptset_tip(Rt font_nametvalueRR((s!plugins/Preferences/FontButton.pyt__set_propertiesCs  cCs7|iiƒ}||iƒjo|i|ƒndS(s Handles callback when font changes. @param self: Reference to the PreferencesFontButton instance. @type self: A PreferencesFontButton object. @param client: A client used to query the GConf daemon and database @type client: A gconf.Client object. @param cnxn_id: The identification number for the GConf client. @type cnxn_id: An Integer object. @param entry: An entry from the GConf database. @type entry: A gconf.Entry object. @param data: Optional data @type data: Any type object. N(R t to_stringt get_font_nameR(Rtclienttcnxn_idtentrytdataR((s!plugins/Preferences/FontButton.pyt__font_changed_cbTscCsf|iƒ}|iid|ƒ|iidƒddkl}||}|iii|ddƒt S(si Handles callback when the "clicked" signal is emitted. @param self: Reference to the PreferencesFontButton instance. @type self: A PreferencesFontButton object. @param button: Reference to the PreferencesFontButton. @type button: A PreferencesFontButton object. @return: True to propagate signals to parent widgets. @type: A Boolean Object. s/apps/scribes/fonti˙˙˙˙(tmsg0011tsucceedi( R#Rt set_stringtnotifyti18nR)Rtfeedbacktupdate_status_messagetTrue(RtbuttonRR)tmessage((s!plugins/Preferences/FontButton.pyt __font_set_cbls  cCsZddkl}l}||i|ƒ||i|iƒ|iƒ||ƒ~d}dS(s Handles callback when the "destroy" signal is emitted. @param self: Reference to the PreferencesFontButton instance. @type self: A PreferencesFontButton object. @param manager: Reference to the PreferencesManager instance. @type manager: A PreferencesManager object. i˙˙˙˙(tdisconnect_signaltdelete_attributesN(t SCRIBES.utilsR4R5R RR RR(RRR4R5((s!plugins/Preferences/FontButton.pyt __destroy_cbs   ( t__name__t __module__t__doc__RRRRR R (((s!plugins/Preferences/FontButton.pyR"s    N(R:tgtkRR(((s!plugins/Preferences/FontButton.pyss