default to desktop in getSaveFile; don't force desktop in stats
This commit is contained in:
parent
1e2f934480
commit
b454d6f169
@ -52,17 +52,14 @@ class DeckStats(QDialog):
|
||||
callback()
|
||||
|
||||
def _imagePath(self):
|
||||
desktopPath = QStandardPaths.writableLocation(
|
||||
QStandardPaths.DesktopLocation)
|
||||
name = time.strftime("-%Y-%m-%d@%H-%M-%S.pdf",
|
||||
time.localtime(time.time()))
|
||||
name = "anki-"+_("stats")+name
|
||||
file = os.path.join(desktopPath, name)
|
||||
file = getSaveFile(self, title=_("Save PDF"),
|
||||
dir_description="stats",
|
||||
key="stats",
|
||||
ext=".pdf",
|
||||
fname=file)
|
||||
fname=name)
|
||||
return file
|
||||
|
||||
def saveImage(self):
|
||||
|
@ -279,7 +279,9 @@ def getSaveFile(parent, title, dir_description, key, ext, fname=None):
|
||||
"""Ask the user for a file to save. Use DIR_DESCRIPTION as config
|
||||
variable. The file dialog will default to open with FNAME."""
|
||||
config_key = dir_description + 'Directory'
|
||||
base = aqt.mw.pm.profile.get(config_key, aqt.mw.pm.base)
|
||||
|
||||
desktopPath = QStandardPaths.writableLocation(QStandardPaths.DesktopLocation)
|
||||
base = aqt.mw.pm.profile.get(config_key, desktopPath)
|
||||
path = os.path.join(base, fname)
|
||||
file = QFileDialog.getSaveFileName(
|
||||
parent, title, path, "{0} (*{1})".format(key, ext),
|
||||
|
Loading…
Reference in New Issue
Block a user