adding quit without saving option
authorTimo Härkönen <timop.harkonen@gmail.com>
Mon, 29 Nov 2010 18:00:59 +0000 (20:00 +0200)
committerTimo Härkönen <timo@plep.(none)>
Mon, 29 Nov 2010 18:01:53 +0000 (20:01 +0200)
debian/control
src/introitem.cpp
src/mainwindow.cpp
src/mainwindow.h

index 1867174..72d8672 100644 (file)
@@ -12,8 +12,6 @@ Depends: libqt4-core (>= 4.6.0), libqt4-gui (>= 4.6.0), libqt4-maemo5 (>= 4.6.0)
 Description: Image puzzle game
  impuzzle is a picture puzzle game that let's you
  use your own pictures as the game board.
- Limitations in current version:
- For random images only images in /home/user/MyDocs/.images is used
 XB-Maemo-Icon-26:
  iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c
  6QAAAAZiS0dEALAAMQAxnfM89gAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0
index 0b7b270..2034640 100644 (file)
@@ -43,20 +43,20 @@ void IntroItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
     painter->setRenderHint(QPainter::Antialiasing, true);
     painter->setPen(Qt::NoPen);
 
-    const int dots = 96;
+    //const int dots = 96;
 
-    int hstep = boundingRect().width() / dots;
-    int vstep = boundingRect().height() / dots;
+    //int hstep = boundingRect().width() / dots;
+    //int vstep = boundingRect().height() / dots;
 
-    QColor colors[3] = {QColor(255, 255, 255), QColor(0, 0, 0), QColor(127, 127, 127)};
+    //QColor colors[3] = {QColor(255, 255, 255), QColor(0, 0, 0), QColor(127, 127, 127)};
 
-    for(int i = 0; i < dots; ++i) {
+    /*for(int i = 0; i < dots; ++i) {
         for(int j = 0; j < dots; ++j) {
             painter->setBrush(QBrush(colors[qrand() % 2]));
             painter->drawRect(QRect(QPoint(i * hstep, j * vstep),
                                     QPoint((i+1) * hstep, (j+1) * vstep)));
         }
-    }
+    }*/
 
     painter->setBrush(Qt::NoBrush);
     painter->setPen(Qt::black);
index e2dbc09..a31baa1 100644 (file)
@@ -30,6 +30,7 @@
 #include <QMenuBar>
 #include <QMessageBox>
 #include <QCloseEvent>
+#include <QApplication>
 
 #include <QDebug>
 
@@ -67,7 +68,8 @@ void MainWindow::createMenu()
     menu_->addAction(newGameAction_);
     menu_->addAction(statisticsAction_);
     menu_->addAction(saveAction_);
-    menu_->addAction(importAction_);
+    menu_->addAction(quitAction_);
+    //menu_->addAction(importAction_);
 
     helpMenu_ = menuBar()->addMenu("&Help");
     helpMenu_->addAction(aboutAction_);
@@ -91,6 +93,9 @@ void MainWindow::createActions()
 
     statisticsAction_ = new QAction(tr("Statistics"), this);
     connect(statisticsAction_, SIGNAL(triggered()), this, SLOT(showStatistics()));
+
+    quitAction_ = new QAction(tr("Quit"), this);
+    connect(quitAction_, SIGNAL(triggered()), qApp, SLOT(quit()));
 }
 
 void MainWindow::importClicked()
index 4fa0aab..e7e7654 100644 (file)
@@ -56,6 +56,7 @@ private:
     QAction *aboutAction_;
     QAction *saveAction_;
     QAction *statisticsAction_;
+    QAction *quitAction_;
 
     QMenu *menu_;
     QMenu *helpMenu_;