Skip to content

Commit

Permalink
Change IProjectSerialisationInterface to ease further refactoring.
Browse files Browse the repository at this point in the history
Refs #9970
  • Loading branch information
Harry Jeffery committed Jul 31, 2014
1 parent daf1a90 commit d399311
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Code/Mantid/MantidPlot/src/ApplicationWindow.cpp
Expand Up @@ -4651,7 +4651,7 @@ void ApplicationWindow::openProjectFolder(Folder* curFolder, std::string lines,
plot->setBirthDate(QString(birthDate.c_str()));
setListViewDate(QString(caption.c_str()), QString(birthDate.c_str()));

plot->loadFromProject(multiLayerLines);
plot->loadFromProject(multiLayerLines, this, d_file_version);
}
}

Expand Down
2 changes: 1 addition & 1 deletion Code/Mantid/MantidPlot/src/Graph.cpp
Expand Up @@ -6155,7 +6155,7 @@ void Graph::slotDragMouseMove(QPoint pos)
emit dragMouseMove(pos);
}

void Graph::loadFromProject(const std::string& lines)
void Graph::loadFromProject(const std::string& lines, ApplicationWindow* app, const int fileVersion)
{
}

2 changes: 1 addition & 1 deletion Code/Mantid/MantidPlot/src/Graph.h
Expand Up @@ -404,7 +404,7 @@ public slots:

//! \name Loading from a project
//@{
void loadFromProject(const std::string& lines);
void loadFromProject(const std::string& lines, ApplicationWindow* app, const int fileVersion);
//@}

//! \name Saving to File
Expand Down
5 changes: 4 additions & 1 deletion Code/Mantid/MantidPlot/src/Mantid/IProjectSerialisable.h
@@ -1,8 +1,11 @@
#ifndef MANTID_API_IPROJECTSERIALISABLE_H_
#define MANTID_API_IPROJECTSERIALISABLE_H_

class ApplicationWindow;

namespace Mantid
{

/**
Defines an interface to a MantidPlot class that can be saved into or loaded from a project.
Expand Down Expand Up @@ -35,7 +38,7 @@ namespace Mantid
/// Virtual destructor (required by linker on some versions of OS X/Intel compiler)
virtual ~IProjectSerialisable() {}
/// Loads the given lines from the project file and applies them.
virtual void loadFromProject(const std::string& lines) = 0;
virtual void loadFromProject(const std::string& lines, ApplicationWindow* app, const int fileVersion) = 0;
};

} // namespace Mantid
Expand Down
4 changes: 2 additions & 2 deletions Code/Mantid/MantidPlot/src/MultiLayer.cpp
Expand Up @@ -1655,7 +1655,7 @@ void MultiLayer::setWaterfallFillColor(const QColor& c)
active_graph->setWaterfallFillColor(c);
}

void MultiLayer::loadFromProject(const std::string& lines)
void MultiLayer::loadFromProject(const std::string& lines, ApplicationWindow* app, const int fileVersion)
{
TSVSerialiser tsv(lines);

Expand Down Expand Up @@ -1724,7 +1724,7 @@ void MultiLayer::loadFromProject(const std::string& lines)

if(g)
{
g->loadFromProject(graphLines);
g->loadFromProject(graphLines, app, fileVersion);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Code/Mantid/MantidPlot/src/MultiLayer.h
Expand Up @@ -97,7 +97,7 @@ class MultiLayer: public MdiSubWindow, public Mantid::IProjectSerialisable

void setWaterfallLayout(bool on = true);

void loadFromProject(const std::string& lines);
void loadFromProject(const std::string& lines, ApplicationWindow* app, const int fileVersion);

public slots:
Graph* addLayer(int x = 0, int y = 0, int width = 0, int height = 0);
Expand Down

0 comments on commit d399311

Please sign in to comment.