Commit dc123252 authored by Clement CHAVANCE's avatar Clement CHAVANCE

project cleanup and connected signals in settings

The class Transcode is not used anymore in the project.
The Ok/Apply/Cancel buttons of the settings interface are now connected
parent 5e700235
......@@ -4,6 +4,7 @@
GraphicsCursorItem::GraphicsCursorItem( const QPen& pen )
: m_pen( pen )
{
int height;
setFlags( QGraphicsItem::ItemIgnoresTransformations | QGraphicsItem::ItemIsMovable );
setCursor( QCursor( Qt::SizeHorCursor ) );
setZValue( 100 );
......
......@@ -255,7 +255,7 @@ void MainWindow::on_actionAbout_triggered()
void MainWindow::on_actionTranscode_File_triggered()
{
Transcode::instance( this )->exec();
//Transcode::instance( this )->exec();
}
void MainWindow::on_actionRender_triggered()
......
......@@ -21,6 +21,7 @@
*****************************************************************************/
#include <QPushButton>
#include <QDialogButtonBox>
#include <QAbstractButton>
#include <QApplication>
#include <QSizePolicy>
#include <QLabel>
......@@ -28,6 +29,8 @@
#include <QIcon>
#include <QLabel>
#include <QtDebug>
#include "PreferenceWidget.h"
#include "Settings.h"
......@@ -91,7 +94,10 @@ QVBoxLayout* Settings::buildRightHLayout()
{
QVBoxLayout* layout = new QVBoxLayout;
QFrame* titleLine = new QFrame;
QDialogButtonBox* buttons = new QDialogButtonBox( this );
m_buttons = new QDialogButtonBox( this );
QObject::connect( m_buttons, SIGNAL( clicked( QAbstractButton* ) ),
this, SLOT( buttonClicked( QAbstractButton* ) ) );
m_title = new QLabel( this );
titleLine->setFrameShape( QFrame::HLine );
......@@ -103,7 +109,7 @@ QVBoxLayout* Settings::buildRightHLayout()
labelFont.setFamily( "Verdana" );
m_title->setFont( labelFont );
buttons->setStandardButtons( QDialogButtonBox::Ok |
m_buttons->setStandardButtons( QDialogButtonBox::Ok |
QDialogButtonBox::Cancel |
QDialogButtonBox::Apply );
......@@ -112,7 +118,7 @@ QVBoxLayout* Settings::buildRightHLayout()
layout->addWidget( m_title );
layout->addWidget( titleLine );
layout->addWidget( m_stackedWidgets );
layout->addWidget( buttons );
layout->addWidget( m_buttons );
return ( layout );
}
......@@ -120,6 +126,24 @@ void Settings::save( void )
{
}
void Settings::buttonClicked( QAbstractButton* button )
{
switch ( m_buttons->standardButton( button ) )
{
case QDialogButtonBox::Ok :
qDebug() << "MOK";
break;
case QDialogButtonBox::Cancel :
qDebug() << "Oh NOES";
break;
case QDialogButtonBox::Apply :
qDebug() << "Apply";
break;
default :
break;
}
}
void Settings::switchWidget( int widget )
{
......
......@@ -28,8 +28,10 @@
#include <QHash>
#include <QLabel>
#include <QVBoxLayout>
#include <QDialogButtonBox>
#include <QButtonGroup>
#include <QStackedWidget>
#include <QAbstractButton>
#include <QVector>
#include "Panel.h"
......@@ -60,12 +62,14 @@ class Settings : public QWidget
Panel* m_panel;
QLabel* m_title;
QStackedWidget* m_stackedWidgets;
QDialogButtonBox* m_buttons;
bool m_saved;
public slots:
void switchWidget( int widget );
private slots:
void buttonClicked( QAbstractButton* button );
signals:
void widgetSwitched( int widget );
......
......@@ -32,7 +32,7 @@ SOURCES += src/main.cpp \
src/GUI/MediaListWidget.cpp \
src/Media/Clip.cpp \
src/GUI/About.cpp \
src/GUI/Transcode.cpp \
# src/GUI/Transcode.cpp \
src/GUI/Slider.cpp \
src/Metadata/MetaDataWorker.cpp \
src/Library/Library.cpp \
......@@ -81,7 +81,7 @@ HEADERS += src/GUI/MainWindow.h \
src/Media/Clip.h \
src/GUI/MediaListWidget.h \
src/GUI/About.h \
src/GUI/Transcode.h \
# src/GUI/Transcode.h \
src/GUI/Slider.h \
src/Metadata/MetaDataWorker.h \
src/Tools/Singleton.hpp \
......@@ -125,7 +125,7 @@ FORMS += src/GUI/ui/MainWindow.ui \
src/GUI/ui/Timeline.ui \
src/GUI/ui/LibraryWidget.ui \
src/GUI/ui/About.ui \
src/GUI/ui/Transcode.ui \
# src/GUI/ui/Transcode.ui \
src/GUI/ui/FileBrowser.ui \
src/GUI/ui/WorkflowFileRendererDialog.ui \
src/GUI/ui/ClipProperty.ui \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment