mirror of
https://github.com/fergalmoran/picard.git
synced 2026-02-24 00:26:08 +00:00
Set default paths to standard locations
This commit is contained in:
@@ -21,15 +21,19 @@
|
||||
import os
|
||||
import sys
|
||||
from PyQt5 import QtCore, QtWidgets
|
||||
from PyQt5.QtCore import QStandardPaths
|
||||
from picard import config
|
||||
from picard.formats import supported_formats
|
||||
from picard.util import find_existing_path
|
||||
|
||||
|
||||
_default_current_browser_path = QStandardPaths.writableLocation(QStandardPaths.HomeLocation)
|
||||
|
||||
|
||||
class FileBrowser(QtWidgets.QTreeView):
|
||||
|
||||
options = [
|
||||
config.TextOption("persist", "current_browser_path", ""),
|
||||
config.TextOption("persist", "current_browser_path", _default_current_browser_path),
|
||||
config.BoolOption("persist", "show_hidden_files", False),
|
||||
]
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
import os.path
|
||||
from functools import partial
|
||||
from PyQt5 import QtCore, QtWidgets
|
||||
from PyQt5.QtCore import QStandardPaths
|
||||
from picard import config
|
||||
from picard.util import icontheme
|
||||
from picard.ui.options import OptionsPage, register_options_page
|
||||
@@ -29,6 +30,9 @@ from picard.const import UI_LANGUAGES
|
||||
import locale
|
||||
|
||||
|
||||
_default_starting_dir = QStandardPaths.writableLocation(QStandardPaths.HomeLocation)
|
||||
|
||||
|
||||
class InterfaceOptionsPage(OptionsPage):
|
||||
|
||||
NAME = "interface"
|
||||
@@ -96,7 +100,7 @@ class InterfaceOptionsPage(OptionsPage):
|
||||
config.BoolOption("setting", "quit_confirmation", True),
|
||||
config.TextOption("setting", "ui_language", ""),
|
||||
config.BoolOption("setting", "starting_directory", False),
|
||||
config.TextOption("setting", "starting_directory_path", ""),
|
||||
config.TextOption("setting", "starting_directory_path", _default_starting_dir),
|
||||
config.TextOption("setting", "load_image_behavior", "append"),
|
||||
config.ListOption("setting", "toolbar_layout", [
|
||||
'add_directory_action',
|
||||
|
||||
@@ -22,6 +22,7 @@ import os.path
|
||||
import sys
|
||||
from functools import partial
|
||||
from PyQt5 import QtWidgets
|
||||
from PyQt5.QtCore import QStandardPaths
|
||||
from PyQt5.QtGui import QPalette
|
||||
from picard import config
|
||||
from picard.const import PICARD_URLS
|
||||
@@ -40,6 +41,10 @@ _DEFAULT_FILE_NAMING_FORMAT = "$if2(%albumartist%,%artist%)/" \
|
||||
"$if(%_multiartist%,%artist% - ,)" \
|
||||
"%title%"
|
||||
|
||||
|
||||
_default_music_dir = QStandardPaths.writableLocation(QStandardPaths.MusicLocation)
|
||||
|
||||
|
||||
class RenamingOptionsPage(OptionsPage):
|
||||
|
||||
NAME = "filerenaming"
|
||||
@@ -58,7 +63,7 @@ class RenamingOptionsPage(OptionsPage):
|
||||
_DEFAULT_FILE_NAMING_FORMAT,
|
||||
),
|
||||
config.BoolOption("setting", "move_files", False),
|
||||
config.TextOption("setting", "move_files_to", ""),
|
||||
config.TextOption("setting", "move_files_to", _default_music_dir),
|
||||
config.BoolOption("setting", "move_additional_files", False),
|
||||
config.TextOption("setting", "move_additional_files_pattern", "*.jpg *.png"),
|
||||
config.BoolOption("setting", "delete_empty_dirs", True),
|
||||
|
||||
Reference in New Issue
Block a user