mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
Fix choosing a file without saving the dir not working on windows
Apparently the data file button in the insert link tool for the comments editor is the only place this was noticed.
This commit is contained in:
parent
6259565a94
commit
9948d17edc
@ -838,7 +838,7 @@ class EditorWidget(QTextEdit, LineEditECM): # {{{
|
|||||||
is_image = q in {'jpeg', 'png', 'gif', 'webp'}
|
is_image = q in {'jpeg', 'png', 'gif', 'webp'}
|
||||||
d.treat_as_image.setChecked(is_image)
|
d.treat_as_image.setChecked(is_image)
|
||||||
if data_dir:
|
if data_dir:
|
||||||
path = os.path.relpath(path, base)
|
path = os.path.relpath(path, base).replace(os.sep, '/')
|
||||||
d.url.setText(path)
|
d.url.setText(path)
|
||||||
b.clicked.connect(lambda: cf())
|
b.clicked.connect(lambda: cf())
|
||||||
d.brdf = b = QPushButton(_('&Data file'))
|
d.brdf = b = QPushButton(_('&Data file'))
|
||||||
|
@ -268,8 +268,7 @@ def choose_files(window, name, title,
|
|||||||
ans = run_file_dialog(window, title, allow_multiple=not select_only_single_file, initial_folder=initial_folder, file_types=file_types)
|
ans = run_file_dialog(window, title, allow_multiple=not select_only_single_file, initial_folder=initial_folder, file_types=file_types)
|
||||||
if ans and not no_save_dir:
|
if ans and not no_save_dir:
|
||||||
dynamic.set(name, os.path.dirname(ans[0]))
|
dynamic.set(name, os.path.dirname(ans[0]))
|
||||||
return ans
|
return ans or None
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
def choose_images(window, name, title, select_only_single_file=True, formats=None):
|
def choose_images(window, name, title, select_only_single_file=True, formats=None):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user