diff --git a/include/about_dialog.h b/include/about_dialog.h index a3c46773e..b2621ba52 100644 --- a/include/about_dialog.h +++ b/include/about_dialog.h @@ -1,7 +1,7 @@ /* * about_dialog.h - declaration of class aboutDialog * - * Copyright (c) 2004-2007 Tobias Doerffel + * Copyright (c) 2004-2008 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -28,29 +28,13 @@ #include -class QPushButton; -class QLabel; -class QTabWidget; +#include "ui_about_dialog.h" -class aboutDialog : public QDialog +class aboutDialog : public QDialog, public Ui::AboutDialog { - Q_OBJECT public: aboutDialog( void ); - ~aboutDialog(); - - -protected: - virtual void keyPressEvent( QKeyEvent * _ke ); - virtual void resizeEvent( QResizeEvent * _re ); - - -private: - QPushButton * m_okBtn; - QLabel * m_iconLbl; - QLabel * m_appNameLbl; - QTabWidget * m_aboutTabs; } ; diff --git a/src/gui/about_dialog.cpp b/src/gui/about_dialog.cpp index c19a40dc8..4d4887217 100644 --- a/src/gui/about_dialog.cpp +++ b/src/gui/about_dialog.cpp @@ -1,5 +1,3 @@ -#ifndef SINGLE_SOURCE_COMPILE - /* * about_dialog.cpp - implementation of about-dialog * @@ -25,111 +23,55 @@ */ -#include -#include -#include -#include -#include - - #include "lmmsconfig.h" #include "about_dialog.h" #include "embed.h" +#include "engine.h" +#include "main_window.h" +#ifdef __GNUC__ +#define GCC_VERSION "GCC "__VERSION__ +#else +#define GCC_VERSION "unknown compiler" +#endif + +#ifdef LMMS_HOST_X86 +#define MACHINE "i386" +#elif LMMS_HOST_X86_64 +#define MACHINE "x86_64" +#else +#define MACHINE "unknown processor" +#endif + +#ifdef LMMS_BUILD_LINUX +#define PLATFORM "Linux" +#elif LMMS_BUILD_APPLE +#define PLATFORM "OS X" +#elif LMMS_BUILD_WIN32 +#define PLATFORM "win32" +#endif aboutDialog::aboutDialog() : - QDialog() + QDialog( engine::getMainWindow() ), + Ui::AboutDialog() { - setWindowTitle( tr( "About LMMS..." ) ); + setupUi( this ); - m_iconLbl = new QLabel( this ); - m_iconLbl->setPixmap( embed::getIconPixmap( "icon" ) ); - m_iconLbl->setGeometry( 10, 10, 64, 64 ); + iconLabel->setPixmap( embed::getIconPixmap( "icon" ) ); - m_appNameLbl = new QLabel( tr( "Linux MultiMedia Studio %1" - ).arg( LMMS_VERSION ), this ); - m_appNameLbl->setGeometry( 80, 30, 280, 20 ); + versionLabel->setText( versionLabel->text(). + arg( LMMS_VERSION ). + arg( PLATFORM ). + arg( MACHINE ). + arg( QT_VERSION_STR ). + arg( GCC_VERSION ) ); - m_aboutTabs = new QTabWidget( this ); + authorLabel->setPlainText( embed::getText( "AUTHORS" ) ); - QLabel * about_lbl = new QLabel( tr( "LMMS - A powerful " - "synthesizer-studio\n\n" - "Copyright (c) 2004-2008 " - "LMMS-Developers\n\n" - "http://lmms.sourceforge.net" ) - ); - about_lbl->setAlignment( Qt::AlignVCenter | Qt::AlignLeft ); - about_lbl->setIndent( 30 ); - - - QTextEdit * authors_lbl = new QTextEdit(); - authors_lbl->setPlainText( embed::getText( "AUTHORS" ) ); - authors_lbl->setReadOnly( TRUE ); - authors_lbl->setLineWrapMode( QTextEdit::NoWrap ); - - QTextEdit * translation_lbl = new QTextEdit(); - translation_lbl->setPlainText( tr( "Current language not translated." - "\n\nIf you're interested in " - "translating LMMS in another " - "language or want to improve " - "existing translations, you're " - "welcome to help us! Just " - "contact the maintainer!" ) ); - translation_lbl->setReadOnly( TRUE ); - - - QTextEdit * copying_lbl = new QTextEdit(); - copying_lbl->setPlainText( embed::getText( "COPYING" ) ); - copying_lbl->setReadOnly( TRUE ); - copying_lbl->setLineWrapMode( QTextEdit::NoWrap ); - - - m_aboutTabs->addTab( about_lbl, tr( "About" ) ); - m_aboutTabs->addTab( authors_lbl, tr( "Authors" ) ); - m_aboutTabs->addTab( translation_lbl, tr( "Translation" ) ); - m_aboutTabs->addTab( copying_lbl, tr( "License" ) ); - - m_okBtn = new QPushButton( tr( "Close" ), this ); - connect( m_okBtn, SIGNAL( clicked() ), this, SLOT( accept() ) ); - - resize( 400, 390 ); + licenseLabel->setPlainText( embed::getText( "COPYING" ) ); } - -aboutDialog::~aboutDialog() -{ -} - - - - -void aboutDialog::keyPressEvent( QKeyEvent * _ke ) -{ - if( _ke->key() == Qt::Key_Escape ) - { - accept(); - } -} - - - - -void aboutDialog::resizeEvent( QResizeEvent * _re ) -{ - m_aboutTabs->setGeometry( 10, 90, _re->size().width() - 20, - _re->size().height() - 140 ); - m_okBtn->setGeometry( _re->size().width() - 110, - _re->size().height() - 40, 100, 30 ); -} - - - - -#include "moc_about_dialog.cxx" - - -#endif diff --git a/src/gui/dialogs/about_dialog.ui b/src/gui/dialogs/about_dialog.ui new file mode 100644 index 000000000..5cd23b433 --- /dev/null +++ b/src/gui/dialogs/about_dialog.ui @@ -0,0 +1,272 @@ + + AboutDialog + + + + 0 + 0 + 558 + 357 + + + + About LMMS + + + + 8 + + + 8 + + + + + + + + 64 + 64 + + + + + + + + + + + + + font:12pt; font-weight:bold; + + + LMMS (Linux MultiMedia Studio) + + + + + + + Version %1 (%2/%3, Qt %4, %5) + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + 0 + + + + About + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 10 + + + + + + + + LMMS - easy music production for everyone + + + true + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 10 + + + + + + + + Copyright (c) 2004-2008, LMMS developers + + + true + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 10 + + + + + + + + http://lmms.sourceforge.net + + + true + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + Authors + + + + + + true + + + + + + + + Translation + + + + + + true + + + Current language not translated (or native English). + +If you're interested in translating LMMS in another language or want to improve existing translations, you're welcome to help us! Simply contact the maintainer! + + + + + + + + License + + + + + + true + + + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Close + + + + + + + + + buttonBox + accepted() + AboutDialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + AboutDialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + +