Commit 9b9d4161 authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

Refactored import window creation.

File->import is now connected, and so is ctrl + I
parent 62aaac95
...@@ -92,6 +92,7 @@ void VLMCSettingsDefault::loadKeyboardShortcutDefaults( const QString& part ) ...@@ -92,6 +92,7 @@ void VLMCSettingsDefault::loadKeyboardShortcutDefaults( const QString& part )
ADD_SHORTCUT( "Save", QKeySequence( QKeySequence::Save ).toString().toLocal8Bit() ); ADD_SHORTCUT( "Save", QKeySequence( QKeySequence::Save ).toString().toLocal8Bit() );
ADD_SHORTCUT( "Save as", "Ctrl+Shift+S" ); ADD_SHORTCUT( "Save as", "Ctrl+Shift+S" );
ADD_SHORTCUT( "Close project", QKeySequence( QKeySequence::Close ).toString().toLocal8Bit() ); ADD_SHORTCUT( "Close project", QKeySequence( QKeySequence::Close ).toString().toLocal8Bit() );
ADD_SHORTCUT( "Import media", "Ctrl+I" );
return ; return ;
} }
......
...@@ -140,6 +140,7 @@ void MainWindow::setupLibrary() ...@@ -140,6 +140,7 @@ void MainWindow::setupLibrary()
//GUI part : //GUI part :
MediaLibraryWidget* mediaLibraryWidget = new MediaLibraryWidget( this ); MediaLibraryWidget* mediaLibraryWidget = new MediaLibraryWidget( this );
m_importController = new ImportController( this );
DockWidgetManager::instance()->addDockedWidget( mediaLibraryWidget, DockWidgetManager::instance()->addDockedWidget( mediaLibraryWidget,
tr( "Media Library" ), tr( "Media Library" ),
...@@ -152,6 +153,8 @@ void MainWindow::setupLibrary() ...@@ -152,6 +153,8 @@ void MainWindow::setupLibrary()
connect( Library::getInstance(), SIGNAL( mediaRemoved( const QUuid& ) ), connect( Library::getInstance(), SIGNAL( mediaRemoved( const QUuid& ) ),
m_clipPreview->getGenericRenderer(), SLOT( mediaUnloaded( QUuid ) ) ); m_clipPreview->getGenericRenderer(), SLOT( mediaUnloaded( QUuid ) ) );
connect( mediaLibraryWidget, SIGNAL( importRequired() ), this, SLOT( on_actionImport_triggered() ) );
} }
void MainWindow::on_actionSave_triggered() void MainWindow::on_actionSave_triggered()
...@@ -367,12 +370,6 @@ void MainWindow::on_actionHelp_triggered() ...@@ -367,12 +370,6 @@ void MainWindow::on_actionHelp_triggered()
QDesktopServices::openUrl( QUrl( "http://vlmc.org" ) ); QDesktopServices::openUrl( QUrl( "http://vlmc.org" ) );
} }
void MainWindow::on_actionImport_triggered()
{
//Import* import = new Import( );
//import->exec();
}
void MainWindow::zoomIn() void MainWindow::zoomIn()
{ {
m_zoomSlider->setValue( m_zoomSlider->value() - 1 ); m_zoomSlider->setValue( m_zoomSlider->value() - 1 );
...@@ -458,6 +455,7 @@ void MainWindow::initializeMenuKeyboardShortcut() ...@@ -458,6 +455,7 @@ void MainWindow::initializeMenuKeyboardShortcut()
INIT_SHORTCUT( save, "Save", actionSave ); INIT_SHORTCUT( save, "Save", actionSave );
INIT_SHORTCUT( saveAs, "Save as", actionSave_As ); INIT_SHORTCUT( saveAs, "Save as", actionSave_As );
INIT_SHORTCUT( closeProject, "Close project", actionClose_Project ); INIT_SHORTCUT( closeProject, "Close project", actionClose_Project );
INIT_SHORTCUT( importProject, "Import media", actionImport );
} }
#undef INIT_SHORTCUT #undef INIT_SHORTCUT
...@@ -483,6 +481,8 @@ void MainWindow::keyboardShortcutChanged( const QString& name, const QString& ...@@ -483,6 +481,8 @@ void MainWindow::keyboardShortcutChanged( const QString& name, const QString&
m_ui.actionSave_As->setShortcut( val ); m_ui.actionSave_As->setShortcut( val );
else if ( name == "Close project" ) else if ( name == "Close project" )
m_ui.actionClose_Project->setShortcut( val ); m_ui.actionClose_Project->setShortcut( val );
else if ( name == "Import media" )
m_ui.actionImport->setShortcut( val );
else else
qWarning() << "Unknown shortcut:" << name; qWarning() << "Unknown shortcut:" << name;
} }
...@@ -529,3 +529,8 @@ bool MainWindow::restoreSession() ...@@ -529,3 +529,8 @@ bool MainWindow::restoreSession()
s.sync(); s.sync();
return ret; return ret;
} }
void MainWindow::on_actionImport_triggered()
{
m_importController->exec();
}
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
#include "EffectsEngine.h" #include "EffectsEngine.h"
#include "MainWorkflow.h" #include "MainWorkflow.h"
#include "ProjectWizard.h" #include "ProjectWizard.h"
#include "ImportController.h"
class MainWindow : public QMainWindow class MainWindow : public QMainWindow
{ {
...@@ -85,6 +86,7 @@ private: ...@@ -85,6 +86,7 @@ private:
Settings* m_DefaultProjectPreferences; Settings* m_DefaultProjectPreferences;
Settings* m_projectPreferences; Settings* m_projectPreferences;
ProjectWizard* m_pWizard; ProjectWizard* m_pWizard;
ImportController* m_importController;
private slots: private slots:
void on_actionBypass_effects_engine_toggled(bool ); void on_actionBypass_effects_engine_toggled(bool );
...@@ -98,11 +100,11 @@ private slots: ...@@ -98,11 +100,11 @@ private slots:
void on_actionLoad_Project_triggered(); void on_actionLoad_Project_triggered();
void on_actionSave_triggered(); void on_actionSave_triggered();
void on_actionSave_As_triggered(); void on_actionSave_As_triggered();
void on_actionImport_triggered();
void on_actionHelp_triggered(); void on_actionHelp_triggered();
void on_actionProject_Preferences_triggered(); void on_actionProject_Preferences_triggered();
void on_actionClose_Project_triggered(); void on_actionClose_Project_triggered();
void on_actionCrash_triggered(); void on_actionCrash_triggered();
void on_actionImport_triggered();
void toolButtonClicked( int id ); void toolButtonClicked( int id );
void projectUpdated( const QString& projectName, bool savedStatus ); void projectUpdated( const QString& projectName, bool savedStatus );
void keyboardShortcutChanged( const QString&, const QString& ); void keyboardShortcutChanged( const QString&, const QString& );
......
...@@ -30,6 +30,7 @@ MediaLibraryWidget::MediaLibraryWidget( QWidget* parent ) : QWidget( parent ) ...@@ -30,6 +30,7 @@ MediaLibraryWidget::MediaLibraryWidget( QWidget* parent ) : QWidget( parent )
connect( list, SIGNAL( mediaSelected( Media* ) ), this, SLOT( mediaSelection( Media* ) ) ); connect( list, SIGNAL( mediaSelected( Media* ) ), this, SLOT( mediaSelection( Media* ) ) );
connect( list, SIGNAL( mediaDeleted( const QUuid& ) ), library, SLOT( removingMediaAsked( const QUuid& ) ) ); connect( list, SIGNAL( mediaDeleted( const QUuid& ) ), library, SLOT( removingMediaAsked( const QUuid& ) ) );
connect( library, SIGNAL( mediaRemoved( QUuid ) ), list, SLOT( mediaRemoved( const QUuid& ) ) ); connect( library, SIGNAL( mediaRemoved( QUuid ) ), list, SLOT( mediaRemoved( const QUuid& ) ) );
connect( m_nav, SIGNAL( importRequired() ), this, SIGNAL( importRequired() ) );
m_nav->pushViewController( list ); m_nav->pushViewController( list );
} }
......
...@@ -49,6 +49,7 @@ private slots: ...@@ -49,6 +49,7 @@ private slots:
signals: signals:
void mediaSelected( Media* media ); void mediaSelected( Media* media );
void clipSelected( Clip* clip ); void clipSelected( Clip* clip );
void importRequired();
}; };
#endif // MEDIALIBRARYWIDGET_H #endif // MEDIALIBRARYWIDGET_H
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#include "ImportController.h" #include "ImportController.h"
StackViewController::StackViewController( QWidget* parent, bool enableImport ) : StackViewController::StackViewController( QWidget* parent, bool enableImport ) :
QWidget( parent ), m_importButton( NULL ), m_current( 0 ), m_importController( NULL ) QWidget( parent ), m_importButton( NULL ), m_current( 0 )
{ {
m_nav = new StackViewNavController( this ); m_nav = new StackViewNavController( this );
...@@ -114,8 +114,5 @@ const ViewController* StackViewController::getCurrentViewController() const ...@@ -114,8 +114,5 @@ const ViewController* StackViewController::getCurrentViewController() const
void StackViewController::displayImportMenu() void StackViewController::displayImportMenu()
{ {
if ( m_importController != NULL ) emit importRequired();
delete m_importController;
m_importController = new ImportController();
m_importController->exec();
} }
...@@ -54,12 +54,14 @@ private: ...@@ -54,12 +54,14 @@ private:
QVBoxLayout* m_layout; QVBoxLayout* m_layout;
ViewController* m_current; ViewController* m_current;
QStack<ViewController*>* m_controllerStack; QStack<ViewController*>* m_controllerStack;
ImportController* m_importController;
public slots: public slots:
void previous(); void previous();
void displayImportMenu(); void displayImportMenu();
signals:
void importRequired();
}; };
#endif // STACKVIEWCONTROLLER_H #endif // STACKVIEWCONTROLLER_H
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