Moved UI files from src/gui/dialogs to src/gui/Forms and renamed files

All UI files are now located in src/gui/Forms and have been renamed.
Old classes using some of the forms (AboutDialog, ExportProjectDialog)
have been adapted to instantiate Ui::* instead of inheriting from it.
This commit is contained in:
Tobias Doerffel
2009-08-22 00:13:58 +02:00
parent fe99a7a35c
commit beed7a6ee6
12 changed files with 180 additions and 175 deletions

View File

@@ -447,7 +447,7 @@ SET(CMAKE_CXX_FLAGS "-O2 -g -fno-exceptions -Wall -ftree-vectorize ${CMAKE_CXX_F
FILE(GLOB_RECURSE lmms_INCLUDES ${CMAKE_SOURCE_DIR}/include/*.h)
FILE(GLOB lmms_UI ${CMAKE_SOURCE_DIR}/src/gui/dialogs/*.ui)
FILE(GLOB lmms_UI ${CMAKE_SOURCE_DIR}/src/gui/Forms/*.ui)
FILE(GLOB_RECURSE lmms_SOURCES ${CMAKE_SOURCE_DIR}/src/*.cpp)
SET(lmms_MOC ${lmms_INCLUDES})

View File

@@ -1,8 +1,8 @@
/*
* about_dialog.h - declaration of class aboutDialog
* AboutDialog.h - declaration of class AboutDialog
*
* Copyright (c) 2004-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* Copyright (c) 2004-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
@@ -22,22 +22,22 @@
*
*/
#ifndef _ABOUT_DIALOG_H
#define _ABOUT_DIALOG_H
#include <QtGui/QDialog>
#include "ui_about_dialog.h"
namespace Ui { class AboutDialog; }
class aboutDialog : public QDialog, public Ui::AboutDialog
class AboutDialog : public QDialog
{
public:
aboutDialog( void );
AboutDialog();
private:
Ui::AboutDialog * ui;
} ;
#endif

View File

@@ -1,9 +1,9 @@
/*
* export_project_dialog.h - declaration of class exportProjectDialog which is
* responsible for exporting project
* ExportProjectDialog.h - declaration of class ExportProjectDialog which
* offers options for exporting project
*
* Copyright (c) 2004-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* Copyright (c) 2004-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
@@ -23,36 +23,34 @@
*
*/
#ifndef _EXPORT_PROJECT_DIALOG_H
#define _EXPORT_PROJECT_DIALOG_H
#include <QtGui/QDialog>
#include "ui_export_project.h"
namespace Ui { class ExportProjectDialog; }
class ProjectRenderer;
class exportProjectDialog : public QDialog, public Ui::ExportProjectDialog
class ExportProjectDialog : public QDialog
{
Q_OBJECT
public:
exportProjectDialog( const QString & _file_name, QWidget * _parent );
virtual ~exportProjectDialog();
ExportProjectDialog( const QString & _file_name, QWidget * _parent );
virtual ~ExportProjectDialog();
protected:
virtual void reject( void );
virtual void reject();
virtual void closeEvent( QCloseEvent * _ce );
private slots:
void startBtnClicked( void );
void startBtnClicked();
void updateTitleBar( int );
private:
Ui::ExportProjectDialog * ui;
QString m_fileName;
ProjectRenderer * m_renderer;

View File

@@ -27,7 +27,7 @@
#include <QtDebug>
#include "AudioFileDevice.h"
#include "export_project_dialog.h"
#include "ExportProjectDialog.h"
#include "engine.h"
@@ -52,7 +52,7 @@ AudioFileDevice::AudioFileDevice( const sample_rate_t _sample_rate,
if( m_outputFile.open( QFile::WriteOnly | QFile::Truncate ) == false )
{
QString warningMessage = exportProjectDialog::tr(
QString warningMessage = ExportProjectDialog::tr(
"Could not open file %1 "
"for writing.\nPlease make "
"sure you have write-"
@@ -61,7 +61,7 @@ AudioFileDevice::AudioFileDevice( const sample_rate_t _sample_rate,
"file and try again!" ).arg( _file );
if( engine::hasGUI() ){
QMessageBox::critical( NULL,
exportProjectDialog::tr( "Could not open file" ),
ExportProjectDialog::tr( "Could not open file" ),
warningMessage,
QMessageBox::Ok,
QMessageBox::NoButton );

View File

@@ -22,7 +22,7 @@
*
*/
#include <QtCore/QCoreApplication>
#include <QtCore/QFile>
#include <QtCore/QFileInfo>
#include <QtGui/QFileDialog>
@@ -42,7 +42,7 @@
#include "ControllerConnection.h"
#include "embed.h"
#include "envelope_and_lfo_parameters.h"
#include "export_project_dialog.h"
#include "ExportProjectDialog.h"
#include "fx_mixer.h"
#include "fx_mixer_view.h"
#include "import_filter.h"
@@ -1164,7 +1164,7 @@ void song::exportProject()
!efd.selectedFiles().isEmpty() && !efd.selectedFiles()[0].isEmpty() )
{
const QString export_file_name = efd.selectedFiles()[0];
exportProjectDialog epd( export_file_name,
ExportProjectDialog epd( export_file_name,
engine::mainWindow() );
epd.exec();
}

View File

@@ -1,8 +1,8 @@
/*
* about_dialog.cpp - implementation of about-dialog
* AboutDialog.cpp - implementation of about-dialog
*
* Copyright (c) 2004-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* Copyright (c) 2004-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
@@ -22,13 +22,12 @@
*
*/
#include "lmmsversion.h"
#include "about_dialog.h"
#include "AboutDialog.h"
#include "embed.h"
#include "engine.h"
#include "MainWindow.h"
#include "ui_AboutDialog.h"
#ifdef __GNUC__
#define GCC_VERSION "GCC "__VERSION__
@@ -61,24 +60,24 @@
#endif
aboutDialog::aboutDialog() :
AboutDialog::AboutDialog() :
QDialog( engine::mainWindow() ),
Ui::AboutDialog()
ui( new Ui::AboutDialog )
{
setupUi( this );
ui->setupUi( this );
iconLabel->setPixmap( embed::getIconPixmap( "icon" ) );
ui->iconLabel->setPixmap( embed::getIconPixmap( "icon" ) );
versionLabel->setText( versionLabel->text().
arg( LMMS_VERSION ).
arg( PLATFORM ).
arg( MACHINE ).
arg( QT_VERSION_STR ).
arg( GCC_VERSION ) );
ui->versionLabel->setText( ui->versionLabel->text().
arg( LMMS_VERSION ).
arg( PLATFORM ).
arg( MACHINE ).
arg( QT_VERSION_STR ).
arg( GCC_VERSION ) );
authorLabel->setPlainText( embed::getText( "AUTHORS" ) );
ui->authorLabel->setPlainText( embed::getText( "AUTHORS" ) );
licenseLabel->setPlainText( embed::getText( "COPYING" ) );
ui->licenseLabel->setPlainText( embed::getText( "COPYING" ) );
}

View File

@@ -1,5 +1,5 @@
/*
* export_project_dialog.cpp - implementation of dialog for exporting project
* ExportProjectDialog.cpp - implementation of dialog for exporting project
*
* Copyright (c) 2004-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
@@ -25,29 +25,31 @@
#include <QtCore/QFileInfo>
#include <QtGui/QMessageBox>
#include "export_project_dialog.h"
#include "ExportProjectDialog.h"
#include "engine.h"
#include "MainWindow.h"
#include "ProjectRenderer.h"
#include "ui_ExportProjectDialog.h"
exportProjectDialog::exportProjectDialog( const QString & _file_name,
ExportProjectDialog::ExportProjectDialog( const QString & _file_name,
QWidget * _parent ) :
QDialog( _parent ),
Ui::ExportProjectDialog(),
ui( new Ui::ExportProjectDialog ),
m_fileName( _file_name ),
m_renderer( NULL )
{
setupUi( this );
setWindowTitle( tr( "Export project to %1" ).arg(
ui->setupUi( this );
setWindowTitle( tr( "Export project to %1" ).arg(
QFileInfo( _file_name ).fileName() ) );
// get the extension of the chosen file
QStringList parts = _file_name.split( '.' );
QString file_ext;
QString fileExt;
if( parts.size() > 0 )
{
file_ext = parts[parts.size()-1];
fileExt = parts[parts.size()-1];
}
int cbIndex = 0;
@@ -56,32 +58,32 @@ exportProjectDialog::exportProjectDialog( const QString & _file_name,
if( __fileEncodeDevices[i].m_getDevInst != NULL )
{
// get the extension of this format
QString render_ext = ProjectRenderer::EFF_ext[i];
QString renderExt = ProjectRenderer::EFF_ext[i];
// add to combo box
fileFormatCB->addItem( ProjectRenderer::tr(
ui->fileFormatCB->addItem( ProjectRenderer::tr(
__fileEncodeDevices[i].m_description ) );
// if this is our extension, select it
if( QString::compare(render_ext, file_ext,
Qt::CaseInsensitive ) == 0 )
if( QString::compare( renderExt, fileExt,
Qt::CaseInsensitive ) == 0 )
{
fileFormatCB->setCurrentIndex(cbIndex);
ui->fileFormatCB->setCurrentIndex(cbIndex);
}
cbIndex++;
}
}
connect( startButton, SIGNAL( clicked() ),
this, SLOT( startBtnClicked() ) );
connect( ui->startButton, SIGNAL( clicked() ),
this, SLOT( startBtnClicked() ) );
}
exportProjectDialog::~exportProjectDialog()
ExportProjectDialog::~ExportProjectDialog()
{
delete m_renderer;
}
@@ -89,7 +91,7 @@ exportProjectDialog::~exportProjectDialog()
void exportProjectDialog::reject()
void ExportProjectDialog::reject()
{
if( m_renderer == NULL )
{
@@ -104,7 +106,7 @@ void exportProjectDialog::reject()
void exportProjectDialog::closeEvent( QCloseEvent * _ce )
void ExportProjectDialog::closeEvent( QCloseEvent * _ce )
{
if( m_renderer != NULL && m_renderer->isRunning() )
{
@@ -116,15 +118,14 @@ void exportProjectDialog::closeEvent( QCloseEvent * _ce )
void exportProjectDialog::startBtnClicked()
void ExportProjectDialog::startBtnClicked()
{
ProjectRenderer::ExportFileFormats ft = ProjectRenderer::NumFileFormats;
for( int i = 0; i < ProjectRenderer::NumFileFormats; ++i )
{
if( fileFormatCB->currentText() ==
ProjectRenderer::tr(
__fileEncodeDevices[i].m_description ) )
if( ui->fileFormatCB->currentText() ==
ProjectRenderer::tr( __fileEncodeDevices[i].m_description ) )
{
ft = __fileEncodeDevices[i].m_fileFormat;
break;
@@ -141,31 +142,30 @@ void exportProjectDialog::startBtnClicked()
return;
}
startButton->setEnabled( false );
progressBar->setEnabled( true );
ui->startButton->setEnabled( false );
ui->progressBar->setEnabled( true );
mixer::qualitySettings qs = mixer::qualitySettings(
static_cast<mixer::qualitySettings::Interpolation>(
interpolationCB->currentIndex() ),
ui->interpolationCB->currentIndex() ),
static_cast<mixer::qualitySettings::Oversampling>(
oversamplingCB->currentIndex() ),
sampleExactControllersCB->isChecked(),
aliasFreeOscillatorsCB->isChecked() );
ui->oversamplingCB->currentIndex() ),
ui->sampleExactControllersCB->isChecked(),
ui->aliasFreeOscillatorsCB->isChecked() );
ProjectRenderer::OutputSettings os = ProjectRenderer::OutputSettings(
samplerateCB->currentText().section( " ", 0, 0 ).toUInt(),
ui->samplerateCB->currentText().section( " ", 0, 0 ).toUInt(),
false,
bitrateCB->currentText().section( " ", 0, 0 ).toUInt(),
static_cast<ProjectRenderer::Depths>(
depthCB->currentIndex() ) );
ui->bitrateCB->currentText().section( " ", 0, 0 ).toUInt(),
static_cast<ProjectRenderer::Depths>( ui->depthCB->currentIndex() ) );
m_renderer = new ProjectRenderer( qs, os, ft, m_fileName );
if( m_renderer->isReady() )
{
updateTitleBar( 0 );
connect( m_renderer, SIGNAL( progressChanged( int ) ),
progressBar, SLOT( setValue( int ) ) );
ui->progressBar, SLOT( setValue( int ) ) );
connect( m_renderer, SIGNAL( progressChanged( int ) ),
this, SLOT( updateTitleBar( int ) ) );
connect( m_renderer, SIGNAL( finished() ),
@@ -184,7 +184,7 @@ void exportProjectDialog::startBtnClicked()
void exportProjectDialog::updateTitleBar( int _prog )
void ExportProjectDialog::updateTitleBar( int _prog )
{
engine::mainWindow()->setWindowTitle(
tr( "Rendering: %1%" ).arg( _prog ) );
@@ -192,7 +192,7 @@ void exportProjectDialog::updateTitleBar( int _prog )
#include "moc_export_project_dialog.cxx"
#include "moc_ExportProjectDialog.cxx"
/* vim: set tw=0 noexpandtab: */

View File

@@ -1,126 +1,127 @@
<ui version="4.0" >
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ExportProjectDialog</class>
<widget class="QDialog" name="ExportProjectDialog" >
<property name="geometry" >
<widget class="QDialog" name="ExportProjectDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>519</width>
<height>412</height>
<height>427</height>
</rect>
</property>
<property name="windowTitle" >
<property name="windowTitle">
<string>Export project</string>
</property>
<layout class="QVBoxLayout" >
<layout class="QVBoxLayout">
<item>
<layout class="QHBoxLayout" >
<layout class="QHBoxLayout">
<item>
<widget class="QGroupBox" name="outputGroupBox" >
<property name="title" >
<widget class="QGroupBox" name="outputGroupBox">
<property name="title">
<string>Output</string>
</property>
<layout class="QVBoxLayout" >
<property name="spacing" >
<layout class="QVBoxLayout">
<property name="spacing">
<number>-1</number>
</property>
<property name="leftMargin" >
<property name="leftMargin">
<number>9</number>
</property>
<item>
<widget class="QLabel" name="label" >
<property name="text" >
<widget class="QLabel" name="label">
<property name="text">
<string>File format:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="fileFormatCB" />
<widget class="QComboBox" name="fileFormatCB"/>
</item>
<item>
<widget class="QLabel" name="label_3" >
<property name="text" >
<widget class="QLabel" name="label_3">
<property name="text">
<string>Samplerate:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="samplerateCB" >
<widget class="QComboBox" name="samplerateCB">
<item>
<property name="text" >
<property name="text">
<string>44100 Hz</string>
</property>
</item>
<item>
<property name="text" >
<property name="text">
<string>48000 Hz</string>
</property>
</item>
<item>
<property name="text" >
<property name="text">
<string>88200 Hz</string>
</property>
</item>
<item>
<property name="text" >
<property name="text">
<string>96000 Hz</string>
</property>
</item>
<item>
<property name="text" >
<property name="text">
<string>192000 Hz</string>
</property>
</item>
</widget>
</item>
<item>
<widget class="QWidget" native="1" name="bitrateWidget" >
<layout class="QVBoxLayout" >
<property name="spacing" >
<widget class="QWidget" name="bitrateWidget" native="true">
<layout class="QVBoxLayout">
<property name="spacing">
<number>-1</number>
</property>
<property name="margin" >
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="label_5" >
<property name="text" >
<widget class="QLabel" name="label_5">
<property name="text">
<string>Bitrate:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="bitrateCB" >
<property name="currentIndex" >
<widget class="QComboBox" name="bitrateCB">
<property name="currentIndex">
<number>2</number>
</property>
<item>
<property name="text" >
<property name="text">
<string>64 KBit/s</string>
</property>
</item>
<item>
<property name="text" >
<property name="text">
<string>128 KBit/s</string>
</property>
</item>
<item>
<property name="text" >
<property name="text">
<string>160 KBit/s</string>
</property>
</item>
<item>
<property name="text" >
<property name="text">
<string>192 KBit/s</string>
</property>
</item>
<item>
<property name="text" >
<property name="text">
<string>256 KBit/s</string>
</property>
</item>
<item>
<property name="text" >
<property name="text">
<string>320 KBit/s</string>
</property>
</item>
@@ -130,32 +131,32 @@
</widget>
</item>
<item>
<widget class="QWidget" native="1" name="depthWidget" >
<layout class="QVBoxLayout" >
<property name="margin" >
<widget class="QWidget" name="depthWidget" native="true">
<layout class="QVBoxLayout">
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="label_6" >
<property name="text" >
<widget class="QLabel" name="label_6">
<property name="text">
<string>Depth:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="depthCB" >
<widget class="QComboBox" name="depthCB">
<item>
<property name="text" >
<property name="text">
<string>16 Bit Integer</string>
</property>
</item>
<item>
<property name="text" >
<property name="text">
<string>24 Bit Integer</string>
</property>
</item>
<item>
<property name="text" >
<property name="text">
<string>32 Bit Float</string>
</property>
</item>
@@ -166,13 +167,13 @@
</item>
<item>
<spacer>
<property name="orientation" >
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0" >
<property name="sizeHint" stdset="0">
<size>
<width>1</width>
<height>10</height>
@@ -181,21 +182,27 @@
</spacer>
</item>
<item>
<widget class="QLabel" name="label_7" >
<property name="text" >
<widget class="QLabel" name="label_7">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Please note that not all of the parameters above apply for all file formats.</string>
</property>
<property name="wordWrap" >
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0" >
<property name="sizeHint" stdset="0">
<size>
<width>163</width>
<height>20</height>
@@ -207,96 +214,96 @@
</widget>
</item>
<item>
<widget class="QGroupBox" name="qualityGroupBox" >
<property name="title" >
<widget class="QGroupBox" name="qualityGroupBox">
<property name="title">
<string>Quality settings</string>
</property>
<layout class="QVBoxLayout" >
<layout class="QVBoxLayout">
<item>
<widget class="QLabel" name="label_2" >
<property name="text" >
<widget class="QLabel" name="label_2">
<property name="text">
<string>Interpolation:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="interpolationCB" >
<property name="currentIndex" >
<widget class="QComboBox" name="interpolationCB">
<property name="currentIndex">
<number>1</number>
</property>
<item>
<property name="text" >
<property name="text">
<string>Zero Order Hold</string>
</property>
</item>
<item>
<property name="text" >
<property name="text">
<string>Sinc Fastest</string>
</property>
</item>
<item>
<property name="text" >
<property name="text">
<string>Sinc Medium (recommended)</string>
</property>
</item>
<item>
<property name="text" >
<property name="text">
<string>Sinc Best (very slow!)</string>
</property>
</item>
</widget>
</item>
<item>
<widget class="QLabel" name="label_4" >
<property name="text" >
<widget class="QLabel" name="label_4">
<property name="text">
<string>Oversampling (use with care!):</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="oversamplingCB" >
<widget class="QComboBox" name="oversamplingCB">
<item>
<property name="text" >
<property name="text">
<string>1x (None)</string>
</property>
</item>
<item>
<property name="text" >
<property name="text">
<string>2x</string>
</property>
</item>
<item>
<property name="text" >
<property name="text">
<string>4x</string>
</property>
</item>
<item>
<property name="text" >
<property name="text">
<string>8x</string>
</property>
</item>
</widget>
</item>
<item>
<widget class="QCheckBox" name="sampleExactControllersCB" >
<property name="text" >
<widget class="QCheckBox" name="sampleExactControllersCB">
<property name="text">
<string>Sample-exact controllers</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="aliasFreeOscillatorsCB" >
<property name="text" >
<widget class="QCheckBox" name="aliasFreeOscillatorsCB">
<property name="text">
<string>Alias-free oscillators</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0" >
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
@@ -310,13 +317,13 @@
</layout>
</item>
<item>
<layout class="QHBoxLayout" >
<layout class="QHBoxLayout">
<item>
<spacer>
<property name="orientation" >
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0" >
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
@@ -325,15 +332,15 @@
</spacer>
</item>
<item>
<widget class="QPushButton" name="startButton" >
<property name="text" >
<widget class="QPushButton" name="startButton">
<property name="text">
<string>Start</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="cancelButton" >
<property name="text" >
<widget class="QPushButton" name="cancelButton">
<property name="text">
<string>Cancel</string>
</property>
</widget>
@@ -341,11 +348,11 @@
</layout>
</item>
<item>
<widget class="QProgressBar" name="progressBar" >
<property name="enabled" >
<widget class="QProgressBar" name="progressBar">
<property name="enabled">
<bool>false</bool>
</property>
<property name="value" >
<property name="value">
<number>0</number>
</property>
</widget>
@@ -360,11 +367,11 @@
<receiver>ExportProjectDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel" >
<hint type="sourcelabel">
<x>357</x>
<y>293</y>
</hint>
<hint type="destinationlabel" >
<hint type="destinationlabel">
<x>202</x>
<y>175</y>
</hint>

View File

@@ -28,6 +28,7 @@
#include <QtGui/QCloseEvent>
#include <QtGui/QDesktopServices>
#include <QtGui/QFileDialog>
#include <QtGui/QLabel>
#include <QtGui/QMdiArea>
#include <QtGui/QMdiSubWindow>
#include <QtGui/QMenuBar>
@@ -49,7 +50,7 @@
#include "embed.h"
#include "engine.h"
#include "fx_mixer_view.h"
#include "about_dialog.h"
#include "AboutDialog.h"
#include "ControllerRackView.h"
#include "plugin_browser.h"
#include "side_bar.h"
@@ -1061,7 +1062,7 @@ void MainWindow::showSettingsDialog()
void MainWindow::aboutLMMS()
{
aboutDialog().exec();
AboutDialog().exec();
}