File indexing completed on 2025-02-23 04:34:18

0001 /**
0002  * \file playlistdialog.h
0003  * Create playlist dialog.
0004  *
0005  * \b Project: Kid3
0006  * \author Urs Fleisch
0007  * \date 13 Sep 2009
0008  *
0009  * Copyright (C) 2009-2024  Urs Fleisch
0010  *
0011  * This file is part of Kid3.
0012  *
0013  * Kid3 is free software; you can redistribute it and/or modify
0014  * it under the terms of the GNU General Public License as published by
0015  * the Free Software Foundation; either version 2 of the License, or
0016  * (at your option) any later version.
0017  *
0018  * Kid3 is distributed in the hope that it will be useful,
0019  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0020  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0021  * GNU General Public License for more details.
0022  *
0023  * You should have received a copy of the GNU General Public License
0024  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
0025  */
0026 
0027 #pragma once
0028 
0029 #include <QDialog>
0030 
0031 class QRadioButton;
0032 class QCheckBox;
0033 class QComboBox;
0034 class QLineEdit;
0035 class PlaylistConfig;
0036 
0037 /**
0038  * Playlist dialog.
0039  */
0040 class PlaylistDialog : public QDialog {
0041   Q_OBJECT
0042 public:
0043   /**
0044    * Constructor.
0045    *
0046    * @param parent  parent widget
0047    */
0048   explicit PlaylistDialog(QWidget* parent);
0049 
0050   /**
0051    * Destructor.
0052    */
0053   ~PlaylistDialog() override = default;
0054 
0055   /**
0056    * Read the local settings from the configuration.
0057    */
0058   void readConfig();
0059 
0060   /**
0061    * Get the current dialog configuration.
0062    *
0063    * @param cfg the current configuration is returned here
0064    */
0065   void getCurrentConfig(PlaylistConfig& cfg) const;
0066 
0067   /**
0068    * Get the entered file name to create a new empty playlist.
0069    * @return file name if "Create new empty playlist" is selected, else empty.
0070    */
0071   QString getFileNameForNewEmptyPlaylist() const;
0072 
0073 private slots:
0074   /**
0075    * Save the local settings to the configuration.
0076    */
0077   void saveConfig() const;
0078 
0079   /**
0080    * Show help.
0081    */
0082   void showHelp();
0083 
0084 private:
0085   QRadioButton* m_sameAsDirNameButton;
0086   QRadioButton* m_fileNameFormatButton;
0087   QRadioButton* m_fileNameForEmptyButton;
0088   QLineEdit* m_fileNameForEmptyEdit;
0089   QComboBox* m_locationComboBox;
0090   QComboBox* m_formatComboBox;
0091   QCheckBox* m_onlySelectedFilesCheckBox;
0092   QRadioButton* m_sortFileNameButton;
0093   QRadioButton* m_sortTagFieldButton;
0094   QRadioButton* m_relPathButton;
0095   QRadioButton* m_fullPathButton;
0096   QRadioButton* m_writeListButton;
0097   QRadioButton* m_writeInfoButton;
0098   QComboBox* m_fileNameFormatComboBox;
0099   QComboBox* m_sortTagFieldComboBox;
0100   QComboBox* m_writeInfoComboBox;
0101 };