From: Heli Hyvättinen Date: Sat, 16 Jul 2011 16:06:38 +0000 (+0300) Subject: work towards new pause and menu systems X-Git-Tag: v0.3.0_fremantle~34 X-Git-Url: http://vcs.maemo.org/git/?p=ghostsoverboard;a=commitdiff_plain;h=056ace0d1592056e0f396221811f82eaacfc52fd work towards new pause and menu systems --- diff --git a/Ghost Ship UML.xmi b/Ghost Ship UML.xmi index 5c76402..4e86a05 100644 --- a/Ghost Ship UML.xmi +++ b/Ghost Ship UML.xmi @@ -1,5 +1,5 @@ - + umbrello uml modeller http://uml.sf.net @@ -322,10 +322,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -340,7 +364,8 @@ - + + @@ -356,7 +381,7 @@ - + @@ -380,22 +405,12 @@ - + - - - - - - - - - - @@ -414,7 +429,7 @@ - + @@ -444,9 +459,9 @@ - - - + + + @@ -454,18 +469,38 @@ - + - + + + + + + + + + + + + + + + + + + + + + @@ -487,7 +522,7 @@ - + @@ -551,7 +586,8 @@ - + + diff --git a/ghostsoverboard.pro b/ghostsoverboard.pro index 48bef5e..30a176f 100644 --- a/ghostsoverboard.pro +++ b/ghostsoverboard.pro @@ -19,7 +19,8 @@ SOURCES += main.cpp\ screenlitkeeper.cpp \ timercontrolledgraphicspixmapobject.cpp \ octopus.cpp \ - level.cpp + level.cpp \ + seaview.cpp HEADERS += mainwindow.h \ orientationcontrolledgraphicspixmapobject.h \ @@ -28,7 +29,8 @@ HEADERS += mainwindow.h \ screenlitkeeper.h \ timercontrolledgraphicspixmapobject.h \ octopus.h \ - level.h + level.h \ + seaview.h CONFIG += mobility MOBILITY = sensors @@ -73,4 +75,10 @@ OTHER_FILES += \ qtc_packaging/debian_fremantle/copyright \ qtc_packaging/debian_fremantle/control \ qtc_packaging/debian_fremantle/compat \ - qtc_packaging/debian_fremantle/changelog + qtc_packaging/debian_fremantle/changelog \ + qtc_packaging/debian_harmattan/rules \ + qtc_packaging/debian_harmattan/README \ + qtc_packaging/debian_harmattan/copyright \ + qtc_packaging/debian_harmattan/control \ + qtc_packaging/debian_harmattan/compat \ + qtc_packaging/debian_harmattan/changelog diff --git a/mainwindow.cpp b/mainwindow.cpp index f30d851..d834829 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -43,7 +43,8 @@ MainWindow::MainWindow(QWidget *parent) pScene_ = new SeaScene (); connect(pScene_,SIGNAL(allGhostsPicked()),this,SLOT(nextLevel())); - pView_ = new QGraphicsView (); + pView_ = new SeaView (); + pView_->setScene(pScene_); setCentralWidget(pView_); @@ -53,6 +54,7 @@ MainWindow::MainWindow(QWidget *parent) addAction(pPauseAction_); connect(pPauseAction_,SIGNAL(triggered(bool)),pScene_,SLOT(pause(bool))); menuBar()->addAction(pPauseAction_); + connect(pView_,SIGNAL(pauseChanged()),pPauseAction_,SLOT(toggle())); QAction * pRestartLevelAction = new QAction(tr("Restart level"),this); addAction(pRestartLevelAction); diff --git a/mainwindow.h b/mainwindow.h index 5c2664c..b96eb4a 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -27,6 +27,7 @@ #include #include "orientationcontrolledgraphicspixmapobject.h" #include "seascene.h" +#include "seaview.h" #include "level.h" class MainWindow : public QMainWindow @@ -51,7 +52,7 @@ public slots: private: SeaScene * pScene_; -QGraphicsView * pView_; +SeaView * pView_; QAction* pPauseAction_; QList levelList_; int currentLevel_; diff --git a/qtc_packaging/debian_harmattan/README b/qtc_packaging/debian_harmattan/README new file mode 100644 index 0000000..0e78871 --- /dev/null +++ b/qtc_packaging/debian_harmattan/README @@ -0,0 +1,6 @@ +The Debian Package ghostsoverboard +---------------------------- + +Comments regarding the Package + + -- Heli Hyvättinen Sat, 16 Jul 2011 16:15:34 +0300 diff --git a/qtc_packaging/debian_harmattan/changelog b/qtc_packaging/debian_harmattan/changelog new file mode 100644 index 0000000..e3b7a3a --- /dev/null +++ b/qtc_packaging/debian_harmattan/changelog @@ -0,0 +1,5 @@ +ghostsoverboard (0.2.1) unstable; urgency=low + + * Initial Release. + + -- Heli Hyvättinen Sat, 16 Jul 2011 16:15:34 +0300 diff --git a/qtc_packaging/debian_harmattan/compat b/qtc_packaging/debian_harmattan/compat new file mode 100644 index 0000000..7f8f011 --- /dev/null +++ b/qtc_packaging/debian_harmattan/compat @@ -0,0 +1 @@ +7 diff --git a/qtc_packaging/debian_harmattan/control b/qtc_packaging/debian_harmattan/control new file mode 100644 index 0000000..655a601 --- /dev/null +++ b/qtc_packaging/debian_harmattan/control @@ -0,0 +1,15 @@ +Source: ghostsoverboard +Section: user/other +Priority: optional +Maintainer: Heli Hyvättinen +Build-Depends: debhelper (>= 5), libqt4-dev +Standards-Version: 3.7.3 +Homepage: + +Package: ghostsoverboard +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Pick up ghosts by tilting the device + +XSBC-Maemo-Display-Name: ghostsoverboard +XB-Maemo-Icon-26: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAOxAAADsQBlSsOGwAAB/9JREFUaIHtmGtsVNcRx//nru2117DEBrOYgINtoFWBVOIl6ijUIETSVC2Uh9ukwbyCKiHRUvH+gJS2iUiE1BaRNi3PSkAQhaI2IRFNBMFNIQoNUJKS0CYk1DbCKS0YL7Lx3pn598PdXW/MI7YxfPJIV3t1zt07/985c+acuUCP9ViP9RgAXKutfTReW7vuXvv1uutF9Lyv0PPm3ar/VytXzvj50qX/HBeN/mVsfv7mMSiOdIffbgMw6GUHDGiqrz99tb6+on0/nVtzqaFhOMiHnfOeyr6vZelDxcUld+q32wAAACQc8aAHHI3X168jmfn+sf9paABIAER2OPxsXm7ev78xYsT+6WPGlHfVpbtz1YHF6+q2AG5h5ptpOEyTX7x34sT9p48f/w2Ixl1bt8wHuT6cnz80HIkgHIkgnJ+PcCTyek5e3u7BjY07f1JTI/cUoKmubgbAfQ6eM4f5AOAR240KUYOpId50FQ0X6uuLR44aVlpaen1qeXlFODe3MLt379G5kcj8nPz8IbmRCLzs7L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SR/3PO7egdjx/7orDpsR7rsR7rsR5L2f8BvgjKOoDMTeYAAAAASUVORK5CYII= diff --git a/qtc_packaging/debian_harmattan/copyright b/qtc_packaging/debian_harmattan/copyright new file mode 100644 index 0000000..763a679 --- /dev/null +++ b/qtc_packaging/debian_harmattan/copyright @@ -0,0 +1,40 @@ +This package was debianized by Heli Hyvättinen on +Sat, 16 Jul 2011 16:15:34 +0300. + +It was downloaded from + +Upstream Author(s): + + + + +Copyright: + + + + +License: + + This package is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this package; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +On Debian systems, the complete text of the GNU General +Public License can be found in `/usr/share/common-licenses/GPL'. + +The Debian packaging is (C) 2011, Heli Hyvättinen and +is licensed under the GPL, see above. + + +# Please also look if there are files or directories which have a +# different copyright/license attached and list them here. diff --git a/qtc_packaging/debian_harmattan/rules b/qtc_packaging/debian_harmattan/rules new file mode 100755 index 0000000..5497d44 --- /dev/null +++ b/qtc_packaging/debian_harmattan/rules @@ -0,0 +1,91 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + + + + + +configure: configure-stamp +configure-stamp: + dh_testdir + # qmake PREFIX=/usr# Uncomment this line for use without Qt Creator + + touch configure-stamp + + +build: build-stamp + +build-stamp: configure-stamp + dh_testdir + + # Add here commands to compile the package. + # $(MAKE) # Uncomment this line for use without Qt Creator + #docbook-to-man debian/ghostsoverboard.sgml > ghostsoverboard.1 + + touch $@ + +clean: + dh_testdir + dh_testroot + rm -f build-stamp configure-stamp + + # Add here commands to clean up after the build process. + $(MAKE) clean + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + # Add here commands to install the package into debian/ghostsoverboard. + $(MAKE) INSTALL_ROOT="$(CURDIR)"/debian/ghostsoverboard install + + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot + dh_installchangelogs + dh_installdocs + dh_installexamples +# dh_install +# dh_installmenu +# dh_installdebconf +# dh_installlogrotate +# dh_installemacsen +# dh_installpam +# dh_installmime +# dh_python +# dh_installinit +# dh_installcron +# dh_installinfo + dh_installman + dh_link + dh_strip + dh_compress + dh_fixperms +# dh_perl +# dh_makeshlibs + dh_installdeb + # dh_shlibdeps # Uncomment this line for use without Qt Creator + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install configure diff --git a/seascene.cpp b/seascene.cpp index 764fea9..866fae1 100644 --- a/seascene.cpp +++ b/seascene.cpp @@ -49,6 +49,10 @@ SeaScene::SeaScene(QObject *parent) : qsrand(QTime::currentTime().msec()+2); //+2 to avoid setting it to 1 + //connect selecting to menu handling (only menu items selectable) + + connect(this,SIGNAL(selectionChanged()),this,SLOT(menuClicked())); + } @@ -318,3 +322,53 @@ void SeaScene::vibrationActivate(bool on) { emit vibrationActivated(on); } + +void SeaScene::menuClicked() +{ + QList items = selectedItems(); + + //if nothing selected (selection was removed) do nothing + + if (items.isEmpty()) + return; + + //Menu functions + + QString menuitem = items.at(0)->data(0).toString(); + + if (menuitem == "restart game") + { + + } + + else if (menuitem == "restart level") + { + + } + + else if (menuitem == "vibration effects") + { + + } + + else if (menuitem == "about") + { + + } + + + //Selection is just used to get notice of being clicked, removed after use + + clearSelection(); + +} + +void SeaScene::showMenu() +{ + menuItems_.show(); +} + +void::SeaScene::hideMenu() +{ + menuItems_.hide(); +} diff --git a/seascene.h b/seascene.h index 6d932ab..69eeb6d 100644 --- a/seascene.h +++ b/seascene.h @@ -25,6 +25,7 @@ #define SEASCENE_H #include +#include #include "screenlitkeeper.h" #include "level.h" @@ -63,6 +64,12 @@ public slots: void vibrationActivate(bool); + void menuClicked(); + + void showMenu(); + + void hideMenu(); + protected: /*! Gives a pointer to a random position if a free one is found. Otherwise returns NULL. @@ -86,7 +93,9 @@ protected: ScreenLitKeeper screenLitKeeper_; +private: + QGraphicsItemGroup menuItems_; }; diff --git a/seaview.cpp b/seaview.cpp index 9cdac5c..4dd3fb9 100644 --- a/seaview.cpp +++ b/seaview.cpp @@ -26,3 +26,8 @@ SeaView::SeaView(QWidget *parent) : QGraphicsView(parent) { } + +int SeaView::mousePressEvent(QMouseEvent *event) +{ + emit pauseChanged(); +} diff --git a/seaview.h b/seaview.h index 06a67e4..e6e20ed 100644 --- a/seaview.h +++ b/seaview.h @@ -31,8 +31,12 @@ class SeaView : public QGraphicsView public: explicit SeaView(QWidget *parent = 0); + virtual void mousePressEvent(QMouseEvent *event); + signals: + void pauseChanged(); + public slots: };