'Save the exported data to a file using a file chooser.'

def _save_as(self, widg):

    chooser = gtk.FileChooserDialog(title='Save    as...', action=gtk.FILE_CHOOSER_ACTION_SAVE, buttons=(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, gtk.STOCK_OPEN, gtk.RESPONSE_OK))
    response = chooser.run()
    if (response == gtk.RESPONSE_OK):
        filename = chooser.get_filename()
        try:
            fh = file(filename, 'w')
            fh.write(self.exported_text.get_text())
        except:
            msg = _('Failed    to    save    exported    data    to    file')
            dlg = gtk.MessageDialog(None, gtk.DIALOG_MODAL, gtk.MESSAGE_ERROR, gtk.BUTTONS_OK, msg)
            opt = dlg.run()
            dlg.destroy()
    elif (response == gtk.RESPONSE_CANCEL):
        pass
    chooser.destroy()
