@@ -74,7 +74,7 @@ namespace Gui {
7474 << new QAction (" Help" , parent)
7575 << new QAction (" Edit Notes..." , parent)
7676 << new QAction (" Duplicate" , parent)
77- << new QAction (" Replace With" , parent)
77+ << new QAction (" Replace With... " , parent)
7878 // << disabled(new QAction("Ignore*", parent))
7979 << new QAction (" Show Log" , parent)
8080 // << disabled(new QAction("Make Sub-Network", parent)) // Issue #287
@@ -527,22 +527,35 @@ void ModuleWidget::setupModuleActions()
527527 || theModule_->get_id ().name_ == " Subnet" )
528528 actionsMenu_->getMenu ()->removeAction (actionsMenu_->getAction (" Duplicate" ));
529529 if (theModule_->get_id ().name_ == " Subnet" )
530- actionsMenu_->getMenu ()->removeAction (actionsMenu_->getAction (" Replace With" ));
530+ actionsMenu_->getMenu ()->removeAction (actionsMenu_->getAction (" Replace With... " ));
531531
532532 connectNoteEditorToAction (actionsMenu_->getAction (" Notes" ));
533533 connectUpdateNote (this );
534534}
535535
536536void ModuleWidget::postLoadAction ()
537537{
538- auto replaceWith = actionsMenu_->getAction (" Replace With" );
538+ auto replaceWith = actionsMenu_->getAction (" Replace With..." );
539+ connect (replaceWith, SIGNAL (triggered ()), this , SLOT (showReplaceWithWidget ()));
540+ replaceWithWidget_ = new QPushButton (this );
539541 auto menu = new QMenu (this );
540- replaceWith ->setMenu (menu);
542+ replaceWithWidget_ ->setMenu (menu);
541543 fillReplaceWithMenu ();
542544 connect (this , SIGNAL (connectionAdded (const SCIRun::Dataflow::Networks::ConnectionDescription&)), this , SLOT (fillReplaceWithMenu ()));
543545 connect (this , SIGNAL (connectionDeleted (const SCIRun::Dataflow::Networks::ConnectionId&)), this , SLOT (fillReplaceWithMenu ()));
544546}
545547
548+ void ModuleWidget::showReplaceWithWidget ()
549+ {
550+ qDebug () << __FUNCTION__;
551+ QMessageBox msgBox;
552+ QPushButton *connectButton = msgBox.addButton (" Replacement" , QMessageBox::ActionRole);
553+ connectButton->setMenu (replaceWithWidget_->menu ());
554+ QPushButton *abortButton = msgBox.addButton (QMessageBox::Abort);
555+ msgBox.setText (" Press button to replace." );
556+ msgBox.exec ();
557+ }
558+
546559bool ModuleWidget::guiVisible () const
547560{
548561 if (dockable_)
@@ -574,7 +587,7 @@ void ModuleWidget::menuFunction()
574587
575588QMenu* ModuleWidget::getReplaceWithMenu ()
576589{
577- return actionsMenu_-> getAction ( " Replace With " ) ->menu ();
590+ return replaceWithWidget_ ->menu ();
578591}
579592
580593void ModuleWidget::replaceModuleWith ()
0 commit comments