1 /*****************************************************************************
2 * ml_configuration.hpp: ML's configuration dialog (folder view)
3 *****************************************************************************
4 * Copyright (C) 2008-2010 the VideoLAN Team and AUTHORS
7 * Authors: Antoine Lejeune <phytos@videolan.org>
8 * Jean-Philippe André <jpeg@videolan.org>
9 * Rémi Duraffort <ivoire@videolan.org>
10 * Adrien Maglo <magsoft@videolan.org>
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
25 *****************************************************************************/
28 #ifndef _MEDIA_LIBRARY_CONFIG_H
29 #define _MEDIA_LIBRARY_CONFIG_H
37 #include <vlc_common.h>
38 #include <vlc_media_library.h>
40 #include "util/qvlcframe.hpp"
44 #include <QDialogButtonBox>
45 #include <QPushButton>
47 /** Classes in this header */
51 /** *************************************************************************
52 * \brief Model representing the filesystem and whose items are checkable
53 ****************************************************************************/
54 class MLDirModel
: public QDirModel
59 MLDirModel( const QStringList
&nameFilters
, QDir::Filters filters
,
60 QDir::SortFlags sort
, QObject
*parent
= 0 )
61 : QDirModel( nameFilters
, filters
, sort
, parent
) {};
63 virtual Qt::ItemFlags
flags( const QModelIndex
&index
) const;
64 virtual QVariant
data( const QModelIndex
&index
, int role
) const;
65 virtual bool setData( const QModelIndex
&index
, const QVariant
&value
,
66 int role
= Qt::EditRole
);
67 int columnCount( const QModelIndex
&parent
= QModelIndex() ) const;
68 void reset( bool, vlc_array_t
*);
70 QStringList monitoredDirs
;
74 QMap
<QString
, Qt::CheckState
> itemCheckState
;
75 intf_thread_t
*p_intf
;
76 media_library_t
* p_ml
;
79 void setRecursivity( bool );
82 /** *************************************************************************
83 * \brief Configuration dialog for the media library
84 ****************************************************************************/
85 class MLConfDialog
: public QVLCDialog
89 MLConfDialog( QWidget
*, intf_thread_t
* );
94 vlc_array_t
*p_monitored_dirs
;
95 media_library_t
*p_ml
;
96 intf_thread_t
*p_intf
;
99 QCheckBox
*recursivity
;
101 static MLConfDialog
*instance
;
107 void close() { save(); };