1 /**
2  * \file playlistdialog.h
3  * Create playlist dialog.
4  *
5  * \b Project: Kid3
6  * \author Urs Fleisch
7  * \date 13 Sep 2009
8  *
9  * Copyright (C) 2009-2018  Urs Fleisch
10  *
11  * This file is part of Kid3.
12  *
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.
17  *
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.
22  *
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/>.
25  */
26 
27 #pragma once
28 
29 #include <QDialog>
30 
31 class QRadioButton;
32 class QCheckBox;
33 class QComboBox;
34 class QLineEdit;
35 class PlaylistConfig;
36 
37 /**
38  * Playlist dialog.
39  */
40 class PlaylistDialog : public QDialog {
41   Q_OBJECT
42 public:
43   /**
44    * Constructor.
45    *
46    * @param parent  parent widget
47    */
48   explicit PlaylistDialog(QWidget* parent);
49 
50   /**
51    * Destructor.
52    */
53   virtual ~PlaylistDialog() override = default;
54 
55   /**
56    * Read the local settings from the configuration.
57    */
58   void readConfig();
59 
60   /**
61    * Get the current dialog configuration.
62    *
63    * @param cfg the current configuration is returned here
64    */
65   void getCurrentConfig(PlaylistConfig& cfg) const;
66 
67   /**
68    * Get the entered file name to create a new empty playlist.
69    * @return file name if "Create new empty playlist" is selected, else empty.
70    */
71   QString getFileNameForNewEmptyPlaylist() const;
72 
73 private slots:
74   /**
75    * Save the local settings to the configuration.
76    */
77   void saveConfig() const;
78 
79   /**
80    * Show help.
81    */
82   void showHelp();
83 
84 private:
85   QRadioButton* m_sameAsDirNameButton;
86   QRadioButton* m_fileNameFormatButton;
87   QRadioButton* m_fileNameForEmptyButton;
88   QLineEdit* m_fileNameForEmptyEdit;
89   QComboBox* m_locationComboBox;
90   QComboBox* m_formatComboBox;
91   QCheckBox* m_onlySelectedFilesCheckBox;
92   QRadioButton* m_sortFileNameButton;
93   QRadioButton* m_sortTagFieldButton;
94   QRadioButton* m_relPathButton;
95   QRadioButton* m_fullPathButton;
96   QRadioButton* m_writeListButton;
97   QRadioButton* m_writeInfoButton;
98   QComboBox* m_fileNameFormatComboBox;
99   QComboBox* m_sortTagFieldComboBox;
100   QComboBox* m_writeInfoComboBox;
101 };
102