Skip to content

Commit ce5ed9d

Browse files
authored
Merge pull request #2435 from zas/comment_options
Add header & comment to new options.py
2 parents 64f8d47 + 4c6cb1d commit ce5ed9d

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

picard/options.py

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1+
# -*- coding: utf-8 -*-
2+
#
3+
# Picard, the next-generation MusicBrainz tagger
4+
#
5+
# Copyright (C) 2024 Laurent Monin
6+
#
7+
# This program is free software; you can redistribute it and/or
8+
# modify it under the terms of the GNU General Public License
9+
# as published by the Free Software Foundation; either version 2
10+
# of the License, or (at your option) any later version.
11+
#
12+
# This program is distributed in the hope that it will be useful,
13+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
# GNU General Public License for more details.
16+
#
17+
# You should have received a copy of the GNU General Public License
18+
# along with this program; if not, write to the Free Software
19+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20+
21+
122
import logging
223

324
from PyQt6 import QtCore
@@ -41,6 +62,32 @@
4162
from picard.ui.colors import InterfaceColors
4263

4364

65+
# Note: There are two steps to adding an option to an option page:
66+
#
67+
# 1. The option is added to the appropriate section below.
68+
# If it's using a default value that may be used elsewhere,
69+
# a constant starting with `DEFAULT_` can be added to `const/defaults.py`
70+
# and imported here.
71+
#
72+
# The `title` parameter of `Option` is required for options that may be
73+
# used in user profiles.
74+
# The translated title will be displayed in Profiles option page.
75+
#
76+
# 2. If the option is a 'setting' which is edited in one of the option pages,
77+
# then the option can be registered in the `__init__()` method of the
78+
# matching `OptionPage` declaration with a call to the page's
79+
# `register_setting()` method.
80+
#
81+
# Registering a setting allows it to be reset to the default when the user
82+
# asks for it on the corresponding option page.
83+
#
84+
# If the setting can be overriden in profiles, the `highlights` parameter
85+
# has to be set a list of widget names associated with the option.
86+
#
87+
#
88+
# Please, try to keep options ordered by section and name in their own group.
89+
90+
4491
# picard/coverart/providers/caa.py
4592
# Cover Art Archive Cover Art Archive: Release
4693
BoolOption('setting', 'caa_approved_only', False)

0 commit comments

Comments
 (0)