3
* Miscellaneous Configuration.
9
* Copyright (C) 2004-2007 Urs Fleisch
11
* This file is part of Kid3.
13
* Kid3 is free software; you can redistribute it and/or modify
14
* it under the terms of the GNU General Public License as published by
15
* the Free Software Foundation; either version 2 of the License, or
16
* (at your option) any later version.
18
* Kid3 is distributed in the hope that it will be useful,
19
* but WITHOUT ANY WARRANTY; without even the implied warranty of
20
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
* GNU General Public License for more details.
23
* You should have received a copy of the GNU General Public License
24
* along with this program. If not, see <http://www.gnu.org/licenses/>.
30
#include <qstringlist.h>
31
#include "qtcompatmac.h"
32
#if QT_VERSION >= 0x040000
35
#include <qvaluelist.h>
38
#include "generalconfig.h"
43
* Miscellaneous Configuration.
45
class MiscConfig : public GeneralConfig
48
/** The ID3v2 version used for new tags. */
54
/** Encoding used for ID3v2 frames. */
61
/** Name for Vorbis picture. */
62
enum VorbisPictureName {
63
VP_METADATA_BLOCK_PICTURE,
68
* External command in context menu.
75
* @param name display name
76
* @param cmd command string with argument codes
77
* @param confirm true if confirmation required
78
* @param showOutput true if output of command shall be shown
80
explicit MenuCommand(const QString& name = QString::null,
81
const QString& cmd = QString::null,
82
bool confirm = false, bool showOutput = false);
87
* @param strList string list with encoded command
89
explicit MenuCommand(const QStringList& strList);
92
* Encode into string list.
94
* @return string list with encoded command.
96
QStringList toStringList() const;
99
* Get the display name.
102
const QString& getName() const { return m_name; }
105
* Get the command string.
106
* @return command string.
108
const QString& getCommand() const { return m_cmd; }
111
* Check if command must be confirmed.
112
* @return true if command has to be confirmed.
114
bool mustBeConfirmed() const { return m_confirm; }
117
* Check if command output has to be shown.
118
* @return true if command output has to be shown.
120
bool outputShown() const { return m_showOutput; }
132
MiscConfig(const QString& group);
137
virtual ~MiscConfig();
140
* Persist configuration.
142
* @param config KDE configuration
145
#ifdef CONFIG_USE_KDE
153
* Read persisted configuration.
155
* @param config KDE configuration
158
#ifdef CONFIG_USE_KDE
165
/** true to mark truncated ID3v1.1 fields */
166
bool m_markTruncations;
167
/** true to write total number of tracks into track fields */
168
bool m_enableTotalNumberOfTracks;
169
/** true to write genres as text instead of numeric string */
170
bool m_genreNotNumeric;
171
/** true to preserve file time stamps */
173
/** true to mark changed fields */
175
/** field name used for Vorbis comment entries */
176
QString m_commentName;
177
/** index of field name used for Vorbis picture entries */
178
int m_pictureNameItem;
179
/** filter of file names to be opened */
180
QString m_nameFilter;
181
/** filename format */
182
QString m_formatText;
183
/** index of filename format selected */
185
/** filename formats */
186
QStringList m_formatItems;
187
/** from filename format */
188
QString m_formatFromFilenameText;
189
/** index of from filename format selected */
190
int m_formatFromFilenameItem;
191
/** from filename formats */
192
QStringList m_formatFromFilenameItems;
193
/** directory name format */
194
QString m_dirFormatText;
195
/** index of directory name format selected */
197
/** rename directory from tags 1, tags 2, or both */
199
/** number tracks in tags 1, tags 2, or both */
200
int m_numberTracksDst;
201
/** number tracks start number */
202
int m_numberTracksStart;
203
#if QT_VERSION >= 0x040000
204
/** List of splitter sizes. */
205
typedef QList<int> SizesList;
206
/** List of menu commands */
207
typedef QList<MenuCommand> MenuCommandList;
209
/** List of splitter sizes. */
210
typedef QValueList<int> SizesList;
211
/** List of menu commands */
212
typedef QValueList<MenuCommand> MenuCommandList;
214
/** size of splitter in main window */
215
SizesList m_splitterSizes;
216
/** size of file/dirlist splitter */
217
SizesList m_vSplitterSizes;
218
/** commands available in context menu */
219
MenuCommandList m_contextMenuCommands;
220
/** custom genres for ID3v2.3 */
221
QStringList m_customGenres;
222
#ifndef CONFIG_USE_KDE
223
#if QT_VERSION >= 0x040000
224
/** true to hide toolbar */
227
/** true to hide statusbar */
228
bool m_hideStatusBar;
230
/** true to automatically hide unused tags */
232
/** true to hide file controls */
234
/** true to hide ID3v1.1 controls */
236
/** true to hide ID3v2.3 controls */
238
/** true to hide picture preview */
240
/** version used for new ID3v2 tags */
242
/** text encoding used for new ID3v1 tags */
243
QString m_textEncodingV1;
244
/** text encoding used for new ID3v2 tags */
246
/** number of digits in track number */
247
int m_trackNumberDigits;
248
/** true if proxy is used */
250
/** proxy used for access */
252
#if QT_VERSION >= 0x040000
253
/** true to use proxy authentication */
254
bool m_useProxyAuthentication;
255
/** proxy user name */
256
QString m_proxyUserName;
257
/** proxy password */
258
QString m_proxyPassword;
260
/** web browser substituted for %b */
262
/** true to show only custom genres in combo boxes */
263
bool m_onlyCustomGenres;
264
#ifndef CONFIG_USE_KDE
265
#if QT_VERSION >= 0x040200
266
/** mainwindow geometry */
267
QByteArray m_geometry;
268
/** mainwindow state */
269
QByteArray m_windowState;
271
/** mainwindow x-position */
273
/** mainwindow y-position */
275
/** mainwindow width */
277
/** mainwindow height */
280
/** true if custom application font is used */
282
/** custom application font family */
283
QString m_fontFamily;
284
/** custom application font size */
286
/** custom application style, empty if not used */
290
/** Default value for comment name */
291
static const char* const s_defaultCommentName;
292
/** Default value for web browser */
293
static const char* const s_defaultBrowser;
294
/** Default filename format list */
295
static const char** s_defaultFnFmtList;
296
/** Default directory format list */
297
static const char** s_defaultDirFmtList;