From c2735896cf2229a57976707b3f6135991d976d52 Mon Sep 17 00:00:00 2001 From: "David A. Cuadrado" Date: Mon, 12 Nov 2007 13:59:52 -0500 Subject: [PATCH] New class Dash::Project --- dash.png | Bin 2158 -> 1500 bytes src/components/base/widget.cpp | 2 +- src/components/base/widget.h | 4 +- src/components/camera/camerawidget.cpp | 4 +- src/components/camera/camerawidget.h | 2 +- src/components/library/librarywidget.cpp | 4 +- src/components/library/librarywidget.h | 2 +- src/components/projectbrowser/projectbrowser.cpp | 4 +- src/components/projectbrowser/projectbrowser.h | 2 +- src/components/timeline/timeline.cpp | 57 +++++++++++---------- src/components/timeline/timeline.h | 2 +- src/dash/dash.pro | 10 ++-- src/dash/module.cpp | 8 +-- src/dash/module.h | 11 ++-- .../base/widget.cpp => dash/project.cpp} | 19 ++----- src/{components/base/widget.cpp => dash/project.h} | 35 ++++++------- src/dash/projectsaver.cpp | 7 ++- src/dash/projectsaver.h | 13 ++--- src/dashd/dashd.pro | 3 +- src/dashserver/backups/backupmanager.cpp | 2 - src/dashserver/project/project.cpp | 2 +- src/dashserver/project/project.h | 6 +-- src/shell/documentviewer.cpp | 4 +- src/shell/documentviewer.h | 6 +-- src/shell/mainwindow.cpp | 2 + src/shell/networkhandler.cpp | 2 + src/shell/projectmanager.cpp | 8 +-- src/shell/projectmanager.h | 7 +-- 28 files changed, 108 insertions(+), 120 deletions(-) rewrite dash.png (99%) copy src/{components/base/widget.cpp => dash/project.cpp} (82%) copy src/{components/base/widget.cpp => dash/project.h} (82%) diff --git a/dash.png b/dash.png dissimilarity index 99% index c03d56b53c75401d5586d05f176c4cd848e5c7ac..731e56d2dd57fb26c497328f0a0296cc94a86d54 100644 GIT binary patch delta 1465 zcwPay1xEVr5ZntPiBL{Q4GJ0x0000DNk~Le0000T0000T2nGNE09KP{50N1g5(#if zS#tmY4c7nw4c7reD4TeZF(-coSxH1eR7i=fm&;EZR}{v-bLU}W8ynjZex!jwA$ABQ zG*OyHN}p2GMoI|kqTQs6{sY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9@`{Ve&l(%IL~VOhmtm;&EiD9VYf*hZ zRG$x@;~*ObvSFYKff@>-R8`?qRV3GiQi;;Jb6o!VYj(wA#p8bew*9xdm`q21x2m=^ z#p6A545MSA9uG7pVe$S zR))jN8e*~SLDy|-85^r^Di%fD=Og0tp#ZkykaZls)->5+G;L|)tXZpMAv)yA^}GZo7i`ZQ_$ diff --git a/src/components/base/widget.cpp b/src/components/base/widget.cpp index 14bef1e..9b05b9f 100644 --- a/src/components/base/widget.cpp +++ b/src/components/base/widget.cpp @@ -24,7 +24,7 @@ namespace Dash { namespace Component { -Widget::Widget(YAMF::Model::Project *const project, QWidget *parent) +Widget::Widget(Dash::Project *const project, QWidget *parent) : QWidget(parent), Dash::Module(project) { } diff --git a/src/components/base/widget.h b/src/components/base/widget.h index e6ce238..a140afe 100644 --- a/src/components/base/widget.h +++ b/src/components/base/widget.h @@ -27,6 +27,8 @@ #include namespace Dash { +class Project; + namespace Component { /** @@ -37,7 +39,7 @@ class Widget : public QWidget, public Dash::Module Q_OBJECT; public: - Widget(YAMF::Model::Project *const project, QWidget *parent = 0); + Widget(Dash::Project *const project, QWidget *parent = 0); ~Widget(); virtual Dash::Workspace workspace() const; diff --git a/src/components/camera/camerawidget.cpp b/src/components/camera/camerawidget.cpp index 1b12d99..4e3cf2f 100644 --- a/src/components/camera/camerawidget.cpp +++ b/src/components/camera/camerawidget.cpp @@ -26,6 +26,8 @@ #include #include +#include "dash/project.h" + #include "ui_camera.h" namespace Dash { @@ -36,7 +38,7 @@ struct CameraWidget::Private Ui::Camera *ui; }; -CameraWidget::CameraWidget(YAMF::Model::Project *const project, QWidget *parent) +CameraWidget::CameraWidget(Dash::Project *const project, QWidget *parent) : Dash::Component::Widget(project, parent), d(new Private) { d->ui = new Ui::Camera; diff --git a/src/components/camera/camerawidget.h b/src/components/camera/camerawidget.h index 1b9d33f..5c3813d 100644 --- a/src/components/camera/camerawidget.h +++ b/src/components/camera/camerawidget.h @@ -36,7 +36,7 @@ class CameraWidget : public Dash::Component::Widget { Q_OBJECT public: - CameraWidget(YAMF::Model::Project *const project, QWidget *parent = 0); + CameraWidget(Dash::Project *const project, QWidget *parent = 0); ~CameraWidget(); QSize sizeHint() const; diff --git a/src/components/library/librarywidget.cpp b/src/components/library/librarywidget.cpp index a3aef42..aea48f7 100644 --- a/src/components/library/librarywidget.cpp +++ b/src/components/library/librarywidget.cpp @@ -56,6 +56,8 @@ #include "gctable.h" +#include "dash/project.h" + namespace Dash { namespace Component { @@ -86,7 +88,7 @@ struct LibraryWidget::Private QHash objects; }; -LibraryWidget::LibraryWidget(YAMF::Model::Project *const project, QWidget *parent) : Widget(project, parent), d(new Private) +LibraryWidget::LibraryWidget(Dash::Project *const project, QWidget *parent) : Widget(project, parent), d(new Private) { D_INIT; diff --git a/src/components/library/librarywidget.h b/src/components/library/librarywidget.h index fdc3f3c..8e8c1b8 100644 --- a/src/components/library/librarywidget.h +++ b/src/components/library/librarywidget.h @@ -42,7 +42,7 @@ class LibraryWidget : public Widget { Q_OBJECT public: - LibraryWidget(YAMF::Model::Project *const project, QWidget *parent = 0); + LibraryWidget(Dash::Project *const project, QWidget *parent = 0); ~LibraryWidget(); virtual Dash::Workspace workspace() const; diff --git a/src/components/projectbrowser/projectbrowser.cpp b/src/components/projectbrowser/projectbrowser.cpp index a33778d..c92adac 100644 --- a/src/components/projectbrowser/projectbrowser.cpp +++ b/src/components/projectbrowser/projectbrowser.cpp @@ -34,6 +34,8 @@ #include +#include "dash/project.h" + #include "ui_projectbrowser.h" @@ -46,7 +48,7 @@ struct ProjectBrowser::Private Ui::ProjectBrowser ui; }; -ProjectBrowser::ProjectBrowser(YAMF::Model::Project *const project, QGraphicsScene *scene, QWidget *parent) : Dash::Component::Widget(project,parent), d(new Private) +ProjectBrowser::ProjectBrowser(Dash::Project *const project, QGraphicsScene *scene, QWidget *parent) : Dash::Component::Widget(project,parent), d(new Private) { setWindowTitle(tr("&Project browser")); setWindowIcon( DGui::IconLoader::self()->load("")); diff --git a/src/components/projectbrowser/projectbrowser.h b/src/components/projectbrowser/projectbrowser.h index 22058b9..229fd4d 100644 --- a/src/components/projectbrowser/projectbrowser.h +++ b/src/components/projectbrowser/projectbrowser.h @@ -34,7 +34,7 @@ namespace Component { class ProjectBrowser : public Dash::Component::Widget { public: - ProjectBrowser(YAMF::Model::Project *const project, QGraphicsScene *scene, QWidget *parent = 0); + ProjectBrowser(Dash::Project *const project, QGraphicsScene *scene, QWidget *parent = 0); ~ProjectBrowser(); virtual Dash::Workspace workspace() const; diff --git a/src/components/timeline/timeline.cpp b/src/components/timeline/timeline.cpp index a4d8d25..a1a801d 100644 --- a/src/components/timeline/timeline.cpp +++ b/src/components/timeline/timeline.cpp @@ -35,7 +35,8 @@ #include // Dash -#include +#include "dash/datasource.h" +#include "dash/project.h" #include @@ -44,11 +45,11 @@ namespace Component { struct TimeLine::Private { - Private(YAMF::Model::Project *const project) : tlWidget(0), project(project){} + Private(TimeLine *q) : q(q), tlWidget(0) {} - TimeLineWidget *tlWidget; - YAMF::Model::Project *const project; + TimeLine *q; + TimeLineWidget *tlWidget; void updateScene( const Dash::DataSource * datasource, bool undo ) { @@ -72,7 +73,7 @@ struct TimeLine::Private if( undo ) { - YAMF::Model::Scene *scene = project->scene(visualIndex); + YAMF::Model::Scene *scene = q->project()->scene(visualIndex); tlWidget->insertScene(visualIndex, scene->sceneName()); @@ -169,7 +170,7 @@ struct TimeLine::Private if( undo ) { - YAMF::Model::Scene *scene = project->scene(sceneIndex); + YAMF::Model::Scene *scene = q->project()->scene(sceneIndex); YAMF::Model::Layer *layer = scene->layer( index ); tlWidget->insertLayer(sceneIndex, index, layer->layerName()); @@ -388,7 +389,7 @@ struct TimeLine::Private } }; -TimeLine::TimeLine(YAMF::Model::Project *const project, QWidget *parent) : Widget(project, parent), d(new Private(project)) +TimeLine::TimeLine(Dash::Project *const project, QWidget *parent) : Widget(project, parent), d(new Private(this)) { QVBoxLayout *layout = new QVBoxLayout(this); setWindowTitle(tr("&Time Line")); @@ -431,7 +432,7 @@ void TimeLine::onEvent(const TimeLineWidget::Event &event ) { case TimeLineWidget::InsertFrame: { - YAMF::Model::Scene *scene = d->project->scene(event.scene); + YAMF::Model::Scene *scene = project()->scene(event.scene); if(scene) { YAMF::Model::Layer *layer = scene->layer(event.layer); @@ -446,7 +447,7 @@ void TimeLine::onEvent(const TimeLineWidget::Event &event ) { if(event.scene > -1 && event.layer > -1 && event.frame > -1) { - YAMF::Model::Scene *scene = d->project->scene(event.scene); + YAMF::Model::Scene *scene = project()->scene(event.scene); if( scene ) { YAMF::Model::Layer *layer = scene->layer(event.layer); @@ -464,7 +465,7 @@ void TimeLine::onEvent(const TimeLineWidget::Event &event ) break; case TimeLineWidget::MoveFrameUp: { - YAMF::Model::Scene *scene = d->project->scene(event.scene); + YAMF::Model::Scene *scene = project()->scene(event.scene); YAMF::Model::Layer *layer = scene->layer(event.layer); YAMF::Model::Frame *frame = layer->frame(event.frame); @@ -477,7 +478,7 @@ void TimeLine::onEvent(const TimeLineWidget::Event &event ) break; case TimeLineWidget::MoveFrameDown: { - YAMF::Model::Scene *scene = d->project->scene(event.scene); + YAMF::Model::Scene *scene = project()->scene(event.scene); YAMF::Model::Layer *layer = scene->layer(event.layer); @@ -494,7 +495,7 @@ void TimeLine::onEvent(const TimeLineWidget::Event &event ) break; case TimeLineWidget::LockFrame: { - YAMF::Model::Scene *scene = d->project->scene(event.scene); + YAMF::Model::Scene *scene = project()->scene(event.scene); YAMF::Model::Layer *layer = scene->layer(event.layer); YAMF::Model::Frame *frame = layer->frame(event.frame); frame->setLocked(event.data.toBool()); @@ -506,7 +507,7 @@ void TimeLine::onEvent(const TimeLineWidget::Event &event ) break; case TimeLineWidget::ChangeFrameVisibility: { - YAMF::Model::Scene *scene = d->project->scene(event.scene); + YAMF::Model::Scene *scene = project()->scene(event.scene); YAMF::Model::Layer *layer = scene->layer(event.layer); YAMF::Model::Frame *frame = layer->frame(event.frame); frame->setVisible(event.data.toBool()); @@ -514,14 +515,14 @@ void TimeLine::onEvent(const TimeLineWidget::Event &event ) break; case TimeLineWidget::ExpandFrame: { - YAMF::Model::Scene *scene = d->project->scene(event.scene); + YAMF::Model::Scene *scene = project()->scene(event.scene); YAMF::Model::Layer *layer = scene->layer(event.layer); layer->expandFrame(event.frame, event.data.toInt()); } break; case TimeLineWidget::InsertLayer: { - YAMF::Model::Scene *scene = d->project->scene(event.scene); + YAMF::Model::Scene *scene = project()->scene(event.scene); if(scene) { YAMF::Model::Layer *layer = scene->createLayer( event.layer+1 ); @@ -536,7 +537,7 @@ void TimeLine::onEvent(const TimeLineWidget::Event &event ) { if(event.scene > -1 && event.layer > -1) { - YAMF::Model::Scene *scene = d->project->scene(event.scene); + YAMF::Model::Scene *scene = project()->scene(event.scene); YAMF::Model::Layer *layer = scene->layer(event.layer); scene->removeLayer(layer); } @@ -544,33 +545,33 @@ void TimeLine::onEvent(const TimeLineWidget::Event &event ) break; case TimeLineWidget::MoveLayerUp: { - YAMF::Model::Scene *scene = d->project->scene(event.scene); + YAMF::Model::Scene *scene = project()->scene(event.scene); scene->moveLayer(event.layer, event.layer-1); } break; case TimeLineWidget::MoveLayerDown: { - YAMF::Model::Scene *scene = d->project->scene(event.scene); + YAMF::Model::Scene *scene = project()->scene(event.scene); scene->moveLayer(event.layer, event.layer+1); } break; case TimeLineWidget::LockLayer: { - YAMF::Model::Scene *scene = d->project->scene(event.scene); + YAMF::Model::Scene *scene = project()->scene(event.scene); YAMF::Model::Layer *layer = scene->layer(event.layer); layer->setLocked(event.data.toBool()); } break; case TimeLineWidget::RenameLayer: { - YAMF::Model::Scene *scene = d->project->scene(event.scene); + YAMF::Model::Scene *scene = project()->scene(event.scene); YAMF::Model::Layer *layer = scene->layer(event.layer); layer->setLayerName(event.data.toString()); } break; case TimeLineWidget::ChangeLayerVisibility: { - YAMF::Model::Scene *scene = d->project->scene(event.scene); + YAMF::Model::Scene *scene = project()->scene(event.scene); YAMF::Model::Layer *layer = scene->layer(event.layer); layer->setVisible(event.data.toBool()); } @@ -578,7 +579,7 @@ void TimeLine::onEvent(const TimeLineWidget::Event &event ) case TimeLineWidget::InsertScene: { - YAMF::Model::Scene *scene = d->project->createScene(event.scene+1); + YAMF::Model::Scene *scene = project()->createScene(event.scene+1); YAMF::Model::Layer *layer = scene->createLayer(); layer->createFrame(); } @@ -587,33 +588,33 @@ void TimeLine::onEvent(const TimeLineWidget::Event &event ) { if(event.scene > -1) { - YAMF::Model::Scene *scene = d->project->scene(event.scene); + YAMF::Model::Scene *scene = project()->scene(event.scene); if(scene) { - d->project->removeScene(scene); + project()->removeScene(scene); } } } break; case TimeLineWidget::MoveSceneUp: { - d->project->moveScene(event.scene, event.scene-1); + project()->moveScene(event.scene, event.scene-1); } break; case TimeLineWidget::MoveSceneDown: { - d->project->moveScene(event.scene, event.scene+1); + project()->moveScene(event.scene, event.scene+1); } break; case TimeLineWidget::LockScene: { - YAMF::Model::Scene *scene = d->project->scene(event.scene); + YAMF::Model::Scene *scene = project()->scene(event.scene); scene->setLocked(event.data.toBool()); } break; case TimeLineWidget::RenameScene: { - YAMF::Model::Scene *scene = d->project->scene(event.scene); + YAMF::Model::Scene *scene = project()->scene(event.scene); scene->setSceneName(event.data.toString()); } break; diff --git a/src/components/timeline/timeline.h b/src/components/timeline/timeline.h index c2aa75a..eb9efb1 100644 --- a/src/components/timeline/timeline.h +++ b/src/components/timeline/timeline.h @@ -56,7 +56,7 @@ class TimeLine : public Widget Q_OBJECT; public: - TimeLine(YAMF::Model::Project *const project, QWidget *parent = 0); + TimeLine(Dash::Project *const project, QWidget *parent = 0); ~TimeLine(); virtual Dash::Workspace workspace() const; diff --git a/src/dash/dash.pro b/src/dash/dash.pro index 676d988..517f5ee 100644 --- a/src/dash/dash.pro +++ b/src/dash/dash.pro @@ -2,9 +2,9 @@ DEFINES += _BUILD_DASH_ TEMPLATE = lib -win32{ +win32 { CONFIG += dll -}else{ +}else { CONFIG += staticlib \ warn_on } @@ -14,13 +14,15 @@ module.h \ datasource.h \ commandparser.h \ exports.h \ -projectsaver.h +projectsaver.h \ + project.h TARGET = dash SOURCES += module.cpp \ datasource.cpp \ commandparser.cpp \ -projectsaver.cpp +projectsaver.cpp \ + project.cpp INCLUDEPATH += .. include(../../config.pri) diff --git a/src/dash/module.cpp b/src/dash/module.cpp index d4e209d..382e44b 100644 --- a/src/dash/module.cpp +++ b/src/dash/module.cpp @@ -25,12 +25,12 @@ namespace Dash { struct Module::Private { - Private(YAMF::Model::Project *const project) : project(project) {} + Private(Dash::Project *const project) : project(project) {} - YAMF::Model::Project *const project; + Dash::Project *const project; }; -Module::Module(YAMF::Model::Project *const project) : d(new Private(project)) +Module::Module(Dash::Project *const project) : d(new Private(project)) { } @@ -40,7 +40,7 @@ Module::~Module() delete d; } -YAMF::Model::Project *Module::project() const +Dash::Project *Module::project() const { return d->project; } diff --git a/src/dash/module.h b/src/dash/module.h index 77ef5fe..ebff35c 100644 --- a/src/dash/module.h +++ b/src/dash/module.h @@ -25,13 +25,8 @@ #include #include -namespace YAMF { -namespace Model { - class Project; -} -} - namespace Dash { +class Project; /** * @author David Cuadrado @@ -39,10 +34,10 @@ namespace Dash { class DASH_EXPORT Module { public: - Module(YAMF::Model::Project *const project); + Module(Dash::Project *const project); virtual ~Module(); - YAMF::Model::Project *project() const; + Dash::Project *project() const; virtual DataSource::Types sources() const; virtual void update(const DataSource *datasource, bool undo = false); diff --git a/src/components/base/widget.cpp b/src/dash/project.cpp similarity index 82% copy from src/components/base/widget.cpp copy to src/dash/project.cpp index 14bef1e..74a7e8c 100644 --- a/src/components/base/widget.cpp +++ b/src/dash/project.cpp @@ -18,32 +18,19 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ - -#include "widget.h" +#include "project.h" namespace Dash { -namespace Component { -Widget::Widget(YAMF::Model::Project *const project, QWidget *parent) - : QWidget(parent), Dash::Module(project) +Project::Project(QObject *parent) : YAMF::Model::Project(parent) { } -Widget::~Widget() +Project::~Project() { } -Dash::Workspace Widget::workspace() const -{ - return Dash::All; -} -Qt::DockWidgetArea Widget::area() const -{ - return Qt::LeftDockWidgetArea; -} - -} } diff --git a/src/components/base/widget.cpp b/src/dash/project.h similarity index 82% copy from src/components/base/widget.cpp copy to src/dash/project.h index 14bef1e..add585c 100644 --- a/src/components/base/widget.cpp +++ b/src/dash/project.h @@ -18,32 +18,27 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ +#ifndef DASHPROJECT_H +#define DASHPROJECT_H -#include "widget.h" +#include +#include namespace Dash { -namespace Component { -Widget::Widget(YAMF::Model::Project *const project, QWidget *parent) - : QWidget(parent), Dash::Module(project) +/** + * @author David Cuadrado +*/ +class DASH_EXPORT Project : public YAMF::Model::Project { -} - + Q_OBJECT; + + public: + Project(QObject *parent = 0); + ~Project(); -Widget::~Widget() -{ -} +}; -Dash::Workspace Widget::workspace() const -{ - return Dash::All; -} - -Qt::DockWidgetArea Widget::area() const -{ - return Qt::LeftDockWidgetArea; -} - -} } +#endif diff --git a/src/dash/projectsaver.cpp b/src/dash/projectsaver.cpp index 97903cf..1bc16c0 100644 --- a/src/dash/projectsaver.cpp +++ b/src/dash/projectsaver.cpp @@ -36,6 +36,9 @@ #include #include +// Dash +#include "dash/project.h" + namespace Dash { static bool deleteProjectDir(const QString &projectDir) @@ -101,7 +104,7 @@ ProjectSaver::~ProjectSaver() { } -bool ProjectSaver::save(YAMF::Model::Project *project, const QString &path) +bool ProjectSaver::save(Dash::Project *project, const QString &path) { QDir projectDir = QDir::tempPath()+"/dash."+QString::number(DCore::Algorithm::random()); @@ -195,7 +198,7 @@ bool ProjectSaver::save(YAMF::Model::Project *project, const QString &path) return true; } -bool ProjectSaver::load(YAMF::Model::Project *project, const QString &path) +bool ProjectSaver::load(Dash::Project *project, const QString &path) { QDir projectDir = QDir::tempPath()+"/dash."+QString::number(DCore::Algorithm::random()); diff --git a/src/dash/projectsaver.h b/src/dash/projectsaver.h index a3d1849..ca3fb7f 100644 --- a/src/dash/projectsaver.h +++ b/src/dash/projectsaver.h @@ -25,16 +25,11 @@ #include #include -namespace YAMF { -namespace Model { -class Project; -} -} - namespace Dash { +class Project; /** - @author David Cuadrado + * @author David Cuadrado */ class DASH_EXPORT ProjectSaver { @@ -42,8 +37,8 @@ class DASH_EXPORT ProjectSaver ProjectSaver(); ~ProjectSaver(); - static bool save(YAMF::Model::Project *project, const QString &path); - static bool load(YAMF::Model::Project *project, const QString &file); + static bool save(Dash::Project *project, const QString &path); + static bool load(Dash::Project *project, const QString &file); }; } diff --git a/src/dashd/dashd.pro b/src/dashd/dashd.pro index 9ff5c44..fa6e8dc 100644 --- a/src/dashd/dashd.pro +++ b/src/dashd/dashd.pro @@ -3,12 +3,13 @@ TEMPLATE = app QT += network xml -LIBS += -ldashserver -ldash !include(../../config.pri){ error(cannot include config.pri) } +LIBS += -L$$DESTDIR/lib -ldashserver -ldash + INCLUDEPATH += .. TARGET = dashd diff --git a/src/dashserver/backups/backupmanager.cpp b/src/dashserver/backups/backupmanager.cpp index 324da01..c3fec49 100644 --- a/src/dashserver/backups/backupmanager.cpp +++ b/src/dashserver/backups/backupmanager.cpp @@ -200,8 +200,6 @@ void Manager::handlePackage(DashServer::Package *const pkg) { QStringList backups = parser.backups(); - dfDebug << backups; - Dash::Network::Package::AddBackup response; bool ok = false; diff --git a/src/dashserver/project/project.cpp b/src/dashserver/project/project.cpp index ff9b790..f7bc460 100644 --- a/src/dashserver/project/project.cpp +++ b/src/dashserver/project/project.cpp @@ -46,7 +46,7 @@ struct Project::Private QSet owners; }; -Project::Project() : YAMF::Model::Project(), d(new Private) +Project::Project(QObject *parent) : Dash::Project(parent), d(new Private) { d->processor = new YAMF::Command::Processor(this); } diff --git a/src/dashserver/project/project.h b/src/dashserver/project/project.h index 3d8b822..9870ff1 100644 --- a/src/dashserver/project/project.h +++ b/src/dashserver/project/project.h @@ -22,7 +22,7 @@ #ifndef DASHSERVER_PROJECTPROJECT_H #define DASHSERVER_PROJECTPROJECT_H -#include +#include #include #include @@ -34,10 +34,10 @@ namespace Project { /** @author David Cuadrado */ -class DASHSERVER_EXPORT Project : public YAMF::Model::Project, public XDBMS::Object +class DASHSERVER_EXPORT Project : public Dash::Project, public XDBMS::Object { public: - Project(); + Project(QObject *parent = 0); ~Project(); void execute(const QString &xml, DashServer::Connection *source); diff --git a/src/shell/documentviewer.cpp b/src/shell/documentviewer.cpp index 3a67247..538fc79 100644 --- a/src/shell/documentviewer.cpp +++ b/src/shell/documentviewer.cpp @@ -21,6 +21,8 @@ #include "documentviewer.h" +#include "dash/project.h" + // YAMF #include @@ -43,7 +45,7 @@ // Dash -DocumentViewer::DocumentViewer(YAMF::Model::Project *const project, QWidget *parent) +DocumentViewer::DocumentViewer(Dash::Project *const project, QWidget *parent) : QMainWindow(parent), Dash::Module(project) { { diff --git a/src/shell/documentviewer.h b/src/shell/documentviewer.h index 532cdc7..070b67e 100644 --- a/src/shell/documentviewer.h +++ b/src/shell/documentviewer.h @@ -29,11 +29,11 @@ namespace YAMF { namespace Drawing { class View; } +} -namespace Model { +namespace Dash { class Project; } -} /** @@ -44,7 +44,7 @@ class DocumentViewer : public QMainWindow, public Dash::Module Q_OBJECT; public: - DocumentViewer(YAMF::Model::Project *const project, QWidget *parent = 0); + DocumentViewer(Dash::Project *const project, QWidget *parent = 0); ~DocumentViewer(); YAMF::Drawing::View *view(); diff --git a/src/shell/mainwindow.cpp b/src/shell/mainwindow.cpp index b95c2fb..7dd0a67 100644 --- a/src/shell/mainwindow.cpp +++ b/src/shell/mainwindow.cpp @@ -47,6 +47,7 @@ #include "settingsdialog.h" #include "newprojectdialog.h" #include "exportdialog.h" +#include "dash/project.h" #include #include @@ -77,6 +78,7 @@ MainWindow::MainWindow(QWidget *parent) : Ideality::StackedMainWindow(parent) { setWindowTitle(tr("Dash")); + setWindowIcon(QIcon(__PREFIX__+QString("/share/icons/dash.png"))); YAMF::initialize(); diff --git a/src/shell/networkhandler.cpp b/src/shell/networkhandler.cpp index d13a8f1..be6721b 100644 --- a/src/shell/networkhandler.cpp +++ b/src/shell/networkhandler.cpp @@ -36,6 +36,8 @@ #include // Dash +#include "dash/project.h" + #include "dash/network/socket.h" #include "dash/network/filereceiver.h" diff --git a/src/shell/projectmanager.cpp b/src/shell/projectmanager.cpp index e3d76ac..77a9d51 100644 --- a/src/shell/projectmanager.cpp +++ b/src/shell/projectmanager.cpp @@ -30,7 +30,6 @@ #include // YAMF -#include #include #include #include @@ -42,6 +41,7 @@ #include // DASH +#include "dash/project.h" #include "dash/module.h" #include "dash/commandparser.h" #include "dash/projectsaver.h" @@ -72,7 +72,7 @@ struct ProjectManager::Private Private() : isLocal(true), project(0), commandCounter(0), networkHandler(0) {} bool isLocal; - YAMF::Model::Project *project; + Dash::Project *project; QList modules; @@ -84,7 +84,7 @@ struct ProjectManager::Private ProjectManager::ProjectManager(QObject *parent) : QObject(parent), d(new Private) { - d->project = new YAMF::Model::Project(this); + d->project = new Dash::Project(this); d->project->commandManager()->setObserver(this); } @@ -139,7 +139,7 @@ void ProjectManager::closeProject() d->project->setOpen(false); } -YAMF::Model::Project *ProjectManager::project() const +Dash::Project *ProjectManager::project() const { return d->project; } diff --git a/src/shell/projectmanager.h b/src/shell/projectmanager.h index b9812b8..1e3b8e0 100644 --- a/src/shell/projectmanager.h +++ b/src/shell/projectmanager.h @@ -27,14 +27,11 @@ namespace Dash { class Module; + class Project; } namespace YAMF { -namespace Model { - class Project; -} - namespace Command { class Base; } @@ -76,7 +73,7 @@ class ProjectManager : public QObject, public YAMF::Command::Observer void closeProject(); - YAMF::Model::Project *project() const; + Dash::Project *project() const; void registerModule(Dash::Module *module); -- 2.11.4.GIT