deletedialog.h 1.81 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
/**
 * Copyright (C) 2004, 2008 Michael Pyne <mpyne@kde.org>
 *
 * This program is free software; you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation; either version 2 of the License, or (at your option) any later
 * version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
 * PARTICULAR PURPOSE. See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program.  If not, see <http://www.gnu.org/licenses/>.
 */
16

17 18
#ifndef JUK_DELETEDIALOG_H
#define JUK_DELETEDIALOG_H
19

20
class QStringList;
21

22
#include <QWidget>
23
#include <QDialog>
24

25
#include <KGuiItem>
26 27 28 29 30

namespace Ui
{
    class DeleteDialogBase;
}
31

32 33
class DeleteDialog;

34
class DeleteWidget : public QWidget
35 36 37 38
{
    Q_OBJECT

public:
Yuri Chornoivan's avatar
Yuri Chornoivan committed
39
    explicit DeleteWidget(QWidget *parent);
40

41
    void setFiles(const QStringList &files);
42 43 44 45
    bool shouldDelete() const;

signals:
    void signalShouldDelete(bool);
46 47
    void accepted();
    void rejected();
48 49 50

protected slots:
    virtual void slotShouldDelete(bool shouldDelete);
51 52

private:
53
    friend DeleteDialog; // TODO: Move KGuiItem stuff into here too
54
    Ui::DeleteDialogBase *m_ui;
55 56
};

57
class DeleteDialog : public QDialog
58
{
59 60
    Q_OBJECT

61
public:
Yuri Chornoivan's avatar
Yuri Chornoivan committed
62
    explicit DeleteDialog(QWidget* parent);
63

64
    bool confirmDeleteList(const QStringList &condemnedFiles);
65
    void setFiles(const QStringList &files);
66
    bool shouldDelete() const { return m_widget->shouldDelete(); }
67 68

protected slots:
69
    virtual void accept() override;
70
    void slotShouldDelete(bool shouldDelete);
71

72 73 74
private:
    DeleteWidget *m_widget;
    KGuiItem m_trashGuiItem;
75 76 77 78
};

#endif

79
// vim: set et sw=4 tw=0 sta: