File indexing completed on 2022-08-04 15:34:40

0001 /**
0002  * Copyright (C) 2004, 2008 Michael Pyne <mpyne@kde.org>
0003  *
0004  * This program is free software; you can redistribute it and/or modify it under
0005  * the terms of the GNU General Public License as published by the Free Software
0006  * Foundation; either version 2 of the License, or (at your option) any later
0007  * version.
0008  *
0009  * This program is distributed in the hope that it will be useful, but WITHOUT ANY
0010  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
0011  * PARTICULAR PURPOSE. See the GNU General Public License for more details.
0012  *
0013  * You should have received a copy of the GNU General Public License along with
0014  * this program.  If not, see <http://www.gnu.org/licenses/>.
0015  */
0016 
0017 #ifndef JUK_DELETEDIALOG_H
0018 #define JUK_DELETEDIALOG_H
0019 
0020 
0021 #include <QWidget>
0022 #include <QDialog>
0023 #include <QStringList>
0024 
0025 #include <KGuiItem>
0026 
0027 namespace Ui
0028 {
0029     class DeleteDialogBase;
0030 }
0031 
0032 class DeleteDialog;
0033 
0034 class DeleteWidget : public QWidget
0035 {
0036     Q_OBJECT
0037 
0038 public:
0039     explicit DeleteWidget(QWidget *parent);
0040 
0041     void setFiles(const QStringList &files);
0042     bool shouldDelete() const;
0043 
0044 signals:
0045     void signalShouldDelete(bool);
0046     void accepted();
0047     void rejected();
0048 
0049 protected slots:
0050     virtual void slotShouldDelete(bool shouldDelete);
0051 
0052 private:
0053     friend DeleteDialog; // TODO: Move KGuiItem stuff into here too
0054     Ui::DeleteDialogBase *m_ui;
0055 };
0056 
0057 class DeleteDialog : public QDialog
0058 {
0059     Q_OBJECT
0060 
0061 public:
0062     explicit DeleteDialog(QWidget* parent);
0063 
0064     bool confirmDeleteList(const QStringList &condemnedFiles);
0065     void setFiles(const QStringList &files);
0066     bool shouldDelete() const { return m_widget->shouldDelete(); }
0067 
0068 protected slots:
0069     virtual void accept() override;
0070     void slotShouldDelete(bool shouldDelete);
0071 
0072 private:
0073     DeleteWidget *m_widget;
0074     KGuiItem m_trashGuiItem;
0075 };
0076 
0077 #endif
0078 
0079 // vim: set et sw=4 tw=0 sta: