summaryrefslogtreecommitdiff
path: root/noncore/games
Unidiff
Diffstat (limited to 'noncore/games') (more/less context) (show whitespace changes)
-rw-r--r--noncore/games/backgammon/backgammon.cpp14
-rw-r--r--noncore/games/backgammon/filedialog.cpp2
-rw-r--r--noncore/games/backgammon/themedialog.cpp2
3 files changed, 9 insertions, 9 deletions
diff --git a/noncore/games/backgammon/backgammon.cpp b/noncore/games/backgammon/backgammon.cpp
index bdb1c78..c286a36 100644
--- a/noncore/games/backgammon/backgammon.cpp
+++ b/noncore/games/backgammon/backgammon.cpp
@@ -54,13 +54,13 @@ BackGammon::BackGammon(QWidget* parent, const char* name, WFlags fl)
54 conf.writeEntry("safe",3); 54 conf.writeEntry("safe",3);
55 conf.writeEntry("empty",2); 55 conf.writeEntry("empty",2);
56 56
57 } 57 }
58 conf.setGroup("general"); 58 conf.setGroup("general");
59 theme_name=conf.readEntry("theme","default"); 59 theme_name=conf.readEntry("theme","default");
60 QString theme_file=QPEApplication::qpeDir()+"/backgammon/"+theme_name+".theme"; 60 QString theme_file=QPEApplication::qpeDir()+"backgammon/"+theme_name+".theme";
61 61
62 //the rules 62 //the rules
63 conf.setGroup("rules"); 63 conf.setGroup("rules");
64 rules.move_with_pieces_out=conf.readBoolEntry("move_with_pieces_out",false); 64 rules.move_with_pieces_out=conf.readBoolEntry("move_with_pieces_out",false);
65 rules.generous_dice=conf.readBoolEntry("nice_dice",false); 65 rules.generous_dice=conf.readBoolEntry("nice_dice",false);
66 66
@@ -325,13 +325,13 @@ void BackGammon::loadgame()
325{ 325{
326 FileDialog* file=new FileDialog(this,"Load Game",".game"); 326 FileDialog* file=new FileDialog(this,"Load Game",".game");
327 if(!file->exec()) 327 if(!file->exec())
328 return; 328 return;
329 329
330 game_name=file->filename(); 330 game_name=file->filename();
331 QString game_file=QPEApplication::qpeDir()+"/backgammon/"+game_name+".game"; 331 QString game_file=QPEApplication::qpeDir()+"backgammon/"+game_name+".game";
332 332
333 Config game(game_file,Config::File); 333 Config game(game_file,Config::File);
334 game.setGroup("dice"); 334 game.setGroup("dice");
335 diceA1_value=game.readNumEntry("diceA1_value"); 335 diceA1_value=game.readNumEntry("diceA1_value");
336 diceA2_value=game.readNumEntry("diceA2_value"); 336 diceA2_value=game.readNumEntry("diceA2_value");
337 diceA3_value=game.readNumEntry("diceA3_value"); 337 diceA3_value=game.readNumEntry("diceA3_value");
@@ -364,13 +364,13 @@ void BackGammon::loadgame()
364 draw(); 364 draw();
365 area->update(); 365 area->update();
366} 366}
367 367
368void BackGammon::savegame() 368void BackGammon::savegame()
369{ 369{
370 QString game_file=QPEApplication::qpeDir()+"/backgammon/"+game_name+".game"; 370 QString game_file=QPEApplication::qpeDir()+"backgammon/"+game_name+".game";
371 371
372 Config game(game_file,Config::File); 372 Config game(game_file,Config::File);
373 game.setGroup("dice"); 373 game.setGroup("dice");
374 game.writeEntry("diceA1_value",diceA1_value); 374 game.writeEntry("diceA1_value",diceA1_value);
375 game.writeEntry("diceA2_value",diceA2_value); 375 game.writeEntry("diceA2_value",diceA2_value);
376 game.writeEntry("diceA3_value",diceA3_value); 376 game.writeEntry("diceA3_value",diceA3_value);
@@ -403,13 +403,13 @@ void BackGammon::deletegame()
403{ 403{
404 FileDialog* file=new FileDialog(this,"Delete Game",".game"); 404 FileDialog* file=new FileDialog(this,"Delete Game",".game");
405 if(!file->exec()) 405 if(!file->exec())
406 return; 406 return;
407 407
408 game_name=file->filename(); 408 game_name=file->filename();
409 QString game_file=QPEApplication::qpeDir()+"/backgammon/"+game_name+".game"; 409 QString game_file=QPEApplication::qpeDir()+"backgammon/"+game_name+".game";
410 410
411 if(!QMessageBox::warning(this,"Backgammon","deleted game\n"+game_name+" ?","OK","Cancel")) 411 if(!QMessageBox::warning(this,"Backgammon","deleted game\n"+game_name+" ?","OK","Cancel"))
412 { 412 {
413 QFile(game_file).remove(); 413 QFile(game_file).remove();
414 } 414 }
415} 415}
@@ -450,13 +450,13 @@ void BackGammon::loadtheme()
450{ 450{
451 FileDialog* file=new FileDialog(this,"Load Theme",".theme"); 451 FileDialog* file=new FileDialog(this,"Load Theme",".theme");
452 if(!file->exec()) 452 if(!file->exec())
453 return; 453 return;
454 454
455 theme_name=file->filename(); 455 theme_name=file->filename();
456 QString theme_file=QPEApplication::qpeDir()+"/backgammon/"+theme_name+".theme"; 456 QString theme_file=QPEApplication::qpeDir()+"backgammon/"+theme_name+".theme";
457 457
458 Config theme(theme_file,Config::File); 458 Config theme(theme_file,Config::File);
459 theme.setGroup("theme"); 459 theme.setGroup("theme");
460 board_name=theme.readEntry("board","board_1"); 460 board_name=theme.readEntry("board","board_1");
461 piecesA_name=theme.readEntry("pieces1","pieces_1"); 461 piecesA_name=theme.readEntry("pieces1","pieces_1");
462 piecesB_name=theme.readEntry("pieces2","pieces_2"); 462 piecesB_name=theme.readEntry("pieces2","pieces_2");
@@ -473,13 +473,13 @@ void BackGammon::savetheme()
473{ 473{
474 if(theme_name=="default") 474 if(theme_name=="default")
475 { 475 {
476 QMessageBox::information(this,"Backgammon","Sorry\nCannot overwrite default.theme","OK"); 476 QMessageBox::information(this,"Backgammon","Sorry\nCannot overwrite default.theme","OK");
477 return; 477 return;
478 } 478 }
479 QString theme_file=QPEApplication::qpeDir()+"/backgammon/"+theme_name+".theme"; 479 QString theme_file=QPEApplication::qpeDir()+"backgammon/"+theme_name+".theme";
480 if(QMessageBox::information(this,"Backgammon","Save Theme\n"+theme_name,"Yes","No")) 480 if(QMessageBox::information(this,"Backgammon","Save Theme\n"+theme_name,"Yes","No"))
481 return; 481 return;
482 482
483 Config theme(theme_file,Config::File); 483 Config theme(theme_file,Config::File);
484 theme.setGroup("theme"); 484 theme.setGroup("theme");
485 theme.writeEntry("board",board_name); 485 theme.writeEntry("board",board_name);
@@ -506,13 +506,13 @@ void BackGammon::deletetheme()
506{ 506{
507 FileDialog* file=new FileDialog(this,"Delete Theme",".theme"); 507 FileDialog* file=new FileDialog(this,"Delete Theme",".theme");
508 if(!file->exec()) 508 if(!file->exec())
509 return; 509 return;
510 510
511 theme_name=file->filename(); 511 theme_name=file->filename();
512 QString theme_file=QPEApplication::qpeDir()+"/backgammon/"+theme_name+".theme"; 512 QString theme_file=QPEApplication::qpeDir()+"backgammon/"+theme_name+".theme";
513 513
514 if(!QMessageBox::warning(this,tr( "Backgammon" ),tr( "deleted theme %1?").arg(theme_name),tr( "OK" ),tr( "Cancel" ))) 514 if(!QMessageBox::warning(this,tr( "Backgammon" ),tr( "deleted theme %1?").arg(theme_name),tr( "OK" ),tr( "Cancel" )))
515 { 515 {
516 QFile(theme_file).remove(); 516 QFile(theme_file).remove();
517 } 517 }
518} 518}
diff --git a/noncore/games/backgammon/filedialog.cpp b/noncore/games/backgammon/filedialog.cpp
index e0a2914..f185188 100644
--- a/noncore/games/backgammon/filedialog.cpp
+++ b/noncore/games/backgammon/filedialog.cpp
@@ -34,13 +34,13 @@ void FileDialog::selectorclicked(QListViewItem* entry)
34 fileinput->setText(file_name); 34 fileinput->setText(file_name);
35} 35}
36 36
37void FileDialog::getCurrentDir() 37void FileDialog::getCurrentDir()
38{ 38{
39 dirselector->clear(); 39 dirselector->clear();
40 QDir dir(QPEApplication::qpeDir()+"/backgammon"); 40 QDir dir(QPEApplication::qpeDir()+"backgammon");
41 dir.setFilter(QDir::Files); 41 dir.setFilter(QDir::Files);
42 QFileInfoListIterator it(*(dir.entryInfoList())); 42 QFileInfoListIterator it(*(dir.entryInfoList()));
43 QFileInfo* fi; 43 QFileInfo* fi;
44 44
45 int ext_length=ext.length(); 45 int ext_length=ext.length();
46 while((fi=it.current())) // go through all file and subdirs 46 while((fi=it.current())) // go through all file and subdirs
diff --git a/noncore/games/backgammon/themedialog.cpp b/noncore/games/backgammon/themedialog.cpp
index afd6a1b..9bdb6a9 100644
--- a/noncore/games/backgammon/themedialog.cpp
+++ b/noncore/games/backgammon/themedialog.cpp
@@ -140,13 +140,13 @@ void ThemeDialog::setCurrent(const ImageNames& current)
140 } 140 }
141} 141}
142 142
143void ThemeDialog::fillBox(QString dirname,QComboBox* thebox) 143void ThemeDialog::fillBox(QString dirname,QComboBox* thebox)
144{ 144{
145 thebox->clear(); 145 thebox->clear();
146 QDir dir(QPEApplication::qpeDir()+"/pics/backgammon/"+dirname); 146 QDir dir(QPEApplication::qpeDir()+"pics/backgammon/"+dirname);
147 dir.setFilter(QDir::Dirs | QDir::Files); 147 dir.setFilter(QDir::Dirs | QDir::Files);
148 QFileInfoListIterator it(*(dir.entryInfoList())); 148 QFileInfoListIterator it(*(dir.entryInfoList()));
149 QFileInfo* fi; 149 QFileInfo* fi;
150 150
151 while((fi=it.current())) // go through all file and subdirs 151 while((fi=it.current())) // go through all file and subdirs
152 { 152 {