Skip to content

Commit

Permalink
Merge pull request #126 from ehb54/alexey-dev-issue327
Browse files Browse the repository at this point in the history
GMP : 1. EXP -> 2.Lab/Rotor: make sure all 2 roles - operator(s), rev…
  • Loading branch information
demeler authored Aug 11, 2024
2 parents 3c229c3 + a3fcefc commit 2fdbd8a
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions programs/us_experiment/us_exp_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1209,6 +1209,20 @@ void US_ExperGuiRotor::addOpertoList( void )
.arg( c_oper ) );
return;
}

//also, check if to-be-added operator is in other role(s) already [rev, appr]
QString e_revList = te_revs_to_assign->toPlainText();
QString e_apprList = te_apprs_to_assign->toPlainText();
if ( e_revList. contains( c_oper ) || e_apprList. contains( c_oper ) )
{
QMessageBox::information( this, tr( "Cannot add Operator" ),
tr( "<font color='red'><b>ATTENTION:</b> </font> Selected operator: <br><br>"
"<font ><b>%1</b><br><br>"
"is already set as REVIEWER or APPROVER.<br>"
"Please choose other operator.")
.arg( c_oper ) );
return;
}

te_opers_to_assign->append( c_oper );
}
Expand Down Expand Up @@ -1244,6 +1258,19 @@ void US_ExperGuiRotor::addRevtoList( void )
.arg( c_rev ) );
return;
}

//also, check if to-be-added reviewer is an operator already
QString e_operList = te_opers_to_assign->toPlainText();
if ( e_operList. contains( c_rev ) )
{
QMessageBox::information( this, tr( "Cannot add Reviewer" ),
tr( "<font color='red'><b>ATTENTION:</b> </font> Selected reviewer: <br><br>"
"<font ><b>%1</b><br><br>"
"is already set as an OPERATOR.<br>"
"Please choose other reviewer.")
.arg( c_rev ) );
return;
}

te_revs_to_assign->append( c_rev );

Expand Down Expand Up @@ -1284,6 +1311,20 @@ void US_ExperGuiRotor::addApprtoList( void )
.arg( c_appr) );
return;
}

//also, check if to-be-added approver is an operator already
QString e_operList = te_opers_to_assign->toPlainText();
if ( e_operList. contains( c_appr ) )
{
QMessageBox::information( this, tr( "Cannot add Approver" ),
tr( "<font color='red'><b>ATTENTION:</b> </font> Selected approver: <br><br>"
"<font ><b>%1</b><br><br>"
"is already set as an OPERATOR.<br>"
"Please choose other approver.")
.arg( c_appr ) );
return;
}


te_apprs_to_assign->append( c_appr );

Expand Down

0 comments on commit 2fdbd8a

Please sign in to comment.