X-Git-Url: http://git.maemo.org/git/?p=impuzzle;a=blobdiff_plain;f=src%2Fpuzzleitem.cpp;h=fd5ff88b9cfa48ed971d7cd590bda85c971e88d9;hp=93e56757230b58962441350798e74846c071ea03;hb=78fb1d0d471aedbec19852ca6874fdbcb94a7550;hpb=01fe9f39236b5d0a9b4d9ad2cd202a80874950d4 diff --git a/src/puzzleitem.cpp b/src/puzzleitem.cpp index 93e5675..fd5ff88 100644 --- a/src/puzzleitem.cpp +++ b/src/puzzleitem.cpp @@ -26,6 +26,7 @@ #include int PuzzleItem::moveCount_ = 0; +bool PuzzleItem::manuallyMovable_ = false; PuzzleItem::PuzzleItem(QGraphicsItem *parent) : QGraphicsPixmapItem(parent) @@ -75,7 +76,7 @@ void PuzzleItem::moveMeTo(const QPointF &location) void PuzzleItem::mousePressEvent(QGraphicsSceneMouseEvent *event) { - if(movable_) { + if(movable_ && manuallyMovable_) { moveMeTo(GameView::instance()->emptyPlace()); QPointF tmp = currentPlace(); setCurrentPlace(GameView::instance()->emptyPlace()); @@ -115,6 +116,11 @@ void PuzzleItem::resetMoveCount() moveCount_ = 0; } +void PuzzleItem::setManuallyMovable(const bool manuallyMovable) +{ + manuallyMovable_ = manuallyMovable; +} + void PuzzleItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { QGraphicsPixmapItem::paint(painter, option, widget);