Esempio n. 1
0
    def suggest_filename(self):
        """Prepare suggested filename and set it in the file chooser."""
        ix = self.get_selected_format_index()
        ext = self.map_exporters[ix].get_extension()

        default_dir = config.get('paths.recent-export-dir')

        if ext == 'gramps':
            new_filename = os.path.join(default_dir, 'data.gramps')
        elif ext == 'burn':
            new_filename = os.path.basename(self.dbstate.db.get_save_path())
        else:
            new_filename = get_new_filename(ext, default_dir)
        return (default_dir, os.path.split(new_filename)[1])
Esempio n. 2
0
    def suggest_filename(self):
        """Prepare suggested filename and set it in the file chooser."""
        ix = self.get_selected_format_index()
        ext = self.map_exporters[ix].get_extension()

        default_dir = config.get('paths.recent-export-dir')

        if ext == 'gramps':
            new_filename = os.path.join(default_dir,'data.gramps')
        elif ext == 'burn':
            new_filename = os.path.basename(self.dbstate.db.get_save_path())
        else:
            new_filename = get_new_filename(ext,default_dir)
        return (default_dir, os.path.split(new_filename)[1])