QTfrontend/pages.cpp
changeset 3697 d5b30d6373fc
parent 3695 c11abf387a7d
child 3708 64e059b6f9c5
equal deleted inserted replaced
3695:c11abf387a7d 3697:d5b30d6373fc
   117     Tips << tr("Special game modes such as 'Vampirism' or 'Karma' allow you to develop completely new tactics. Try them in a custom game!", "Tips");
   117     Tips << tr("Special game modes such as 'Vampirism' or 'Karma' allow you to develop completely new tactics. Try them in a custom game!", "Tips");
   118     Tips << tr("The Windows version of Hedgewars supports Xfire. Make sure to add Hedgwars to its game list so your friends can see you playing.", "Tips");
   118     Tips << tr("The Windows version of Hedgewars supports Xfire. Make sure to add Hedgwars to its game list so your friends can see you playing.", "Tips");
   119     Tips << tr("You should never install Hedgewars on computers you don't own (school, university, work, etc.). Please ask the responsible person instead!", "Tips");
   119     Tips << tr("You should never install Hedgewars on computers you don't own (school, university, work, etc.). Please ask the responsible person instead!", "Tips");
   120     Tips << tr("Hedgewars can be perfect for short games during breaks. Just ensure you don't add too many hedgehogs or use an huge map. Reducing time and health might help as well.", "Tips");
   120     Tips << tr("Hedgewars can be perfect for short games during breaks. Just ensure you don't add too many hedgehogs or use an huge map. Reducing time and health might help as well.", "Tips");
   121     Tips << tr("No hedgehogs were harmed in making this game.", "Tips");
   121     Tips << tr("No hedgehogs were harmed in making this game.", "Tips");
   122     
   122 
   123 
   123 
   124     if(isDevBuild)
   124     if(isDevBuild)
   125         mainNote->setText(QLabel::tr("This development build is 'work in progress' and may not be compatible with other versions of the game. Some features might be broken or incomplete. Use at your own risk!"));
   125         mainNote->setText(QLabel::tr("This development build is 'work in progress' and may not be compatible with other versions of the game. Some features might be broken or incomplete. Use at your own risk!"));
   126     else
   126     else
   127         mainNote->setText(QLabel::tr("Tip: ") + Tips[QTime(0, 0, 0).secsTo(QTime::currentTime()) % Tips.length()]);
   127         mainNote->setText(QLabel::tr("Tip: ") + Tips[QTime(0, 0, 0).secsTo(QTime::currentTime()) % Tips.length()]);
   367 void PageEditTeam::testSound()
   367 void PageEditTeam::testSound()
   368 {
   368 {
   369     Mix_Chunk *sound;
   369     Mix_Chunk *sound;
   370     QDir tmpdir;
   370     QDir tmpdir;
   371     mySdli->SDLMusicInit();
   371     mySdli->SDLMusicInit();
   372     
   372 
   373     tmpdir.cd(datadir->absolutePath());
   373     tmpdir.cd(datadir->absolutePath());
   374     tmpdir.cd("Sounds/voices");
   374     tmpdir.cd("Sounds/voices");
   375     tmpdir.cd(CBVoicepack->currentText());
   375     tmpdir.cd(CBVoicepack->currentText());
   376     QStringList list = tmpdir.entryList(QStringList() << "Illgetyou.ogg" << "Incoming.ogg" << "Stupid.ogg" << "Coward.ogg" << "Firstblood.ogg", QDir::Files);
   376     QStringList list = tmpdir.entryList(QStringList() << "Illgetyou.ogg" << "Incoming.ogg" << "Stupid.ogg" << "Coward.ogg" << "Firstblood.ogg", QDir::Files);
   377     if (list.size()) {
   377     if (list.size()) {
   945     tmpdir.cd("Missions/Training");
   945     tmpdir.cd("Missions/Training");
   946     tmpdir.setFilter(QDir::Files);
   946     tmpdir.setFilter(QDir::Files);
   947     CBSelect->addItems(tmpdir.entryList(QStringList("*.lua")).replaceInStrings(QRegExp("^(.*)\\.lua"), "\\1"));
   947     CBSelect->addItems(tmpdir.entryList(QStringList("*.lua")).replaceInStrings(QRegExp("^(.*)\\.lua"), "\\1"));
   948 
   948 
   949     pageLayout->addWidget(CBSelect, 1, 1);
   949     pageLayout->addWidget(CBSelect, 1, 1);
   950     
   950 
   951     BtnStartTrain = new QPushButton(this);
   951     BtnStartTrain = new QPushButton(this);
   952     BtnStartTrain->setFont(*font14);
   952     BtnStartTrain->setFont(*font14);
   953     BtnStartTrain->setText(QPushButton::tr("Go!"));
   953     BtnStartTrain->setText(QPushButton::tr("Go!"));
   954     pageLayout->addWidget(BtnStartTrain, 1, 2);
   954     pageLayout->addWidget(BtnStartTrain, 1, 2);
   955 
   955 
  1061     for(int i = 0, r = 0; i < list.size(); i += 8, r++)
  1061     for(int i = 0, r = 0; i < list.size(); i += 8, r++)
  1062     {
  1062     {
  1063         QTableWidgetItem * item;
  1063         QTableWidgetItem * item;
  1064         item = new QTableWidgetItem(list[i + 1]); // room name
  1064         item = new QTableWidgetItem(list[i + 1]); // room name
  1065         item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable);
  1065         item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable);
  1066         
  1066 
  1067         // pick appropriate room icon and tooltip (game in progress yes/no; later maybe locked rooms etc.)
  1067         // pick appropriate room icon and tooltip (game in progress yes/no; later maybe locked rooms etc.)
  1068         if(list[i].compare("True"))
  1068         if(list[i].compare("True"))
  1069         {
  1069         {
  1070             item->setIcon(QIcon(":/res/iconTime.png"));// game is in lobby
  1070             item->setIcon(QIcon(":/res/iconTime.png"));// game is in lobby
  1071             item->setToolTip(tr("This game is in lobby.\nYou may join and start playing once the game starts."));
  1071             item->setToolTip(tr("This game is in lobby.\nYou may join and start playing once the game starts."));
  1100         else if (list[i+5] == "+maze+")
  1100         else if (list[i+5] == "+maze+")
  1101             item = new QTableWidgetItem(tr("Random Maze"));
  1101             item = new QTableWidgetItem(tr("Random Maze"));
  1102         else
  1102         else
  1103         {
  1103         {
  1104             item = new QTableWidgetItem(list[i + 5]); // selected map
  1104             item = new QTableWidgetItem(list[i + 5]); // selected map
  1105             
  1105 
  1106             // check to see if we've got this map
  1106             // check to see if we've got this map
  1107             // not perfect but a start
  1107             // not perfect but a start
  1108             if(!mapList->contains(list[i + 5]))
  1108             if(!mapList->contains(list[i + 5]))
  1109                 item->setForeground(QBrush(QColor(255, 0, 0)));
  1109                 item->setForeground(QBrush(QColor(255, 0, 0)));
  1110         }
  1110         }
  1111         
  1111 
  1112         item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable);
  1112         item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable);
  1113         item->setToolTip(tr("Games may be played on precreated or randomized maps."));
  1113         item->setToolTip(tr("Games may be played on precreated or randomized maps."));
  1114         roomsList->setItem(r, 4, item);
  1114         roomsList->setItem(r, 4, item);
  1115 
  1115 
  1116         item = new QTableWidgetItem(list[i + 6].left(20)); // selected game scheme
  1116         item = new QTableWidgetItem(list[i + 6].left(20)); // selected game scheme
  1504     QGridLayout * pageLayout = new QGridLayout(this);
  1504     QGridLayout * pageLayout = new QGridLayout(this);
  1505 
  1505 
  1506     // 0
  1506     // 0
  1507     pbAsk = addButton(tr("Fetch data"), pageLayout, 0, 0, 1, 3);
  1507     pbAsk = addButton(tr("Fetch data"), pageLayout, 0, 0, 1, 3);
  1508     connect(pbAsk, SIGNAL(clicked()), this, SIGNAL(askServerVars()));
  1508     connect(pbAsk, SIGNAL(clicked()), this, SIGNAL(askServerVars()));
  1509     
  1509 
  1510     // 1
  1510     // 1
  1511     QLabel * lblSMN = new QLabel(this);
  1511     QLabel * lblSMN = new QLabel(this);
  1512     lblSMN->setText(tr("Server message for latest version:"));
  1512     lblSMN->setText(tr("Server message for latest version:"));
  1513     pageLayout->addWidget(lblSMN, 1, 0);
  1513     pageLayout->addWidget(lblSMN, 1, 0);
  1514 
  1514 
  1538 
  1538 
  1539     tb = new QTextBrowser(this);
  1539     tb = new QTextBrowser(this);
  1540     pageLayout->addWidget(tb, 4, 1, 1, 2);
  1540     pageLayout->addWidget(tb, 4, 1, 1, 2);
  1541     connect(leServerMessageNew, SIGNAL(textEdited(const QString &)), tb, SLOT(setHtml(const QString &)));
  1541     connect(leServerMessageNew, SIGNAL(textEdited(const QString &)), tb, SLOT(setHtml(const QString &)));
  1542     connect(leServerMessageOld, SIGNAL(textEdited(const QString &)), tb, SLOT(setHtml(const QString &)));
  1542     connect(leServerMessageOld, SIGNAL(textEdited(const QString &)), tb, SLOT(setHtml(const QString &)));
  1543     
  1543 
  1544     // 5
  1544     // 5
  1545     pbClearAccountsCache = addButton(tr("Clear Accounts Cache"), pageLayout, 5, 0);
  1545     pbClearAccountsCache = addButton(tr("Clear Accounts Cache"), pageLayout, 5, 0);
  1546     
  1546 
  1547     // 6
  1547     // 6
  1548     pbSetSM = addButton(tr("Set data"), pageLayout, 6, 0, 1, 3);
  1548     pbSetSM = addButton(tr("Set data"), pageLayout, 6, 0, 1, 3);
  1549 
  1549 
  1550     // 7
  1550     // 7
  1551     BtnBack = addButton(":/res/Exit.png", pageLayout, 7, 0, true);
  1551     BtnBack = addButton(":/res/Exit.png", pageLayout, 7, 0, true);