fix exporting & one bug in stats image export
This commit is contained in:
parent
d9fe0ef6e7
commit
d831bbee5f
@ -68,12 +68,12 @@ class ExportDialog(QDialog):
|
||||
# it's a verbatim apkg export, so place on desktop instead of
|
||||
# choosing file; use homedir if no desktop
|
||||
usingHomedir = False
|
||||
file = os.path.join(QDesktopServices.storageLocation(
|
||||
QDesktopServices.DesktopLocation), "collection.apkg")
|
||||
file = os.path.join(QStandardPaths.writableLocation(
|
||||
QStandardPaths.DesktopLocation), "collection.apkg")
|
||||
if not os.path.exists(os.path.dirname(file)):
|
||||
usingHomedir = True
|
||||
file = os.path.join(QDesktopServices.storageLocation(
|
||||
QDesktopServices.HomeLocation), "collection.apkg")
|
||||
file = os.path.join(QStandardPaths.writableLocation(
|
||||
QStandardPaths.HomeLocation), "collection.apkg")
|
||||
if os.path.exists(file):
|
||||
if usingHomedir:
|
||||
question = _("%s already exists in your home directory. Overwrite it?")
|
||||
|
@ -49,7 +49,8 @@ class DeckStats(QDialog):
|
||||
name = time.strftime("-%Y-%m-%d@%H-%M-%S.png",
|
||||
time.localtime(time.time()))
|
||||
name = "anki-"+_("stats")+name
|
||||
desktopPath = QDesktopServices.storageLocation(QDesktopServices.DesktopLocation)
|
||||
desktopPath = QStandardPaths.writableLocation(
|
||||
QStandardPaths.DesktopLocation)
|
||||
if not os.path.exists(desktopPath):
|
||||
os.mkdir(desktopPath)
|
||||
path = os.path.join(desktopPath, name)
|
||||
|
Loading…
Reference in New Issue
Block a user