started import process
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
|
||||
#include <QApplication>
|
||||
#include <QCommandLineParser>
|
||||
#include <QFileDialog>
|
||||
#include <QDebug>
|
||||
|
||||
#include "ui/icons/icons.h"
|
||||
@@ -104,6 +105,15 @@ olive::MainWindow *Core::main_window()
|
||||
return main_window_;
|
||||
}
|
||||
|
||||
void Core::ImportFiles(const QStringList &urls)
|
||||
{
|
||||
for (int i=0;i<urls.size();i++) {
|
||||
//const QString& url = urls.at(i);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void Core::SetTool(const olive::tool::Tool &tool)
|
||||
{
|
||||
tool_ = tool;
|
||||
@@ -111,6 +121,18 @@ void Core::SetTool(const olive::tool::Tool &tool)
|
||||
emit ToolChanged(tool_);
|
||||
}
|
||||
|
||||
void Core::StartImportFootage()
|
||||
{
|
||||
// Open dialog for user to select files
|
||||
QStringList files = QFileDialog::getOpenFileNames(main_window_,
|
||||
tr("Import footage..."));
|
||||
|
||||
// Check if the user actually selected files to import
|
||||
if (!files.isEmpty()) {
|
||||
ImportFiles(files);
|
||||
}
|
||||
}
|
||||
|
||||
void Core::AddOpenProject(ProjectPtr p)
|
||||
{
|
||||
open_projects_.append(p);
|
||||
|
||||
+12
@@ -67,6 +67,13 @@ public:
|
||||
*/
|
||||
olive::MainWindow* main_window();
|
||||
|
||||
/**
|
||||
* @brief Import a list of files
|
||||
*
|
||||
* @param urls
|
||||
*/
|
||||
void ImportFiles(const QStringList& urls);
|
||||
|
||||
public slots:
|
||||
/**
|
||||
* @brief Set the current application-wide tool
|
||||
@@ -75,6 +82,11 @@ public slots:
|
||||
*/
|
||||
void SetTool(const olive::tool::Tool& tool);
|
||||
|
||||
/**
|
||||
* @brief Open the import footage dialog and import the files selected (runs ImportFiles())
|
||||
*/
|
||||
void StartImportFootage();
|
||||
|
||||
signals:
|
||||
/**
|
||||
* @brief Signal emitted when a project is opened
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
/***
|
||||
|
||||
Olive - Non-Linear Video Editor
|
||||
@@ -35,6 +36,12 @@ public:
|
||||
const QString& filename();
|
||||
void set_filename(const QString& s);
|
||||
|
||||
void add_audio_stream(const AudioStream& as);
|
||||
void add_video_stream(const VideoStream& vs);
|
||||
|
||||
const AudioStream* audio_stream(int index);
|
||||
const VideoStream* video_stream(int index);
|
||||
|
||||
virtual Type type() const override;
|
||||
|
||||
private:
|
||||
|
||||
@@ -26,6 +26,16 @@
|
||||
|
||||
#include "project/item/folder/folder.h"
|
||||
|
||||
/**
|
||||
* @brief The Project class
|
||||
*
|
||||
* A project instance containing all the data pertaining to the user's project, including:
|
||||
*
|
||||
* * Footage
|
||||
* * Sequences
|
||||
* * Project Settings
|
||||
* * Window Layout
|
||||
*/
|
||||
class Project : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -42,8 +42,8 @@ Toolbar::Toolbar(QWidget *parent) :
|
||||
btn_slide_tool_ = CreateToolButton(olive::icon::ToolSlide, olive::tool::kSlide);
|
||||
btn_hand_tool_ = CreateToolButton(olive::icon::ToolHand, olive::tool::kHand);
|
||||
btn_zoom_tool_ = CreateToolButton(olive::icon::ZoomIn, olive::tool::kZoom);
|
||||
btn_transition_tool_ = CreateToolButton(olive::icon::ToolTransition, olive::tool::kTransition);
|
||||
btn_record_ = CreateToolButton(olive::icon::Record, olive::tool::kRecord);
|
||||
btn_transition_tool_ = CreateToolButton(olive::icon::ToolTransition, olive::tool::kTransition);
|
||||
btn_add_ = CreateToolButton(olive::icon::Add, olive::tool::kAdd);
|
||||
|
||||
// Create snapping button, which is not actually a tool, it's a toggle option
|
||||
@@ -88,9 +88,9 @@ void Toolbar::Retranslate()
|
||||
btn_hand_tool_->setToolTip(tr("Hand Tool"));
|
||||
btn_zoom_tool_->setToolTip(tr("Zoom Tool"));
|
||||
btn_transition_tool_->setToolTip(tr("Transition Tool"));
|
||||
btn_record_->setToolTip(tr("Record Tool"));
|
||||
btn_add_->setToolTip(tr("Add Tool"));
|
||||
btn_snapping_toggle_->setToolTip(tr("Toggle Snapping"));
|
||||
btn_record_->setToolTip(tr("Record Audio"));
|
||||
btn_add_->setToolTip(tr("Add Object"));
|
||||
}
|
||||
|
||||
ToolbarButton* Toolbar::CreateToolButton(const QIcon &icon, const olive::tool::Tool& tool)
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include <QEvent>
|
||||
|
||||
#include "widget/menu/menushared.h"
|
||||
#include "core.h"
|
||||
|
||||
MainMenu::MainMenu(QWidget *parent) :
|
||||
QMenuBar(parent)
|
||||
@@ -39,7 +40,7 @@ MainMenu::MainMenu(QWidget *parent) :
|
||||
file_save_item_ = file_menu_->AddItem("saveproj", nullptr, nullptr, "Ctrl+S");
|
||||
file_save_as_item_ = file_menu_->AddItem("saveprojas", nullptr, nullptr, "Ctrl+Shift+S");
|
||||
file_menu_->addSeparator();
|
||||
file_import_item_ = file_menu_->AddItem("import", nullptr, nullptr, "Ctrl+I");
|
||||
file_import_item_ = file_menu_->AddItem("import", &olive::core, SLOT(StartImportFootage()), "Ctrl+I");
|
||||
file_menu_->addSeparator();
|
||||
file_export_item_ = file_menu_->AddItem("export", nullptr, nullptr, "Ctrl+M");
|
||||
file_menu_->addSeparator();
|
||||
|
||||
Reference in New Issue
Block a user