summaryrefslogtreecommitdiff
path: root/noncore
Unidiff
Diffstat (limited to 'noncore') (more/less context) (show whitespace changes)
-rw-r--r--noncore/games/buzzword/buzzword.cpp3
-rw-r--r--noncore/games/buzzword/buzzword.h2
-rw-r--r--noncore/games/buzzword/main.cpp2
3 files changed, 3 insertions, 4 deletions
diff --git a/noncore/games/buzzword/buzzword.cpp b/noncore/games/buzzword/buzzword.cpp
index 37032df..447396b 100644
--- a/noncore/games/buzzword/buzzword.cpp
+++ b/noncore/games/buzzword/buzzword.cpp
@@ -1,29 +1,29 @@
1/* 1/*
2 * Copyright (C) 2002 Martin Imobersteg <imm@gmx.ch> 2 * Copyright (C) 2002 Martin Imobersteg <imm@gmx.ch>
3 * 3 *
4 * This program is free software; you can redistribute it and/or 4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License,Life or (at your option) any later version. 7 * version 2 of the License,Life or (at your option) any later version.
8 * 8 *
9 * This program is distributed in the hope that it will be useful, 9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details. 12 * Library General Public License for more details.
13 * 13 *
14 * You should have received a copy of the GNU Library General Public 14 * You should have received a copy of the GNU Library General Public
15 * License along with this program; if not, write to the Free 15 * License along with this program; if not, write to the Free
16 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 16 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 */ 17 */
18 18
19#include <qlayout.h> 19#include <qlayout.h>
20#include <qmessagebox.h> 20#include <qmessagebox.h>
21#include <qmainwindow.h> 21#include <qmainwindow.h>
22#include <qlabel.h> 22#include <qlabel.h>
23#include <qgrid.h> 23#include <qgrid.h>
24#include <qcolor.h> 24#include <qcolor.h>
25#include <qbutton.h> 25#include <qbutton.h>
26#include <qfile.h> 26#include <qfile.h>
27#include <qtextstream.h> 27#include <qtextstream.h>
28#include <qstringlist.h> 28#include <qstringlist.h>
29#include <qmessagebox.h> 29#include <qmessagebox.h>
@@ -65,49 +65,48 @@ BuzzItem::BuzzItem( int row, int column, QString text, QWidget *parent, const ch
65 setLineWidth( 1 ); 65 setLineWidth( 1 );
66 label = new BuzzLabel(this, "label"); 66 label = new BuzzLabel(this, "label");
67 label->setText(text); 67 label->setText(text);
68 label->setAlignment( int( QLabel::AlignCenter ) ); 68 label->setAlignment( int( QLabel::AlignCenter ) );
69 69
70 connect( label, SIGNAL(clicked()), this, SLOT(flip()) ); 70 connect( label, SIGNAL(clicked()), this, SLOT(flip()) );
71} 71}
72 72
73void BuzzItem::flip() 73void BuzzItem::flip()
74{ 74{
75 setLineWidth( 1 ); 75 setLineWidth( 1 );
76 label->setBackgroundColor(label->colorGroup().highlight()); 76 label->setBackgroundColor(label->colorGroup().highlight());
77 emit clicked(_row, _column); 77 emit clicked(_row, _column);
78} 78}
79 79
80BuzzWord::BuzzWord() : QMainWindow(0) 80BuzzWord::BuzzWord() : QMainWindow(0)
81{ 81{
82 setCaption(tr("buZzword")); 82 setCaption(tr("buZzword"));
83 83
84 menu = menuBar(); 84 menu = menuBar();
85 game = new QPopupMenu; 85 game = new QPopupMenu;
86 game->insertItem(tr("&New game"), this, SLOT(newGame()), Key_N ); 86 game->insertItem(tr("&New game"), this, SLOT(newGame()), Key_N );
87 game->insertSeparator(); 87 game->insertSeparator();
88 game->insertItem(tr("&About"), this, SLOT(about())); 88 game->insertItem(tr("&About"), this, SLOT(about()));
89 game->insertItem(tr("&Quit"), qApp, SLOT(quit()), Key_Q );
90 menu->insertItem( tr("&Game"), game ); 89 menu->insertItem( tr("&Game"), game );
91 90
92 gridVal = 4; 91 gridVal = 4;
93 grid = NULL; 92 grid = NULL;
94 gameOver = false; 93 gameOver = false;
95 newGame(); 94 newGame();
96} 95}
97 96
98void BuzzWord::drawGrid() 97void BuzzWord::drawGrid()
99{ 98{
100 std::list<QString> l; 99 std::list<QString> l;
101 100
102 QString path = QPEApplication::qpeDir()+"share/buzzword/"; 101 QString path = QPEApplication::qpeDir()+"share/buzzword/";
103 QFile f( path + "buzzwords" ); 102 QFile f( path + "buzzwords" );
104 if ( !f.open( IO_ReadOnly ) ) 103 if ( !f.open( IO_ReadOnly ) )
105 return; 104 return;
106 105
107 QTextStream t( &f ); 106 QTextStream t( &f );
108 107
109 while (!t.atEnd()) 108 while (!t.atEnd())
110 { 109 {
111 l.push_back(t.readLine()); 110 l.push_back(t.readLine());
112 } 111 }
113 112
diff --git a/noncore/games/buzzword/buzzword.h b/noncore/games/buzzword/buzzword.h
index f72be9a..2e00563 100644
--- a/noncore/games/buzzword/buzzword.h
+++ b/noncore/games/buzzword/buzzword.h
@@ -1,29 +1,29 @@
1/* 1/*
2 * Copyright (C) 2002 Martin Imobersteg <imm@gmx.ch> 2 * Copyright (C) 2002 Martin Imobersteg <imm@gmx.ch>
3 * 3 *
4 * This program is free software; you can redistribute it and/or 4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License,Life or (at your option) any later version. 7 * version 2 of the License,Life or (at your option) any later version.
8 * 8 *
9 * This program is distributed in the hope that it will be useful, 9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details. 12 * Library General Public License for more details.
13 * 13 *
14 * You should have received a copy of the GNU Library General Public 14 * You should have received a copy of the GNU Library General Public
15 * License along with this program; if not, write to the Free 15 * License along with this program; if not, write to the Free
16 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 16 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 */ 17 */
18 18
19#ifndef BUZZWORD_H 19#ifndef BUZZWORD_H
20#define BUZZWORD_H 20#define BUZZWORD_H
21 21
22#include <qmainwindow.h> 22#include <qmainwindow.h>
23#include <qmenubar.h> 23#include <qmenubar.h>
24#include <qlabel.h> 24#include <qlabel.h>
25#include <qvbox.h> 25#include <qvbox.h>
26 26
27class QGrid; 27class QGrid;
28 28
29class BuzzLabel : public QLabel 29class BuzzLabel : public QLabel
diff --git a/noncore/games/buzzword/main.cpp b/noncore/games/buzzword/main.cpp
index 1fa011b..2d9ff81 100644
--- a/noncore/games/buzzword/main.cpp
+++ b/noncore/games/buzzword/main.cpp
@@ -1,29 +1,29 @@
1/* 1/*
2 * Copyright (C) 2002 Martin Imobersteg <imm@gmx.ch> 2 * Copyright (C) 2002 Martin Imobersteg <imm@gmx.ch>
3 * 3 *
4 * This program is free software; you can redistribute it and/or 4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License,Life or (at your option) any later version. 7 * version 2 of the License,Life or (at your option) any later version.
8 * 8 *
9 * This program is distributed in the hope that it will be useful, 9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details. 12 * Library General Public License for more details.
13 * 13 *
14 * You should have received a copy of the GNU Library General Public 14 * You should have received a copy of the GNU Library General Public
15 * License along with this program; if not, write to the Free 15 * License along with this program; if not, write to the Free
16 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 16 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 */ 17 */
18 18
19#include <qpe/qpeapplication.h> 19#include <qpe/qpeapplication.h>
20 20
21#include <stdlib.h> 21#include <stdlib.h>
22#include <time.h> 22#include <time.h>
23 23
24#include "buzzword.h" 24#include "buzzword.h"
25 25
26int main(int argc, char **argv) 26int main(int argc, char **argv)
27{ 27{
28 srand(time(0)); 28 srand(time(0));
29 29