1 /*****************************************************************************
2 * Help.cpp : Help and About dialogs
3 ****************************************************************************
4 * Copyright (C) 2007 the VideoLAN team
7 * Authors: Jean-Baptiste Kempf <jb (at) videolan.org>
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.
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.
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 *****************************************************************************/
24 #include "dialogs/help.hpp"
25 #include "dialogs/about.hpp"
27 #include "dialogs_provider.hpp"
29 #include <vlc_intf_strings.h>
31 #include <QTextBrowser>
37 HelpDialog *HelpDialog::instance = NULL;
39 HelpDialog::HelpDialog( intf_thread_t *_p_intf) : QVLCFrame( _p_intf )
41 setWindowTitle( qtr( "Help" ) );
44 QGridLayout *layout = new QGridLayout( this );
45 QTextBrowser *helpBrowser = new QTextBrowser( this );
46 helpBrowser->setOpenExternalLinks( true );
47 helpBrowser->setHtml( I_LONGHELP );
48 QPushButton *closeButton = new QPushButton( qtr( "&Close" ) );
49 closeButton->setDefault( true );
51 layout->addWidget( helpBrowser, 0, 0, 1, 0 );
52 layout->addWidget( closeButton, 1, 3 );
54 BUTTONACT( closeButton, close() );
57 HelpDialog::~HelpDialog()
60 void HelpDialog::close()
62 this->toggleVisible();
65 AboutDialog *AboutDialog::instance = NULL;
67 AboutDialog::AboutDialog( intf_thread_t *_p_intf) : QVLCFrame( _p_intf )
69 setWindowTitle( qtr( "About" ) );
72 QGridLayout *layout = new QGridLayout( this );
73 QTabWidget *tab = new QTabWidget( this );
75 QPushButton *closeButton = new QPushButton( qtr( "&Close" ) );
76 closeButton->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum );
77 closeButton->setDefault( true );
79 QLabel *introduction = new QLabel(
80 qtr( "Information about VLC media player." ) );
81 QLabel *iconVLC = new QLabel;
82 iconVLC->setPixmap( QPixmap( ":/vlc48.png" ) );
83 layout->addWidget( iconVLC, 0, 0, 1, 1 );
84 layout->addWidget( introduction, 0, 1, 1, 7 );
85 layout->addWidget( tab, 1, 0, 1, 8 );
86 layout->addWidget( closeButton, 2, 6, 1, 2 );
88 /* Main Introduction */
89 QWidget *infoWidget = new QWidget( this );
90 QHBoxLayout *infoLayout = new QHBoxLayout( infoWidget );
91 QLabel *infoLabel = new QLabel( "VLC media player " PACKAGE_VERSION "\n\n"
92 "(c) 1996-2007 - the VideoLAN Team\n\n" +
93 qtr( "VLC media player is a free media player, made by the "
94 "VideoLAN Team.\nIt is a standalone multimedia player, "
95 "encoder and streamer, that can read from many supports "
96 "(files, CDs, DVDs, networks, capture cards...) and that "
97 " works on many platforms.\n\n" )
98 + qtr( "You are using the new Qt4 Interface.\n" )
99 + qtr( "Compiled by " ) + qfu( VLC_CompileBy() )+ "@"
100 + qfu( VLC_CompileDomain() ) + ".\n"
101 + "Compiler: " + qfu( VLC_Compiler() ) +".\n"
102 + qtr( "Based on SVN revision: " ) + qfu( VLC_Changeset() )
104 + qtr( "This program comes with NO WARRANTY, to the extent "
105 "permitted by the law; read the distribution tab.\n\n" )
106 + "The VideoLAN team <videolan@videolan.org> \n"
107 "http://www.videolan.org/\n") ;
108 infoLabel->setWordWrap( infoLabel );
110 QLabel *iconVLC2 = new QLabel;
111 iconVLC2->setPixmap( QPixmap( ":/vlc128.png" ) );
112 infoLayout->addWidget( iconVLC2 );
113 infoLayout->addWidget( infoLabel );
116 QTextEdit *licenseEdit = new QTextEdit( this );
117 licenseEdit->setText( qfu( psz_license ) );
118 licenseEdit->setReadOnly( true );
120 /* People who helped */
121 QWidget *thanksWidget = new QWidget( this );
122 QVBoxLayout *thanksLayout = new QVBoxLayout( thanksWidget );
124 QLabel *thanksLabel = new QLabel( qtr("We would like to thanks the whole "
125 "community, the testers, our users and the following people "
126 "(and the missing ones...) for their collaboration to "
127 "provide the best software." ) );
128 thanksLabel->setWordWrap( true );
129 thanksLayout->addWidget( thanksLabel );
130 QTextEdit *thanksEdit = new QTextEdit( this );
131 thanksEdit->setText( qfu( psz_thanks ) );
132 thanksEdit->setReadOnly( true );
133 thanksLayout->addWidget( thanksEdit );
135 /* People who wrote the software */
136 QTextEdit *authorsEdit = new QTextEdit( this );
137 authorsEdit->setText( qfu( psz_authors ) );
138 authorsEdit->setReadOnly( true );
140 /* add the tabs to the Tabwidget */
141 tab->addTab( infoWidget, qtr( "General Info" ) );
142 tab->addTab( authorsEdit, qtr( "Authors" ) );
143 tab->addTab( thanksWidget, qtr("Thanks") );
144 tab->addTab( licenseEdit, qtr("Distribution License") );
146 BUTTONACT( closeButton, close() );
149 AboutDialog::~AboutDialog()
152 void AboutDialog::close()
154 this->toggleVisible();