preferences.hpp 2.58 KB
Newer Older
Clément Stenac's avatar
Clément Stenac committed
1
/*****************************************************************************
2
 * preferences.hpp : Preferences
3 4
 *****************************************************************************
 * Copyright (C) 2006-2007 the VideoLAN team
5
 * $Id$
Clément Stenac's avatar
Clément Stenac committed
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
 *
 * Authors: Clément Stenac <zorglub@videolan.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, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22
 *****************************************************************************/
Clément Stenac's avatar
Clément Stenac committed
23 24 25 26 27

#ifndef _PREFS_DIALOG_H_
#define _PREFS_DIALOG_H_

#include "util/qvlcframe.hpp"
Clément Stenac's avatar
Clément Stenac committed
28
#include "components/simple_preferences.hpp"
Clément Stenac's avatar
Clément Stenac committed
29 30

class PrefsTree;
Clément Stenac's avatar
Clément Stenac committed
31
class SPrefsCatList;
32
class AdvPrefsPanel;
Clément Stenac's avatar
Clément Stenac committed
33
class SPrefsPanel;
Clément Stenac's avatar
Clément Stenac committed
34 35 36 37 38 39 40 41
class QTreeWidgetItem;
class QTreeWidget;
class QHBoxLayout;
class QVBoxLayout;
class QGroupBox;
class QRadioButton;
class QWidget;
class QCheckBox;
42
class QLabel;
Clément Stenac's avatar
Clément Stenac committed
43

44
class PrefsDialog : public QVLCDialog
Clément Stenac's avatar
Clément Stenac committed
45 46 47
{
    Q_OBJECT;
public:
48
    static PrefsDialog * getInstance( intf_thread_t *p_intf )
Clément Stenac's avatar
Clément Stenac committed
49 50
    {
        if( !instance )
51
            instance = new PrefsDialog( (QWidget *)p_intf->p_sys->p_mi, p_intf );
Clément Stenac's avatar
Clément Stenac committed
52 53
        return instance;
    }
Clément Stenac's avatar
Clément Stenac committed
54
    virtual ~PrefsDialog() {};
55 56
#if 0
    /*Called from extended settings, is not used anymore, but could be useful one day*/
Clément Stenac's avatar
Clément Stenac committed
57
    void showModulePrefs( char* );
58
#endif
59

Clément Stenac's avatar
Clément Stenac committed
60
private:
61
    PrefsDialog( QWidget *, intf_thread_t * );
62
    QGridLayout *main_layout;
Clément Stenac's avatar
Clément Stenac committed
63

64 65
    void destroyPanels();

66 67
    QWidget *main_panel;
    QHBoxLayout *main_panel_l;
68 69

    AdvPrefsPanel *advanced_panel;
70
    SPrefsPanel *current_simple_panel;
Clément Stenac's avatar
Clément Stenac committed
71
    SPrefsPanel *simple_panels[SPrefsMax];
72 73 74

    QWidget *tree_panel;
    QHBoxLayout *tree_panel_l;
75

Clément Stenac's avatar
Clément Stenac committed
76
    SPrefsCatList *simple_tree;
77 78
    PrefsTree *advanced_tree;

Clément Stenac's avatar
Clément Stenac committed
79 80
    QGroupBox *types;
    QRadioButton *small,*all;
Clément Stenac's avatar
Clément Stenac committed
81

Clément Stenac's avatar
Clément Stenac committed
82
    static PrefsDialog *instance;
83

Clément Stenac's avatar
Clément Stenac committed
84
private slots:
85
    void setAdvanced();
86 87 88 89 90 91 92 93
    void setSmall();

    void changeAdvPanel( QTreeWidgetItem * );
    void changeSimplePanel( int );

    void save();
    void cancel();
    void reset();
94
    void close() { save(); };
Clément Stenac's avatar
Clément Stenac committed
95 96 97
};

#endif