Logo Search packages:      
Sourcecode: inkscape version File versions

bool Inkscape::have_viable_layer ( SPDesktop desktop,
MessageContext *  message 
)

Check to see if the current layer is both unhidden and unlocked. If not, set a message about it on the given context.

Parameters:
desktop Desktop.
message Message context to put messages on.
Returns:
true if the current layer is both unhidden and unlocked, otherwise false.

Definition at line 30 of file context-fns.cpp.

References SPDesktop::currentLayer(), Inkscape::MessageContext::flash(), SPItem::isLocked(), and SPDesktop::itemIsHidden().

Referenced by pen_handle_button_press().

{
    SPItem const *layer = SP_ITEM(desktop->currentLayer());

    if ( !layer || desktop->itemIsHidden(layer) ) {
            message->flash(Inkscape::ERROR_MESSAGE,
                         _("<b>Current layer is hidden</b>. Unhide it to be able to draw on it."));
            return false;
    }

    if ( !layer || layer->isLocked() ) {
            message->flash(Inkscape::ERROR_MESSAGE,
                         _("<b>Current layer is locked</b>. Unlock it to be able to draw on it."));
            return false;
    }

    return true;
}


Generated by  Doxygen 1.6.0   Back to index