mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Edit Book: Add an option to show full file paths in the Files Browser instead of just the file name (in Preferences->Main window)
Edit Book: Fix filename being duplicated in the Files Browser when multiple files with the same name are present. Merge branch 'master' of https://github.com/JimmXinu/calibre
This commit is contained in:
commit
102bd76e8c
@ -73,6 +73,7 @@ d['editor_accepts_drops'] = True
|
||||
d['toolbar_icon_size'] = 24
|
||||
d['insert_full_screen_image'] = False
|
||||
d['preserve_aspect_ratio_when_inserting_image'] = False
|
||||
d['file_list_shows_full_pathname'] = False
|
||||
del d
|
||||
|
||||
ucase_map = {l:string.ascii_uppercase[i] for i, l in enumerate(string.ascii_lowercase)}
|
||||
|
@ -169,6 +169,7 @@ class Boss(QObject):
|
||||
if ret == p.Accepted:
|
||||
setup_cssutils_serialization()
|
||||
self.gui.apply_settings()
|
||||
self.refresh_file_list()
|
||||
if ret == p.Accepted or p.dictionaries_changed:
|
||||
for ed in editors.itervalues():
|
||||
ed.apply_settings(dictionaries_changed=p.dictionaries_changed)
|
||||
|
@ -304,6 +304,9 @@ class FileList(QTreeWidget):
|
||||
return category
|
||||
|
||||
def set_display_name(name, item):
|
||||
if tprefs['file_list_shows_full_pathname']:
|
||||
text = name
|
||||
else:
|
||||
if name in processed:
|
||||
# We have an exact duplicate (can happen if there are
|
||||
# duplicates in the spine)
|
||||
@ -312,9 +315,10 @@ class FileList(QTreeWidget):
|
||||
return
|
||||
|
||||
parts = name.split('/')
|
||||
text = parts[-1]
|
||||
text = parts.pop()
|
||||
while text in seen and parts:
|
||||
text = parts.pop() + '/' + text
|
||||
|
||||
seen[text] = item
|
||||
item.setText(0, text)
|
||||
item.setText(1, hexlify(sort_key(text)))
|
||||
|
@ -321,6 +321,14 @@ class MainWindowSettings(BasicSettings):
|
||||
))
|
||||
l.addRow(nd)
|
||||
|
||||
nd = self('file_list_shows_full_pathname')
|
||||
nd.setText(_('Show full file paths in the Files Browser'))
|
||||
nd.setToolTip('<p>' + _(
|
||||
'Showing the full file paths is useful when editing books that contain'
|
||||
' multiple files with the same file name.'
|
||||
))
|
||||
l.addRow(nd)
|
||||
|
||||
class PreviewSettings(BasicSettings):
|
||||
|
||||
def __init__(self, parent=None):
|
||||
|
Loading…
x
Reference in New Issue
Block a user