Commit 21d2a808 authored by Ludovic Fauvet's avatar Ludovic Fauvet
Browse files

Code cleanup

parent 72e9f57e
...@@ -60,7 +60,7 @@ MainWindow::MainWindow( QWidget *parent ) : ...@@ -60,7 +60,7 @@ MainWindow::MainWindow( QWidget *parent ) :
createStatusBar(); createStatusBar();
createGlobalPreferences(); createGlobalPreferences();
// Translation // Translations
connect( this, SIGNAL( translateDockWidgetTitle() ), connect( this, SIGNAL( translateDockWidgetTitle() ),
DockWidgetManager::instance(), SLOT( transLateWidgetTitle() ) ); DockWidgetManager::instance(), SLOT( transLateWidgetTitle() ) );
...@@ -73,12 +73,6 @@ MainWindow::MainWindow( QWidget *parent ) : ...@@ -73,12 +73,6 @@ MainWindow::MainWindow( QWidget *parent ) :
this, SLOT( zoomOut() ) ); this, SLOT( zoomOut() ) );
connect( this, SIGNAL( toolChanged( ToolButtons ) ), connect( this, SIGNAL( toolChanged( ToolButtons ) ),
m_timeline, SLOT( setTool( ToolButtons ) ) ); m_timeline, SLOT( setTool( ToolButtons ) ) );
//Global Preferences
QObject::connect( qApp,
SIGNAL( aboutToQuit() ),
m_globalPreferences,
SLOT( deleteLater() ) );
} }
MainWindow::~MainWindow() MainWindow::~MainWindow()
...@@ -276,16 +270,11 @@ void MainWindow::initializeDockWidgets( void ) ...@@ -276,16 +270,11 @@ void MainWindow::initializeDockWidgets( void )
void MainWindow::createGlobalPreferences() void MainWindow::createGlobalPreferences()
{ {
m_globalPreferences = new Settings( ); m_globalPreferences = new Settings( this );
m_globalPreferences->addWidget("VLMC", m_globalPreferences->addWidget("VLMC",
new VLMCPreferences, new VLMCPreferences,
"../images/vlmc.png", "../images/vlmc.png",
"VLMC settings"); "VLMC settings");
////For debugging purpose
//m_globalPreferences->addWidget("Test",
// new QLabel("This is a test"),
// "images/vlmc.png",
// "Test");
m_globalPreferences->build(); m_globalPreferences->build();
} }
......
...@@ -37,8 +37,8 @@ ...@@ -37,8 +37,8 @@
#include "Panel.h" #include "Panel.h"
Settings::Settings( QWidget* parent) Settings::Settings( QWidget* parent, Qt::WindowFlags f )
: QWidget(parent), : QDialog( parent, f ),
m_currentWidget( NULL ), m_currentWidget( NULL ),
m_panel( NULL ), m_panel( NULL ),
m_title( NULL ), m_title( NULL ),
...@@ -120,7 +120,7 @@ QVBoxLayout* Settings::buildRightHLayout() ...@@ -120,7 +120,7 @@ QVBoxLayout* Settings::buildRightHLayout()
layout->addWidget( m_stackedWidgets ); layout->addWidget( m_stackedWidgets );
layout->addWidget( m_buttons ); layout->addWidget( m_buttons );
return ( layout ); return ( layout );
} }
void Settings::save( void ) void Settings::save( void )
{ {
...@@ -149,7 +149,7 @@ void Settings::switchWidget( int widget ) ...@@ -149,7 +149,7 @@ void Settings::switchWidget( int widget )
{ {
//TODO : Change the title of the preferences shown //TODO : Change the title of the preferences shown
//Hide the current widget and show the new one. //Hide the current widget and show the new one.
if ( !m_widgets.contains( widget ) ) if ( !m_widgets.contains( widget ) )
return ; return ;
m_title->setText( m_widgets.value( widget ) ); m_title->setText( m_widgets.value( widget ) );
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#ifndef SIMPLEPREFERENCES_H #ifndef SIMPLEPREFERENCES_H
#define SIMPLEPREFERENCES_H #define SIMPLEPREFERENCES_H
#include <QWidget> #include <QDialog>
#include <QString> #include <QString>
#include <QHash> #include <QHash>
#include <QLabel> #include <QLabel>
...@@ -37,13 +37,13 @@ ...@@ -37,13 +37,13 @@
#include "Panel.h" #include "Panel.h"
#include "PreferenceWidget.h" #include "PreferenceWidget.h"
class Settings : public QWidget class Settings : public QDialog
{ {
Q_OBJECT Q_OBJECT
Q_DISABLE_COPY( Settings ) Q_DISABLE_COPY( Settings )
public: public:
Settings( QWidget* parent = 0 ); Settings( QWidget* parent = 0, Qt::WindowFlags f = 0 );
~Settings(); ~Settings();
void addWidget( const QString& name, void addWidget( const QString& name,
PreferenceWidget* pWidget, PreferenceWidget* pWidget,
......
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