summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/games/go/gowidget.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/games/go/gowidget.cpp b/noncore/games/go/gowidget.cpp
index 8567b30..1d38c9f 100644
--- a/noncore/games/go/gowidget.cpp
+++ b/noncore/games/go/gowidget.cpp
@@ -82,97 +82,97 @@ GoMainWidget::GoMainWidget( QWidget *parent, const char* name) :
a = new QAction( tr( "Two player option" ), QString::null, 0, this, 0 );
a->setToggleAction( TRUE );
connect( a, SIGNAL( toggled(bool) ), go, SLOT( setTwoplayer(bool) ) );
a->addTo( file );
mb->insertItem( tr( "Game" ), file );
QLabel *turnLabel = new QLabel( toolbar );
turnLabel->setBackgroundMode( PaletteButton );
connect( go, SIGNAL(showTurn(const QPixmap&)),
turnLabel, SLOT(setPixmap(const QPixmap&)) );
QLabel * scoreLabel = new QLabel( toolbar );
scoreLabel->setBackgroundMode( PaletteButton );
connect( go, SIGNAL(showScore(const QString&)),
scoreLabel, SLOT(setText(const QString&)) );
toolbar->setStretchableWidget( scoreLabel );
go->readConfig();
}
void GoMainWidget::resizeEvent( QResizeEvent * )
{
//### this won't work because of the text label...
/*
if ( width() > height() )
moveToolBar( toolbar, Left );
else
moveToolBar( toolbar, Top );
*/
}
GoWidget *GoWidget::self = 0;
GoWidget::GoWidget( QWidget *parent, const char* name) :
QWidget( parent, name )
{
if ( self )
fatal( "Only one Go widget allowed" );
self = this;
twoplayer = FALSE;
d = bx = by = 1;
- QPixmap pix = Resource::loadPixmap( "pine" );
+ QPixmap pix = Resource::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" ));
init();
}
GoWidget::~GoWidget()
{
writeConfig();
}
void GoWidget::writeConfig()
{
Config cfg("Go");
cfg.setGroup("Game");
cfg.writeEntry("TwoPlayer", twoplayer);
cfg.writeEntry("CurrentPlayer", currentPlayer);
cfg.writeEntry("NPassed", nPassed);
QString b;
for (int i=0; i<19; i++)
for (int j=0; j<19; j++)
b += board[i][j] == BLACK ? 'B' : board[i][j] == WHITE ? 'W' : '.';
cfg.writeEntry("Board", b);
cfg.writeEntry("LastX", lastX);
cfg.writeEntry("LastY", lastY);
extern int blackPrisoners, whitePrisoners;
cfg.writeEntry("BlackPrisoners", blackPrisoners);
cfg.writeEntry("WhitePrisoners", whitePrisoners);
}
void GoWidget::readConfig()
{
init();
Config cfg("Go");
cfg.setGroup("Game");
twoplayer = cfg.readBoolEntry("TwoPlayer");
currentPlayer = (bVal)cfg.readNumEntry("CurrentPlayer",1);
nPassed = cfg.readNumEntry("NPassed",0);