Commit 961f5e83 authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

StackViewController: Don't have a specific case for import button.

The import button is to be added when required.
parent e3c7b3b1
......@@ -227,12 +227,16 @@ void
MainWindow::setupLibrary()
{
//GUI part :
QWidget* libraryWidget = new QWidget( this );
QWidget *libraryWidget = new QWidget( this );
libraryWidget->setMinimumWidth( 280 );
StackViewController *nav = new StackViewController( libraryWidget, true );
QPushButton *button = new QPushButton( tr( "Import" ), this );
connect( button, SIGNAL( clicked() ), this, SLOT( on_actionImport_triggered() ) );
StackViewController *nav = new StackViewController( libraryWidget );
MediaListView *mediaView = new MediaListView( nav, Library::getInstance() );
nav->pushViewController( mediaView );
connect( nav, SIGNAL( importRequired() ), this, SLOT( on_actionImport_triggered() ) );
libraryWidget->layout()->addWidget( button );
m_importController = new ImportController();
const ClipRenderer* clipRenderer = qobject_cast<const ClipRenderer*>( m_clipPreview->getGenericRenderer() );
......
......@@ -44,7 +44,7 @@ ImportController::ImportController(QWidget *parent) :
{
m_ui->setupUi(this);
m_preview = new PreviewWidget( new ClipRenderer, m_ui->previewContainer );
m_stackNav = new StackViewController( m_ui->stackViewContainer, false );
m_stackNav = new StackViewController( m_ui->stackViewContainer );
m_temporaryMedias = new MediaContainer;
m_mediaListView = new MediaListView( m_stackNav, m_temporaryMedias );
m_tag = new TagWidget( m_ui->tagContainer, 6 );
......
......@@ -4,7 +4,7 @@
* Copyright (C) 2008-2010 VideoLAN
*
* Authors: Thomas Boquet <thomas.boquet@gmail.com>
* Authors: Clement CHAVANCE <chavance.c@gmail.com>
* Hugo Beauzée-Luyssen <beauze.h@gmail.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
......
......@@ -4,6 +4,7 @@
* Copyright (C) 2008-2010 VideoLAN
*
* Authors: Thomas Boquet <thomas.boquet@gmail.com>
* Hugo Beauzée-Luyssen <beauze.h@gmail.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
......
......@@ -23,8 +23,8 @@
#include "StackViewController.h"
#include "ImportController.h"
StackViewController::StackViewController( QWidget* parent, bool enableImport ) :
QWidget( parent ), m_importButton( NULL ), m_current( 0 )
StackViewController::StackViewController( QWidget* parent ) :
QWidget( parent ), m_current( 0 )
{
m_nav = new StackViewNavController( this );
m_layout = new QVBoxLayout( this );
......@@ -33,21 +33,12 @@ StackViewController::StackViewController( QWidget* parent, bool enableImport ) :
connect( m_nav->previousButton(), SIGNAL( clicked() ),
this, SLOT( previous() ) );
m_layout->addWidget( m_nav );
if ( enableImport )
{
m_importButton = new QPushButton( "Import", parent );
m_layout->addWidget( m_importButton );
connect( m_importButton, SIGNAL( clicked() ), this, SIGNAL( importRequired() ) );
}
parent->setLayout( m_layout );
}
StackViewController::~StackViewController()
{
delete m_nav;
if ( m_importButton != NULL )
delete m_importButton;
delete m_controllerStack;
}
......
......@@ -40,7 +40,7 @@ class StackViewController : public QWidget
Q_OBJECT
public:
StackViewController( QWidget* parent = 0, bool enableImport = true );
StackViewController( QWidget* parent = 0 );
~StackViewController();
void pushViewController( ViewController* viewController,
......@@ -49,7 +49,6 @@ public:
private:
StackViewNavController* m_nav;
QPushButton* m_importButton;
QVBoxLayout* m_layout;
ViewController* m_current;
QStack<ViewController*>* m_controllerStack;
......@@ -58,7 +57,6 @@ public slots:
void previous();
signals:
void importRequired();
void previousButtonPushed();
};
......
......@@ -55,7 +55,6 @@ PreferenceWidget::PreferenceWidget( const QString &categorie, SettingsManager::T
layout->addRow( label, widget->widget() );
m_settings.push_back( widget );
}
setLayout( layout );
}
......@@ -79,11 +78,6 @@ PreferenceWidget::widgetFactory( SettingValue *s )
}
}
void
PreferenceWidget::load()
{
}
void
PreferenceWidget::save()
{
......
......@@ -41,7 +41,6 @@ class PreferenceWidget : public QWidget
QWidget* parent = 0 );
virtual ~PreferenceWidget() {}
virtual void load();
virtual void save();
private:
ISettingsCategorieWidget *widgetFactory( SettingValue* s );
......
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