From 58b5d4a15ba661d7ef7046d9f64a5df688397274 Mon Sep 17 00:00:00 2001 From: Francois Cartegnie Date: Sat, 18 Sep 2010 14:41:43 +0200 Subject: [PATCH] Qt: rebase about dialog on Qtcreator --- modules/gui/qt4/Modules.am | 2 + modules/gui/qt4/dialogs/help.cpp | 66 +++--------- modules/gui/qt4/dialogs/help.hpp | 2 + modules/gui/qt4/ui/about.ui | 178 +++++++++++++++++++++++++++++++ 4 files changed, 195 insertions(+), 53 deletions(-) create mode 100644 modules/gui/qt4/ui/about.ui diff --git a/modules/gui/qt4/Modules.am b/modules/gui/qt4/Modules.am index 3365f93b07..55ad347e14 100644 --- a/modules/gui/qt4/Modules.am +++ b/modules/gui/qt4/Modules.am @@ -86,6 +86,7 @@ nodist_SOURCES_qt4 = \ ui/sprefs_video.h \ ui/streampanel.h \ ui/messages_panel.h \ + ui/about.h \ ui/sout.h DEPS_res = \ @@ -358,6 +359,7 @@ EXTRA_DIST += \ ui/sprefs_video.ui \ ui/streampanel.ui \ ui/messages_panel.ui \ + ui/about.ui \ ui/sout.ui \ ui/vlm.ui \ $(DEPS_res) diff --git a/modules/gui/qt4/dialogs/help.cpp b/modules/gui/qt4/dialogs/help.cpp index d19cc93fa5..93989498d9 100644 --- a/modules/gui/qt4/dialogs/help.cpp +++ b/modules/gui/qt4/dialogs/help.cpp @@ -82,35 +82,28 @@ void HelpDialog::close() AboutDialog::AboutDialog( intf_thread_t *_p_intf) : QVLCDialog( (QWidget*)_p_intf->p_sys->p_mi, _p_intf ) { + /* Build UI */ + ui.setupUi( this ); + setWindowTitle( qtr( "About" ) ); setWindowRole( "vlc-about" ); resize( 600, 500 ); setMinimumSize( 600, 500 ); setWindowModality( Qt::WindowModal ); - QGridLayout *layout = new QGridLayout( this ); - QTabWidget *tab = new QTabWidget( this ); - - QPushButton *closeButton = new QPushButton( qtr( "&Close" ) ); - closeButton->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum ); - closeButton->setDefault( true ); + CONNECT( ui.closeButtonBox, rejected(), this, close() ); + ui.closeButtonBox->setFocus(); - QLabel *introduction = new QLabel( + ui.introduction->setText( qtr( "VLC media player" ) + qfu( " " VERSION_MESSAGE ) ); - QLabel *iconVLC = new QLabel; + if( QDate::currentDate().dayOfYear() >= 354 ) - iconVLC->setPixmap( QPixmap( ":/logo/vlc48-christmas.png" ) ); + ui.iconVLC->setPixmap( QPixmap( ":/logo/vlc128-christmas.png" ) ); else - iconVLC->setPixmap( QPixmap( ":/logo/vlc48.png" ) ); - layout->addWidget( iconVLC, 0, 0, 1, 1 ); - layout->addWidget( introduction, 0, 1, 1, 7 ); - layout->addWidget( tab, 1, 0, 1, 8 ); - layout->addWidget( closeButton, 2, 6, 1, 2 ); + ui.iconVLC->setPixmap( QPixmap( ":/logo/vlc128.png" ) ); /* Main Introduction */ - QWidget *infoWidget = new QWidget( this ); - QHBoxLayout *infoLayout = new QHBoxLayout( infoWidget ); - QLabel *infoLabel = new QLabel( + ui.infoLabel->setText( qtr( "VLC media player is a free media player, " "encoder and streamer that can read from files, " "CDs, DVDs, network streams, capture cards and even more!\n" @@ -124,48 +117,15 @@ AboutDialog::AboutDialog( intf_thread_t *_p_intf) + qtr( "Copyright (C) " ) + COPYRIGHT_YEARS + qtr( " by the VideoLAN Team.\n" ) + "vlc@videolan.org, http://www.videolan.org" ); - infoLabel->setWordWrap( infoLabel ); - - QLabel *iconVLC2 = new QLabel; - if( QDate::currentDate().dayOfYear() >= 354 ) - iconVLC2->setPixmap( QPixmap( ":/logo/vlc128-christmas.png" ) ); - else - iconVLC2->setPixmap( QPixmap( ":/logo/vlc128.png" ) ); - infoLayout->addWidget( iconVLC2 ); - infoLayout->addWidget( infoLabel ); /* GPL License */ - QTextEdit *licenseEdit = new QTextEdit( this ); - licenseEdit->setText( qfu( psz_license ) ); - licenseEdit->setReadOnly( true ); + ui.licenseEdit->setText( qfu( psz_license ) ); /* People who helped */ - QWidget *thanksWidget = new QWidget( this ); - QVBoxLayout *thanksLayout = new QVBoxLayout( thanksWidget ); - - QLabel *thanksLabel = new QLabel( qtr( "We would like to thank the whole " - "VLC community, the testers, our users and the following people " - "(and the missing ones...) for their collaboration to " - "create the best free software." ) ); - thanksLabel->setWordWrap( true ); - thanksLayout->addWidget( thanksLabel ); - QTextEdit *thanksEdit = new QTextEdit( this ); - thanksEdit->setText( qfu( psz_thanks ) ); - thanksEdit->setReadOnly( true ); - thanksLayout->addWidget( thanksEdit ); + ui.thanksEdit->setText( qfu( psz_thanks ) ); /* People who wrote the software */ - QTextEdit *authorsEdit = new QTextEdit( this ); - authorsEdit->setText( qfu( psz_authors ) ); - authorsEdit->setReadOnly( true ); - - /* add the tabs to the Tabwidget */ - tab->addTab( infoWidget, qtr( "About" ) ); - tab->addTab( authorsEdit, qtr( "Authors" ) ); - tab->addTab( thanksWidget, qtr("Thanks") ); - tab->addTab( licenseEdit, qtr("License") ); - - BUTTONACT( closeButton, close() ); + ui.authorsEdit->setText( qfu( psz_authors ) ); } AboutDialog::~AboutDialog() diff --git a/modules/gui/qt4/dialogs/help.hpp b/modules/gui/qt4/dialogs/help.hpp index 0f1a2b2366..495747ae6a 100644 --- a/modules/gui/qt4/dialogs/help.hpp +++ b/modules/gui/qt4/dialogs/help.hpp @@ -32,6 +32,7 @@ #include "util/qvlcframe.hpp" #include "util/singleton.hpp" +#include "ui/about.h" class QPushButton; class QTextBrowser; @@ -61,6 +62,7 @@ class AboutDialog : public QVLCDialog, public Singleton private: AboutDialog( intf_thread_t * ); virtual ~AboutDialog(); + Ui::aboutWidget ui; public slots: void close(); diff --git a/modules/gui/qt4/ui/about.ui b/modules/gui/qt4/ui/about.ui new file mode 100644 index 0000000000..6b6d990ad7 --- /dev/null +++ b/modules/gui/qt4/ui/about.ui @@ -0,0 +1,178 @@ + + + aboutWidget + + + + 0 + 0 + 520 + 357 + + + + About + + + + + + 0 + + + + Version + + + + + + + 0 + 0 + + + + + 0 + 40 + + + + + 75 + true + + + + introduction + + + Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + + + + + 0 + 0 + + + + infoLabel + + + true + + + Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse + + + + + + + + 0 + 0 + + + + iconVLC + + + + + + + + Authors + + + + + + Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + + + + + Thanks + + + + + + We would like to thank the whole VLC community, the testers, our users and the following people (and the missing ones...) for their collaboration to create the best free software. + + + true + + + + + + + Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + + + + + Licence + + + + + + + Courier + 9 + + + + QTextEdit::NoWrap + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Courier'; font-size:9pt; font-weight:400; font-style:normal;"> +<table border="0" style="-qt-table-type: root; margin-top:4px; margin-bottom:4px; margin-left:4px; margin-right:4px;"> +<tr> +<td style="border: none;"> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans'; font-size:10pt;"></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans'; font-size:10pt;"></p></td></tr></table></body></html> + + + false + + + Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + + + + + + + + QDialogButtonBox::Close + + + + + + + + -- 2.39.2