summaryrefslogtreecommitdiff
authordrw <drw>2005-05-18 00:07:05 (UTC)
committer drw <drw>2005-05-18 00:07:05 (UTC)
commit600f14a61969ec2edd6d89efecaac997b1c6464f (patch) (unidiff)
tree3700d6b7a98f67f423e9316aad844d377377ab65
parent73738d14ca541eaa41b8ee81168e98826752a98c (diff)
downloadopie-600f14a61969ec2edd6d89efecaac997b1c6464f.zip
opie-600f14a61969ec2edd6d89efecaac997b1c6464f.tar.gz
opie-600f14a61969ec2edd6d89efecaac997b1c6464f.tar.bz2
Resource -> OResource, set application caption
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/games/go/gowidget.cpp34
1 files changed, 13 insertions, 21 deletions
diff --git a/noncore/games/go/gowidget.cpp b/noncore/games/go/gowidget.cpp
index ec03c1d..bc5d788 100644
--- a/noncore/games/go/gowidget.cpp
+++ b/noncore/games/go/gowidget.cpp
@@ -19,14 +19,14 @@
19**********************************************************************/ 19**********************************************************************/
20 20
21#include "gowidget.h" 21#include "gowidget.h"
22 22
23/* OPIE */ 23/* OPIE */
24#include <opie2/odebug.h> 24#include <opie2/odebug.h>
25#include <opie2/oresource.h>
25#include <qpe/config.h> 26#include <qpe/config.h>
26#include <qpe/resource.h>
27using namespace Opie::Core; 27using namespace Opie::Core;
28 28
29/* QT */ 29/* QT */
30#include <qpainter.h> 30#include <qpainter.h>
31#include <qtoolbar.h> 31#include <qtoolbar.h>
32#include <qmenubar.h> 32#include <qmenubar.h>
@@ -36,24 +36,22 @@ using namespace Opie::Core;
36 36
37static const enum bVal computer_color = BLACK; 37static const enum bVal computer_color = BLACK;
38 38
39static int current_handicap = 1; 39static int current_handicap = 1;
40 40
41static QBrush *goBrush; 41static QBrush *goBrush;
42//static QImage *newBlackStone;
43//static QImage *blackStone;
44//static QImage *whiteStone;
45static QPixmap *newBlackStone; 42static QPixmap *newBlackStone;
46static QPixmap *blackStone; 43static QPixmap *blackStone;
47static QPixmap *whiteStone; 44static QPixmap *whiteStone;
48 45
49static bool smallStones = FALSE; 46static bool smallStones = FALSE;
50 47
51GoMainWidget::GoMainWidget( QWidget *parent, const char* name, WFlags fl) : 48GoMainWidget::GoMainWidget( QWidget *parent, const char* name, WFlags fl) :
52 QMainWindow( parent, name, fl ) 49 QMainWindow( parent, name, fl )
53{ 50{
51 setCaption( tr( "Go" ) );
54 setToolBarsMovable( FALSE ); 52 setToolBarsMovable( FALSE );
55 GoWidget *go = new GoWidget(this); 53 GoWidget *go = new GoWidget(this);
56 54
57 setCentralWidget(go); 55 setCentralWidget(go);
58 toolbar = new QToolBar(this); 56 toolbar = new QToolBar(this);
59 toolbar->setHorizontalStretchable( TRUE ); 57 toolbar->setHorizontalStretchable( TRUE );
@@ -64,19 +62,21 @@ GoMainWidget::GoMainWidget( QWidget *parent, const char* name, WFlags fl) :
64 QPopupMenu *file = new QPopupMenu( this ); 62 QPopupMenu *file = new QPopupMenu( this );
65 63
66 QAction *a = new QAction( tr( "New Game" ), QString::null, 0, this, 0 ); 64 QAction *a = new QAction( tr( "New Game" ), QString::null, 0, this, 0 );
67 connect( a, SIGNAL( activated() ), go, SLOT( newGame() ) ); 65 connect( a, SIGNAL( activated() ), go, SLOT( newGame() ) );
68 a->addTo( file ); 66 a->addTo( file );
69 67
70 a = new QAction( tr( "Pass" ), Resource::loadPixmap( "pass" ), QString::null, 0, this, 0 ); 68 a = new QAction( tr( "Pass" ), Opie::Core::OResource::loadPixmap( "pass", Opie::Core::OResource::SmallIcon ),
69 QString::null, 0, this, 0 );
71 connect( a, SIGNAL( activated() ), go, SLOT( pass() ) ); 70 connect( a, SIGNAL( activated() ), go, SLOT( pass() ) );
72 a->addTo( file ); 71 a->addTo( file );
73 a->addTo( toolbar ); 72 a->addTo( toolbar );
74 73
75 74
76 a = new QAction( tr( "Resign" ), Resource::loadPixmap( "reset" ), QString::null, 0, this, 0 ); 75 a = new QAction( tr( "Resign" ), Opie::Core::OResource::loadPixmap( "reset", Opie::Core::OResource::SmallIcon ),
76 QString::null, 0, this, 0 );
77 connect( a, SIGNAL( activated() ), go, SLOT( resign() ) ); 77 connect( a, SIGNAL( activated() ), go, SLOT( resign() ) );
78 a->addTo( file ); 78 a->addTo( file );
79 79
80 a = new QAction( tr( "Two player option" ), QString::null, 0, this, 0 ); 80 a = new QAction( tr( "Two player option" ), QString::null, 0, this, 0 );
81 a->setToggleAction( TRUE ); 81 a->setToggleAction( TRUE );
82 connect( a, SIGNAL( toggled(bool) ), go, SLOT( setTwoplayer(bool) ) ); 82 connect( a, SIGNAL( toggled(bool) ), go, SLOT( setTwoplayer(bool) ) );
@@ -121,25 +121,17 @@ GoWidget::GoWidget( QWidget *parent, const char* name) :
121 self = this; 121 self = this;
122 twoplayer = FALSE; 122 twoplayer = FALSE;
123 123
124 124
125 d = bx = by = 1; 125 d = bx = by = 1;
126 126
127 QPixmap pix = Resource::loadPixmap( "go/pine" ); 127 QPixmap pix = Opie::Core::OResource::loadPixmap( "go/pine" );
128 goBrush = new QBrush( black, pix ); 128 goBrush = new QBrush( black, pix );
129 /* 129 blackStone = new QPixmap(Opie::Core::OResource::loadPixmap( "Go-black" ));
130 QString fn = Resource::findPixmap("Go-black"); 130 whiteStone = new QPixmap(Opie::Core::OResource::loadPixmap( "Go-white" ));
131 blackStone = new QImage( fn ); 131 newBlackStone = new QPixmap(Opie::Core::OResource::loadPixmap( "Go-black-highlight" ));
132 fn = Resource::findPixmap("Go-black-highlight");
133 newBlackStone = new QImage( fn );
134 fn = Resource::findPixmap("Go-white");
135 whiteStone = new QImage( fn );
136 */
137 blackStone = new QPixmap(Resource::loadPixmap( "Go-black" ));
138 whiteStone = new QPixmap(Resource::loadPixmap( "Go-white" ));
139 newBlackStone = new QPixmap(Resource::loadPixmap( "Go-black-highlight" ));
140 132
141 init(); 133 init();
142} 134}
143 135
144GoWidget::~GoWidget() 136GoWidget::~GoWidget()
145{ 137{
@@ -201,15 +193,15 @@ void GoWidget::resizeEvent( QResizeEvent * )
201 blackStone->convertFromImage( blackStone->convertToImage().smoothScale(8,8) ); 193 blackStone->convertFromImage( blackStone->convertToImage().smoothScale(8,8) );
202 whiteStone->convertFromImage( whiteStone->convertToImage().smoothScale(8,8) ); 194 whiteStone->convertFromImage( whiteStone->convertToImage().smoothScale(8,8) );
203 newBlackStone->convertFromImage( newBlackStone->convertToImage().smoothScale(8,8) ); 195 newBlackStone->convertFromImage( newBlackStone->convertToImage().smoothScale(8,8) );
204 196
205 smallStones = TRUE; 197 smallStones = TRUE;
206 } else if ( d >= 10 && smallStones ) { 198 } else if ( d >= 10 && smallStones ) {
207 blackStone = new QPixmap(Resource::loadPixmap( "Go-black" )); 199 blackStone = new QPixmap(Opie::Core::OResource::loadPixmap( "Go-black" ));
208 whiteStone = new QPixmap(Resource::loadPixmap( "Go-white" )); 200 whiteStone = new QPixmap(Opie::Core::OResource::loadPixmap( "Go-white" ));
209 newBlackStone = new QPixmap(Resource::loadPixmap( "Go-black-highlight" )); 201 newBlackStone = new QPixmap(Opie::Core::OResource::loadPixmap( "Go-black-highlight" ));
210 smallStones = FALSE; 202 smallStones = FALSE;
211 } 203 }
212} 204}
213 205
214void GoWidget::init() 206void GoWidget::init()
215{ 207{