summaryrefslogtreecommitdiff
authorcniehaus <cniehaus>2003-06-01 13:48:07 (UTC)
committer cniehaus <cniehaus>2003-06-01 13:48:07 (UTC)
commit145faa6417fd952768d0abe15cc8b9920548d45f (patch) (unidiff)
treed78efad22827115e07bf584425bf666f0f8d7e47
parent316ced6af8e9492215ad0a39d43127665239503d (diff)
downloadopie-145faa6417fd952768d0abe15cc8b9920548d45f.zip
opie-145faa6417fd952768d0abe15cc8b9920548d45f.tar.gz
opie-145faa6417fd952768d0abe15cc8b9920548d45f.tar.bz2
first patches for tr()-changes\!
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/games/backgammon/aidialog.cpp44
-rw-r--r--noncore/games/backgammon/backgammon.cpp48
2 files changed, 46 insertions, 46 deletions
diff --git a/noncore/games/backgammon/aidialog.cpp b/noncore/games/backgammon/aidialog.cpp
index 9642ca5..7dfe403 100644
--- a/noncore/games/backgammon/aidialog.cpp
+++ b/noncore/games/backgammon/aidialog.cpp
@@ -1,84 +1,84 @@
1#include "aidialog.h" 1#include "aidialog.h"
2 2
3#include <qgroupbox.h> 3#include <qgroupbox.h>
4 4
5 5
6AI_Dialog::AI_Dialog(QWidget* parent,const char* name,bool modal,WFlags f) 6AI_Dialog::AI_Dialog(QWidget* parent,const char* name,bool modal,WFlags f)
7 : QDialog(parent,name,modal,f) 7 : QDialog(parent,name,modal,f)
8{ 8{
9 setCaption("AI Configuration"); 9 setCaption("AI Configuration");
10 10
11 QGroupBox* settings=new QGroupBox("Settings",this); 11 QGroupBox* settings=new QGroupBox(tr( "Settings" ),this);
12 settings->setGeometry(10,5,220,170); 12 settings->setGeometry(10,5,220,170);
13 13
14 QLabel* rescue_label=new QLabel("<b>Rescue</b>",settings); 14 QLabel* rescue_label=new QLabel(tr( "<b>Rescue</b>" ),settings);
15 rescue_label->setGeometry(50,20,50,20); 15 rescue_label->setGeometry(50,20,50,20);
16 rescue=new QSpinBox(0,6,1,settings); 16 rescue=new QSpinBox(0,6,1,settings);
17 rescue->setGeometry(100,20,40,20); 17 rescue->setGeometry(100,20,40,20);
18 QPushButton* rescuehelp=new QPushButton("?",settings); 18 QPushButton* rescuehelp=new QPushButton(tr( "?" ),settings);
19 rescuehelp->setGeometry(140,20,20,20); 19 rescuehelp->setGeometry(140,20,20,20);
20 connect(rescuehelp,SIGNAL(pressed()),this,SLOT(rescuehelp_pressed())); 20 connect(rescuehelp,SIGNAL(pressed()),this,SLOT(rescuehelp_pressed()));
21 connect(rescuehelp,SIGNAL(released()),this,SLOT(rescuehelp_released())); 21 connect(rescuehelp,SIGNAL(released()),this,SLOT(rescuehelp_released()));
22 22
23 QLabel* eliminate_label=new QLabel("<b>Eliminate</b>",settings); 23 QLabel* eliminate_label=new QLabel(tr( "<b>Eliminate</b>" ),settings);
24 eliminate_label->setGeometry(50,40,50,20); 24 eliminate_label->setGeometry(50,40,50,20);
25 eliminate=new QSpinBox(0,6,1,settings); 25 eliminate=new QSpinBox(0,6,1,settings);
26 eliminate->setGeometry(100,40,40,20); 26 eliminate->setGeometry(100,40,40,20);
27 QPushButton* eliminatehelp=new QPushButton("?",settings); 27 QPushButton* eliminatehelp=new QPushButton(tr( "?" ),settings);
28 eliminatehelp->setGeometry(140,40,20,20); 28 eliminatehelp->setGeometry(140,40,20,20);
29 connect(eliminatehelp,SIGNAL(pressed()),this,SLOT(eliminatehelp_pressed())); 29 connect(eliminatehelp,SIGNAL(pressed()),this,SLOT(eliminatehelp_pressed()));
30 connect(eliminatehelp,SIGNAL(released()),this,SLOT(eliminatehelp_released())); 30 connect(eliminatehelp,SIGNAL(released()),this,SLOT(eliminatehelp_released()));
31 31
32 QLabel* expose_label=new QLabel("<b>Expose</b>",settings); 32 QLabel* expose_label=new QLabel(tr( "<b>Expose</b>" ),settings);
33 expose_label->setGeometry(50,60,50,20); 33 expose_label->setGeometry(50,60,50,20);
34 expose=new QSpinBox(0,6,1,settings); 34 expose=new QSpinBox(0,6,1,settings);
35 expose->setGeometry(100,60,40,20); 35 expose->setGeometry(100,60,40,20);
36 QPushButton* exposeehelp=new QPushButton("?",settings); 36 QPushButton* exposeehelp=new QPushButton(tr( "?" ),settings);
37 exposeehelp->setGeometry(140,60,20,20); 37 exposeehelp->setGeometry(140,60,20,20);
38 connect(exposeehelp,SIGNAL(pressed()),this,SLOT(exposehelp_pressed())); 38 connect(exposeehelp,SIGNAL(pressed()),this,SLOT(exposehelp_pressed()));
39 connect(exposeehelp,SIGNAL(released()),this,SLOT(exposehelp_released())); 39 connect(exposeehelp,SIGNAL(released()),this,SLOT(exposehelp_released()));
40 40
41 QLabel* protect_label=new QLabel("<b>Protect</b>",settings); 41 QLabel* protect_label=new QLabel(tr( "<b>Protect</b>" ),settings);
42 protect_label->setGeometry(50,80,50,20); 42 protect_label->setGeometry(50,80,50,20);
43 protect=new QSpinBox(0,6,1,settings); 43 protect=new QSpinBox(0,6,1,settings);
44 protect->setGeometry(100,80,40,20); 44 protect->setGeometry(100,80,40,20);
45 QPushButton* protecthelp=new QPushButton("?",settings); 45 QPushButton* protecthelp=new QPushButton(tr( "?" ),settings);
46 protecthelp->setGeometry(140,80,20,20); 46 protecthelp->setGeometry(140,80,20,20);
47 connect(protecthelp,SIGNAL(pressed()),this,SLOT(protecthelp_pressed())); 47 connect(protecthelp,SIGNAL(pressed()),this,SLOT(protecthelp_pressed()));
48 connect(protecthelp,SIGNAL(released()),this,SLOT(protecthelp_released())); 48 connect(protecthelp,SIGNAL(released()),this,SLOT(protecthelp_released()));
49 49
50 QLabel* safe_label=new QLabel("<b>Safe</b>",settings); 50 QLabel* safe_label=new QLabel(tr( "<b>Safe</b>" ),settings);
51 safe_label->setGeometry(50,100,50,20); 51 safe_label->setGeometry(50,100,50,20);
52 safe=new QSpinBox(0,6,1,settings); 52 safe=new QSpinBox(0,6,1,settings);
53 safe->setGeometry(100,100,40,20); 53 safe->setGeometry(100,100,40,20);
54 QPushButton* safeehelp=new QPushButton("?",settings); 54 QPushButton* safeehelp=new QPushButton(tr( "?" ),settings);
55 safeehelp->setGeometry(140,100,20,20); 55 safeehelp->setGeometry(140,100,20,20);
56 connect(safeehelp,SIGNAL(pressed()),this,SLOT(safehelp_pressed())); 56 connect(safeehelp,SIGNAL(pressed()),this,SLOT(safehelp_pressed()));
57 connect(safeehelp,SIGNAL(released()),this,SLOT(safehelp_released())); 57 connect(safeehelp,SIGNAL(released()),this,SLOT(safehelp_released()));
58 58
59 QLabel* empty_label=new QLabel("<b>Empty</b>",settings); 59 QLabel* empty_label=new QLabel(tr( "<b>Empty</b>" ),settings);
60 empty_label->setGeometry(50,120,50,20); 60 empty_label->setGeometry(50,120,50,20);
61 empty=new QSpinBox(0,6,1,settings); 61 empty=new QSpinBox(0,6,1,settings);
62 empty->setGeometry(100,120,40,20); 62 empty->setGeometry(100,120,40,20);
63 QPushButton* emptyhelp=new QPushButton("?",settings); 63 QPushButton* emptyhelp=new QPushButton(tr( "?" ),settings);
64 emptyhelp->setGeometry(140,120,20,20); 64 emptyhelp->setGeometry(140,120,20,20);
65 connect(emptyhelp,SIGNAL(pressed()),this,SLOT(emptyhelp_pressed())); 65 connect(emptyhelp,SIGNAL(pressed()),this,SLOT(emptyhelp_pressed()));
66 connect(emptyhelp,SIGNAL(released()),this,SLOT(emptyhelp_released())); 66 connect(emptyhelp,SIGNAL(released()),this,SLOT(emptyhelp_released()));
67 67
68 defaultvalues=new QPushButton("Default Values",settings); 68 defaultvalues=new QPushButton(tr( "Default Values" ),settings);
69 defaultvalues->setGeometry(60,140,90,20); 69 defaultvalues->setGeometry(60,140,90,20);
70 connect(defaultvalues,SIGNAL(clicked()),this,SLOT(setDefaultValues())); 70 connect(defaultvalues,SIGNAL(clicked()),this,SLOT(setDefaultValues()));
71 71
72 QGroupBox* helpbox=new QGroupBox("Help",this); 72 QGroupBox* helpbox=new QGroupBox(tr( "Help" ),this);
73 helpbox->setGeometry(10,185,220,90); 73 helpbox->setGeometry(10,185,220,90);
74 74
75 help=new QLabel(helpbox); 75 help=new QLabel(helpbox);
76 help->setGeometry(10,15,200,65); 76 help->setGeometry(10,15,200,65);
77 77
78 setHelpText(); 78 setHelpText();
79 showMaximized(); 79 showMaximized();
80} 80}
81 81
82 82
83AI_Dialog::~AI_Dialog() 83AI_Dialog::~AI_Dialog()
84{ 84{
@@ -173,39 +173,39 @@ AISettings AI_Dialog::getAISettings()
173 ai.eliminate=eliminate->value(); 173 ai.eliminate=eliminate->value();
174 ai.expose=expose->value(); 174 ai.expose=expose->value();
175 ai.protect=protect->value(); 175 ai.protect=protect->value();
176 ai.safe= safe->value(); 176 ai.safe= safe->value();
177 ai.empty=empty->value(); 177 ai.empty=empty->value();
178 return ai; 178 return ai;
179} 179}
180 180
181void AI_Dialog::setHelpText(const QString& type) 181void AI_Dialog::setHelpText(const QString& type)
182{ 182{
183 if(type=="rescue") 183 if(type=="rescue")
184 { 184 {
185 help->setText("Bring the pieces out of the endzone"); 185 help->setText(tr( "Bring the pieces out of the endzone" ));
186 } 186 }
187 else if(type=="eliminate") 187 else if(type=="eliminate")
188 { 188 {
189 help->setText("Eliminate an opponents piece"); 189 help->setText(tr( "Eliminate an opponents piece" ));
190 } 190 }
191 else if(type=="expose") 191 else if(type=="expose")
192 { 192 {
193 help->setText("Expose you own pieces.\nAfter such a move only one piece will remain in the slot"); 193 help->setText(tr( "Expose you own pieces.\nAfter such a move only one piece will remain in the slot") );
194 } 194 }
195 else if(type=="protect") 195 else if(type=="protect")
196 { 196 {
197 help->setText("Protect a single piece by\nputting another one in this slot"); 197 help->setText(tr( "Protect a single piece by\nputting another one in this slot" ));
198 } 198 }
199 else if(type=="safe") 199 else if(type=="safe")
200 { 200 {
201 help->setText("Move piece to a slot already\noccupied by the player"); 201 help->setText(tr( "Move piece to a slot already\noccupied by the player" ));
202 } 202 }
203 else if(type=="empty") 203 else if(type=="empty")
204 { 204 {
205 help->setText("Move piece to an empty slot"); 205 help->setText(tr( "Move piece to an empty slot") );
206 } 206 }
207 else 207 else
208 { 208 {
209 help->setText("Press and hold the ? buttton\nnext to a field for help"); 209 help->setText(tr( "Press and hold the ? buttton\nnext to a field for help") );
210 } 210 }
211} 211}
diff --git a/noncore/games/backgammon/backgammon.cpp b/noncore/games/backgammon/backgammon.cpp
index c40f462..06523f1 100644
--- a/noncore/games/backgammon/backgammon.cpp
+++ b/noncore/games/backgammon/backgammon.cpp
@@ -16,25 +16,25 @@
16#include <qpe/qpeapplication.h> 16#include <qpe/qpeapplication.h>
17#include <qpe/config.h> 17#include <qpe/config.h>
18#include <qpe/qpemenubar.h> 18#include <qpe/qpemenubar.h>
19#include <qpe/resource.h> 19#include <qpe/resource.h>
20 20
21#include <stdlib.h> 21#include <stdlib.h>
22 22
23 23
24BackGammon::BackGammon(QWidget* parent, const char* name, WFlags fl) 24BackGammon::BackGammon(QWidget* parent, const char* name, WFlags fl)
25 : QMainWindow(parent, name, fl) 25 : QMainWindow(parent, name, fl)
26{ 26{
27 if (!name) setName("BackGammon"); 27 if (!name) setName("BackGammon");
28 setCaption("Backgammon"); 28 setCaption(tr( "Backgammon") );
29 setIcon( Resource::loadPixmap( "backgammon" ) ); 29 setIcon( Resource::loadPixmap( "backgammon" ) );
30 //general counter varaible 30 //general counter varaible
31 int a=0; 31 int a=0;
32 //the game engine 32 //the game engine
33 move=new MoveEngine(); 33 move=new MoveEngine();
34 34
35 //load the default theme 35 //load the default theme
36 Config conf("backgammon"); 36 Config conf("backgammon");
37 if(!conf.isValid()) 37 if(!conf.isValid())
38 { 38 {
39 qDebug("config file does not exist"); 39 qDebug("config file does not exist");
40 conf.setGroup("general"); 40 conf.setGroup("general");
@@ -96,48 +96,48 @@ BackGammon::BackGammon(QWidget* parent, const char* name, WFlags fl)
96 piecesA_name=theme.readEntry("pieces1","casino_pieces_blue"); 96 piecesA_name=theme.readEntry("pieces1","casino_pieces_blue");
97 piecesB_name=theme.readEntry("pieces2","casino_pieces_white"); 97 piecesB_name=theme.readEntry("pieces2","casino_pieces_white");
98 diceA_name=theme.readEntry("dice1","casino_dice"); 98 diceA_name=theme.readEntry("dice1","casino_dice");
99 diceB_name=theme.readEntry("dice2","casino_dice"); 99 diceB_name=theme.readEntry("dice2","casino_dice");
100 table_name=theme.readEntry("table","casino_table_green"); 100 table_name=theme.readEntry("table","casino_table_green");
101 odds_name=theme.readEntry("odds","casino_odds"); 101 odds_name=theme.readEntry("odds","casino_odds");
102 102
103 103
104 //the menu 104 //the menu
105 QPEMenuBar* menuBar = new QPEMenuBar(this); 105 QPEMenuBar* menuBar = new QPEMenuBar(this);
106 106
107 QPopupMenu* gamemenu= new QPopupMenu(this); 107 QPopupMenu* gamemenu= new QPopupMenu(this);
108 gamemenu->insertItem("New",this,SLOT(newgame())); 108 gamemenu->insertItem(tr( "New" ),this,SLOT(newgame()));
109 gamemenu->insertSeparator(); 109 gamemenu->insertSeparator();
110 gamemenu->insertItem("Load",this,SLOT(loadgame())); 110 gamemenu->insertItem(tr( "Load" ),this,SLOT(loadgame()));
111 gamemenu->insertItem("Save",this,SLOT(savegame())); 111 gamemenu->insertItem(tr( "Save" ),this,SLOT(savegame()));
112 gamemenu->insertSeparator(); 112 gamemenu->insertSeparator();
113 gamemenu->insertItem("Delete",this,SLOT(deletegame())); 113 gamemenu->insertItem(tr( "Delete" ),this,SLOT(deletegame()));
114 menuBar->insertItem("Game",gamemenu); 114 menuBar->insertItem(tr( "Game" ),gamemenu);
115 115
116 QPopupMenu* thememenu= new QPopupMenu(this); 116 QPopupMenu* thememenu= new QPopupMenu(this);
117 thememenu->insertItem("New",this,SLOT(newtheme())); 117 thememenu->insertItem(tr( "New" ),this,SLOT(newtheme()));
118 thememenu->insertSeparator(); 118 thememenu->insertSeparator();
119 thememenu->insertItem("Load",this,SLOT(loadtheme())); 119 thememenu->insertItem(tr( "Load"),this,SLOT(loadtheme()));
120 thememenu->insertItem("Save",this,SLOT(savetheme())); 120 thememenu->insertItem(tr( "Save" ),this,SLOT(savetheme()));
121 thememenu->insertSeparator(); 121 thememenu->insertSeparator();
122 thememenu->insertItem("Default",this,SLOT(themedefault())); 122 thememenu->insertItem(tr( "Default"),this,SLOT(themedefault()));
123 thememenu->insertItem("Delete",this,SLOT(deletetheme())); 123 thememenu->insertItem(tr( "Delete" ),this,SLOT(deletetheme()));
124 menuBar->insertItem("Theme",thememenu); 124 menuBar->insertItem(tr( "Theme" ),thememenu);
125 125
126 QPopupMenu* optionmenu=new QPopupMenu(this); 126 QPopupMenu* optionmenu=new QPopupMenu(this);
127 optionmenu->insertItem("Player",this,SLOT(playerselect())); 127 optionmenu->insertItem(tr( "Player" ),this,SLOT(playerselect()));
128 optionmenu->insertSeparator(); 128 optionmenu->insertSeparator();
129 optionmenu->insertItem("AI",this,SLOT(modify_AI())); 129 optionmenu->insertItem(tr( "AI" ),this,SLOT(modify_AI()));
130 optionmenu->insertItem("Rules",this,SLOT(setrules())); 130 optionmenu->insertItem(tr( "Rules" ),this,SLOT(setrules()));
131 menuBar->insertItem("Options",optionmenu); 131 menuBar->insertItem(tr( "Options"),optionmenu);
132 132
133 QWidget* mainarea=new QWidget(this); 133 QWidget* mainarea=new QWidget(this);
134 setCentralWidget(mainarea); 134 setCentralWidget(mainarea);
135 //the main area 135 //the main area
136 QBoxLayout* layout=new QBoxLayout(mainarea,QBoxLayout::TopToBottom); 136 QBoxLayout* layout=new QBoxLayout(mainarea,QBoxLayout::TopToBottom);
137 area=new QCanvas(235,235); 137 area=new QCanvas(235,235);
138 boardview=new BackGammonView(area,mainarea); 138 boardview=new BackGammonView(area,mainarea);
139 boardview->setMaximumHeight(240); 139 boardview->setMaximumHeight(240);
140 layout->addWidget(boardview); 140 layout->addWidget(boardview);
141 connect(boardview,SIGNAL(mouse(int,int)),this,SLOT(mouse(int,int))); 141 connect(boardview,SIGNAL(mouse(int,int)),this,SLOT(mouse(int,int)));
142 //status bar 142 //status bar
143 message=new QLabel("<b>Backgammon</b>",mainarea); 143 message=new QLabel("<b>Backgammon</b>",mainarea);
@@ -501,54 +501,54 @@ void BackGammon::themedefault()
501 conf.writeEntry("theme",theme_name); 501 conf.writeEntry("theme",theme_name);
502} 502}
503 503
504void BackGammon::deletetheme() 504void BackGammon::deletetheme()
505{ 505{
506 FileDialog* file=new FileDialog(this,"Delete Theme",".theme"); 506 FileDialog* file=new FileDialog(this,"Delete Theme",".theme");
507 if(!file->exec()) 507 if(!file->exec())
508 return; 508 return;
509 509
510 theme_name=file->filename(); 510 theme_name=file->filename();
511 QString theme_file=QPEApplication::qpeDir()+"/backgammon/"+theme_name+".theme"; 511 QString theme_file=QPEApplication::qpeDir()+"/backgammon/"+theme_name+".theme";
512 512
513 if(!QMessageBox::warning(this,"Backgammon","deleted theme "+theme_name+" ?","OK","Cancel")) 513 if(!QMessageBox::warning(this,tr( "Backgammon" ),tr( "deleted theme %1?").arg(theme_name),tr( "OK" ),tr( "Cancel" )))
514 { 514 {
515 QFile(theme_file).remove(); 515 QFile(theme_file).remove();
516 } 516 }
517} 517}
518 518
519void BackGammon::modify_AI() 519void BackGammon::modify_AI()
520{ 520{
521 AI_Dialog* ai_mod=new AI_Dialog(this,"Load Theme",".theme"); 521 AI_Dialog* ai_mod=new AI_Dialog(this,tr( "Load Theme" ),".theme");
522 ai_mod->setAISettings(move->getAISettings()); 522 ai_mod->setAISettings(move->getAISettings());
523 if(!ai_mod->exec()) 523 if(!ai_mod->exec())
524 return; 524 return;
525 525
526 //get the AI settings 526 //get the AI settings
527 AISettings ai=ai_mod->getAISettings(); 527 AISettings ai=ai_mod->getAISettings();
528 move->setAISettings(ai); 528 move->setAISettings(ai);
529 //write new settings to conf file 529 //write new settings to conf file
530 Config conf("backgammon"); 530 Config conf("backgammon");
531 conf.setGroup("ai"); 531 conf.setGroup("ai");
532 conf.writeEntry("rescue",ai.rescue); 532 conf.writeEntry("rescue",ai.rescue);
533 conf.writeEntry("eliminate",ai.eliminate); 533 conf.writeEntry("eliminate",ai.eliminate);
534 conf.writeEntry("expose",ai.expose); 534 conf.writeEntry("expose",ai.expose);
535 conf.writeEntry("protect",ai.protect); 535 conf.writeEntry("protect",ai.protect);
536 conf.writeEntry("safe",ai.safe); 536 conf.writeEntry("safe",ai.safe);
537 conf.writeEntry("empty",ai.empty); 537 conf.writeEntry("empty",ai.empty);
538} 538}
539 539
540void BackGammon::setrules() 540void BackGammon::setrules()
541{ 541{
542 RulesDialog* rulesdialog=new RulesDialog(this,"Load Theme",".theme"); 542 RulesDialog* rulesdialog=new RulesDialog(this,tr( "Load Theme" ),".theme");
543 rulesdialog->setRules(rules); 543 rulesdialog->setRules(rules);
544 if(!rulesdialog->exec()) 544 if(!rulesdialog->exec())
545 return; 545 return;
546 rules=rulesdialog->getRules(); 546 rules=rulesdialog->getRules();
547 Config conf("backgammon"); 547 Config conf("backgammon");
548 conf.setGroup("rules"); 548 conf.setGroup("rules");
549 conf.writeEntry("move_with_pieces_out",rules.move_with_pieces_out); 549 conf.writeEntry("move_with_pieces_out",rules.move_with_pieces_out);
550 conf.writeEntry("nice_dice",rules.generous_dice); 550 conf.writeEntry("nice_dice",rules.generous_dice);
551 move->setRules(rules); 551 move->setRules(rules);
552} 552}
553 553
554 554
@@ -790,25 +790,25 @@ void BackGammon::done_dice4()
790 } 790 }
791 } 791 }
792} 792}
793 793
794 794
795void BackGammon::nomove() 795void BackGammon::nomove()
796{ 796{
797 if(player==1) 797 if(player==1)
798 nomove_marker->setX(0); 798 nomove_marker->setX(0);
799 else 799 else
800 nomove_marker->setX(170); 800 nomove_marker->setX(170);
801 nomove_marker->show(); 801 nomove_marker->show();
802 message->setText("<b>no move</b>"); 802 message->setText(tr( "<b>no move</b>" ));
803 dice1_played=true; 803 dice1_played=true;
804 dice2_played=true; 804 dice2_played=true;
805 dice3_played=true; 805 dice3_played=true;
806 dice4_played=true; 806 dice4_played=true;
807 if(player==1) 807 if(player==1)
808 { 808 {
809 diceA1_value=7; 809 diceA1_value=7;
810 diceA2_value=7; 810 diceA2_value=7;
811 diceA3_value=7; 811 diceA3_value=7;
812 diceA4_value=7; 812 diceA4_value=7;
813 } 813 }
814 else 814 else
@@ -826,27 +826,27 @@ void BackGammon::nomove2()
826{ 826{
827 nomove_marker->hide(); 827 nomove_marker->hide();
828 setplayer(); 828 setplayer();
829 showdice(); 829 showdice();
830 draw(); 830 draw();
831 area->update(); 831 area->update();
832} 832}
833 833
834void BackGammon::finished(int theplayer) 834void BackGammon::finished(int theplayer)
835{ 835{
836 nomove_marker->hide(); 836 nomove_marker->hide();
837 if(theplayer==1) 837 if(theplayer==1)
838 message->setText("<b>Player 1 wins. Click on board for new game.</b>"); 838 message->setText(tr( "<b>Player 1 wins. Click on board for new game.</b>" ));
839 else 839 else
840 message->setText("<b>Player 2 wins. Click on board for new game.</b>"); 840 message->setText(tr( "<b>Player 2 wins. Click on board for new game.</b>" ));
841 diceA1_value=7; 841 diceA1_value=7;
842 diceA2_value=7; 842 diceA2_value=7;
843 diceB1_value=7; 843 diceB1_value=7;
844 diceB2_value=7; 844 diceB2_value=7;
845 player=0; 845 player=0;
846 showdice(); 846 showdice();
847 draw(); 847 draw();
848 area->update(); 848 area->update();
849 gameFinished=true; 849 gameFinished=true;
850} 850}
851 851
852void BackGammon::showdice() 852void BackGammon::showdice()
@@ -886,33 +886,33 @@ void BackGammon::showdice()
886 886
887 if(value_diceB2==index) 887 if(value_diceB2==index)
888 diceB2[index]->show(); 888 diceB2[index]->show();
889 else 889 else
890 diceB2[index]->hide(); 890 diceB2[index]->hide();
891 } 891 }
892} 892}
893 893
894void BackGammon::setplayer() 894void BackGammon::setplayer()
895{ 895{
896 if(dice1_played && dice2_played && dice3_played && dice4_played && player==1) 896 if(dice1_played && dice2_played && dice3_played && dice4_played && player==1)
897 { 897 {
898 message->setText("<b>P2 turn</b>"); 898 message->setText(tr( "<b>P2 turn</b>", "P means player" ));
899 dice_rolled=false; 899 dice_rolled=false;
900 player=2; 900 player=2;
901 if(player2_auto) 901 if(player2_auto)
902 QTimer::singleShot(2000,this,SLOT(autoroll_dice2())); 902 QTimer::singleShot(2000,this,SLOT(autoroll_dice2()));
903 } 903 }
904 else if(dice1_played && dice2_played && dice3_played && dice4_played && player==2) 904 else if(dice1_played && dice2_played && dice3_played && dice4_played && player==2)
905 { 905 {
906 message->setText("<b>P1 turn</b>"); 906 message->setText(tr( "<b>P1 turn</b>", "P means player" ));
907 dice_rolled=false; 907 dice_rolled=false;
908 player=1; 908 player=1;
909 if(player1_auto) 909 if(player1_auto)
910 QTimer::singleShot(2000,this,SLOT(autoroll_dice1())); 910 QTimer::singleShot(2000,this,SLOT(autoroll_dice1()));
911 } 911 }
912} 912}
913 913
914void BackGammon::autoroll_dice1() 914void BackGammon::autoroll_dice1()
915{ 915{
916 mouse(20,210); 916 mouse(20,210);
917} 917}
918 918