]> git.sesse.net Git - vlc/blob - modules/gui/qt4/dialogs/help.hpp
Separate the label and the message in update dialog to fix the confusion created...
[vlc] / modules / gui / qt4 / dialogs / help.hpp
1 /*****************************************************************************
2  * Help.hpp : Help and About dialogs
3  ****************************************************************************
4  * Copyright (C) 2007 the VideoLAN team
5  * $Id$
6  *
7  * Authors: Jean-Baptiste Kempf <jb (at) videolan.org>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22  *****************************************************************************/
23
24 #ifndef _HELP_DIALOG_H_
25 #define _HELP_DIALOG_H_
26
27 #ifdef HAVE_CONFIG_H
28 #include "config.h"
29 #endif
30
31 #include "qt4.hpp"
32
33 #include "util/qvlcframe.hpp"
34
35 class QPushButton;
36 class QTextBrowser;
37 class QLabel;
38 class QEvent;
39 class QPushButton;
40 class QTextEdit;
41
42 class HelpDialog : public QVLCFrame
43 {
44     Q_OBJECT;
45 public:
46     static HelpDialog * getInstance( intf_thread_t *p_intf )
47     {
48         if( !instance)
49             instance = new HelpDialog( p_intf );
50         return instance;
51     }
52     static void killInstance()
53     { if( instance ) delete instance; instance = NULL;}
54     virtual ~HelpDialog();
55
56 private:
57     HelpDialog( intf_thread_t * );
58     static HelpDialog *instance;
59 public slots:
60     void close();
61 };
62
63
64 class AboutDialog : public QVLCDialog
65 {
66     Q_OBJECT;
67 public:
68     static AboutDialog * getInstance( intf_thread_t *p_intf )
69     {
70         if( !instance)
71             instance = new AboutDialog( (QWidget *)p_intf->p_sys->p_mi,
72                                         p_intf );
73         return instance;
74     }
75
76 private:
77     AboutDialog( QWidget *, intf_thread_t * );
78     virtual ~AboutDialog();
79
80     static AboutDialog *instance;
81
82 public slots:
83     void close();
84 };
85
86 #ifdef UPDATE_CHECK
87
88 static int UDOkEvent = QEvent::User + DialogEventType + 21;
89 static int UDErrorEvent = QEvent::User + DialogEventType + 22;
90
91 class UpdateDialog : public QVLCFrame
92 {
93     Q_OBJECT;
94 public:
95     static UpdateDialog * getInstance( intf_thread_t *p_intf )
96     {
97         if( !instance )
98             instance = new UpdateDialog( p_intf );
99         return instance;
100     }
101     static void killInstance()
102     { if( instance ) delete instance; instance = NULL;}
103
104     void updateNotify( bool );
105
106 private:
107     UpdateDialog( intf_thread_t * );
108     virtual ~UpdateDialog();
109
110     static UpdateDialog *instance;
111
112     update_t *p_update;
113     QPushButton *updateButton;
114     QLabel *updateLabelTop;
115     QLabel *updateLabelDown;
116     QTextEdit *updateText;
117     void customEvent( QEvent * );
118     bool b_checked;
119
120 private slots:
121     void close();
122     void UpdateOrDownload();
123 };
124 #endif
125
126 #endif