示例#1
0
 def on_set_auto_reply_activate(self, *args):
     def response_cb(response, message=''):
         '''callback for the set autoreply dialog'''
         if response == stock.ACCEPT:
             if message == '':
                 dialog.error(_("Empty autoreply"))
             else:
                 self.controller.autoReplyMessage = message 
                 self.config.user['autoReplyMessage'] = message
     window = dialog.entry_window(_("Autoreply message:"), 
         self.config.user['autoReplyMessage'], response_cb, 
         _("Change autoreply"))
     window.show()
示例#2
0
 def customEmoticonSave( self, widget , path , shortcut ):
     def _on_ce_edit_cb(response, text=''):
         '''method called when the edition is done'''
         if response == stock.ACCEPT:
             if text:
                 success, msg = self.controller.customEmoticons.create(\
                     text, path, 1)
                 if not success:
                     dialog.error(msg)
             else:
                 dialog.error(_("Empty shortcut"))
     window = dialog.entry_window(_("New shortcut"), shortcut, 
         _on_ce_edit_cb, _("Shortcut"))
     window.show()
示例#3
0
 def onEditShortcut(self, button, shortcut):
     self.hide()
     def _on_ce_edit_cb(response, text=''):
         '''method called when the edition is done'''
         if response == stock.ACCEPT:
             if text:
                 ret, msg = self.customEmoticons.chageShortcut(shortcut,
                     text)
                 if not ret:
                     dialog.error(msg)
             else:
                 dialog.error(_("Empty shortcut"))
     window = dialog.entry_window(_("New shortcut"), shortcut,
         _on_ce_edit_cb, _("Change shortcut"))
     window.show()
    def customEmoticonSave( self, widget , path , shortcut ):
        def _on_ce_edit_cb(response, text=''):
            '''method called when the edition is done'''

            if response == stock.ACCEPT:
                if text:
                    success, msg = self.controller.customEmoticons.create(\
                        text, path, 1)

                    if not success:
                        dialog.error(msg)
                else:
                    dialog.error(_("Empty shortcut"))

        window = dialog.entry_window(_("New shortcut"), shortcut,
            _on_ce_edit_cb, _("Shortcut"))
        window.show()