Skip to content

Commit

Permalink
Improve warning messages for cmd.bond()
Browse files Browse the repository at this point in the history
  • Loading branch information
speleo3 committed Mar 15, 2024
1 parent caaa940 commit 656f0b8
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions layer3/Executive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9353,7 +9353,9 @@ pymol::Result<> ExecutiveBond(PyMOLGlobals* G, const char* s1, const char* s2,
ObjectMolecule *obj1 = SelectorGetSingleObjectMolecule(G, sele1);
ObjectMolecule *obj2 = SelectorGetSingleObjectMolecule(G, sele2);
if((!obj1) || (!obj2) || (obj1 != obj2)) {
if((!quiet) && (mode == 1)) {
if (!quiet && mode == 1 && //
tmpsele1->getAtomCount() > 0 && //
tmpsele2->getAtomCount() > 0) {
PRINTFB(G, FB_Editor, FB_Warnings)
"Editor-Warning: bonds cannot be created between objects, only within.\n"
ENDFB(G);
Expand Down Expand Up @@ -9407,16 +9409,16 @@ pymol::Result<> ExecutiveBond(PyMOLGlobals* G, const char* s1, const char* s2,
switch (mode) {
case 1:
PRINTFB(G, FB_Editor, FB_Warnings)
"Bond-Warning: no bonds added." ENDFB(G);
"Bond-Warning: no bonds added.\n" ENDFB(G);
break;
case 2:
PRINTFB(G, FB_Editor, FB_Warnings)
"Valence-Warning: no bond valences changed." ENDFB(G);
"Valence-Warning: no bond valences changed.\n" ENDFB(G);
break;
case 0:
default:
PRINTFB(G, FB_Editor, FB_Warnings)
"Unbond-Warning: no bonds removed." ENDFB(G);
"Unbond-Warning: no bonds removed.\n" ENDFB(G);
break;
}
}
Expand Down

0 comments on commit 656f0b8

Please sign in to comment.