mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
3e41aa0feb
commit
462990210c
@ -12,7 +12,7 @@ from PyQt4.Qt import (QMenu, Qt, QInputDialog, QToolButton, QDialog,
|
|||||||
QDialogButtonBox, QGridLayout, QLabel, QLineEdit, QIcon, QSize,
|
QDialogButtonBox, QGridLayout, QLabel, QLineEdit, QIcon, QSize,
|
||||||
QCoreApplication)
|
QCoreApplication)
|
||||||
|
|
||||||
from calibre import isbytestring
|
from calibre import isbytestring, sanitize_file_name_unicode
|
||||||
from calibre.constants import filesystem_encoding, iswindows
|
from calibre.constants import filesystem_encoding, iswindows
|
||||||
from calibre.utils.config import prefs
|
from calibre.utils.config import prefs
|
||||||
from calibre.gui2 import (gprefs, warning_dialog, Dispatcher, error_dialog,
|
from calibre.gui2 import (gprefs, warning_dialog, Dispatcher, error_dialog,
|
||||||
@ -275,7 +275,7 @@ class ChooseLibraryAction(InterfaceAction):
|
|||||||
'<p>'+_('Choose a new name for the library <b>%s</b>. ')%name +
|
'<p>'+_('Choose a new name for the library <b>%s</b>. ')%name +
|
||||||
'<p>'+_('Note that the actual library folder will be renamed.'),
|
'<p>'+_('Note that the actual library folder will be renamed.'),
|
||||||
text=name)
|
text=name)
|
||||||
newname = unicode(newname)
|
newname = sanitize_file_name_unicode(unicode(newname))
|
||||||
if not ok or not newname or newname == name:
|
if not ok or not newname or newname == name:
|
||||||
return
|
return
|
||||||
newloc = os.path.join(base, newname)
|
newloc = os.path.join(base, newname)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user