Skip to content

Commit

Permalink
CellML Annotation view plugin: reworked our approach to the saving/re…
Browse files Browse the repository at this point in the history
…loading of a file (#1491).
  • Loading branch information
agarny committed Dec 18, 2017
1 parent 6ab8a17 commit ee513c6
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,9 @@ void CellMLAnnotationViewPlugin::fileModified(const QString &pFileName)

void CellMLAnnotationViewPlugin::fileSaved(const QString &pFileName)
{
//---ISSUE1491---
Q_UNUSED(pFileName);
// The given file has been saved, so let our view widget know about it

mViewWidget->fileSaved(pFileName);
}

//==============================================================================
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,19 @@ void CellmlAnnotationViewWidget::filePermissionsChanged(const QString &pFileName

//==============================================================================

void CellmlAnnotationViewWidget::fileSaved(const QString &pFileName)
{
// The given file has been saved, so consider it reloaded, but only if it
// has a corresponing widget and that it is invisible

CellmlAnnotationViewEditingWidget *editingWidget = mEditingWidgets.value(pFileName);

if (editingWidget && !editingWidget->isVisible())
fileReloaded(pFileName);
}

//==============================================================================

void CellmlAnnotationViewWidget::fileReloaded(const QString &pFileName)
{
// The given file has been reloaded, so reload it, should it be managed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ class CellmlAnnotationViewWidget : public Core::ViewWidget
void finalize(const QString &pFileName);

void filePermissionsChanged(const QString &pFileName);
void fileSaved(const QString &pFileName);
void fileReloaded(const QString &pFileName);
void fileRenamed(const QString &pOldFileName, const QString &pNewFileName);

Expand Down

0 comments on commit ee513c6

Please sign in to comment.