summaryrefslogtreecommitdiff
authorimm <imm>2002-08-31 22:59:38 (UTC)
committer imm <imm>2002-08-31 22:59:38 (UTC)
commit277ec30e2807c7bd6bdc9efdb086e9c72c3741e9 (patch) (unidiff)
tree399c6bd30dbc766688fea389a96988ac85e30ac7
parentaf1fb861d849575d9c10d33f0a49423fc2b4d976 (diff)
downloadopie-277ec30e2807c7bd6bdc9efdb086e9c72c3741e9.zip
opie-277ec30e2807c7bd6bdc9efdb086e9c72c3741e9.tar.gz
opie-277ec30e2807c7bd6bdc9efdb086e9c72c3741e9.tar.bz2
remove credits
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/games/buzzword/buzzword.cpp7
-rw-r--r--noncore/games/buzzword/buzzword.h1
2 files changed, 0 insertions, 8 deletions
diff --git a/noncore/games/buzzword/buzzword.cpp b/noncore/games/buzzword/buzzword.cpp
index 324b5bd..b870a59 100644
--- a/noncore/games/buzzword/buzzword.cpp
+++ b/noncore/games/buzzword/buzzword.cpp
@@ -54,50 +54,48 @@ BuzzItem::BuzzItem( int row, int column, QString text, QWidget *parent, const ch
54{ 54{
55 setFrameStyle( QFrame::Panel | QFrame::Raised ); 55 setFrameStyle( QFrame::Panel | QFrame::Raised );
56 setLineWidth( 1 ); 56 setLineWidth( 1 );
57 label = new BuzzLabel(this, "label"); 57 label = new BuzzLabel(this, "label");
58 label->setText(text); 58 label->setText(text);
59 label->setAlignment( int( QLabel::AlignCenter ) ); 59 label->setAlignment( int( QLabel::AlignCenter ) );
60 60
61 connect( label, SIGNAL(clicked()), this, SLOT(flip()) ); 61 connect( label, SIGNAL(clicked()), this, SLOT(flip()) );
62} 62}
63 63
64void BuzzItem::flip() 64void BuzzItem::flip()
65{ 65{
66 setLineWidth( 1 ); 66 setLineWidth( 1 );
67 label->setBackgroundColor(label->colorGroup().highlight()); 67 label->setBackgroundColor(label->colorGroup().highlight());
68 emit clicked(_row, _column); 68 emit clicked(_row, _column);
69} 69}
70 70
71BuzzWord::BuzzWord() : QMainWindow(0) 71BuzzWord::BuzzWord() : QMainWindow(0)
72{ 72{
73 setCaption(tr("buZzword")); 73 setCaption(tr("buZzword"));
74 74
75 menu = menuBar(); 75 menu = menuBar();
76 game = new QPopupMenu; 76 game = new QPopupMenu;
77 game->insertItem(tr("&New game"), this, SLOT(newGame()), Key_N ); 77 game->insertItem(tr("&New game"), this, SLOT(newGame()), Key_N );
78 game->insertSeparator();
79 game->insertItem(tr("&About"), this, SLOT(about()));
80 menu->insertItem( tr("&Game"), game ); 78 menu->insertItem( tr("&Game"), game );
81 79
82 gridVal = 4; 80 gridVal = 4;
83 grid = NULL; 81 grid = NULL;
84 gameOver = false; 82 gameOver = false;
85 newGame(); 83 newGame();
86} 84}
87 85
88void BuzzWord::drawGrid() 86void BuzzWord::drawGrid()
89{ 87{
90 QStringList l; 88 QStringList l;
91 89
92 QString path = QPEApplication::qpeDir()+"share/buzzword/"; 90 QString path = QPEApplication::qpeDir()+"share/buzzword/";
93 QFile f( path + "buzzwords" ); 91 QFile f( path + "buzzwords" );
94 if ( !f.open( IO_ReadOnly ) ) 92 if ( !f.open( IO_ReadOnly ) )
95 return; 93 return;
96 94
97 QTextStream t( &f ); 95 QTextStream t( &f );
98 96
99 while (!t.atEnd()) 97 while (!t.atEnd())
100 { 98 {
101 l << t.readLine(); 99 l << t.readLine();
102 } 100 }
103 101
@@ -154,36 +152,31 @@ void BuzzWord::clicked(int row, int column)
154 columnTotal++; 152 columnTotal++;
155 153
156 if ( columnTotal == 4 ) 154 if ( columnTotal == 4 )
157 { 155 {
158 bingo(); 156 bingo();
159 } 157 }
160 } 158 }
161 columnTotal = 0; 159 columnTotal = 0;
162 } 160 }
163 161
164 if ( map[0][0] && map[1][1] && map[2][2] && map[3][3] ) 162 if ( map[0][0] && map[1][1] && map[2][2] && map[3][3] )
165 bingo(); 163 bingo();
166 164
167 if ( map[0][3] && map[1][2] && map[2][1] && map[3][0] ) 165 if ( map[0][3] && map[1][2] && map[2][1] && map[3][0] )
168 bingo(); 166 bingo();
169 } 167 }
170} 168}
171 169
172void BuzzWord::bingo() 170void BuzzWord::bingo()
173{ 171{
174 gameOver = true; 172 gameOver = true;
175 QMessageBox::information( this, "BUZZWORD", tr("<h1><b>BINGO !</b></h1>")); 173 QMessageBox::information( this, "BUZZWORD", tr("<h1><b>BINGO !</b></h1>"));
176} 174}
177 175
178void BuzzWord::about()
179{
180 QMessageBox::information( this, "About", "buZzword 1.0\n(c) 2002 Martin Imobersteg\n\nThis program is distributed\nunder the terms of the GPL v2." );
181}
182
183void BuzzWord::newGame() 176void BuzzWord::newGame()
184{ 177{
185 gameOver = false; 178 gameOver = false;
186 delete grid; 179 delete grid;
187 drawGrid(); 180 drawGrid();
188 setCentralWidget(grid); 181 setCentralWidget(grid);
189} 182}
diff --git a/noncore/games/buzzword/buzzword.h b/noncore/games/buzzword/buzzword.h
index 2e00563..37dd5b4 100644
--- a/noncore/games/buzzword/buzzword.h
+++ b/noncore/games/buzzword/buzzword.h
@@ -59,31 +59,30 @@ signals:
59 void clicked(int row,int column); 59 void clicked(int row,int column);
60}; 60};
61 61
62class BuzzWord : public QMainWindow 62class BuzzWord : public QMainWindow
63{ 63{
64 Q_OBJECT 64 Q_OBJECT
65 65
66public: 66public:
67 BuzzWord(); 67 BuzzWord();
68 68
69private: 69private:
70 void drawGrid(); 70 void drawGrid();
71 void bingo(); 71 void bingo();
72 QString getWord(); 72 QString getWord();
73 73
74 QMenuBar *menu; 74 QMenuBar *menu;
75 QPopupMenu *game; 75 QPopupMenu *game;
76 QGrid *grid; 76 QGrid *grid;
77 77
78 int gridVal; 78 int gridVal;
79 int map[4][4]; 79 int map[4][4];
80 bool gameOver; 80 bool gameOver;
81 81
82public slots: 82public slots:
83 void about();
84 void newGame(); 83 void newGame();
85 void clicked(int row, int column); 84 void clicked(int row, int column);
86 85
87}; 86};
88 87
89#endif 88#endif