-rw-r--r-- | noncore/games/go/gowidget.cpp | 34 |
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 @@ -21,10 +21,10 @@ #include "gowidget.h" /* OPIE */ #include <opie2/odebug.h> +#include <opie2/oresource.h> #include <qpe/config.h> -#include <qpe/resource.h> using namespace Opie::Core; /* QT */ #include <qpainter.h> @@ -38,11 +38,8 @@ static const enum bVal computer_color = BLACK; static int current_handicap = 1; static QBrush *goBrush; -//static QImage *newBlackStone; -//static QImage *blackStone; -//static QImage *whiteStone; static QPixmap *newBlackStone; static QPixmap *blackStone; static QPixmap *whiteStone; @@ -50,8 +47,9 @@ static bool smallStones = FALSE; GoMainWidget::GoMainWidget( QWidget *parent, const char* name, WFlags fl) : QMainWindow( parent, name, fl ) { + setCaption( tr( "Go" ) ); setToolBarsMovable( FALSE ); GoWidget *go = new GoWidget(this); setCentralWidget(go); @@ -66,15 +64,17 @@ GoMainWidget::GoMainWidget( QWidget *parent, const char* name, WFlags fl) : QAction *a = new QAction( tr( "New Game" ), QString::null, 0, this, 0 ); connect( a, SIGNAL( activated() ), go, SLOT( newGame() ) ); a->addTo( file ); - a = new QAction( tr( "Pass" ), Resource::loadPixmap( "pass" ), QString::null, 0, this, 0 ); + a = new QAction( tr( "Pass" ), Opie::Core::OResource::loadPixmap( "pass", Opie::Core::OResource::SmallIcon ), + QString::null, 0, this, 0 ); connect( a, SIGNAL( activated() ), go, SLOT( pass() ) ); a->addTo( file ); a->addTo( toolbar ); - a = new QAction( tr( "Resign" ), Resource::loadPixmap( "reset" ), QString::null, 0, this, 0 ); + a = new QAction( tr( "Resign" ), Opie::Core::OResource::loadPixmap( "reset", Opie::Core::OResource::SmallIcon ), + QString::null, 0, this, 0 ); connect( a, SIGNAL( activated() ), go, SLOT( resign() ) ); a->addTo( file ); a = new QAction( tr( "Two player option" ), QString::null, 0, this, 0 ); @@ -123,21 +123,13 @@ GoWidget::GoWidget( QWidget *parent, const char* name) : d = bx = by = 1; - QPixmap pix = Resource::loadPixmap( "go/pine" ); + QPixmap pix = Opie::Core::OResource::loadPixmap( "go/pine" ); goBrush = new QBrush( black, pix ); - /* - QString fn = Resource::findPixmap("Go-black"); - blackStone = new QImage( fn ); - fn = Resource::findPixmap("Go-black-highlight"); - newBlackStone = new QImage( fn ); - fn = Resource::findPixmap("Go-white"); - whiteStone = new QImage( fn ); - */ - blackStone = new QPixmap(Resource::loadPixmap( "Go-black" )); - whiteStone = new QPixmap(Resource::loadPixmap( "Go-white" )); - newBlackStone = new QPixmap(Resource::loadPixmap( "Go-black-highlight" )); + blackStone = new QPixmap(Opie::Core::OResource::loadPixmap( "Go-black" )); + whiteStone = new QPixmap(Opie::Core::OResource::loadPixmap( "Go-white" )); + newBlackStone = new QPixmap(Opie::Core::OResource::loadPixmap( "Go-black-highlight" )); init(); } @@ -203,11 +195,11 @@ void GoWidget::resizeEvent( QResizeEvent * ) newBlackStone->convertFromImage( newBlackStone->convertToImage().smoothScale(8,8) ); smallStones = TRUE; } else if ( d >= 10 && smallStones ) { - blackStone = new QPixmap(Resource::loadPixmap( "Go-black" )); - whiteStone = new QPixmap(Resource::loadPixmap( "Go-white" )); - newBlackStone = new QPixmap(Resource::loadPixmap( "Go-black-highlight" )); + blackStone = new QPixmap(Opie::Core::OResource::loadPixmap( "Go-black" )); + whiteStone = new QPixmap(Opie::Core::OResource::loadPixmap( "Go-white" )); + newBlackStone = new QPixmap(Opie::Core::OResource::loadPixmap( "Go-black-highlight" )); smallStones = FALSE; } } |