QTfrontend/ui/page/pageeditteam.cpp
changeset 12248 07f67ee424dc
parent 12245 5206f9a803d1
child 12249 d23695f96290
equal deleted inserted replaced
12247:a6e0977be914 12248:07f67ee424dc
    75         HHNameEdit[i]->setMaxLength(64);
    75         HHNameEdit[i]->setMaxLength(64);
    76         HHNameEdit[i]->setMinimumWidth(120);
    76         HHNameEdit[i]->setMinimumWidth(120);
    77         HHNameEdit[i]->setFixedHeight(36);
    77         HHNameEdit[i]->setFixedHeight(36);
    78         HHNameEdit[i]->setWhatsThis(tr("This hedgehog's name"));
    78         HHNameEdit[i]->setWhatsThis(tr("This hedgehog's name"));
    79         HHNameEdit[i]->setStyleSheet("padding: 6px;");
    79         HHNameEdit[i]->setStyleSheet("padding: 6px;");
    80         GBHLayout->addWidget(HHNameEdit[i], i + 1, 1);
    80         GBHLayout->addWidget(HHNameEdit[i], i + 1, 1, 1, 3);
    81 
    81 
    82         btnRandomHogName[i] = addButton(":/res/dice.png", GBHLayout, i + 1, 3, 1, 1, true);
    82         btnRandomHogName[i] = addButton(":/res/dice.png", GBHLayout, i + 1, 5, 1, 1, true);
    83         btnRandomHogName[i]->setFixedHeight(HHNameEdit[i]->height());
    83         btnRandomHogName[i]->setFixedHeight(HHNameEdit[i]->height());
    84         btnRandomHogName[i]->setWhatsThis(tr("Randomize this hedgehog's name"));
    84         btnRandomHogName[i]->setWhatsThis(tr("Randomize this hedgehog's name"));
    85     }
    85     }
       
    86 
       
    87     btnRandomHats = new QPushButton();
       
    88     btnRandomHats->setText(tr("Random Hats"));
       
    89     btnRandomHats->setStyleSheet("padding: 6px 10px;");
       
    90     GBHLayout->addWidget(btnRandomHats, 9, 1, 1, 1, Qt::AlignCenter);
       
    91     btnRandomHats->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
       
    92 
       
    93     btnRandomNames = new QPushButton();
       
    94     btnRandomNames->setText(tr("Random Names"));
       
    95     btnRandomNames->setStyleSheet("padding: 6px 10px;");
       
    96     GBHLayout->addWidget(btnRandomNames, 9, 2, 1, 1, Qt::AlignCenter);
       
    97     btnRandomNames->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
    86 
    98 
    87     btnRandomTeam = new QPushButton();
    99     btnRandomTeam = new QPushButton();
    88     btnRandomTeam->setText(tr("Random Team"));
   100     btnRandomTeam->setText(tr("Random Team"));
    89     btnRandomTeam->setStyleSheet("padding: 6px 10px;");
   101     btnRandomTeam->setStyleSheet("padding: 6px 10px;");
    90     GBHLayout->addWidget(btnRandomTeam, 9, 0, 1, 4, Qt::AlignCenter);
   102     GBHLayout->addWidget(btnRandomTeam, 9, 3, 1, 1, Qt::AlignCenter);
    91     btnRandomTeam->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
   103     btnRandomTeam->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
    92 
   104 
    93     vbox1->addWidget(GBoxHedgehogs);
   105     vbox1->addWidget(GBoxHedgehogs);
    94 
   106 
    95     GBoxTeam = new QGroupBox(this);
   107     GBoxTeam = new QGroupBox(this);
   217         connect(btnRandomHogName[i], SIGNAL(clicked()), signalMapper2, SLOT(map()));
   229         connect(btnRandomHogName[i], SIGNAL(clicked()), signalMapper2, SLOT(map()));
   218         signalMapper2->setMapping(btnRandomHogName[i], i);
   230         signalMapper2->setMapping(btnRandomHogName[i], i);
   219     }
   231     }
   220 
   232 
   221     connect(btnRandomTeam, SIGNAL(clicked()), this, SLOT(setRandomTeam()));
   233     connect(btnRandomTeam, SIGNAL(clicked()), this, SLOT(setRandomTeam()));
       
   234     connect(btnRandomNames, SIGNAL(clicked()), this, SLOT(setRandomHogNames()));
       
   235     connect(btnRandomHats, SIGNAL(clicked()), this, SLOT(setRandomHats()));
       
   236 
   222     connect(btnRandomTeamName, SIGNAL(clicked()), this, SLOT(setRandomTeamName()));
   237     connect(btnRandomTeamName, SIGNAL(clicked()), this, SLOT(setRandomTeamName()));
   223     connect(btnRandomGrave, SIGNAL(clicked()), this, SLOT(setRandomGrave()));
   238     connect(btnRandomGrave, SIGNAL(clicked()), this, SLOT(setRandomGrave()));
   224     connect(btnRandomFlag, SIGNAL(clicked()), this, SLOT(setRandomFlag()));
   239     connect(btnRandomFlag, SIGNAL(clicked()), this, SLOT(setRandomFlag()));
   225     connect(btnRandomVoice, SIGNAL(clicked()), this, SLOT(setRandomVoice()));
   240     connect(btnRandomVoice, SIGNAL(clicked()), this, SLOT(setRandomVoice()));
   226     connect(btnRandomFort, SIGNAL(clicked()), this, SLOT(setRandomFort()));
   241     connect(btnRandomFort, SIGNAL(clicked()), this, SLOT(setRandomFort()));
   405 }
   420 }
   406 
   421 
   407 void PageEditTeam::setRandomTeam()
   422 void PageEditTeam::setRandomTeam()
   408 {
   423 {
   409     HWTeam team = data();
   424     HWTeam team = data();
   410     HWNamegen::teamRandomEverything(team, true);
   425     HWNamegen::teamRandomEverything(team, HWNamegen::rtmEverything);
       
   426     loadTeam(team);
       
   427 }
       
   428 
       
   429 void PageEditTeam::setRandomHogNames()
       
   430 {
       
   431     HWTeam team = data();
       
   432     HWNamegen::teamRandomEverything(team, HWNamegen::rtmHogNames);
       
   433     loadTeam(team);
       
   434 }
       
   435 
       
   436 void PageEditTeam::setRandomHats()
       
   437 {
       
   438     HWTeam team = data();
       
   439     HWNamegen::teamRandomEverything(team, HWNamegen::rtmHats);
   411     loadTeam(team);
   440     loadTeam(team);
   412 }
   441 }
   413 
   442 
   414 void PageEditTeam::setRandomHogName(int hh_index)
   443 void PageEditTeam::setRandomHogName(int hh_index)
   415 {
   444 {