~ubuntu-branches/debian/sid/calibre/sid

« back to all changes in this revision

Viewing changes to src/calibre/gui2/tweak_book/file_list.py

  • Committer: Package Import Robot
  • Author(s): Martin Pitt
  • Date: 2014-05-14 18:17:50 UTC
  • mto: This revision was merged to the branch mainline in revision 75.
  • Revision ID: package-import@ubuntu.com-20140514181750-efj1wymey2vb4cao
Tags: upstream-1.36.0+dfsg
ImportĀ upstreamĀ versionĀ 1.36.0+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
339
339
                    icon = self.rendered_emblem_cache[emblems] = canvas
340
340
            item.setData(0, Qt.DecorationRole, icon)
341
341
 
342
 
        ok_to_be_unmanifested = container.names_that_need_not_be_manifested
343
342
        cannot_be_renamed = container.names_that_must_not_be_changed
344
343
        ncx_mime = guess_type('a.ncx')
345
344
 
371
370
            if imt == ncx_mime:
372
371
                emblems.append('toc.png')
373
372
                tooltips.append(_('This file contains the metadata table of contents'))
374
 
            if name not in manifested_names and name not in ok_to_be_unmanifested:
 
373
            if name not in manifested_names and not container.ok_to_be_unmanifested(name):
375
374
                emblems.append('dialog_question.png')
376
375
                tooltips.append(_('This file is not listed in the book manifest'))
377
376
            if linear is False:
394
393
        for name, linear in container.spine_names:
395
394
            processed[name] = create_item(name, linear=linear)
396
395
 
397
 
        all_files = list(container.manifest_type_map.iteritems())
398
 
        all_files.append((guess_type('a.opf'), [container.opf_name]))
399
 
 
400
396
        for name in container.name_path_map:
401
397
            if name in processed:
402
398
                continue
617
613
 
618
614
    def export(self, name):
619
615
        path = choose_save_file(self, 'tweak_book_export_file', _('Choose location'), filters=[
620
 
            (_('Files'), [name.rpartition('.')[-1].lower()])], all_files=False)
 
616
            (_('Files'), [name.rpartition('.')[-1].lower()])], all_files=False, initial_filename=name.split('/')[-1])
621
617
        if path:
622
618
            self.export_requested.emit(name, path)
623
619
 
681
677
        l.addWidget(bb)
682
678
        if d.exec_() == d.Accepted:
683
679
            tprefs['remove_existing_links_when_linking_sheets'] = r.isChecked()
684
 
            sheets = [unicode(s.item(i).text()) for i in xrange(s.count()) if s.item(i).checkState() == Qt.Checked]
 
680
            sheets = [unicode(s.item(il).text()) for il in xrange(s.count()) if s.item(il).checkState() == Qt.Checked]
685
681
            if sheets:
686
682
                self.link_stylesheets_requested.emit(names, sheets, r.isChecked())
687
683