Skip to content

Commit

Permalink
Fixed small issues in MantidDock, improved save dialog
Browse files Browse the repository at this point in the history
Refs #10125
  • Loading branch information
DanNixon committed Sep 2, 2014
1 parent 8df2510 commit 0f5f04c
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions Code/Mantid/MantidPlot/src/Mantid/MantidDock.cpp
Expand Up @@ -59,6 +59,8 @@ MantidDockWidget::MantidDockWidget(MantidUI *mui, ApplicationWindow *parent) :

if(m_groupButton)
m_groupButton->setEnabled(false);
m_deleteButton->setEnabled(false);
m_saveButton->setEnabled(false);

buttonLayout->addWidget(m_loadButton);
buttonLayout->addWidget(m_deleteButton);
Expand Down Expand Up @@ -684,6 +686,8 @@ void MantidDockWidget::saveWorkspaces()
}
else
{
m_saveFolderDialog->setWindowTitle("Select save folder");
m_saveFolderDialog->setLabelText(QFileDialog::Accept, "Select");
m_saveFolderDialog->open(this, SLOT(saveWorkspacesToFolder(const QString &)));
}
}
Expand Down Expand Up @@ -1063,7 +1067,7 @@ void MantidDockWidget::groupingButtonClick()
{
m_mantidUI->groupWorkspaces();
}
else if(qButtonName == "UnGroup")
else if(qButtonName == "Ungroup")
{
m_mantidUI->ungroupWorkspaces();
}
Expand Down Expand Up @@ -1142,9 +1146,10 @@ void MantidDockWidget::drawColorFillPlot()
void MantidDockWidget::treeSelectionChanged()
{
//get selected workspaces
QList<QTreeWidgetItem*>Items = m_tree->selectedItems();

if(m_groupButton)
{
QList<QTreeWidgetItem*>Items=m_tree->selectedItems();
if(Items.size()==1)
{
//check it's group
Expand All @@ -1156,13 +1161,11 @@ void MantidDockWidget::treeSelectionChanged()
WorkspaceGroup_sptr grpSptr=boost::dynamic_pointer_cast<WorkspaceGroup>(wsSptr);
if(grpSptr)
{
m_groupButton->setText("UnGroup");
m_groupButton->setText("Ungroup");
m_groupButton->setEnabled(true);
}
else
m_groupButton->setEnabled(false);


}

}
Expand All @@ -1178,6 +1181,11 @@ void MantidDockWidget::treeSelectionChanged()
}
}

if(m_deleteButton)
m_deleteButton->setEnabled(Items.size() > 0);

if(m_saveButton)
m_saveButton->setEnabled(Items.size() > 0);
}

/**
Expand Down

0 comments on commit 0f5f04c

Please sign in to comment.