commit palapeli for openSUSE:Factory
Hello community, here is the log from the commit of package palapeli for openSUSE:Factory checked in at 2014-04-18 11:31:03 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/palapeli (Old) and /work/SRC/openSUSE:Factory/.palapeli.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "palapeli" Changes: -------- --- /work/SRC/openSUSE:Factory/palapeli/palapeli.changes 2014-03-30 12:06:14.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.palapeli.new/palapeli.changes 2014-04-18 12:28:50.000000000 +0200 @@ -1,0 +2,7 @@ +Fri Apr 11 17:18:23 UTC 2014 - tittiatcoke@gmail.com + +- Update to 4.13.0 + * KDE 4.13 release + * See http://www.kde.org/announcements/4.13/ + +------------------------------------------------------------------- Old: ---- palapeli-4.12.97.tar.xz New: ---- palapeli-4.13.0.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ palapeli.spec ++++++ --- /var/tmp/diff_new_pack.LyG49C/_old 2014-04-18 12:29:05.000000000 +0200 +++ /var/tmp/diff_new_pack.LyG49C/_new 2014-04-18 12:29:05.000000000 +0200 @@ -21,7 +21,7 @@ License: GPL-2.0+ Group: Amusements/Games/Board/Puzzle Url: http://www.kde.org -Version: 4.12.97 +Version: 4.13.0 Release: 0 Source0: palapeli-%{version}.tar.xz BuildRequires: libkdegames-devel ++++++ palapeli-4.12.97.tar.xz -> palapeli-4.13.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/palapeli-4.12.97/src/engine/constraintinteractor.cpp new/palapeli-4.13.0/src/engine/constraintinteractor.cpp --- old/palapeli-4.12.97/src/engine/constraintinteractor.cpp 2014-03-25 19:50:02.000000000 +0100 +++ new/palapeli-4.13.0/src/engine/constraintinteractor.cpp 2014-04-06 09:15:53.000000000 +0200 @@ -72,7 +72,7 @@ void Palapeli::ConstraintInteractor::continueInteraction(const Palapeli::MouseEvent& event) { - //in this method, we need the scene() as Palapeli::Scene for the piecesBoundingRect + // In this method, we need the scene() to be Palapeli::Scene type. Palapeli::Scene* scene = qobject_cast<Palapeli::Scene*>(this->scene()); if (!scene) return; @@ -87,7 +87,7 @@ sceneRect.setTop(newBounds.y()); else if (m_draggingSides.contains(BottomSide)) sceneRect.setBottom(newBounds.y()); - scene->setSceneRect(sceneRect | scene->piecesBoundingRect()); + scene->setSceneRect(sceneRect | scene->extPiecesBoundingRect()); } void Palapeli::ConstraintInteractor::stopInteraction(const Palapeli::MouseEvent& event) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/palapeli-4.12.97/src/engine/constraintvisualizer.cpp new/palapeli-4.13.0/src/engine/constraintvisualizer.cpp --- old/palapeli-4.12.97/src/engine/constraintvisualizer.cpp 2014-03-25 19:50:02.000000000 +0100 +++ new/palapeli-4.13.0/src/engine/constraintvisualizer.cpp 2014-04-06 09:15:53.000000000 +0200 @@ -117,9 +117,7 @@ if (m_sceneRect == sceneRect) return; // Make sure the ConstraintVisualizer stays outside the pieces' area. - QRectF minimumRect = m_scene->piecesBoundingRect(); - qreal m = m_scene->margin(); - minimumRect.adjust(-m, -m, m, m); + QRectF minimumRect = m_scene->extPiecesBoundingRect(); m_sceneRect = sceneRect; if(!sceneRect.contains(minimumRect)) { // IDW TODO - Works and seems safe, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/palapeli-4.12.97/src/engine/gameplay.cpp new/palapeli-4.13.0/src/engine/gameplay.cpp --- old/palapeli-4.12.97/src/engine/gameplay.cpp 2014-03-25 19:50:02.000000000 +0100 +++ new/palapeli-4.13.0/src/engine/gameplay.cpp 2014-04-06 09:15:53.000000000 +0200 @@ -351,8 +351,7 @@ createHolder(name); // Merges/moves in new holders add to the progress bar and are saved. Palapeli::View* view = m_viewList.last(); - Palapeli::PieceHolder* h = qobject_cast<Palapeli::PieceHolder*>(view); - h->initializeZooming(); + view->setCloseUp(true); // New holders start in close-up scale. connect(view->scene(), SIGNAL(saveMove(int)), this, SLOT(positionChanged(int))); connect(view, @@ -368,6 +367,7 @@ Palapeli::PieceHolder* h = new Palapeli::PieceHolder(m_mainWindow, m_pieceAreaSize, name); m_viewList << h; + h->initializeZooming(); // Min. view 2x2 to 6x6 pieces. connect(h, SIGNAL(selected(PieceHolder*)), this, SLOT(changeSelectedHolder(PieceHolder*))); connect (h, SIGNAL(closing(PieceHolder*)), @@ -466,10 +466,17 @@ bRect |= piece->sceneBareBoundingRect(); } Palapeli::Scene* scene = view->scene(); - scene->initializeGrid(bRect.topLeft()); + // If in a piece-holder and ALL pieces are selected, start at (0, 0). + scene->initializeGrid(((view == m_currentHolder) && + (selectedPieces.count() == scene->pieces().count())) ? + QPointF(0.0, 0.0) : bRect.topLeft()); foreach (Palapeli::Piece* piece, selectedPieces) { scene->addToGrid(piece); } + if (view == m_currentHolder) { + // Adjust the piece-holder's scene to frame the pieces. + scene->setSceneRect(scene->extPiecesBoundingRect()); + } positionChanged(0); // There is no attempt to merge pieces here. } @@ -629,7 +636,7 @@ connect(piece, SIGNAL(moved(bool)), scene, SLOT(pieceMoved(bool))); } - scene->setSceneRect(scene->piecesBoundingRect()); + scene->setSceneRect(scene->extPiecesBoundingRect()); if (! destIsPuzzleTable) { dest->centerOn(pieces.last()->sceneBareBoundingRect().center()); } @@ -994,13 +1001,18 @@ // solved puzzle. updateSavedGame(); } + // Add constraint_handles+spacer to puzzle table and setSceneRect(). + QRectF s = m_puzzleTableScene->piecesBoundingRect(); + qreal handleWidth = qMin(s.width(), s.height())/100.0; + m_puzzleTableScene->addMargin(handleWidth, 0.5*handleWidth); + // Add all the pieces to the puzzle table and piece-holder scenes. foreach (Palapeli::View* view, m_viewList) { Palapeli::Scene* scene = view->scene(); - QRectF s = scene->piecesBoundingRect(); - qreal handleWidth = qMin(s.width(), s.height())/100.0; - // Add margin for constraint_handles+spacer and setSceneRect(). - scene->addMargin(handleWidth, 0.5*handleWidth); scene->addPieceItemsToScene(); + if (scene != m_puzzleTableScene) { + // Expand the piece-holder sceneRects. + scene->setSceneRect(scene->extPiecesBoundingRect()); + } } qDebug() << "Finish loadPiecePositions(): time" << t.restart(); finishLoading(); @@ -1018,21 +1030,18 @@ m_currentPieceCount = m_currentPieceCount + scene->pieces().size(); qDebug() << "Counted" << scene->pieces().size(); - // IDW TODO - Do this better. It's the VIEWS that need to know. - // IDW TODO - DELETE scene->startPuzzle(); if (view != m_puzzleTable->view()) { - Palapeli::PieceHolder* holder = - qobject_cast<Palapeli::PieceHolder*>(view); - qDebug() << "Holder" << holder->name() << scene->pieces().size(); - holder->initializeZooming(); + // Saved-and-restored holders start in close-up scale. + view->setCloseUp(true); } else { qDebug() << "Puzzle table" << scene->pieces().size(); } } - m_puzzleTable->view()->puzzleStarted(); - // Initialize external progress display. + // Initialize external progress display, hide loading widget, show view. emit reportProgress(m_originalPieceCount, m_currentPieceCount); + // Adjust zoom-levels, center the view, show autosave message if needed. + m_puzzleTable->view()->puzzleStarted(); if (!m_restoredGame && (m_originalPieceCount >= LargePuzzle)) { // New puzzle and a large one: create a default PieceHolder. createHolder(i18nc("For holding pieces", "Hand")); @@ -1135,7 +1144,7 @@ QPropertyAnimation* animation = new QPropertyAnimation (m_puzzleTableScene, "sceneRect", this); animation->setStartValue(m_puzzleTableScene->sceneRect()); - animation->setEndValue(m_puzzleTableScene->piecesBoundingRect()); + animation->setEndValue(m_puzzleTableScene->extPiecesBoundingRect()); animation->setDuration(1000); connect(animation, SIGNAL(finished()), this, SLOT(playVictoryAnimation2())); @@ -1144,7 +1153,7 @@ void Palapeli::GamePlay::playVictoryAnimation2() { - m_puzzleTableScene->setSceneRect(m_puzzleTableScene->piecesBoundingRect()); + m_puzzleTableScene->setSceneRect(m_puzzleTableScene->extPiecesBoundingRect()); QTimer::singleShot(100, this, SIGNAL(victoryAnimationFinished())); // Give the View some time to play its part of the victory animation. QTimer::singleShot(1500, this, SLOT(playVictoryAnimation3())); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/palapeli-4.12.97/src/engine/piece.h new/palapeli-4.13.0/src/engine/piece.h --- old/palapeli-4.12.97/src/engine/piece.h 2014-03-25 19:50:02.000000000 +0100 +++ new/palapeli-4.13.0/src/engine/piece.h 2014-04-06 09:15:53.000000000 +0200 @@ -28,7 +28,7 @@ namespace Palapeli { class MovePieceInteractor; - struct PieceVisuals; + class PieceVisuals; class Piece : public Palapeli::GraphicsObject<Palapeli::PieceUserType> { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/palapeli-4.12.97/src/engine/puzzlepreview.h new/palapeli-4.13.0/src/engine/puzzlepreview.h --- old/palapeli-4.12.97/src/engine/puzzlepreview.h 2014-03-25 19:50:02.000000000 +0100 +++ new/palapeli-4.13.0/src/engine/puzzlepreview.h 2014-04-06 09:15:53.000000000 +0200 @@ -24,7 +24,7 @@ namespace Palapeli { - class PuzzleMetadata; + struct PuzzleMetadata; class PuzzlePreview : public QGraphicsView { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/palapeli-4.12.97/src/engine/scene.cpp new/palapeli-4.13.0/src/engine/scene.cpp --- old/palapeli-4.12.97/src/engine/scene.cpp 2014-03-25 19:50:02.000000000 +0100 +++ new/palapeli-4.13.0/src/engine/scene.cpp 2014-04-06 09:15:53.000000000 +0200 @@ -33,6 +33,7 @@ , m_pieceAreaSize(QSizeF(32.0, 32.0)) // Allow 1024 pixels initially. , m_margin(10.0) , m_handleWidth(7.0) + , m_minGrid(1) // Min. space for puzzle table. { initializeGrid(QPointF(0.0, 0.0)); } @@ -76,19 +77,39 @@ QRectF r = piecesBoundingRect(); r.adjust(-m_margin, -m_margin, m_margin, m_margin); setSceneRect(r); + m_constraintVisualizer->stop(); m_constraintVisualizer->start(r, handleWidth); views()[0]->fitInView(r, Qt::KeepAspectRatio); qDebug() << "SCENE RECT" << r << "VIEW SIZE" << views()[0]->size(); } -QRectF Palapeli::Scene::piecesBoundingRect(const int minGrid) const +QRectF Palapeli::Scene::extPiecesBoundingRect() const +{ + // Bounding rectangle of pieces plus constraint visualizer (margin). + QRectF result = piecesBoundingRect(); + result.adjust(-m_margin, -m_margin, m_margin, m_margin); + return result; +} + +void Palapeli::Scene::setMinGrid(const int minGrid) { - // Space is >= minGrid*minGrid pieces (e.g. for a new PieceHolder). - QSizeF minSize = minGrid * m_gridSpacing; - QRectF result (QPointF(0.0, 0.0), minSize); + m_minGrid = minGrid; +} + +QRectF Palapeli::Scene::piecesBoundingRect() const +{ + // If no pieces, space is >= m_minGrid*m_minGrid pieces (e.g. for a new + // PieceHolder). Default is >= 1 piece for the puzzle table. + QRectF result; foreach (Palapeli::Piece* piece, m_pieces) result |= piece->sceneBareBoundingRect(); - return result; + QSizeF minSize = m_minGrid * m_gridSpacing; + QRectF minRect(QPointF(0.0, 0.0), minSize); + if (m_pieces.count() > 0) { + // Center the minRect over the piece(s). + minRect.moveTopLeft(result.center() - minRect.center()); + } + return (result | minRect); } bool Palapeli::Scene::isConstrained() const diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/palapeli-4.12.97/src/engine/scene.h new/palapeli-4.13.0/src/engine/scene.h --- old/palapeli-4.12.97/src/engine/scene.h 2014-03-25 19:50:02.000000000 +0100 +++ new/palapeli-4.13.0/src/engine/scene.h 2014-04-06 09:15:53.000000000 +0200 @@ -45,7 +45,9 @@ void addPieceToList(Palapeli::Piece* piece); void addPieceItemsToScene(); bool isConstrained() const; - QRectF piecesBoundingRect(const int minGrid = 2) const; + QRectF extPiecesBoundingRect() const; + void setMinGrid(const int minGrid); + QRectF piecesBoundingRect() const; qreal margin() { return m_margin; } qreal handleWidth() { return m_handleWidth; } void addMargin(const qreal handleWidth, @@ -96,6 +98,8 @@ int m_gridRank; int m_gridX; int m_gridY; + // Scene has at least m_minGrid*m_minGrid piece-spaces. + int m_minGrid; }; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/palapeli-4.12.97/src/engine/view.cpp new/palapeli-4.13.0/src/engine/view.cpp --- old/palapeli-4.12.97/src/engine/view.cpp 2014-03-25 19:50:02.000000000 +0100 +++ new/palapeli-4.13.0/src/engine/view.cpp 2014-04-06 09:15:53.000000000 +0200 @@ -62,7 +62,7 @@ // IDW test. void Palapeli::View::logSceneChange(QRectF r) { - qDebug() << "View::logSceneChange" << r << "View size" << this->size(); + // qDebug() << "View::logSceneChange" << r << "View size" << this->size(); } Palapeli::InteractorManager* Palapeli::View::interactorManager() const @@ -268,6 +268,19 @@ } } +void Palapeli::View::setCloseUp(bool onOff) +{ + m_isCloseUp = onOff; + // Force zoomTo() to recalculate, even if m_zoomLevel == required value. + m_zoomLevel = m_isCloseUp ? m_closeUpLevel - 1 : m_distantLevel + 1; + if (m_isCloseUp) { + zoomTo(m_closeUpLevel); + } + else { + zoomTo(m_distantLevel); + } +} + void Palapeli::View::handleNewPieceSelection() { emit newPieceSelectionSeen(this); @@ -341,7 +354,7 @@ { //move viewport to show the complete puzzle QPropertyAnimation* animation = new QPropertyAnimation(this, "viewportRect", this); - animation->setEndValue(m_scene->piecesBoundingRect()); + animation->setEndValue(m_scene->extPiecesBoundingRect()); animation->setDuration(1000); animation->start(QAbstractAnimation::DeleteWhenStopped); emit zoomAdjustable(false); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/palapeli-4.12.97/src/engine/view.h new/palapeli-4.13.0/src/engine/view.h --- old/palapeli-4.12.97/src/engine/view.h 2014-03-25 19:50:02.000000000 +0100 +++ new/palapeli-4.13.0/src/engine/view.h 2014-04-06 09:15:53.000000000 +0200 @@ -43,6 +43,7 @@ void setViewportRect(const QRectF& viewportRect); void teleportPieces(Piece* piece, const QPointF& scPos); void toggleCloseUp(); + void setCloseUp(bool onOff); void handleNewPieceSelection(); static const int MinimumZoomLevel; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/palapeli-4.12.97/src/file-io/puzzle.h new/palapeli-4.13.0/src/file-io/puzzle.h --- old/palapeli-4.12.97/src/file-io/puzzle.h 2014-03-25 19:50:02.000000000 +0100 +++ new/palapeli-4.13.0/src/file-io/puzzle.h 2014-04-06 09:15:53.000000000 +0200 @@ -114,7 +114,7 @@ ///in memory. void dropComponent(Palapeli::PuzzleComponent::Type type); private: - class Private; + struct Private; Private* const d; }; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/palapeli-4.12.97/src/palapeliui.rc new/palapeli-4.13.0/src/palapeliui.rc --- old/palapeli-4.12.97/src/palapeliui.rc 2014-03-25 19:50:02.000000000 +0100 +++ new/palapeli-4.13.0/src/palapeliui.rc 2014-04-06 09:15:53.000000000 +0200 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<gui name="palapeli" version="4" +<gui name="palapeli" version="5" xmlns="http://www.kde.org/standards/kxmlgui/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.kde.org/standards/kxmlgui/1.0 http://www.kde.org/standards/kxmlgui/1.0/kxmlgui.xsd"> @@ -27,6 +27,9 @@ <Action name="view_zoom_in"/> <Action name="view_zoom_out"/> </Menu> + <Menu name="settings"> + <Action name="enable_messages"/> + </Menu> </MenuBar> <ToolBar name="mainToolBar"> <text>Main toolbar</text> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/palapeli-4.12.97/src/window/mainwindow.cpp new/palapeli-4.13.0/src/window/mainwindow.cpp --- old/palapeli-4.12.97/src/window/mainwindow.cpp 2014-03-25 19:50:02.000000000 +0100 +++ new/palapeli-4.13.0/src/window/mainwindow.cpp 2014-04-06 09:15:53.000000000 +0200 @@ -30,6 +30,7 @@ #include <KDE/KLocalizedString> #include <KDE/KStandardAction> #include <KDE/KToggleAction> +#include <KDE/KMessageBox> Palapeli::MainWindow::MainWindow(KCmdLineArgs* args) : m_game(new Palapeli::GamePlay(this)) @@ -155,6 +156,22 @@ // View zoom out. KStandardAction::zoomOut(m_game, SLOT(actionZoomOut()), actionCollection()); + // Settings: enable messages that the user marked "Do not show again". + KAction* enableMessagesAct = new KAction(i18n("Enable all messages"),0); + actionCollection()->addAction("enable_messages", enableMessagesAct); + connect(enableMessagesAct, SIGNAL(triggered()), SLOT(enableMessages())); +} + +void Palapeli::MainWindow::enableMessages() +{ + // Enable all messages that the user has marked "Do not show again". + int result = KMessageBox::questionYesNo(this, + i18n("Enable all messages")); + if (result == KMessageBox::Yes) { + qDebug() << "ENABLE ALL MESSAGES"; + KMessageBox::enableAllMessages(); + KGlobal::config()->sync(); // Save the changes to disk. + } } #include "mainwindow.moc" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/palapeli-4.12.97/src/window/mainwindow.h new/palapeli-4.13.0/src/window/mainwindow.h --- old/palapeli-4.12.97/src/window/mainwindow.h 2014-03-25 19:50:02.000000000 +0100 +++ new/palapeli-4.13.0/src/window/mainwindow.h 2014-04-06 09:15:53.000000000 +0200 @@ -38,6 +38,8 @@ MainWindow(KCmdLineArgs* args); protected: virtual bool queryClose(); + private Q_SLOTS: + void enableMessages(); private: void setupActions(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/palapeli-4.12.97/src/window/pieceholder.cpp new/palapeli-4.13.0/src/window/pieceholder.cpp --- old/palapeli-4.12.97/src/window/pieceholder.cpp 2014-03-25 19:50:02.000000000 +0100 +++ new/palapeli-4.13.0/src/window/pieceholder.cpp 2014-04-06 09:15:53.000000000 +0200 @@ -37,7 +37,11 @@ // Allow space for (2 * 2) pieces in minimum view initially. m_scene->setPieceAreaSize(pieceArea); m_scene->initializeGrid(QPointF(0.0, 0.0)); - m_scene->setSceneRect(m_scene->piecesBoundingRect(minGrid)); + m_scene->setMinGrid(minGrid); + // Add margin for constraint_handles+spacer and setSceneRect(). + QRectF rect = m_scene->piecesBoundingRect(); + qreal handleWidth = qMin(rect.width(), rect.height())/25.0; + m_scene->addMargin(handleWidth, 0.5*handleWidth); setWindowTitle(title); qreal s = calculateCloseUpScale(); QRectF r = m_scene->sceneRect(); -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@hilbert.suse.de