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

0001 /**
0002  * \file playlisteditdialog.h
0003  * Edit playlist dialog.
0004  *
0005  * \b Project: Kid3
0006  * \author Urs Fleisch
0007  * \date 05 Aug 2018
0008  *
0009  * Copyright (C) 2018-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 QDialogButtonBox;
0032 class QItemSelectionModel;
0033 class PlaylistModel;
0034 
0035 /**
0036  * Edit playlist dialog.
0037  */
0038 class PlaylistEditDialog : public QDialog {
0039   Q_OBJECT
0040 public:
0041   /**
0042    * Constructor.
0043    * @param model playlist model
0044    * @param selModel selection model of associated file proxy model
0045    * @param parent parent widget
0046    */
0047   PlaylistEditDialog(PlaylistModel* model, QItemSelectionModel* selModel,
0048                      QWidget* parent = nullptr);
0049 
0050   /**
0051    * Destructor.
0052    */
0053   ~PlaylistEditDialog() override;
0054 
0055   /**
0056    * Get playlist model.
0057    * @return playlist model.
0058    */
0059   PlaylistModel* playlistModel() const { return m_playlistModel; }
0060 
0061 protected:
0062   /**
0063    * Ask user before closing with unsaved modifications.
0064    * @param event close event
0065    */
0066   void closeEvent(QCloseEvent* event) override;
0067 
0068 private slots:
0069   void setModified(bool modified);
0070   void showHelp();
0071 
0072 private:
0073   void setWindowCaption();
0074 
0075   QDialogButtonBox* m_buttonBox;
0076   PlaylistModel* m_playlistModel;
0077 };