Warning, file /games/ksirk/ksirk/krightdialog.cpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 /* This file is part of KsirK. 0002 Copyright (C) 2008 Gael Clouet <pelouas@hotmail.fr> 0003 0004 KsirK is free software; you can redistribute it and/or 0005 modify it under the terms of the GNU General Public 0006 License as published by the Free Software Foundation, either version 2 0007 of the License, or (at your option) any later version. 0008 0009 This program is distributed in the hope that it will be useful, 0010 but WITHOUT ANY WARRANTY; without even the implied warranty of 0011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0012 General Public License for more details. 0013 0014 You should have received a copy of the GNU General Public License 0015 along with this program; if not, write to the Free Software 0016 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 0017 02110-1301, USA 0018 */ 0019 0020 /* begin : Thu JAN 22 2008 */ 0021 0022 #include "krightdialog.h" 0023 #include "Sprites/animsprite.h" 0024 #include <qdrawutil.h> 0025 #include <QColor> 0026 #include <QBrush> 0027 #include <QBitmap> 0028 #include <QPixmap> 0029 #include <QString> 0030 #include <QScrollBar> 0031 #include <QScrollArea> 0032 #include <QPalette> 0033 #include <QMovie> 0034 0035 namespace Ksirk 0036 { 0037 using namespace GameLogic; 0038 0039 KRightDialog::KRightDialog(QDockWidget * parent, ONU * world,KGameWindow* m_game) 0040 : QWidget(parent), 0041 mainLayout(new QGridLayout(this)), 0042 m_parentWidget(parent), 0043 world(world), 0044 rightContents(), 0045 flag1(nullptr), 0046 flag2(nullptr), 0047 milieu(nullptr), 0048 milieu2(nullptr), 0049 btRecycleWidget(nullptr), 0050 btValidWidget(nullptr), 0051 game(m_game), 0052 buttonStopAttack(nullptr), 0053 buttonStopDefense(nullptr) 0054 { 0055 setLayout(mainLayout); 0056 // setBaseSize(220,360); 0057 0058 // load the armie image 0059 KConfig config(world->getConfigFileName()); 0060 KConfigGroup onugroup = config.group("onu"); 0061 QString skin = onugroup.readEntry("skinpath"); 0062 0063 InfantrySprite *sprite = new InfantrySprite(1.0, m_game->backGnd()); 0064 sprite-> setDestination(nullptr); // Sprite immobile 0065 soldat = sprite->image(0).scaled(24,24,Qt::KeepAspectRatioByExpanding); 0066 delete sprite; 0067 0068 // load the stopAttackAuto image 0069 QString imageFileName = QStandardPaths::locate(QStandardPaths::AppDataLocation, skin + "/Images/stopAttackAuto.png"); 0070 stopAttackAuto.load(imageFileName); 0071 0072 // load the recycle image 0073 imageFileName = QStandardPaths::locate(QStandardPaths::AppDataLocation, skin + '/' +CM_RECYCLING); 0074 recycleContinue.load(imageFileName); 0075 0076 // load the finish recycle image 0077 imageFileName = QStandardPaths::locate(QStandardPaths::AppDataLocation, skin + '/' + CM_RECYCLINGFINISHED); 0078 recycleDone.load(imageFileName); 0079 0080 // load the next player image 0081 imageFileName = QStandardPaths::locate(QStandardPaths::AppDataLocation, skin + '/' + CM_NEXTPLAYER); 0082 recycleNextPlayer.load(imageFileName); 0083 0084 show(); 0085 } 0086 0087 KRightDialog::~KRightDialog() 0088 { 0089 delete mainLayout; 0090 } 0091 0092 void KRightDialog::displayCountryDetails(const QPointF& countryPoint) 0093 { 0094 qCDebug(KSIRK_LOG); 0095 Country* country = world->countryAt(countryPoint); 0096 if (country == nullptr) 0097 { 0098 return; 0099 } 0100 clearLayout(); 0101 QHBoxLayout * unit = new QHBoxLayout(); 0102 QHBoxLayout * drap = new QHBoxLayout(); 0103 flag1 = new QLabel(); 0104 flag2 = new QLabel(); 0105 initListLabel(7); 0106 0107 QPixmap picture; 0108 0109 picture = country->owner()->getFlag()->image(0); 0110 0111 QString continent = i18n(country->continent()->name().toUtf8().data()); 0112 QString pays = i18n(country->name().toUtf8().data()); 0113 QString units = QString::number(country->nbArmies()); 0114 QString owner = country->owner()->name(); 0115 0116 rightContents.at(0)->setText(i18n("<b>Nationality:</b>")); 0117 rightContents.at(1)->setText(i18n("<b>Continent:</b> %1", continent)); 0118 rightContents.at(2)->setText(i18n("<b>Country:</b> %1", pays)); 0119 0120 rightContents.at(3)->setPixmap(soldat); 0121 rightContents.at(6)->setText(units); 0122 rightContents.at(4)->setText(i18n("<b>Owner:</b> %1", owner)); 0123 rightContents.at(5)->setText(i18n("<b><u>Country details</u></b>")); 0124 0125 flag1->setPixmap(QPixmap()); 0126 flag2->setPixmap(QPixmap()); 0127 flag1->setPixmap(picture); 0128 0129 drap->addWidget(rightContents.at(0)); 0130 drap->addWidget(flag1); 0131 mainLayout->addWidget(rightContents.at(5),0,0,Qt::AlignLeft); 0132 mainLayout->addWidget(rightContents.at(1),2,0,Qt::AlignLeft); 0133 mainLayout->addWidget(rightContents.at(2),3,0,Qt::AlignLeft); 0134 0135 mainLayout->addWidget(rightContents.at(4),5,0,Qt::AlignLeft); 0136 0137 unit->addWidget(rightContents.at(3)); 0138 unit->addWidget(rightContents.at(6)); 0139 0140 mainLayout->addLayout(unit,4,0,Qt::AlignLeft); 0141 mainLayout->addLayout(drap,1,0,Qt::AlignLeft); 0142 0143 m_parentWidget->show(); 0144 repaint(); 0145 } 0146 0147 void KRightDialog::displayFightDetails(Country * attaker, Country * defender,int nb_A, int nb_D) 0148 { 0149 qCDebug(KSIRK_LOG); 0150 0151 clearLayout(); 0152 initListLabel(10); 0153 0154 haut = new QWidget(); 0155 bas = new QWidget(); 0156 QGridLayout * hautGrid = new QGridLayout(this); 0157 QGridLayout * basGrid = new QGridLayout(this); 0158 0159 flag1 = new QLabel(); 0160 flag2 = new QLabel(); 0161 0162 QHBoxLayout * box1 = new QHBoxLayout(); 0163 QHBoxLayout * box2 = new QHBoxLayout(); 0164 QHBoxLayout * box3 = new QHBoxLayout(); 0165 QHBoxLayout * box4 = new QHBoxLayout(); 0166 0167 QGridLayout * tp = new QGridLayout(); 0168 infoProcess = new QLabel(); 0169 infoProcess->setWordWrap(true); 0170 infoProcess->setText(i18n("<i>Fighting in progress...</i>")); 0171 loadingLabel = new QLabel(); 0172 QLabel *l3 = new QLabel(); 0173 QLabel *l4 = new QLabel(); 0174 0175 KConfig config(world->getConfigFileName()); 0176 KConfigGroup onugroup = config.group("onu"); 0177 QString skin = onugroup.readEntry("skinpath"); 0178 QString imageFileName = QStandardPaths::locate(QStandardPaths::AppDataLocation, skin + "/Images/loader.gif"); 0179 0180 QMovie * loading = new QMovie(imageFileName); 0181 loadingLabel->setMovie(loading); 0182 loading->start(); 0183 0184 tp->addWidget(l3,0,0); 0185 tp->addWidget(infoProcess,1,0,Qt::AlignCenter); 0186 tp->addWidget(loadingLabel,2,0,Qt::AlignCenter); 0187 tp->addWidget(l4,3,0); 0188 0189 milieu2 = new QWidget(this); 0190 milieu2->setAutoFillBackground(true); 0191 QPalette tempP(milieu2->palette()); 0192 tempP.setColor(QPalette::Window,QColor(190,190,190)); 0193 milieu2->setPalette(tempP); 0194 0195 milieu2->setLayout(tp); 0196 0197 haut->setLayout(hautGrid); 0198 bas->setLayout(basGrid); 0199 0200 //ATTACKER 0201 QString owner_A = attaker->owner()->name(); 0202 QString nb_units_A = QString::number(attaker->nbArmies()); 0203 QString pays_A = attaker->name(); 0204 0205 QString owner_D = defender->owner()->name(); 0206 QString nb_units_D = QString::number(defender->nbArmies()); 0207 QString pays_D = defender->name(); 0208 0209 QPixmap picture1; 0210 QPixmap picture2; 0211 picture1 = attaker->owner()->getFlag()->image(0); 0212 picture2 = defender->owner()->getFlag()->image(0); 0213 0214 rightContents.at(0)->setText("<u><b>"+i18n(pays_A.toUtf8().data())+"</b></u>"); 0215 flag1->setPixmap(picture1); 0216 rightContents.at(1)->setText("<i>("+owner_A+")</i> "); 0217 0218 if (!soldat.isNull()) 0219 rightContents.at(2)->setPixmap(soldat); 0220 rightContents.at(3)->setText("<b>"+nb_units_A+"</b>"); 0221 0222 rightContents.at(4)->setText(i18np("<font color=\"red\">Attack</font> with 1 army.<br>","<font color=\"red\">Attack</font> with %1 armies.<br>", nb_A)); 0223 0224 0225 rightContents.at(5)->setText("<u><b>"+i18n(pays_D.toUtf8().data())+"</b></u> "); 0226 flag2->setPixmap(picture2); 0227 rightContents.at(6)->setText("<i>("+owner_D+")</i> "); 0228 0229 if (!soldat.isNull()) 0230 rightContents.at(7)->setPixmap(soldat); 0231 rightContents.at(8)->setText("<b>"+nb_units_D+"</b> "); 0232 0233 rightContents.at(9)->setText(i18np("<font color=\"blue\">Defend</font> with 1 army.<br>","<font color=\"blue\">Defend</font> with %1 armies.<br>", nb_D)); 0234 0235 box1->addWidget(rightContents.at(0)); 0236 box1->addWidget(flag1); 0237 0238 box2->addWidget(rightContents.at(2)); 0239 box2->addWidget(rightContents.at(3)); 0240 0241 box3->addWidget(rightContents.at(5)); 0242 box3->addWidget(flag2); 0243 0244 box4->addWidget(rightContents.at(7)); 0245 box4->addWidget(rightContents.at(8)); 0246 0247 hautGrid->addLayout(box1,0,0,Qt::AlignCenter); 0248 hautGrid->addWidget(rightContents.at(1),1,0,Qt::AlignCenter); 0249 hautGrid->addLayout(box2,2,0,Qt::AlignLeft); 0250 hautGrid->addWidget(rightContents.at(4),3,0,Qt::AlignLeft); 0251 0252 basGrid->addLayout(box3,0,0,Qt::AlignCenter); 0253 basGrid->addWidget(rightContents.at(6),1,0,Qt::AlignCenter); 0254 basGrid->addLayout(box4,2,0,Qt::AlignLeft); 0255 basGrid->addWidget(rightContents.at(9),3,0,Qt::AlignLeft); 0256 0257 mainLayout->addWidget(haut,0,0); 0258 mainLayout->addWidget(milieu2,1,0); 0259 mainLayout->addWidget(bas,2,0); 0260 0261 if (game->automaton()->isAttackAuto() 0262 && !game->automaton()->currentPlayer()->isAI() 0263 && !game->automaton()->currentPlayer()->isVirtual()) 0264 { 0265 buttonStopAttack = new QPushButton(stopAttackAuto,i18n("Stop Auto-Attack")); 0266 mainLayout->addWidget(buttonStopAttack,3,0); 0267 connect(buttonStopAttack, &QAbstractButton::clicked, this, &KRightDialog::slotStopAttackAuto); 0268 } 0269 if (game->automaton()->isDefenseAuto() 0270 && !game->automaton()->currentPlayer()->isAI() 0271 && !game->automaton()->currentPlayer()->isVirtual()) 0272 { 0273 buttonStopDefense = new QPushButton(stopAttackAuto,i18n("Stop Auto-Defense")); 0274 mainLayout->addWidget(buttonStopDefense,4,0); 0275 connect(buttonStopDefense, &QAbstractButton::clicked, this, &KRightDialog::slotStopDefenseAuto); 0276 } 0277 0278 mainLayout->update(); 0279 m_parentWidget->show(); 0280 repaint(); 0281 } 0282 0283 void KRightDialog::displayRecycleDetails(GameLogic::Player * player, int nbAvailArmies) 0284 { 0285 qCDebug(KSIRK_LOG) << player->name() << nbAvailArmies; 0286 this->show(); 0287 0288 clearLayout(); 0289 initListLabel(4); 0290 0291 flag1 = new QLabel(); 0292 flag2 = new QLabel(); 0293 0294 QGridLayout* recycleLayout = new QGridLayout(); 0295 QGridLayout* btRecycleLayout = new QGridLayout(); 0296 QGridLayout* btValidLayout = new QGridLayout(); 0297 0298 QPushButton* buttonValid = new QPushButton(recycleNextPlayer, i18n("Valid"), this); 0299 QPushButton* buttonRecycle = new QPushButton(recycleContinue, i18n("Recycle"), this); 0300 QPushButton* buttonRecycleDone = new QPushButton(recycleDone, i18n("Done"), this); 0301 0302 connect(buttonValid, &QAbstractButton::clicked, game, &KGameWindow::slotNextPlayer); 0303 connect(buttonRecycle, &QAbstractButton::clicked, game, &KGameWindow::slotRecycling); 0304 connect(buttonRecycleDone, &QAbstractButton::clicked, game, &KGameWindow::slotRecyclingFinished); 0305 0306 QHBoxLayout* title = new QHBoxLayout(); 0307 0308 haut = new QWidget(); 0309 0310 0311 // Widgets which contains buttons 0312 btRecycleWidget = new QWidget(); 0313 btValidWidget = new QWidget(); 0314 0315 btRecycleLayout->addWidget(buttonRecycle,0,0,Qt::AlignCenter); 0316 btRecycleLayout->addWidget(buttonRecycleDone,0,1,Qt::AlignCenter); 0317 0318 btValidLayout->addWidget(buttonValid,0,0,Qt::AlignCenter); 0319 0320 btRecycleWidget->setLayout(btRecycleLayout); 0321 btValidWidget->setLayout(btValidLayout); 0322 0323 0324 rightContents.at(0)->setText("<u><b>"+player->name()+"</b></u> "); 0325 flag1->setPixmap(player->getFlag()->image(0)); 0326 0327 rightContents.at(1)->setText(i18np("%1 army to place", "%1 armies to place", nbAvailArmies)); 0328 0329 title->addWidget(rightContents.at(0)); 0330 title->addWidget(flag1); 0331 0332 recycleLayout->addLayout(title,0,0,Qt::AlignCenter); 0333 recycleLayout->addWidget(rightContents.at(1),1,0,Qt::AlignCenter); 0334 0335 recycleLayout->addWidget(rightContents.at(2),2,0,Qt::AlignCenter); 0336 recycleLayout->addWidget(rightContents.at(3),3,0,Qt::AlignCenter); 0337 0338 recycleLayout->addWidget(btRecycleWidget,4,0,Qt::AlignCenter); 0339 recycleLayout->addWidget(btValidWidget,5,0,Qt::AlignCenter); 0340 0341 haut->setLayout(recycleLayout); 0342 mainLayout->addWidget(haut,0,0); 0343 0344 // hide buttons initialy 0345 btRecycleWidget->hide(); 0346 if (nbAvailArmies > 0 || game->getState() == GameLogic::GameAutomaton::INTERLUDE || player->isVirtual() || player->isAI()) 0347 { 0348 btValidWidget->hide(); 0349 } 0350 else 0351 { 0352 btValidWidget->show(); 0353 } 0354 0355 mainLayout->update(); 0356 m_parentWidget->show(); 0357 repaint(); 0358 } 0359 0360 void KRightDialog::updateRecycleDetails(GameLogic::Country* country, bool recyclePhase, int nbAvailArmies) 0361 { 0362 qCDebug(KSIRK_LOG) << (void*)country << recyclePhase << nbAvailArmies; 0363 this->show(); 0364 if (btValidWidget == nullptr) 0365 { 0366 if (country == nullptr) 0367 { 0368 return; 0369 } 0370 displayRecycleDetails(country->owner(),nbAvailArmies); 0371 } 0372 0373 if (recyclePhase) 0374 { 0375 rightContents.at(0)->setText(i18n("<u><b>Change some<br>placements?</b></u> ")); 0376 flag1->hide(); 0377 rightContents.at(1)->setText(QString()); 0378 rightContents.at(2)->setText(QString()); 0379 rightContents.at(3)->setText(QString()); 0380 0381 // show "redistribute" and "end redistribute" buttons 0382 if (!game->automaton()->allLocalPlayersComputer()) 0383 { 0384 btRecycleWidget->show(); 0385 } 0386 btValidWidget->hide(); 0387 } 0388 else 0389 { 0390 rightContents.at(1)->setText(i18np("1 army to place", "%1 armies to place", nbAvailArmies)); 0391 rightContents.at(2)->setText("<b>"+i18n(country->name().toUtf8().data())+"</b>"); 0392 rightContents.at(3)->setText(i18n("<b>Armies:</b> %1", country->nbArmies())); 0393 if (nbAvailArmies > 0) 0394 { 0395 btValidWidget->hide(); 0396 } 0397 else 0398 { 0399 if (!game->currentPlayer()->isVirtual() && !game->currentPlayer()->isAI()) 0400 { 0401 btValidWidget->show(); 0402 } 0403 } 0404 } 0405 qCDebug(KSIRK_LOG) << "before update and repaint"; 0406 mainLayout->update(); 0407 repaint(); 0408 0409 } 0410 0411 void KRightDialog::displayFightResult(int A1=0, int A2=0, int A3=0, int D1=0, int D2=0,int nbA=0,int nbD=0, bool win=false) 0412 { 0413 qCDebug(KSIRK_LOG); 0414 0415 // Bug 309863. Should not happen anymore because Country details and Fight results shouldn't be mixed. 0416 // If, by any chance, occurs again, do not crash and log the incident. In that case label just won't be refreshed. 0417 if (loadingLabel != nullptr) 0418 { 0419 QMovie* movie = loadingLabel->movie(); 0420 delete movie; 0421 loadingLabel->clear(); 0422 } 0423 else 0424 qCDebug(KSIRK_LOG) << "Item (loadingLabel) has already been cleared!"; 0425 0426 if (infoProcess != nullptr) 0427 infoProcess->clear(); 0428 else 0429 qCDebug(KSIRK_LOG) << "Item (infoProcess) has already been cleared!"; 0430 0431 milieu = new QWidget(this); 0432 milieu->setAutoFillBackground(true); 0433 QPalette tempP(milieu->palette()); 0434 tempP.setColor(QPalette::Window,QColor(190,190,190)); 0435 milieu->setPalette(tempP); 0436 0437 QGridLayout * milieuGrid = new QGridLayout(); 0438 QHBoxLayout * deAtt = new QHBoxLayout(); 0439 QHBoxLayout * deDef = new QHBoxLayout(); 0440 0441 if(A1!=0 && A1!=-1) 0442 { 0443 QLabel * de1 = new QLabel(); 0444 de1->setPixmap(game->getDice(KGameWindow::Red,A1)); 0445 rightContents.insert(0,de1);deAtt->addWidget(de1); 0446 } 0447 if(A2!=0 && A2!=-1) 0448 { 0449 QLabel * de2= new QLabel(); 0450 de2->setPixmap(game->getDice(KGameWindow::Red,A2)); 0451 rightContents.insert(0,de2);deAtt->addWidget(de2); 0452 } 0453 if(A3!=0 && A3!=-1) 0454 { 0455 QLabel * de3= new QLabel(); 0456 de3->setPixmap(game->getDice(KGameWindow::Red,A3)); 0457 rightContents.insert(0,de3);deAtt->addWidget(de3); 0458 } 0459 if(D1!=0 && D1!=-1) 0460 { 0461 QLabel * de4= new QLabel(); 0462 de4->setPixmap(game->getDice(KGameWindow::Blue,D1)); 0463 rightContents.insert(0,de4);deDef->addWidget(de4); 0464 } 0465 if(D2!=0 && D2!=-1) 0466 { 0467 QLabel * de5= new QLabel(); 0468 de5->setPixmap(game->getDice(KGameWindow::Blue,D2)); 0469 rightContents.insert(0,de5);deDef->addWidget(de5); 0470 } 0471 QLabel * rLabelR = new QLabel(i18n("<font color=\"red\">lost armies: %1</font>", nbA)); 0472 rLabelR->setWordWrap(true); 0473 0474 rightContents.insert(0,rLabelR); 0475 0476 QLabel * rLabelB = new QLabel(i18n("<font color=\"blue\">lost armies: %1</font>", nbD)); 0477 rLabelB->setWordWrap(true); 0478 0479 rightContents.insert(0,rLabelB); 0480 0481 milieuGrid->addWidget(rightContents.at(1),0,0,Qt::AlignCenter); 0482 milieuGrid->addLayout(deAtt,1,0,Qt::AlignCenter); 0483 milieuGrid->addLayout(deDef,2,0,Qt::AlignCenter); 0484 milieuGrid->addWidget(rightContents.at(0),4,0,Qt::AlignCenter); 0485 0486 milieu->setLayout(milieuGrid); 0487 mainLayout->addWidget(milieu,1,0); 0488 0489 if (buttonStopAttack != nullptr && win) 0490 { 0491 buttonStopAttack->setEnabled(false); 0492 } 0493 repaint(); 0494 } 0495 0496 void KRightDialog::initListLabel(int nb) 0497 { 0498 qCDebug(KSIRK_LOG); 0499 0500 removeListLabel(); 0501 for (int i=0;i<nb;i++) 0502 { 0503 QLabel* label = new QLabel(); 0504 label->setWordWrap ( true ); 0505 rightContents.push_back(label); 0506 } 0507 clearLabel(); 0508 } 0509 0510 void KRightDialog::removeListLabel() 0511 { 0512 qCDebug(KSIRK_LOG); 0513 while (rightContents.size() > 0) 0514 { 0515 QLabel* label = rightContents.first(); 0516 rightContents.removeFirst(); 0517 delete label; 0518 } 0519 } 0520 0521 void KRightDialog::clearLabel() 0522 { 0523 qCDebug(KSIRK_LOG); 0524 for (int i=0;i<rightContents.size();i++) 0525 { 0526 rightContents.at(i)->setText(""); 0527 rightContents.at(i)->setPixmap(QPixmap()); 0528 } 0529 } 0530 0531 void KRightDialog::clearLayout() 0532 { 0533 qCDebug(KSIRK_LOG); 0534 while (rightContents.size() > 0) 0535 { 0536 QLabel* obj = rightContents.first(); 0537 rightContents.removeFirst(); 0538 mainLayout->removeWidget(obj); 0539 delete obj; 0540 } 0541 if (flag1 != nullptr) 0542 { 0543 mainLayout->removeWidget(flag1); 0544 delete flag1; 0545 flag1 = nullptr; 0546 } 0547 if (flag2 != nullptr) 0548 { 0549 mainLayout->removeWidget(flag2); 0550 delete flag2; 0551 flag2 = nullptr; 0552 } 0553 if (btRecycleWidget != nullptr) 0554 { 0555 delete btRecycleWidget; 0556 btRecycleWidget = nullptr; 0557 } 0558 if (btValidWidget != nullptr) 0559 { 0560 delete btValidWidget; 0561 btValidWidget = nullptr; 0562 } 0563 if (buttonStopAttack != nullptr) 0564 { 0565 mainLayout->removeWidget(buttonStopAttack); 0566 delete buttonStopAttack; 0567 buttonStopAttack = nullptr; 0568 } 0569 if (buttonStopDefense != nullptr) 0570 { 0571 mainLayout->removeWidget(buttonStopDefense); 0572 delete buttonStopDefense; 0573 buttonStopDefense = nullptr; 0574 } 0575 if(bas != nullptr && mainLayout->indexOf(bas)!=-1) 0576 { 0577 mainLayout->removeWidget(bas); 0578 delete bas; 0579 } 0580 if(milieu != nullptr) 0581 { 0582 mainLayout->removeWidget(milieu); 0583 delete milieu; 0584 milieu = nullptr; 0585 } 0586 if (milieu2 != nullptr) 0587 { 0588 mainLayout->removeWidget(milieu2); 0589 QMovie* movie = loadingLabel->movie(); 0590 loadingLabel->clear(); 0591 delete movie; 0592 delete loadingLabel; 0593 loadingLabel = nullptr; 0594 delete infoProcess; 0595 infoProcess = nullptr; 0596 delete milieu2; 0597 milieu2 = nullptr; 0598 } 0599 if(mainLayout->indexOf(haut)!=-1) 0600 { 0601 mainLayout->removeWidget(haut); 0602 delete haut; 0603 } 0604 } 0605 0606 void KRightDialog::slotStopAttackAuto() 0607 { 0608 qCDebug(KSIRK_LOG); 0609 this->game->automaton()->setAttackAuto(false); 0610 this->buttonStopAttack->setEnabled(false); 0611 } 0612 0613 void KRightDialog::slotStopDefenseAuto() 0614 { 0615 qCDebug(KSIRK_LOG); 0616 this->game->automaton()->setDefenseAuto(false); 0617 this->buttonStopDefense->setEnabled(false); 0618 } 0619 0620 } 0621 0622