mirror of
https://github.com/ankitects/anki.git
synced 2025-11-09 14:17:13 -05:00
split dropbox folder calculation into seperate defn so plugins can change it
This commit is contained in:
parent
33372980cc
commit
bff095925d
1 changed files with 11 additions and 7 deletions
|
|
@ -2875,13 +2875,7 @@ This deck already exists on your computer. Overwrite the local copy?"""),
|
||||||
if not prefix:
|
if not prefix:
|
||||||
next = ""
|
next = ""
|
||||||
elif prefix == "dropbox":
|
elif prefix == "dropbox":
|
||||||
if sys.platform.startswith("win32"):
|
p = self.dropboxFolder()
|
||||||
s = QSettings(QSettings.UserScope, "Microsoft", "Windows")
|
|
||||||
s.beginGroup("CurrentVersion/Explorer/Shell Folders")
|
|
||||||
p = os.path.join(unicode(s.value("Personal").toString()),
|
|
||||||
"My Dropbox")
|
|
||||||
else:
|
|
||||||
p = os.path.expanduser("~/Dropbox")
|
|
||||||
next = os.path.join(p, "Public", "Anki")
|
next = os.path.join(p, "Public", "Anki")
|
||||||
else:
|
else:
|
||||||
next = prefix
|
next = prefix
|
||||||
|
|
@ -2925,6 +2919,16 @@ This deck already exists on your computer. Overwrite the local copy?"""),
|
||||||
# everything copied, we can remove old folder
|
# everything copied, we can remove old folder
|
||||||
shutil.rmtree(from_, ignore_errors=True)
|
shutil.rmtree(from_, ignore_errors=True)
|
||||||
|
|
||||||
|
def dropboxFolder(self):
|
||||||
|
if sys.platform.startswith("win32"):
|
||||||
|
s = QSettings(QSettings.UserScope, "Microsoft", "Windows")
|
||||||
|
s.beginGroup("CurrentVersion/Explorer/Shell Folders")
|
||||||
|
p = os.path.join(unicode(s.value("Personal").toString()),
|
||||||
|
"My Dropbox")
|
||||||
|
else:
|
||||||
|
p = os.path.expanduser("~/Dropbox")
|
||||||
|
return p
|
||||||
|
|
||||||
def setupDropbox(self, deck):
|
def setupDropbox(self, deck):
|
||||||
if not self.config['dropboxPublicFolder']:
|
if not self.config['dropboxPublicFolder']:
|
||||||
# put a file in the folder
|
# put a file in the folder
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue