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

Code cleanup

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