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