Block cluttering of the user's home folder
This commit is contained in:
+2
-4
@@ -68,7 +68,6 @@ class Config:
|
|||||||
self.confPath = None # Folder where the config is saved
|
self.confPath = None # Folder where the config is saved
|
||||||
self.confFile = None # The config file name
|
self.confFile = None # The config file name
|
||||||
self.dataPath = None # Folder where app data is stored
|
self.dataPath = None # Folder where app data is stored
|
||||||
self.homePath = None # The user's home folder
|
|
||||||
self.lastPath = None # The last user-selected folder (browse dialogs)
|
self.lastPath = None # The last user-selected folder (browse dialogs)
|
||||||
self.appPath = None # The full path to the novelwriter package folder
|
self.appPath = None # The full path to the novelwriter package folder
|
||||||
self.appRoot = None # The full path to the novelwriter root folder
|
self.appRoot = None # The full path to the novelwriter root folder
|
||||||
@@ -257,8 +256,7 @@ class Config:
|
|||||||
logger.verbose("Data path: %s" % self.dataPath)
|
logger.verbose("Data path: %s" % self.dataPath)
|
||||||
|
|
||||||
self.confFile = self.appHandle+".conf"
|
self.confFile = self.appHandle+".conf"
|
||||||
self.homePath = os.path.expanduser("~")
|
self.lastPath = os.path.expanduser("~")
|
||||||
self.lastPath = self.homePath
|
|
||||||
self.appPath = getattr(sys, "_MEIPASS", os.path.abspath(os.path.dirname(__file__)))
|
self.appPath = getattr(sys, "_MEIPASS", os.path.abspath(os.path.dirname(__file__)))
|
||||||
self.appRoot = os.path.join(self.appPath, os.path.pardir)
|
self.appRoot = os.path.join(self.appPath, os.path.pardir)
|
||||||
self.assetPath = os.path.join(self.appPath, "assets")
|
self.assetPath = os.path.join(self.appPath, "assets")
|
||||||
@@ -268,7 +266,7 @@ class Config:
|
|||||||
self.appIcon = os.path.join(self.iconPath, "novelwriter.svg")
|
self.appIcon = os.path.join(self.iconPath, "novelwriter.svg")
|
||||||
|
|
||||||
logger.verbose("App path: %s" % self.appPath)
|
logger.verbose("App path: %s" % self.appPath)
|
||||||
logger.verbose("Home path: %s" % self.homePath)
|
logger.verbose("Last path: %s" % self.lastPath)
|
||||||
|
|
||||||
# If config folder does not exist, make it.
|
# If config folder does not exist, make it.
|
||||||
# This assumes that the os config folder itself exists.
|
# This assumes that the os config folder itself exists.
|
||||||
|
|||||||
@@ -757,6 +757,10 @@ class NWProject():
|
|||||||
if self.projPath is None or self.projPath == "":
|
if self.projPath is None or self.projPath == "":
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
if self.projPath == os.path.expanduser("~"):
|
||||||
|
# Don't make a mess in the user's home folder
|
||||||
|
return False
|
||||||
|
|
||||||
self.projMeta = os.path.join(self.projPath, "meta")
|
self.projMeta = os.path.join(self.projPath, "meta")
|
||||||
self.projCache = os.path.join(self.projPath, "cache")
|
self.projCache = os.path.join(self.projPath, "cache")
|
||||||
self.projContent = os.path.join(self.projPath, "content")
|
self.projContent = os.path.join(self.projPath, "content")
|
||||||
|
|||||||
@@ -320,11 +320,12 @@ class GuiWritingStats(QDialog):
|
|||||||
|
|
||||||
# Generate the file name
|
# Generate the file name
|
||||||
if fileExt:
|
if fileExt:
|
||||||
fileName = "sessionStats.%s" % fileExt
|
saveDir = self.mainConf.lastPath
|
||||||
saveDir = self.mainConf.lastPath
|
|
||||||
savePath = os.path.join(saveDir, fileName)
|
|
||||||
if not os.path.isdir(saveDir):
|
if not os.path.isdir(saveDir):
|
||||||
saveDir = self.mainConf.homePath
|
saveDir = os.path.expanduser("~")
|
||||||
|
|
||||||
|
fileName = "sessionStats.%s" % fileExt
|
||||||
|
savePath = os.path.join(saveDir, fileName)
|
||||||
|
|
||||||
dlgOpt = QFileDialog.Options()
|
dlgOpt = QFileDialog.Options()
|
||||||
dlgOpt |= QFileDialog.DontUseNativeDialog
|
dlgOpt |= QFileDialog.DontUseNativeDialog
|
||||||
|
|||||||
Reference in New Issue
Block a user