first commit of big refactor
This commit is contained in:
+18
-19
@@ -1,19 +1,17 @@
|
||||
#include "loadthread.h"
|
||||
|
||||
#include "oliveglobal.h"
|
||||
|
||||
#include "mainwindow.h"
|
||||
|
||||
#include "panels/panels.h"
|
||||
#include "panels/effectcontrols.h"
|
||||
#include "panels/project.h"
|
||||
#include "project/footage.h"
|
||||
|
||||
#include "project/projectelements.h"
|
||||
|
||||
#include "io/config.h"
|
||||
#include "project/clip.h"
|
||||
#include "project/sequence.h"
|
||||
#include "project/transition.h"
|
||||
#include "project/effect.h"
|
||||
#include "playback/playback.h"
|
||||
#include "io/previewgenerator.h"
|
||||
#include "dialogs/loaddialog.h"
|
||||
#include "project/media.h"
|
||||
#include "effects/internal/voideffect.h"
|
||||
#include "debug.h"
|
||||
|
||||
@@ -575,7 +573,7 @@ Media* LoadThread::find_loaded_folder_by_id(int id) {
|
||||
void LoadThread::run() {
|
||||
mutex.lock();
|
||||
|
||||
QFile file(project_url);
|
||||
QFile file(Olive::ActiveProjectFilename);
|
||||
if (!file.open(QIODevice::ReadOnly)) {
|
||||
qCritical() << "Could not open file";
|
||||
return;
|
||||
@@ -586,9 +584,9 @@ void LoadThread::run() {
|
||||
* case the project file has moved without the footage,
|
||||
* we check both
|
||||
*/
|
||||
proj_dir = QFileInfo(project_url).absoluteDir();
|
||||
internal_proj_dir = QFileInfo(project_url).absoluteDir();
|
||||
internal_proj_url = project_url;
|
||||
proj_dir = QFileInfo(Olive::ActiveProjectFilename).absoluteDir();
|
||||
internal_proj_dir = QFileInfo(Olive::ActiveProjectFilename).absoluteDir();
|
||||
internal_proj_url = Olive::ActiveProjectFilename;
|
||||
|
||||
QXmlStreamReader stream(&file);
|
||||
|
||||
@@ -696,7 +694,7 @@ void LoadThread::cancel() {
|
||||
|
||||
void LoadThread::question_func(const QString &title, const QString &text, int buttons) {
|
||||
question_btn = QMessageBox::warning(
|
||||
mainWindow,
|
||||
Olive::MainWindow,
|
||||
title,
|
||||
text,
|
||||
static_cast<enum QMessageBox::StandardButton>(buttons));
|
||||
@@ -706,12 +704,12 @@ void LoadThread::question_func(const QString &title, const QString &text, int bu
|
||||
void LoadThread::error_func() {
|
||||
if (xml_error) {
|
||||
qCritical() << "Error parsing XML." << error_str;
|
||||
QMessageBox::critical(mainWindow,
|
||||
QMessageBox::critical(Olive::MainWindow,
|
||||
tr("XML Parsing Error"),
|
||||
tr("Couldn't load '%1'. %2").arg(project_url, error_str),
|
||||
tr("Couldn't load '%1'. %2").arg(Olive::ActiveProjectFilename, error_str),
|
||||
QMessageBox::Ok);
|
||||
} else {
|
||||
QMessageBox::critical(mainWindow,
|
||||
QMessageBox::critical(Olive::MainWindow,
|
||||
tr("Project Load Error"),
|
||||
tr("Error loading project: %1").arg(error_str),
|
||||
QMessageBox::Ok);
|
||||
@@ -733,12 +731,13 @@ void LoadThread::success_func() {
|
||||
orig_filename.insert(insert_index, " (" + recover_text + ")");
|
||||
counter++;
|
||||
}
|
||||
mainWindow->updateTitle(orig_filename);
|
||||
|
||||
Olive::Global.data()->update_project_filename(orig_filename);
|
||||
} else {
|
||||
panel_project->add_recent_project(project_url);
|
||||
panel_project->add_recent_project(Olive::ActiveProjectFilename);
|
||||
}
|
||||
|
||||
mainWindow->setWindowModified(autorecovery);
|
||||
Olive::MainWindow->setWindowModified(autorecovery);
|
||||
if (open_seq != nullptr) set_sequence(open_seq);
|
||||
update_ui(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user