directorylist.h 2.05 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
/**
 * Copyright (C) 2003-2004 Scott Wheeler <wheeler@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 19

#ifndef DIRECTORYLIST_H
#define DIRECTORYLIST_H

Laurent Montel's avatar
Laurent Montel committed
20
#include <kdialog.h>
Laurent Montel's avatar
Laurent Montel committed
21
#include "ui_directorylistbase.h"
22

23 24
class QStringListModel;

Laurent Montel's avatar
Laurent Montel committed
25 26 27
class DirectoryListBase : public QWidget, public Ui::DirectoryListBase
{
public:
28 29 30 31
    DirectoryListBase(QWidget *parent) : QWidget(parent)
    {
        setupUi(this);
    }
Laurent Montel's avatar
Laurent Montel committed
32
};
Nadeem Hasan's avatar
Nadeem Hasan committed
33

Laurent Montel's avatar
Laurent Montel committed
34
class DirectoryList : public KDialog
35 36 37 38
{
    Q_OBJECT

public:
39 40
    struct Result
    {
41 42
        QStringList addedDirs;
        QStringList removedDirs;
43
        QStringList excludedDirs;
44 45
        DialogCode status;
        bool addPlaylists;
46 47
    };

48
    DirectoryList(QStringList directories, QStringList excludeDirectories, bool importPlaylists,
Laurent Montel's avatar
Laurent Montel committed
49
                  QWidget *parent = 0);
50 51
    virtual ~DirectoryList();

52 53 54
public slots:
    Result exec();

55
signals:
56 57
    void signalDirectoryAdded(const QString &directory);
    void signalDirectoryRemoved(const QString &directory);
58 59
    void signalExcludeDirectoryAdded(const QString &directory);
    void signalExcludeDirectoryRemoved(const QString &directory);
60 61

private slots:
62 63
    void slotAddDirectory();
    void slotRemoveDirectory();
64 65
    void slotAddExcludeDirectory();
    void slotRemoveExcludeDirectory();
66 67

private:
68 69
    static QStringList defaultFolders();

70
    QStringListModel *m_dirListModel;
71
    QStringListModel *m_excludedDirListModel;
Nadeem Hasan's avatar
Nadeem Hasan committed
72
    DirectoryListBase *m_base;
73
    Result m_result;
74 75 76
};

#endif
Nadeem Hasan's avatar
Nadeem Hasan committed
77

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