[vlmc-devel] commit: StackViewController: Don't have a specific case for import button. (Hugo Beauzee-Luyssen )

git at videolan.org git at videolan.org
Wed Mar 10 23:22:16 CET 2010


vlmc | branch: master | Hugo Beauzee-Luyssen <beauze.h at gmail.com> | Wed Mar 10 23:20:35 2010 +0100| [961f5e83e1b764682124bd5dc29bdd743e3bd7d7] | committer: Hugo Beauzee-Luyssen 

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

The import button is to be added when required.

> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=961f5e83e1b764682124bd5dc29bdd743e3bd7d7
---

 src/Gui/MainWindow.cpp                  |   10 +++++++---
 src/Gui/import/ImportController.cpp     |    2 +-
 src/Gui/library/MediaCellView.cpp       |    2 +-
 src/Gui/library/MediaCellView.h         |    1 +
 src/Gui/library/StackViewController.cpp |   13 ++-----------
 src/Gui/library/StackViewController.h   |    4 +---
 src/Gui/settings/PreferenceWidget.cpp   |    6 ------
 src/Gui/settings/PreferenceWidget.h     |    1 -
 8 files changed, 13 insertions(+), 26 deletions(-)

diff --git a/src/Gui/MainWindow.cpp b/src/Gui/MainWindow.cpp
index b1bd6f4..fe4a783 100644
--- a/src/Gui/MainWindow.cpp
+++ b/src/Gui/MainWindow.cpp
@@ -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() );
diff --git a/src/Gui/import/ImportController.cpp b/src/Gui/import/ImportController.cpp
index 8176dd3..973eb91 100644
--- a/src/Gui/import/ImportController.cpp
+++ b/src/Gui/import/ImportController.cpp
@@ -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 );
diff --git a/src/Gui/library/MediaCellView.cpp b/src/Gui/library/MediaCellView.cpp
index d7a4185..8280697 100644
--- a/src/Gui/library/MediaCellView.cpp
+++ b/src/Gui/library/MediaCellView.cpp
@@ -4,7 +4,7 @@
  * Copyright (C) 2008-2010 VideoLAN
  *
  * Authors: Thomas Boquet <thomas.boquet at gmail.com>
- * Authors: Clement CHAVANCE <chavance.c at gmail.com>
+ *          Hugo Beauzée-Luyssen <beauze.h at gmail.com>
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
diff --git a/src/Gui/library/MediaCellView.h b/src/Gui/library/MediaCellView.h
index a96ae72..7c969db 100644
--- a/src/Gui/library/MediaCellView.h
+++ b/src/Gui/library/MediaCellView.h
@@ -4,6 +4,7 @@
  * Copyright (C) 2008-2010 VideoLAN
  *
  * Authors: Thomas Boquet <thomas.boquet at gmail.com>
+ *          Hugo Beauzée-Luyssen <beauze.h at gmail.com>
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
diff --git a/src/Gui/library/StackViewController.cpp b/src/Gui/library/StackViewController.cpp
index ac09edc..ac513ba 100644
--- a/src/Gui/library/StackViewController.cpp
+++ b/src/Gui/library/StackViewController.cpp
@@ -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;
 }
 
diff --git a/src/Gui/library/StackViewController.h b/src/Gui/library/StackViewController.h
index 49ed1fc..2f1154d 100644
--- a/src/Gui/library/StackViewController.h
+++ b/src/Gui/library/StackViewController.h
@@ -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();
 
 };
diff --git a/src/Gui/settings/PreferenceWidget.cpp b/src/Gui/settings/PreferenceWidget.cpp
index 9ccfd60..1502028 100644
--- a/src/Gui/settings/PreferenceWidget.cpp
+++ b/src/Gui/settings/PreferenceWidget.cpp
@@ -55,7 +55,6 @@ PreferenceWidget::PreferenceWidget( const QString &categorie, SettingsManager::T
         layout->addRow( label, widget->widget() );
         m_settings.push_back( widget );
     }
-
     setLayout( layout );
 }
 
@@ -80,11 +79,6 @@ PreferenceWidget::widgetFactory( SettingValue *s )
 }
 
 void
-PreferenceWidget::load()
-{
-}
-
-void
 PreferenceWidget::save()
 {
     foreach ( ISettingsCategorieWidget* w, m_settings )
diff --git a/src/Gui/settings/PreferenceWidget.h b/src/Gui/settings/PreferenceWidget.h
index c56e39b..0a1b897 100644
--- a/src/Gui/settings/PreferenceWidget.h
+++ b/src/Gui/settings/PreferenceWidget.h
@@ -41,7 +41,6 @@ class   PreferenceWidget : public QWidget
                           QWidget* parent = 0 );
         virtual ~PreferenceWidget() {}
 
-        virtual void    load();
         virtual void    save();
     private:
         ISettingsCategorieWidget        *widgetFactory( SettingValue* s );



More information about the Vlmc-devel mailing list