Commit 78fb8e39 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen
Browse files

Plugin notification bar with medialibrary

parent 6a97b86d
......@@ -42,6 +42,7 @@
#include "Tools/VlmcDebug.h"
#include "Tools/VlmcLogger.h"
#include "Backend/IBackend.h"
#include "Library/MediaLibrary.h"
#include "Workflow/MainWorkflow.h"
#include "Renderer/ClipRenderer.h"
#include "Commands/AbstractUndoStack.h"
......@@ -108,6 +109,16 @@ MainWindow::MainWindow( Backend::IBackend* backend, QWidget *parent )
this, &MainWindow::cleanStateChanged );
connect( Core::instance()->recentProjects(), &RecentProjects::updated,
this, &MainWindow::updateRecentProjects );
connect( Core::instance()->mediaLibrary(), &MediaLibrary::progressUpdated,
NotificationZone::instance(), &NotificationZone::progressUpdated );
connect( Core::instance()->mediaLibrary(), &MediaLibrary::discoveryStarted,
[](const QString& folder) {
NotificationZone::instance()->notify( "Discovering " + folder + "..." );
});
connect( Core::instance()->mediaLibrary(), &MediaLibrary::reloadStarted,
[](const QString& folder) {
NotificationZone::instance()->notify( "Reloading medialibrary (" + folder + ")..." );
});
//Connecting Library stuff:
const ClipRenderer* clipRenderer = qobject_cast<const ClipRenderer*>( m_clipPreview->getAbstractRenderer() );
......@@ -385,7 +396,7 @@ MainWindow::on_actionSave_As_triggered()
path, QObject::tr( "VLMC project file(*.vlmc)" ) );
if ( dest.isEmpty() == true )
return;
if ( !dest.endsWith( ".vlmc" ) )
if ( !dest.endsWith( ".vlmc" ) )
dest += ".vlmc";
Core::instance()->project()->saveAs( dest );
}
......
......@@ -108,22 +108,27 @@ void MediaLibrary::onTracksDeleted( std::vector<int64_t> )
{
}
void MediaLibrary::onDiscoveryStarted( const std::string& )
void MediaLibrary::onDiscoveryStarted( const std::string& entryPoint )
{
emit discoveryStarted( QString::fromStdString( entryPoint ) );
}
void MediaLibrary::onDiscoveryCompleted( const std::string& )
void MediaLibrary::onDiscoveryCompleted( const std::string& entryPoint )
{
emit discoveryCompleted( QString::fromStdString( entryPoint ) );
}
void MediaLibrary::onReloadStarted( const std::string& )
void MediaLibrary::onReloadStarted( const std::string& entryPoint )
{
emit reloadStarted( QString::fromStdString( entryPoint ) );
}
void MediaLibrary::onReloadCompleted( const std::string& )
void MediaLibrary::onReloadCompleted( const std::string& entryPoint )
{
emit reloadCompleted( QString::fromStdString( entryPoint ) );
}
void MediaLibrary::onParsingStatsUpdated( uint32_t )
void MediaLibrary::onParsingStatsUpdated( uint32_t percent )
{
emit progressUpdated( static_cast<int>( percent ) );
}
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