Skip to content

Commit

Permalink
Refs #11597 Fix out of focus issue
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonPiccardoSelg committed Apr 22, 2015
1 parent c0f5bbd commit 36d90ed
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ protected slots:
/// Reset the current view to the appropriate initial view.
void resetCurrentView(int workspaceType, const std::string& instrumentName);
/// Render rebinned workspace
void prepareRebinnedWorkspace(const std::string rebinnedWorkspaceName, std::string sourceType);
pqPipelineSource* prepareRebinnedWorkspace(const std::string rebinnedWorkspaceName, std::string sourceType);
/// Handle drag and drop of peaks workspcaes
void handleDragAndDropPeaksWorkspaces(QEvent* e, QString text, QStringList& wsNames);
/// Set up the default color for the background of the view.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ void MdViewerWidget::onRebin(std::string algorithmType)
void MdViewerWidget::onSwitchSoures(std::string rebinnedWorkspaceName, std::string sourceType)
{
// Create the rebinned workspace
prepareRebinnedWorkspace(rebinnedWorkspaceName, sourceType);
pqPipelineSource* rebinnedSource = prepareRebinnedWorkspace(rebinnedWorkspaceName, sourceType);

try
{
Expand All @@ -444,6 +444,9 @@ void MdViewerWidget::onSwitchSoures(std::string rebinnedWorkspaceName, std::stri

// Set the splatterplot button explicitly
this->currentView->setSplatterplot(true);

pqActiveObjects::instance().setActiveSource(NULL);
pqActiveObjects::instance().setActiveSource(rebinnedSource);
}
catch (const std::runtime_error& error)
{
Expand All @@ -456,7 +459,7 @@ void MdViewerWidget::onSwitchSoures(std::string rebinnedWorkspaceName, std::stri
* @param rebinnedWorkspaceName The name of the rebinned workspace.
* @param sourceType The name of the source plugin.
*/
void MdViewerWidget::prepareRebinnedWorkspace(const std::string rebinnedWorkspaceName, std::string sourceType)
pqPipelineSource* MdViewerWidget::prepareRebinnedWorkspace(const std::string rebinnedWorkspaceName, std::string sourceType)
{
// Load a new source plugin
pqPipelineSource* newRebinnedSource = this->currentView->setPluginSource(QString::fromStdString(sourceType), QString::fromStdString(rebinnedWorkspaceName));
Expand All @@ -471,6 +474,8 @@ void MdViewerWidget::prepareRebinnedWorkspace(const std::string rebinnedWorkspac

// Register the source
m_rebinnedSourcesManager.registerRebinnedSource(newRebinnedSource);

return newRebinnedSource;
}

/**
Expand Down

0 comments on commit 36d90ed

Please sign in to comment.