designed-based about dialog

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1783 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Tobias Doerffel
2008-10-19 21:47:52 +00:00
parent a44ce72b0a
commit 7f713f456b
3 changed files with 310 additions and 112 deletions

View File

@@ -1,5 +1,3 @@
#ifndef SINGLE_SOURCE_COMPILE
/*
* about_dialog.cpp - implementation of about-dialog
*
@@ -25,111 +23,55 @@
*/
#include <QtGui/QLabel>
#include <QtGui/QPushButton>
#include <QtGui/QResizeEvent>
#include <QtGui/QTabWidget>
#include <QtGui/QTextEdit>
#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

View File

@@ -0,0 +1,272 @@
<ui version="4.0" >
<class>AboutDialog</class>
<widget class="QDialog" name="AboutDialog" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>558</width>
<height>357</height>
</rect>
</property>
<property name="windowTitle" >
<string>About LMMS</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3" >
<property name="spacing" >
<number>8</number>
</property>
<property name="margin" >
<number>8</number>
</property>
<item>
<layout class="QHBoxLayout" name="horizontalLayout" >
<item>
<widget class="QLabel" name="iconLabel" >
<property name="minimumSize" >
<size>
<width>64</width>
<height>64</height>
</size>
</property>
<property name="text" >
<string/>
</property>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_2" >
<item>
<widget class="QLabel" name="label" >
<property name="styleSheet" >
<string notr="true" >font:12pt; font-weight:bold;</string>
</property>
<property name="text" >
<string>LMMS (Linux MultiMedia Studio)</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="versionLabel" >
<property name="text" >
<string>Version %1 (%2/%3, Qt %4, %5)</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="horizontalSpacer" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="QTabWidget" name="tabWidget" >
<property name="currentIndex" >
<number>0</number>
</property>
<widget class="QWidget" name="tab" >
<attribute name="title" >
<string>About</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout" >
<item>
<spacer name="verticalSpacer_3" >
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0" >
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_2" >
<property name="text" >
<string>LMMS - easy music production for everyone</string>
</property>
<property name="wordWrap" >
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_2" >
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0" >
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_3" >
<property name="text" >
<string>Copyright (c) 2004-2008, LMMS developers</string>
</property>
<property name="wordWrap" >
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_4" >
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0" >
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_4" >
<property name="text" >
<string>http://lmms.sourceforge.net</string>
</property>
<property name="wordWrap" >
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer" >
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0" >
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_2" >
<attribute name="title" >
<string>Authors</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_4" >
<item>
<widget class="QPlainTextEdit" name="authorLabel" >
<property name="readOnly" >
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="Seite" >
<attribute name="title" >
<string>Translation</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_5" >
<item>
<widget class="QPlainTextEdit" name="translationLabel" >
<property name="readOnly" >
<bool>true</bool>
</property>
<property name="plainText" >
<string>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!</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="Seite_2" >
<attribute name="title" >
<string>License</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_6" >
<item>
<widget class="QPlainTextEdit" name="licenseLabel" >
<property name="readOnly" >
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons" >
<set>QDialogButtonBox::Close</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>AboutDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel" >
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel" >
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>AboutDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel" >
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel" >
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>