X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fdesigner%2Fmanipulator.cpp;h=720309bd8dc4b773374b7120fd09195685464d91;hb=7e27b311e33beda1746eb63e0945633f262427f6;hp=23ea138623c42809726c0df07c644ad15ba52f99;hpb=1ff06c5bc46a677fa389ef86c6b26664368f1653;p=r2c2.git diff --git a/source/designer/manipulator.cpp b/source/designer/manipulator.cpp index 23ea138..720309b 100644 --- a/source/designer/manipulator.cpp +++ b/source/designer/manipulator.cpp @@ -59,12 +59,26 @@ void Manipulator::start_elevate() mode = ELEVATE; } -void Manipulator::start_extend() +bool Manipulator::start_extend() { if(mode) cancel(); - mode = EXTEND; + bool ok = false; + const set &stracks = selection.get_tracks(); + for(set::const_iterator i=stracks.begin(); (!ok && i!=stracks.end()); ++i) + { + const vector &links = (*i)->get_links(); + for(vector::const_iterator j=links.begin(); (!ok && j!=links.end()); ++j) + ok = !*j; + } + + if(ok) + mode = EXTEND; + else + signal_status.emit("No free endpoints"); + + return ok; } void Manipulator::duplicate()