Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
VLMC
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
21
Issues
21
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
VideoLAN
VLMC
Commits
1a039c7a
Commit
1a039c7a
authored
Mar 20, 2010
by
Hugo Beauzee-Luyssen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ProjectManager: Cleaner solution to split GUI and non GUI parts
parent
349abe15
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
134 additions
and
106 deletions
+134
-106
src/CMakeLists.txt
src/CMakeLists.txt
+6
-8
src/Gui/MainWindow.cpp
src/Gui/MainWindow.cpp
+12
-11
src/Gui/UndoStack.cpp
src/Gui/UndoStack.cpp
+4
-4
src/Gui/media/GuiMedia.cpp
src/Gui/media/GuiMedia.cpp
+3
-3
src/Gui/project/GuiProjectManager.cpp
src/Gui/project/GuiProjectManager.cpp
+23
-15
src/Gui/project/GuiProjectManager.h
src/Gui/project/GuiProjectManager.h
+8
-2
src/Gui/wizard/OpenPage.cpp
src/Gui/wizard/OpenPage.cpp
+2
-2
src/Gui/wizard/ProjectWizard.cpp
src/Gui/wizard/ProjectWizard.cpp
+2
-2
src/Gui/wizard/WelcomePage.cpp
src/Gui/wizard/WelcomePage.cpp
+6
-4
src/Gui/wizard/WelcomePage.h
src/Gui/wizard/WelcomePage.h
+0
-1
src/Main/guimain.cpp
src/Main/guimain.cpp
+2
-2
src/Media/Media.h
src/Media/Media.h
+1
-1
src/Metadata/MetaDataWorker.cpp
src/Metadata/MetaDataWorker.cpp
+7
-6
src/Project/ProjectManager.cpp
src/Project/ProjectManager.cpp
+45
-32
src/Project/ProjectManager.h
src/Project/ProjectManager.h
+10
-13
src/Renderer/WorkflowFileRenderer.h
src/Renderer/WorkflowFileRenderer.h
+3
-0
No files found.
src/CMakeLists.txt
View file @
1a039c7a
...
...
@@ -120,8 +120,9 @@ CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/cmake/config.h.cmake ${CMAKE_CURRENT_BINARY_D
#Add GUI stuff if required
IF
(
NOT WITH_GUI
)
SET
(
WITH_CRASHHANDLER_GUI FALSE
)
LIST
(
APPEND VLMC_SRCS Main/main.cpp
)
QT4_ADD_RESOURCES
(
VLMC_RCC_SRCS
${
VLMC_RCC
}
)
QT4_WRAP_CPP
(
VLMC_MOC_SRCS
${
VLMC_HDRS
}
)
ADD_EXECUTABLE
(
vlmc
${
GUI_TYPE
}
${
VLMC_SRCS
}
${
VLMC_MOC_SRCS
}
${
VLMC_RCC_SRCS
}
)
TARGET_LINK_LIBRARIES
(
vlmc
${
QT_QTCORE_LIBRARY
}
...
...
@@ -129,8 +130,6 @@ IF (NOT WITH_GUI)
${
LIBVLC_LIBRARY
}
${
LIBVLCCORE_LIBRARY
}
)
QT4_ADD_RESOURCES
(
VLMC_RCC_SRCS
${
VLMC_RCC
}
)
QT4_WRAP_CPP
(
VLMC_MOC_SRCS
${
VLMC_HDRS
}
)
ELSE
(
NOT WITH_GUI
)
LIST
(
APPEND VLMC_SRCS
...
...
@@ -154,8 +153,8 @@ ELSE(NOT WITH_GUI)
Gui/library/MediaListView.cpp
Gui/library/StackViewController.cpp
Gui/library/StackViewNavController.cpp
Gui/media/G
UI
Media.cpp
Gui/project/G
UI
ProjectManager.cpp
Gui/media/G
ui
Media.cpp
Gui/project/G
ui
ProjectManager.cpp
Gui/preview/PreviewRuler.cpp
Gui/preview/PreviewWidget.cpp
Gui/settings/BoolWidget.cpp
...
...
@@ -203,11 +202,11 @@ ELSE(NOT WITH_GUI)
Gui/library/StackViewNavController.h
Gui/library/ViewController.h
Gui/MainWindow.h
Gui/media/G
UI
Media.h
Gui/media/G
ui
Media.h
Gui/preview/LCDTimecode.h
Gui/preview/PreviewRuler.h
Gui/preview/PreviewWidget.h
Gui/project/G
UI
ProjectManager.h
Gui/project/G
ui
ProjectManager.h
Gui/settings/KeyboardShortcutInput.h
Gui/settings/Panel.h
Gui/settings/PreferenceWidget.h
...
...
@@ -278,7 +277,6 @@ ELSE(NOT WITH_GUI)
${
QT_QTGUI_LIBRARY
}
${
QT_QTXML_LIBRARY
}
${
QT_QTSVG_LIBRARY
}
${
QT_QTNETWORK_LIBRARY
}
${
LIBVLC_LIBRARY
}
${
LIBVLCCORE_LIBRARY
}
)
...
...
src/Gui/MainWindow.cpp
View file @
1a039c7a
...
...
@@ -34,7 +34,6 @@
#include "config.h"
#include "Library.h"
#include "About.h"
#include "ProjectManager.h"
#include "VlmcDebug.h"
#include "MainWorkflow.h"
...
...
@@ -53,7 +52,7 @@
#include "UndoStack.h"
/* Settings / Preferences */
#include "ProjectManager.h"
#include "
project/Gui
ProjectManager.h"
#include "ProjectWizard.h"
#include "Settings.h"
#include "SettingsManager.h"
...
...
@@ -75,10 +74,10 @@ MainWindow::MainWindow( QWidget *parent ) :
// VlmcDebug::getInstance()->setup();
//VLC Instance:
LibVLCpp
::
Instance
::
getInstance
(
this
);
LibVLCpp
::
Instance
::
getInstance
();
//Creating the project manager first (so it can create all the project variables)
ProjectManager
::
getInstance
();
GUI
ProjectManager
::
getInstance
();
//Preferences
initVlmcPreferences
();
...
...
@@ -107,7 +106,7 @@ MainWindow::MainWindow( QWidget *parent ) :
connect
(
this
,
SIGNAL
(
toolChanged
(
ToolButtons
)
),
m_timeline
,
SLOT
(
setTool
(
ToolButtons
)
)
);
connect
(
ProjectManager
::
getInstance
(),
SIGNAL
(
projectUpdated
(
const
QString
&
,
bool
)
),
connect
(
GUI
ProjectManager
::
getInstance
(),
SIGNAL
(
projectUpdated
(
const
QString
&
,
bool
)
),
this
,
SLOT
(
projectUpdated
(
const
QString
&
,
bool
)
)
);
// Undo/Redo
...
...
@@ -151,6 +150,7 @@ MainWindow::~MainWindow()
if
(
m_fileRenderer
)
delete
m_fileRenderer
;
delete
m_importController
;
LibVLCpp
::
Instance
::
destroyInstance
();
}
void
MainWindow
::
changeEvent
(
QEvent
*
e
)
...
...
@@ -258,17 +258,17 @@ MainWindow::setupLibrary()
void
MainWindow
::
on_actionSave_triggered
()
{
ProjectManager
::
getInstance
()
->
saveProject
();
GUI
ProjectManager
::
getInstance
()
->
saveProject
();
}
void
MainWindow
::
on_actionSave_As_triggered
()
{
ProjectManager
::
getInstance
()
->
saveProject
(
true
);
GUI
ProjectManager
::
getInstance
()
->
saveProject
(
true
);
}
void
MainWindow
::
on_actionLoad_Project_triggered
()
{
ProjectManager
*
pm
=
ProjectManager
::
getInstance
();
GUIProjectManager
*
pm
=
GUI
ProjectManager
::
getInstance
();
pm
->
loadProject
(
pm
->
acquireProjectFileName
()
);
}
...
...
@@ -502,7 +502,8 @@ void MainWindow::on_actionProject_Preferences_triggered()
void
MainWindow
::
closeEvent
(
QCloseEvent
*
e
)
{
if
(
ProjectManager
::
getInstance
()
->
askForSaveIfModified
()
)
GUIProjectManager
*
pm
=
GUIProjectManager
::
getInstance
();
if
(
pm
->
askForSaveIfModified
()
)
e
->
accept
();
else
e
->
ignore
();
...
...
@@ -520,7 +521,7 @@ void MainWindow::projectUpdated( const QString& projectName, bool savedStatus
void
MainWindow
::
on_actionClose_Project_triggered
()
{
ProjectManager
::
getInstance
()
->
closeProject
();
GUI
ProjectManager
::
getInstance
()
->
closeProject
();
}
void
MainWindow
::
on_actionUndo_triggered
()
...
...
@@ -564,7 +565,7 @@ bool MainWindow::restoreSession()
QMessageBox
::
Yes
|
QMessageBox
::
No
,
QMessageBox
::
Yes
);
if
(
res
==
QMessageBox
::
Yes
)
{
if
(
ProjectManager
::
getInstance
()
->
loadEmergencyBackup
()
==
true
)
if
(
GUI
ProjectManager
::
getInstance
()
->
loadEmergencyBackup
()
==
true
)
ret
=
true
;
else
QMessageBox
::
warning
(
this
,
tr
(
"Can't restore project"
),
tr
(
"VLMC didn't manage to restore your project. We appology for the inconvenience"
)
);
...
...
src/Gui/UndoStack.cpp
View file @
1a039c7a
...
...
@@ -25,7 +25,7 @@
#include <QUndoCommand>
#include "UndoStack.h"
#include "ProjectManager.h"
#include "
project/Gui
ProjectManager.h"
#include "SettingsManager.h"
#include "KeyboardShortcutHelper.h"
...
...
@@ -36,14 +36,14 @@ UndoStack::UndoStack( QWidget* parent ) : QUndoView( parent )
m_undoStack
=
new
QUndoStack
(
this
);
setStack
(
m_undoStack
);
connect
(
m_undoStack
,
SIGNAL
(
cleanChanged
(
bool
)
),
ProjectManager
::
getInstance
(),
SLOT
(
cleanChanged
(
bool
)
)
);
connect
(
ProjectManager
::
getInstance
(),
SIGNAL
(
projectSaved
()
),
GUI
ProjectManager
::
getInstance
(),
SLOT
(
cleanChanged
(
bool
)
)
);
connect
(
GUI
ProjectManager
::
getInstance
(),
SIGNAL
(
projectSaved
()
),
m_undoStack
,
SLOT
(
setClean
()
)
);
connect
(
m_undoStack
,
SIGNAL
(
canRedoChanged
(
bool
)
),
this
,
SIGNAL
(
canRedoChanged
(
bool
)
)
);
connect
(
m_undoStack
,
SIGNAL
(
canUndoChanged
(
bool
)
),
this
,
SIGNAL
(
canUndoChanged
(
bool
)
)
);
connect
(
ProjectManager
::
getInstance
(),
SIGNAL
(
projectClosed
()
),
this
,
SLOT
(
clear
()
)
);
connect
(
GUI
ProjectManager
::
getInstance
(),
SIGNAL
(
projectClosed
()
),
this
,
SLOT
(
clear
()
)
);
}
void
UndoStack
::
push
(
QUndoCommand
*
command
)
...
...
src/Gui/media/GuiMedia.cpp
View file @
1a039c7a
...
...
@@ -48,9 +48,9 @@ GUIMedia::snapshot() const
{
if
(
m_snapshot
!=
NULL
)
return
*
m_snapshot
;
if
(
Media
::
defaultSnapshot
==
NULL
)
Media
::
defaultSnapshot
=
new
QPixmap
(
":/images/images/vlmc.png"
);
return
*
Media
::
defaultSnapshot
;
if
(
GUI
Media
::
defaultSnapshot
==
NULL
)
GUI
Media
::
defaultSnapshot
=
new
QPixmap
(
":/images/images/vlmc.png"
);
return
*
GUI
Media
::
defaultSnapshot
;
}
void
...
...
src/Gui/project/GuiProjectManager.cpp
View file @
1a039c7a
...
...
@@ -32,7 +32,6 @@
GUIProjectManager
::
GUIProjectManager
()
{
connect
(
this
,
SIGNAL
(
projectClosed
()
),
Library
::
getInstance
(),
SLOT
(
clear
()
)
);
connect
(
this
,
SIGNAL
(
projectClosed
()
),
MainWorkflow
::
getInstance
(),
SLOT
(
clear
()
)
);
...
...
@@ -120,9 +119,7 @@ GUIProjectManager::saveProject( bool saveAs /*= true*/ )
//save the project with a new name
if
(
createNewProjectFile
(
saveAs
)
==
false
)
return
;
__saveProject
(
m_projectFile
->
fileName
()
);
emit
projectSaved
();
emit
projectUpdated
(
projectName
(),
true
);
ProjectManager
::
saveProject
(
saveAs
);
}
bool
...
...
@@ -130,17 +127,7 @@ GUIProjectManager::closeProject()
{
if
(
askForSaveIfModified
()
==
false
)
return
false
;
if
(
m_projectFile
!=
NULL
)
{
delete
m_projectFile
;
m_projectFile
=
NULL
;
}
m_projectName
=
QString
();
//This one is for the mainwindow, to update the title bar
emit
projectUpdated
(
projectName
(),
true
);
//This one is for every part that need to clean something when the project is closed.
emit
projectClosed
();
return
true
;
return
ProjectManager
::
closeProject
();
}
void
...
...
@@ -184,3 +171,24 @@ GUIProjectManager::automaticSaveIntervalChanged( const QVariant& val )
return
;
m_timer
->
start
(
val
.
toInt
()
*
1000
*
60
);
}
bool
GUIProjectManager
::
needSave
()
const
{
return
m_needSave
;
}
void
GUIProjectManager
::
cleanChanged
(
bool
val
)
{
m_needSave
=
!
val
;
emit
projectUpdated
(
projectName
(),
val
);
}
void
GUIProjectManager
::
projectNameChanged
(
const
QVariant
&
name
)
{
m_projectName
=
name
.
toString
();
emit
projectUpdated
(
m_projectName
,
!
m_needSave
);
}
src/Gui/project/GuiProjectManager.h
View file @
1a039c7a
...
...
@@ -23,11 +23,11 @@
#ifndef GUIPROJECTMANAGER_H
#define GUIPROJECTMANAGER_H
#include
<QObject>
#include
"ProjectManager.h"
class
QTimer
;
class
GUIProjectManager
:
public
QObject
class
GUIProjectManager
:
public
ProjectManager
,
public
Singleton
<
GUIProjectManager
>
{
Q_OBJECT
...
...
@@ -51,6 +51,8 @@ public:
* \return true if the project has been closed. false otherwise.
*/
bool
closeProject
();
bool
needSave
()
const
;
private:
bool
createNewProjectFile
(
bool
saveAs
);
...
...
@@ -58,9 +60,13 @@ private:
QTimer
*
m_timer
;
private
slots
:
void
projectNameChanged
(
const
QVariant
&
projectName
);
void
autoSaveRequired
();
void
cleanChanged
(
bool
val
);
void
automaticSaveEnabledChanged
(
const
QVariant
&
enabled
);
void
automaticSaveIntervalChanged
(
const
QVariant
&
interval
);
friend
class
Singleton
<
GUIProjectManager
>
;
};
#endif // GUIPROJECTMANAGER_H
src/Gui/wizard/OpenPage.cpp
View file @
1a039c7a
...
...
@@ -22,7 +22,7 @@
#include <QDebug>
#include "OpenPage.h"
#include "ProjectManager.h"
#include "
project/Gui
ProjectManager.h"
#include "ProjectWizard.h"
#include "WelcomePage.h"
...
...
@@ -51,7 +51,7 @@ void OpenPage::changeEvent( QEvent *e )
bool
OpenPage
::
validatePage
()
{
ProjectManager
*
pm
=
ProjectManager
::
getInstance
();
ProjectManager
*
pm
=
GUI
ProjectManager
::
getInstance
();
if
(
!
WelcomePage
::
projectPath
().
isEmpty
()
)
pm
->
loadProject
(
WelcomePage
::
projectPath
()
);
...
...
src/Gui/wizard/ProjectWizard.cpp
View file @
1a039c7a
...
...
@@ -24,7 +24,7 @@
#include <QString>
#include <QMessageBox>
#include <QWizardPage>
#include "ProjectManager.h"
#include "
project/Gui
ProjectManager.h"
#include "ProjectWizard.h"
#include "SettingsManager.h"
#include "WelcomePage.h"
...
...
@@ -95,7 +95,7 @@ void ProjectWizard::accept()
{
if
(
currentId
()
==
Page_Video
)
{
ProjectManager
::
getInstance
()
->
newProject
(
field
(
"projectName"
).
toString
()
);
GUI
ProjectManager
::
getInstance
()
->
newProject
(
field
(
"projectName"
).
toString
()
);
SettingsManager
::
getInstance
()
->
commit
(
SettingsManager
::
Project
);
SettingsManager
::
getInstance
()
->
commit
(
SettingsManager
::
Vlmc
);
}
...
...
src/Gui/wizard/WelcomePage.cpp
View file @
1a039c7a
...
...
@@ -20,6 +20,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include "WelcomePage.h"
#include "project/GuiProjectManager.h"
#include <QLabel>
#include <QPushButton>
#include <QVBoxLayout>
...
...
@@ -27,7 +31,6 @@
#include <QFileInfo>
#include <QSettings>
#include <QDebug>
#include "WelcomePage.h"
QString
*
WelcomePage
::
m_projectPath
=
NULL
;
...
...
@@ -112,7 +115,7 @@ void WelcomePage::cleanupPage()
void
WelcomePage
::
loadRecentsProjects
()
{
m_ui
.
projectsListWidget
->
clear
();
ProjectManager
*
pm
=
ProjectManager
::
getInstance
();
ProjectManager
*
pm
=
GUI
ProjectManager
::
getInstance
();
QStringList
recents
=
pm
->
recentsProjects
();
for
(
int
i
=
0
;
i
<
recents
.
count
();
++
i
)
...
...
@@ -127,8 +130,7 @@ void WelcomePage::loadRecentsProjects()
void
WelcomePage
::
loadProject
()
{
ProjectManager
*
pm
=
ProjectManager
::
getInstance
();
QString
projectPath
=
pm
->
acquireProjectFileName
();
QString
projectPath
=
GUIProjectManager
::
getInstance
()
->
acquireProjectFileName
();
if
(
projectPath
.
isEmpty
()
)
return
;
...
...
src/Gui/wizard/WelcomePage.h
View file @
1a039c7a
...
...
@@ -25,7 +25,6 @@
#include <QWizardPage>
#include "ProjectWizard.h"
#include "ProjectManager.h"
#include "ui_WelcomePage.h"
class
QWizard
;
...
...
src/Main/guimain.cpp
View file @
1a039c7a
...
...
@@ -28,7 +28,7 @@
#include "config.h"
#include "MainWindow.h"
#include "ProjectManager.h"
#include "
project/Gui
ProjectManager.h"
#include <QApplication>
#include <QColor>
...
...
@@ -88,7 +88,7 @@ VLMCmain( int argc, char **argv )
MainWindow
w
;
if
(
argc
>
1
)
ProjectManager
::
getInstance
()
->
loadProject
(
argv
[
argc
-
1
]
);
GUI
ProjectManager
::
getInstance
()
->
loadProject
(
argv
[
argc
-
1
]
);
w
.
show
();
return
app
.
exec
();
}
src/Media/Media.h
View file @
1a039c7a
...
...
@@ -38,7 +38,7 @@
#include <QHash>
#ifdef WITH_GUI
#include "
Media/GUI
Media.h"
#include "
media/Gui
Media.h"
#endif
namespace
LibVLCpp
...
...
src/Metadata/MetaDataWorker.cpp
View file @
1a039c7a
...
...
@@ -221,6 +221,13 @@ MetaDataWorker::entrypointPlaying()
metaDataAvailable
();
}
void
MetaDataWorker
::
failure
()
{
emit
failed
(
m_media
);
deleteLater
();
}
//void
//MetaDataWorker::prepareAudioSpectrumComputing()
...
...
@@ -299,9 +306,3 @@ MetaDataWorker::entrypointPlaying()
// m_media->audioValues()->append( value );
//}
//
//void
//MetaDataWorker::failure()
//{
// emit failed( m_media );
// deleteLater();
//}
src/Project/ProjectManager.cpp
View file @
1a039c7a
...
...
@@ -33,6 +33,7 @@
#include "Library.h"
#include "MainWorkflow.h"
#include "project/GuiProjectManager.h"
#include "ProjectManager.h"
#include "SettingsManager.h"
...
...
@@ -49,7 +50,11 @@ void ProjectManager::signalHandler( int sig )
{
signal
(
sig
,
SIG_DFL
);
#ifdef WITH_GUI
GUIProjectManager
::
getInstance
()
->
emergencyBackup
();
#else
ProjectManager
::
getInstance
()
->
emergencyBackup
();
#endif
#ifdef WITH_CRASHHANDLER_GUI
CrashHandler
*
ch
=
new
CrashHandler
(
sig
);
...
...
@@ -98,22 +103,12 @@ ProjectManager::~ProjectManager()
delete
m_projectFile
;
}
bool
ProjectManager
::
needSave
()
const
{
return
m_needSave
;
}
QStringList
ProjectManager
::
recentsProjects
()
const
{
return
m_recentsProjects
;
}
void
ProjectManager
::
cleanChanged
(
bool
val
)
{
m_needSave
=
!
val
;
emit
projectUpdated
(
projectName
(),
val
);
}
void
ProjectManager
::
loadTimeline
()
{
QDomElement
root
=
m_domDocument
->
documentElement
();
...
...
@@ -129,18 +124,17 @@ void ProjectManager::loadProject( const QString& fileName )
if
(
fileName
.
isEmpty
()
==
true
)
return
;
#ifdef WITH_GUI
if
(
closeProject
()
==
false
)
return
;
#endif
m_projectFile
=
new
QFile
(
fileName
);
m_projectFile
->
open
(
QFile
::
ReadOnly
);
m_projectFile
->
close
();
m_domDocument
=
new
QDomDocument
;
m_domDocument
->
setContent
(
m_projectFile
);
#ifdef WITH_GUI
m_needSave
=
false
;
#endif
if
(
ProjectManager
::
isBackupFile
(
fileName
)
==
false
)
appendToRecentProject
(
QFileInfo
(
*
m_projectFile
).
absoluteFilePath
()
);
else
...
...
@@ -176,12 +170,6 @@ void ProjectManager::__saveProject( const QString &fileName )
project
.
writeEndDocument
();
}
void
ProjectManager
::
projectNameChanged
(
const
QVariant
&
name
)
{
m_projectName
=
name
.
toString
();
emit
projectUpdated
(
m_projectName
,
!
m_needSave
);
}
void
ProjectManager
::
emergencyBackup
()
{
QString
name
;
...
...
@@ -202,19 +190,6 @@ void ProjectManager::emergencyBackup()
s
.
sync
();
}
bool
ProjectManager
::
loadEmergencyBackup
()
{
QSettings
s
;
QString
lastProject
=
s
.
value
(
"EmergencyBackup"
).
toString
();
if
(
QFile
::
exists
(
lastProject
)
==
true
)
{
loadProject
(
lastProject
);
m_needSave
=
true
;
return
true
;
}
return
false
;
}
bool
ProjectManager
::
isBackupFile
(
const
QString
&
projectFile
)
{
return
projectFile
.
endsWith
(
"backup"
);
...
...
@@ -245,3 +220,41 @@ QString ProjectManager::projectName() const
}
return
m_projectName
;
}
bool
ProjectManager
::
closeProject
()
{
if
(
m_projectFile
!=
NULL
)
{
delete
m_projectFile
;
m_projectFile
=
NULL
;
}
m_projectName
=
QString
();
//This one is for the mainwindow, to update the title bar
emit
projectUpdated
(
projectName
(),
true
);
//This one is for every part that need to clean something when the project is closed.
emit
projectClosed
();
return
true
;
}
void
ProjectManager
::
saveProject
(
bool
)
{
__saveProject
(
m_projectFile
->
fileName
()
);
emit
projectSaved
();
emit
projectUpdated
(
projectName
(),
true
);
}
bool
ProjectManager
::
loadEmergencyBackup
()
{
QSettings
s
;
QString
lastProject
=
s
.
value
(
"EmergencyBackup"
).
toString
();
if
(
QFile
::
exists
(
lastProject
)
==
true
)
{
loadProject
(
lastProject
);
m_needSave
=
true
;
return
true
;
}
return
false
;
}
src/Project/ProjectManager.h
View file @
1a039c7a
...
...
@@ -34,13 +34,10 @@ class QFile;
class
QDomDocument
;
#ifdef WITH_GUI
# include "Project/GUIProjectManager.h"
# define PARENTCLASS GUIProjectManager
class
ProjectManager
:
public
QObject
#else
# define PARENTCLASS QObject
class
ProjectManager
:
public
QObject
,
public
Singleton
<
ProjectManager
>
#endif
class
ProjectManager
:
public
PARENTCLASS
,
public
Singleton
<
ProjectManager
>
{
Q_OBJECT
Q_DISABLE_COPY
(
ProjectManager
);
...
...
@@ -49,14 +46,14 @@ public:
static
const
QString
unSavedProject
;
void
loadProject
(
const
QString
&
fileName
);
bool
needSave
()
const
;
QStringList
recentsProjects
()
const
;
virtual
bool
closeProject
();
virtual
void
saveProject
(
bool
saveAs
=
false
);
bool
loadEmergencyBackup
();
static
void
signalHandler
(
int
sig
);
pr
ivate
:
pr
otected
:
/**
* This shouldn't be call directly.
* It's only purpose it to write the project for very specific cases.
...
...
@@ -75,22 +72,22 @@ private:
*/
QString
projectName
()
const
;
protected:
ProjectManager
();
~
ProjectManager
();
private:
protected:
QFile
*
m_projectFile
;
bool
m_needSave
;
QStringList
m_recentsProjects
;
QString
m_projectName
;
QString
m_projectDescription
;
QDomDocument
*
m_domDocument
;
bool
m_needSave
;
friend
class
Singleton
<
ProjectManager
>
;
pr
ivate
slots
:
pr
otected
slots
:
void
loadTimeline
();
void
cleanChanged
(
bool
val
);
void
projectNameChanged
(
const
QVariant
&
projectName
);
signals:
/**
...
...
src/Renderer/WorkflowFileRenderer.h
View file @
1a039c7a
...
...
@@ -23,6 +23,7 @@
#ifndef WORKFLOWFILERENDERER_H
#define WORKFLOWFILERENDERER_H
#include "config.h"
#include "Workflow/MainWorkflow.h"
#include "WorkflowRenderer.h"
#ifdef WITH_GUI
...
...
@@ -67,7 +68,9 @@ protected:
virtual
quint32
height
()
const
;
private
slots
:
void
stop
();
#ifdef WITH_GUI
void
cancelButtonClicked
();
#endif
void
__frameChanged
(
qint64
frame
,
MainWorkflow
::
FrameChangedReason
reason
);
void
__endReached
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment