Skip to content

Commit

Permalink
Added button to open mapping files
Browse files Browse the repository at this point in the history
  • Loading branch information
LafCorentin committed Aug 22, 2020
1 parent 1276bae commit 1e3fe96
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
Expand Up @@ -115,10 +115,13 @@ CellMLZincMappingViewEditingWidget::CellMLZincMappingViewEditingWidget(const QSt
mOpenMeshFile = Core::newAction(QIcon(":/oxygen/actions/document-open.png"),
mToolBarWidget);

//TODO trash could be hidden when nothing to show
//TODO trash could be hidden when nothing selected
mClearNode = Core::newAction(QIcon(":/oxygen/actions/edit-clear.png"),
mToolBarWidget);

mOpenMappingFile = Core::newAction(QIcon(":/oxygen/actions/document-import.png"),
mToolBarWidget);

mDelayWidget = new QwtWheel(mToolBarWidget);
mDelayWidget->setBorderWidth(0);
mDelayWidget->setFixedSize(int(0.07*availableGeometry.width()),
Expand All @@ -132,6 +135,7 @@ CellMLZincMappingViewEditingWidget::CellMLZincMappingViewEditingWidget(const QSt
mToolBarWidget->addAction(mOpenMeshFile);
mToolBarWidget->addAction(mClearNode);
mToolBarWidget->addWidget(mDelayWidget);
mToolBarWidget->addAction(mOpenMappingFile);

mTopSeparator = Core::newLineWidget(this);

Expand Down Expand Up @@ -187,7 +191,9 @@ CellMLZincMappingViewEditingWidget::CellMLZincMappingViewEditingWidget(const QSt
connect(mSaveMapping, &QAction::triggered,
this, &CellMLZincMappingViewEditingWidget::saveMappingSlot);
connect(mOpenMeshFile, &QAction::triggered,
this, &CellMLZincMappingViewEditingWidget::loadMeshFile);
this, &CellMLZincMappingViewEditingWidget::openMeshFile);
connect(mOpenMappingFile, &QAction::triggered,
this, &CellMLZincMappingViewEditingWidget::openMappingSlot);

//create and add informative labels

Expand Down Expand Up @@ -615,7 +621,14 @@ void CellMLZincMappingViewEditingWidget::saveMappingSlot()

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

void CellMLZincMappingViewEditingWidget::loadMeshFile()
void CellMLZincMappingViewEditingWidget::openMappingSlot()
{
openMapping(Core::getOpenFileName("Open mapping file"));
}

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

void CellMLZincMappingViewEditingWidget::openMeshFile()
{
setMeshFiles(Core::getOpenFileNames("Open mesh file"));
}
Expand Down
Expand Up @@ -125,6 +125,7 @@ class CellMLZincMappingViewEditingWidget : public Core::Widget
QAction *mClearNode;
QAction *mSaveMapping;
QAction *mOpenMeshFile;
QAction *mOpenMappingFile;

QFrame *mTopSeparator;
QFrame *mBottomSeparator;
Expand Down Expand Up @@ -162,7 +163,8 @@ private slots:
void emitHorizontalSplitterMoved();
void emitVerticalSplitterMoved();
void saveMappingSlot();
void loadMeshFile();
void openMeshFile();
void openMappingSlot();
};

//==============================================================================
Expand Down

0 comments on commit 1e3fe96

Please sign in to comment.