9
* Copyright (C) 2003-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/>.
27
#ifndef IMPORTDIALOG_H
28
#define IMPORTDIALOG_H
32
#include "importconfig.h"
42
class MusicBrainzDialog;
44
class ServerImportDialog;
45
class TextImportDialog;
46
class TagImportDialog;
47
class ImportTrackDataVector;
48
class FrameCollection;
51
class MusicBrainzConfig;
57
class ImportDialog : public QDialog {
64
* @param parent parent widget
65
* @param caption dialog title
66
* @param trackDataModel track data to be filled with imported values,
67
* is passed with durations of files set
68
* @param importers server importers
70
ImportDialog(QWidget* parent, QString& caption,
71
TrackDataModel* trackDataModel,
72
const QList<ServerImporter*>& importers);
79
* Set dialog to be started automatically.
81
* @param importerIndex index of importer to use
83
void setAutoStartSubDialog(int importerIndex);
91
* Get import destination.
93
* @return TagV1, TagV2 or TagV2V1 for ID3v1, ID3v2 or both.
95
TrackData::TagVersion getDestination() const;
99
* Shows the dialog as a modal dialog.
110
* Save the local settings to the configuration.
115
* Called when the maximum time difference value is changed.
117
void maxDiffChanged();
122
* The first parameter @a section is not used.
123
* @param fromIndex index of position moved from
124
* @param toIndex index of position moved to
126
void moveTableRow(int, int fromIndex, int toIndex);
129
* Import from server and preview in table.
144
* Show fields to import in text as preview in table.
149
* Match import data with length.
151
void matchWithLength();
154
* Match import data with track number.
156
void matchWithTrack();
159
* Match import data with title.
161
void matchWithTitle();
165
* Import from MusicBrainz and preview in table.
167
void fromMusicBrainz();
173
void hideSubdialogs();
176
* Called when the destination combo box value is changed.
178
void changeTagDestination();
181
* Display custom context menu for horizontal table header.
183
* @param pos position where context menu is drawn on screen
185
void showTableHeaderContextMenu(const QPoint& pos);
188
* Toggle visibility of table column.
190
* @param visible true to make column visible
192
void toggleTableColumnVisibility(bool visible);
196
* Get time difference check configuration.
198
* @param enable true if check is enabled
199
* @param maxDiff maximum allowed time difference
201
void getTimeDifferenceCheck(bool& enable, int& maxDiff) const;
204
* Display server import dialog.
206
* @param importerIdx importer index, if invalid but not negative the
207
* MusicBrainz Fingerprint dialog is displayed
209
void displayServerImportDialog(int importerIdx);
212
* Display server import dialog.
214
* @param source import source
216
void displayServerImportDialog(ServerImporter* source);
218
/** Index of importer for subdialog to open when starting, -1 for none */
219
int m_autoStartSubDialog;
220
/** Mask for visibility of optional columns */
221
quint64 m_columnVisibility;
223
QTableView* m_trackDataTable;
224
/** Track data model */
225
TrackDataModel* m_trackDataModel;
226
/** combobox with import servers */
227
QComboBox* m_serverComboBox;
228
/** combobox with import destinations */
229
QComboBox* m_destComboBox;
230
QCheckBox* m_mismatchCheckBox;
231
QSpinBox* m_maxDiffSpinBox;
232
/** importers for different servers */
233
QList<ServerImporter*> m_importers;
234
/** MusicBrainz import dialog */
235
MusicBrainzDialog* m_musicBrainzDialog;
236
/** Server import dialog */
237
ServerImportDialog* m_serverImportDialog;
238
/** Text import dialog */
239
TextImportDialog* m_textImportDialog;
240
/** Tag import dialog */
241
TagImportDialog* m_tagImportDialog;