[vlmc-devel] Move IProjectUiCb in its own file
Hugo Beauzée-Luyssen
git at videolan.org
Mon Mar 31 20:24:54 CEST 2014
vlmc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Mon Mar 31 21:07:01 2014 +0300| [8ba057f386d27850295b30e97934ec370145ae9a] | committer: Hugo Beauzée-Luyssen
Move IProjectUiCb in its own file
> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=8ba057f386d27850295b30e97934ec370145ae9a
---
src/Gui/project/GuiProjectManager.h | 2 +-
src/Project/Project.cpp | 1 +
src/Project/Project.h | 40 +--------------------
src/Project/ProjectCallbacks.h | 67 +++++++++++++++++++++++++++++++++++
4 files changed, 70 insertions(+), 40 deletions(-)
diff --git a/src/Gui/project/GuiProjectManager.h b/src/Gui/project/GuiProjectManager.h
index c8f34cb..694f534 100644
--- a/src/Gui/project/GuiProjectManager.h
+++ b/src/Gui/project/GuiProjectManager.h
@@ -23,7 +23,7 @@
#ifndef GUIPROJECTMANAGER_H
#define GUIPROJECTMANAGER_H
-#include "Project/Project.h"
+#include "Project/ProjectCallbacks.h"
class GUIProjectManager : public IProjectUiCb
{
diff --git a/src/Project/Project.cpp b/src/Project/Project.cpp
index e553d2e..89ac28c 100644
--- a/src/Project/Project.cpp
+++ b/src/Project/Project.cpp
@@ -29,6 +29,7 @@
#include "AutomaticBackup.h"
#include "Library/Library.h"
#include "Project.h"
+#include "ProjectCallbacks.h"
#include "RecentProjects.h"
#include "Settings/Settings.h"
#include "Workflow/MainWorkflow.h"
diff --git a/src/Project/Project.h b/src/Project/Project.h
index 83b9fbc..3f20492 100644
--- a/src/Project/Project.h
+++ b/src/Project/Project.h
@@ -36,51 +36,13 @@ class QUndoStack;
class QXmlStreamWriter;
class AutomaticBackup;
+class IProjectUiCb;
class Library;
class MainWorkflow;
class ProjectManager;
class Settings;
class Workspace;
-class IProjectUiCb
-{
-public:
- enum SaveMode
- {
- Save, // Save the project
- Discard, // Discard it
- Cancel // Don't do anything
- };
-
- virtual ~IProjectUiCb() {}
-
- /**
- * @brief shouldSaveBeforeClose Ask the user if she wants to save the project in case
- * it's about to be closed
- * @return True if the project should be saved. False if changes are to be discarded.
- */
- virtual SaveMode shouldSaveBeforeClose() = 0;
-
- /**
- * @brief getProjectFile Ask the user where to save a new project
- * @param defaultPath A default project location, if any.
- * @return The selected project file
- */
- virtual QString getProjectFileDestination( const QString& defaultPath ) = 0;
-
- /**
- * @brief shouldLoadBackupFile
- * @return True if the user wants to load the backup file.
- */
- virtual bool shouldLoadBackupFile() = 0;
-
- /**
- * @brief shouldDeleteOutdatedBackupFile
- * @return True if the user wants to delete this backup file
- */
- virtual bool shouldDeleteOutdatedBackupFile() = 0;
-};
-
class Project : public QObject, public Singleton<Project>
{
Q_OBJECT
diff --git a/src/Project/ProjectCallbacks.h b/src/Project/ProjectCallbacks.h
new file mode 100644
index 0000000..2fc8d25
--- /dev/null
+++ b/src/Project/ProjectCallbacks.h
@@ -0,0 +1,67 @@
+/*****************************************************************************
+ * ProjectCallbacks.h: Defines some project related callback interfaces
+ *****************************************************************************
+ * Copyright (C) 2008-2014 VideoLAN
+ *
+ * Authors: Hugo Beauzée-Luyssen <hugo at beauzee.fr>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+
+#ifndef PROJECTCALLBACKS_H
+#define PROJECTCALLBACKS_H
+
+#include <QString>
+
+class IProjectUiCb
+{
+public:
+ enum SaveMode
+ {
+ Save, // Save the project
+ Discard, // Discard it
+ Cancel // Don't do anything
+ };
+
+ virtual ~IProjectUiCb() {}
+
+ /**
+ * @brief shouldSaveBeforeClose Ask the user if she wants to save the project in case
+ * it's about to be closed
+ * @return True if the project should be saved. False if changes are to be discarded.
+ */
+ virtual SaveMode shouldSaveBeforeClose() = 0;
+
+ /**
+ * @brief getProjectFile Ask the user where to save a new project
+ * @param defaultPath A default project location, if any.
+ * @return The selected project file
+ */
+ virtual QString getProjectFileDestination( const QString& defaultPath ) = 0;
+
+ /**
+ * @brief shouldLoadBackupFile
+ * @return True if the user wants to load the backup file.
+ */
+ virtual bool shouldLoadBackupFile() = 0;
+
+ /**
+ * @brief shouldDeleteOutdatedBackupFile
+ * @return True if the user wants to delete this backup file
+ */
+ virtual bool shouldDeleteOutdatedBackupFile() = 0;
+};
+
+#endif // PROJECTCALLBACKS_H
More information about the Vlmc-devel
mailing list