# HG changeset patch # User sheepluva # Date 1359118767 -3600 # Node ID 4821897a0f10d9968d1104e734c1eaca57f1b73e # Parent f2d57e987ba9fa96a3b21adb22f80a16d0812c51 big indentation/whitespaces cleanup diff -r f2d57e987ba9 -r 4821897a0f10 QTfrontend/campaign.cpp --- a/QTfrontend/campaign.cpp Fri Jan 25 12:54:24 2013 +0100 +++ b/QTfrontend/campaign.cpp Fri Jan 25 13:59:27 2013 +0100 @@ -59,7 +59,7 @@ QSettings campfile("physfs://Missions/Campaign/" + campaign + "/campaign.ini", QSettings::IniFormat, 0); campfile.setIniCodec("UTF-8"); unsigned int mNum = campfile.value("MissionNum", 0).toInt(); - + QStringList missionList; for (unsigned int i = 0; i < mNum; i++) { @@ -67,7 +67,7 @@ } return missionList; } - + unsigned int getCampProgress(QString & teamName, QString & campName) { QSettings teamfile(cfgdir->absolutePath() + "/Teams/" + teamName + ".hwt", QSettings::IniFormat, 0); @@ -81,10 +81,3 @@ campfile.setIniCodec("UTF-8"); return campfile.value(QString("Mission %1/Script").arg(mNum)).toString(); } - - - - - - - diff -r f2d57e987ba9 -r 4821897a0f10 QTfrontend/game.cpp --- a/QTfrontend/game.cpp Fri Jan 25 12:54:24 2013 +0100 +++ b/QTfrontend/game.cpp Fri Jan 25 13:59:27 2013 +0100 @@ -60,7 +60,7 @@ switch (gameType) { case gtDemo: - // for video recording we need demo anyway + // for video recording we need demo anyway emit HaveRecord(rtNeither, demo); break; case gtNet: @@ -83,7 +83,7 @@ { QString value = config->value(QString("Binds/%1").arg(cbinds[i].action), cbinds[i].strbind).toString(); if (value.isEmpty() || value == "default") continue; - + QString bind = QString("edbind " + value + " " + cbinds[i].action); HWProto::addStringToBuffer(*buf, bind); } @@ -124,7 +124,7 @@ ; } } - + RawSendIPC(buf); } @@ -171,7 +171,7 @@ HWProto::addStringToBuffer(teamscfg, QString("eammreinf %1").arg(cDefaultAmmoStore->mid(3 * cAmmoNumber, cAmmoNumber))); HWProto::addStringToBuffer(teamscfg, QString("eammstore")); HWProto::addStringToBuffer(teamscfg, QString("eammstore")); - + RawSendIPC(teamscfg); } diff -r f2d57e987ba9 -r 4821897a0f10 QTfrontend/gameuiconfig.cpp --- a/QTfrontend/gameuiconfig.cpp Fri Jan 25 12:54:24 2013 +0100 +++ b/QTfrontend/gameuiconfig.cpp Fri Jan 25 13:59:27 2013 +0100 @@ -83,7 +83,7 @@ Form->ui.pageOptions->CBResolution->setCurrentIndex(0); } else Form->ui.pageOptions->CBResolution->setCurrentIndex(t); - + // Default the windowed resolution to 5/6 of the screen size int screenWidth = SDL_GetVideoInfo()->current_w * 5 / 6; int screenHeight = SDL_GetVideoInfo()->current_h * 5 / 6; @@ -96,7 +96,7 @@ wHeight = (wHeight == "" ? heightStr : wHeight); Form->ui.pageOptions->windowWidthEdit->setText(wWidth); Form->ui.pageOptions->windowHeightEdit->setText(wHeight); - + Form->ui.pageOptions->CBResolution->setCurrentIndex((t < 0) ? 1 : t); Form->ui.pageOptions->CBFullscreen->setChecked(value("video/fullscreen", false).toBool()); bool ffscr=value("frontend/fullscreen", false).toBool(); @@ -263,7 +263,7 @@ setValue("net/nick", netNick()); if (netPasswordIsValid() && Form->ui.pageOptions->CBSavePassword->isChecked()) { - setPasswordHash(netPasswordHash()); + setPasswordHash(netPasswordHash()); } else if(!Form->ui.pageOptions->CBSavePassword->isChecked()) { clearPasswordHash(); @@ -372,7 +372,7 @@ std::pair result = vid_ResolutionPair(); if(Form->ui.pageOptions->CBFullscreen->isChecked()) return result.first; - else + else return result.second; } @@ -515,7 +515,7 @@ return (netPasswordLength() == 0 || Form->ui.pageOptions->editNetPassword->text() != QString(netPasswordLength(), '*')); } -void GameUIConfig::clearPasswordHash() +void GameUIConfig::clearPasswordHash() { setValue("net/passwordhash", QString()); setValue("net/passwordlength", 0); @@ -535,7 +535,7 @@ return value("net/passwordhash").toString(); } -void GameUIConfig::clearTempHash() +void GameUIConfig::clearTempHash() { setTempHash(QString()); } diff -r f2d57e987ba9 -r 4821897a0f10 QTfrontend/gameuiconfig.h --- a/QTfrontend/gameuiconfig.h Fri Jan 25 12:54:24 2013 +0100 +++ b/QTfrontend/gameuiconfig.h Fri Jan 25 13:59:27 2013 +0100 @@ -97,7 +97,7 @@ private: bool netPasswordIsValid(); bool eventFilter(QObject *object, QEvent *event); - QString temphash; + QString temphash; QList m_binds; }; diff -r f2d57e987ba9 -r 4821897a0f10 QTfrontend/hwform.cpp --- a/QTfrontend/hwform.cpp Fri Jan 25 12:54:24 2013 +0100 +++ b/QTfrontend/hwform.cpp Fri Jan 25 13:59:27 2013 +0100 @@ -592,11 +592,11 @@ #ifdef USE_XFIRE updateXfire(); #endif - + qDebug("Leaving %s, entering %s", qPrintable(stringifyPageId(lastid)), qPrintable(stringifyPageId(id))); // pageEnter and pageLeave events - ((AbstractPage*)ui.Pages->widget(lastid))->triggerPageLeave(); + ((AbstractPage*)ui.Pages->widget(lastid))->triggerPageLeave(); ((AbstractPage*)ui.Pages->widget(id))->triggerPageEnter(); if (id == ID_PAGE_DATADOWNLOAD) @@ -1096,10 +1096,10 @@ if (!ok || newNick.isEmpty()) { //ForcedDisconnect(tr("No nickname supplied.")); - bool retry = RetryDialog(tr("Hedgewars - Empty nickname"), tr("No nickname supplied.")); - GoBack(); + bool retry = RetryDialog(tr("Hedgewars - Empty nickname"), tr("No nickname supplied.")); + GoBack(); if (retry) { - NetConnectOfficialServer(); + NetConnectOfficialServer(); } return; } @@ -1490,7 +1490,7 @@ } else { while (ui.Pages->currentIndex() != ID_PAGE_NET - && ui.Pages->currentIndex() != ID_PAGE_MAIN) + && ui.Pages->currentIndex() != ID_PAGE_MAIN) { GoBack(); } @@ -1927,10 +1927,10 @@ MessageDialog::ShowErrorMessage(QMessageBox::tr("File association failed."), this); } -void HWForm::openRegistrationPage() +void HWForm::openRegistrationPage() { QDesktopServices::openUrl(QUrl("http://www.hedgewars.org/user/register")); -} +} void HWForm::saveDemoWithCustomName() { diff -r f2d57e987ba9 -r 4821897a0f10 QTfrontend/hwform.h --- a/QTfrontend/hwform.h Fri Jan 25 12:54:24 2013 +0100 +++ b/QTfrontend/hwform.h Fri Jan 25 13:59:27 2013 +0100 @@ -109,7 +109,7 @@ void NetNickNotRegistered(const QString & nick); void NetNickTaken(const QString & nick); void NetAuthFailed(); - bool RetryDialog(const QString & title, const QString & label); + bool RetryDialog(const QString & title, const QString & label); void NetTeamAccepted(const QString& team); void AddNetTeam(const HWTeam& team); void RemoveNetTeam(const HWTeam& team); @@ -174,7 +174,7 @@ ID_PAGE_CAMPAIGN , ID_PAGE_DRAWMAP , ID_PAGE_DATADOWNLOAD , - ID_PAGE_VIDEOS , + ID_PAGE_VIDEOS , MAX_PAGE }; QPointer game; diff -r f2d57e987ba9 -r 4821897a0f10 QTfrontend/model/HatModel.cpp --- a/QTfrontend/model/HatModel.cpp Fri Jan 25 12:54:24 2013 +0100 +++ b/QTfrontend/model/HatModel.cpp Fri Jan 25 13:59:27 2013 +0100 @@ -76,9 +76,9 @@ QString str = hatsList.at(i); str = str.remove(QRegExp("\\.png$")); - QPixmap pix( + QPixmap pix( "physfs://Graphics/Hats/" + QString(isReserved?"Reserved/":"") + str + - ".png" + ".png" ); // rename properly diff -r f2d57e987ba9 -r 4821897a0f10 QTfrontend/net/newnetclient.h --- a/QTfrontend/net/newnetclient.h Fri Jan 25 12:54:24 2013 +0100 +++ b/QTfrontend/net/newnetclient.h Fri Jan 25 13:59:27 2013 +0100 @@ -161,7 +161,7 @@ void toggleRestrictJoins(); void toggleRestrictTeamAdds(); void partRoom(); - void clearAccountsCache(); + void clearAccountsCache(); void getBanList(); void removeBan(const QString &); void banIP(const QString & ip, const QString & reason, int seconds); diff -r f2d57e987ba9 -r 4821897a0f10 QTfrontend/net/recorder.cpp --- a/QTfrontend/net/recorder.cpp Fri Jan 25 12:54:24 2013 +0100 +++ b/QTfrontend/net/recorder.cpp Fri Jan 25 13:59:27 2013 +0100 @@ -136,7 +136,7 @@ arguments << prefix; arguments << config->AVFormat(); arguments << config->videoCodec(); -// Could use a field to use quality instead. maybe quality could override bitrate - or just pass (and set) both. +// Could use a field to use quality instead. maybe quality could override bitrate - or just pass (and set) both. // The library does support using both at once after all. arguments << QString::number(config->rec_Bitrate()*1024); arguments << (config->recordAudio() ? config->audioCodec() : "no"); diff -r f2d57e987ba9 -r 4821897a0f10 QTfrontend/res/html/about.html --- a/QTfrontend/res/html/about.html Fri Jan 25 12:54:24 2013 +0100 +++ b/QTfrontend/res/html/about.html Fri Jan 25 13:59:27 2013 +0100 @@ -8,8 +8,8 @@ -

Developers:

-

+

Developers:

+

Engine, frontend, net server: Andrey Korotaev <unC0Rr@gmail.com>
Many frontend improvements: Igor Ulyanov <disinbox@gmail.com>
Many engine and frontend improvements: Derek Pomery <nemo@m8y.org>
@@ -31,7 +31,7 @@ Video recording: Stepan Podoskin <stepik-777@mail.ru>
Campaign support, first campaign: Szabolcs Orbàn <szabibibi@gmail.com>

- +

Art:

John Dum <fizzy@gmail.com>
@@ -49,7 +49,7 @@
Hats: Trey Perry <tx.perry.j@gmail.com>

- +

Sounds:

Hedgehogs voice: Stephen Alexander <ArmagonNo1@gmail.com> diff -r f2d57e987ba9 -r 4821897a0f10 QTfrontend/ui/dialog/bandialog.h --- a/QTfrontend/ui/dialog/bandialog.h Fri Jan 25 12:54:24 2013 +0100 +++ b/QTfrontend/ui/dialog/bandialog.h Fri Jan 25 13:59:27 2013 +0100 @@ -11,7 +11,7 @@ { Q_OBJECT public: - explicit BanDialog(QWidget *parent = 0); + explicit BanDialog(QWidget *parent = 0); bool byIP(); int duration(); diff -r f2d57e987ba9 -r 4821897a0f10 QTfrontend/ui/dialog/input_password.cpp --- a/QTfrontend/ui/dialog/input_password.cpp Fri Jan 25 12:54:24 2013 +0100 +++ b/QTfrontend/ui/dialog/input_password.cpp Fri Jan 25 13:59:27 2013 +0100 @@ -28,7 +28,7 @@ HWPasswordDialog::HWPasswordDialog(QWidget* parent) : QDialog(parent) { setWindowTitle(tr("Login")); - + QString titleLabelText = "To connect to the server, please log in.\n\nIf you don't have an account on www.hedgewars.org,\njust enter your nickname."; QString nickLabelText = "Nickname:"; QString passLabelText = "Password:"; @@ -38,15 +38,15 @@ QLabel * titleLabel = new QLabel(this); titleLabel->setText(titleLabelText); layout->addWidget(titleLabel, 0, 0); - + QLabel * nickLabel = new QLabel(this); nickLabel->setText(nickLabelText); layout->addWidget(nickLabel, 1, 0); - + leNickname = new QLineEdit(this); leNickname->setEchoMode(QLineEdit::Normal); layout->addWidget(leNickname, 2, 0); - + QLabel * passLabel = new QLabel(this); passLabel->setText(passLabelText); layout->addWidget(passLabel, 3, 0); diff -r f2d57e987ba9 -r 4821897a0f10 QTfrontend/ui/page/pageeditteam.cpp --- a/QTfrontend/ui/page/pageeditteam.cpp Fri Jan 25 12:54:24 2013 +0100 +++ b/QTfrontend/ui/page/pageeditteam.cpp Fri Jan 25 13:59:27 2013 +0100 @@ -370,7 +370,7 @@ { tbw->setCurrentIndex(0); binder->resetInterface(); - + TeamNameEdit->setText(team.name()); CBTeamLvl->setCurrentIndex(team.difficulty()); @@ -396,7 +396,7 @@ for(int i = 0; i < BINDS_NUMBER; i++) { if (team.keyBind(i).isEmpty()) continue; - + QModelIndexList mdl = binds->match(binds->index(0, 0), Qt::UserRole + 1, team.keyBind(i), 1, Qt::MatchExactly); if(mdl.size() == 1) diff -r f2d57e987ba9 -r 4821897a0f10 QTfrontend/ui/page/pagefeedback.h diff -r f2d57e987ba9 -r 4821897a0f10 QTfrontend/ui/page/pagemain.cpp --- a/QTfrontend/ui/page/pagemain.cpp Fri Jan 25 12:54:24 2013 +0100 +++ b/QTfrontend/ui/page/pagemain.cpp Fri Jan 25 13:59:27 2013 +0100 @@ -50,7 +50,7 @@ BtnNet->setWhatsThis(tr("Play a game across a network")); pageLayout->setAlignment(BtnNet, Qt::AlignHCenter); connect(BtnNet, SIGNAL(clicked()), this, SLOT(toggleNetworkChoice())); - + originalNetworkIcon = BtnNet->icon(); disabledNetworkIcon = QIcon(":/res/NetworkPlayDisabled.png"); @@ -163,8 +163,8 @@ tip_platform = 2; if(line.contains("", Qt::CaseSensitive)) tip_platform = 3; - if(line.contains("", Qt::CaseSensitive) || - line.contains("", Qt::CaseSensitive) || + if(line.contains("", Qt::CaseSensitive) || + line.contains("", Qt::CaseSensitive) || line.contains("", Qt::CaseSensitive)) { tip_platform = 0; } diff -r f2d57e987ba9 -r 4821897a0f10 QTfrontend/ui/page/pagemultiplayer.cpp --- a/QTfrontend/ui/page/pagemultiplayer.cpp Fri Jan 25 12:54:24 2013 +0100 +++ b/QTfrontend/ui/page/pagemultiplayer.cpp Fri Jan 25 13:59:27 2013 +0100 @@ -47,7 +47,7 @@ QLayout * PageMultiplayer::footerLayoutLeftDefinition() { QHBoxLayout * bottomLeftLayout = new QHBoxLayout(); - + btnSetup = addButton(":/res/Settings.png", bottomLeftLayout, 0, true); btnSetup->setWhatsThis(tr("Edit game preferences")); diff -r f2d57e987ba9 -r 4821897a0f10 QTfrontend/ui/page/pagenetgame.cpp --- a/QTfrontend/ui/page/pagenetgame.cpp Fri Jan 25 12:54:24 2013 +0100 +++ b/QTfrontend/ui/page/pagenetgame.cpp Fri Jan 25 13:59:27 2013 +0100 @@ -100,7 +100,7 @@ pageLayout->addWidget(pNetTeamsWidget, 1, 1); // Chat - + chatWidget = new HWChatWidget(this, true); chatWidget->setShowFollow(false); // don't show follow in nicks' context menus chatWidget->setIgnoreListKick(true); // kick ignored players automatically @@ -114,7 +114,7 @@ QLayout * PageNetGame::footerLayoutLeftDefinition() { QHBoxLayout * bottomLeftLayout = new QHBoxLayout(); - + btnSetup = addButton(":/res/Settings.png", bottomLeftLayout, 0, true); btnSetup->setWhatsThis(tr("Edit game preferences")); diff -r f2d57e987ba9 -r 4821897a0f10 QTfrontend/ui/page/pageoptions.cpp --- a/QTfrontend/ui/page/pageoptions.cpp Fri Jan 25 12:54:24 2013 +0100 +++ b/QTfrontend/ui/page/pageoptions.cpp Fri Jan 25 13:59:27 2013 +0100 @@ -199,7 +199,7 @@ { // group: weapons OptionGroupBox * groupWeapons = new OptionGroupBox(":/res/weaponsicon.png", tr("Weapons"), this); leftColumn->addWidget(groupWeapons); - + groupWeapons->layout()->setColumnStretch(0, 1); WeaponsName = new QComboBox(groupWeapons); @@ -250,7 +250,7 @@ CBFullscreen->setText(QLabel::tr("Fullscreen")); // Fullscreen resolution - + lblFullScreenRes = new QLabel(groupGame); lblFullScreenRes->setText(QLabel::tr("Fullscreen Resolution")); groupGame->layout()->addWidget(lblFullScreenRes, 1, 0); @@ -260,28 +260,28 @@ groupGame->layout()->addWidget(CBResolution, 1, 1, Qt::AlignLeft); // Windowed resolution - + lblWinScreenRes = new QLabel(groupGame); lblWinScreenRes->setText(QLabel::tr("Windowed Resolution")); groupGame->layout()->addWidget(lblWinScreenRes, 2, 0); - + winResContainer = new QWidget(); QHBoxLayout * winResLayout = new QHBoxLayout(winResContainer); winResLayout->setSpacing(0); groupGame->layout()->addWidget(winResContainer, 2, 1); - + QLabel *winLabelX = new QLabel(groupGame); winLabelX->setText("x"); // decorational x winLabelX->setFixedWidth(40); winLabelX->setAlignment(Qt::AlignCenter); - + windowWidthEdit = new QLineEdit(groupGame); windowWidthEdit->setValidator(new QIntValidator(this)); windowWidthEdit->setFixedSize(55, CBResolution->height()); windowHeightEdit = new QLineEdit(groupGame); windowHeightEdit->setValidator(new QIntValidator(this)); windowHeightEdit->setFixedSize(55, CBResolution->height()); - + winResLayout->addWidget(windowWidthEdit, 0); winResLayout->addWidget(winLabelX, 0); winResLayout->addWidget(windowHeightEdit, 0); @@ -830,7 +830,7 @@ void PageOptions::forceFullscreen(int index) { bool forced = (index == 7 || index == 8 || index == 9); - + if (index != 0) { this->SLQuality->setValue(this->SLQuality->maximum()); @@ -1114,7 +1114,7 @@ void PageOptions::bindUpdated(int bindID) { int bindIndex = binder->bindIndex(bindID); - + if (bindIndex == 0) bindIndex = resetBindToDefault(bindID); // Save bind diff -r f2d57e987ba9 -r 4821897a0f10 QTfrontend/ui/page/pagevideos.cpp --- a/QTfrontend/ui/page/pagevideos.cpp Fri Jan 25 12:54:24 2013 +0100 +++ b/QTfrontend/ui/page/pagevideos.cpp Fri Jan 25 13:59:27 2013 +0100 @@ -173,7 +173,7 @@ labelDesc = new QLabel(pDescGroup); labelDesc->setAlignment(Qt::AlignLeft | Qt::AlignTop); labelDesc->setTextInteractionFlags(Qt::TextSelectableByMouse | - Qt::TextSelectableByKeyboard | + Qt::TextSelectableByKeyboard | Qt::LinksAccessibleByMouse | Qt::LinksAccessibleByKeyboard); labelDesc->setTextFormat(Qt::RichText); diff -r f2d57e987ba9 -r 4821897a0f10 QTfrontend/ui/widget/about.cpp --- a/QTfrontend/ui/widget/about.cpp Fri Jan 25 12:54:24 2013 +0100 +++ b/QTfrontend/ui/widget/about.cpp Fri Jan 25 13:59:27 2013 +0100 @@ -78,7 +78,7 @@ lbl2 = new QTextBrowser(this); lbl2->setOpenExternalLinks(true); - QUrl localpage = QUrl::fromLocalFile(":/res/html/about.html"); + QUrl localpage = QUrl::fromLocalFile(":/res/html/about.html"); lbl2->setSource(localpage); //sets the source of the label from the file above mainLayout->addWidget(lbl2, 1, 1); diff -r f2d57e987ba9 -r 4821897a0f10 QTfrontend/ui/widget/colorwidget.h --- a/QTfrontend/ui/widget/colorwidget.h Fri Jan 25 12:54:24 2013 +0100 +++ b/QTfrontend/ui/widget/colorwidget.h Fri Jan 25 13:59:27 2013 +0100 @@ -13,7 +13,7 @@ class ColorWidget : public QFrame { Q_OBJECT - + public: explicit ColorWidget(QStandardItemModel *colorsModel, QWidget *parent = 0); ~ColorWidget(); @@ -24,7 +24,7 @@ signals: void colorChanged(int color); - + private: int m_color; QStandardItemModel * m_colorsModel; diff -r f2d57e987ba9 -r 4821897a0f10 QTfrontend/ui/widget/feedbackdialog.cpp --- a/QTfrontend/ui/widget/feedbackdialog.cpp Fri Jan 25 12:54:24 2013 +0100 +++ b/QTfrontend/ui/widget/feedbackdialog.cpp Fri Jan 25 13:59:27 2013 +0100 @@ -53,19 +53,19 @@ FeedbackDialog::FeedbackDialog(QWidget * parent) : QDialog(parent) { - setModal(true); - setWindowFlags(Qt::Sheet); - setWindowModality(Qt::WindowModal); - setMinimumSize(700, 460); - resize(700, 460); - setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); + setModal(true); + setWindowFlags(Qt::Sheet); + setWindowModality(Qt::WindowModal); + setMinimumSize(700, 460); + resize(700, 460); + setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); - netManager = NULL; - GenerateSpecs(); + netManager = NULL; + GenerateSpecs(); - /* Top layout */ + /* Top layout */ - QVBoxLayout * pageLayout = new QVBoxLayout(); + QVBoxLayout * pageLayout = new QVBoxLayout(); QHBoxLayout * summaryLayout = new QHBoxLayout(); QHBoxLayout * emailLayout = new QHBoxLayout(); QHBoxLayout * descriptionLayout = new QHBoxLayout(); @@ -96,7 +96,7 @@ email = new QLineEdit(); emailLayout->addWidget(email); summaryEmailLayout->addLayout(emailLayout); - + label_summary = new QLabel(); label_summary->setText(QLabel::tr("Summary")); label_summary->setFixedWidth(labelWidth); @@ -104,7 +104,7 @@ summary = new QLineEdit(); summaryLayout->addWidget(summary); summaryEmailLayout->addLayout(summaryLayout); - + combinedTopLayout->addLayout(summaryEmailLayout); CheckSendSpecs = new QCheckBox(); @@ -163,7 +163,7 @@ bottomLayout->addLayout(captchaLayout); bottomLayout->addSpacing(40); - + // TODO: Set green arrow icon for send button (:/res/Start.png) BtnSend = new QPushButton(tr("Send Feedback")); bottomLayout->addWidget(BtnSend, 0); @@ -373,7 +373,7 @@ QString url = "http://hedgewars.org/feedback/?captcha&id="; url += QString::number(captchaID); - + QNetworkAccessManager *netManager = GetNetManager(); QUrl captchaURL(url); QNetworkRequest req(captchaURL); @@ -424,7 +424,7 @@ infoMsg.exec(); accept(); - + return; } else @@ -437,7 +437,7 @@ void FeedbackDialog::SendFeedback() { // Get form data - + QString summary = this->summary->text(); QString description = this->description->toPlainText(); QString email = this->email->text(); @@ -452,7 +452,7 @@ } // Submit issue to PHP script - + QByteArray body; body.append("captcha="); body.append(captchaID); @@ -471,14 +471,14 @@ body.append("&specs="); body.append(QUrl::toPercentEncoding(specs)); } - + nam = new QNetworkAccessManager(this); connect(nam, SIGNAL(finished(QNetworkReply*)), this, SLOT(finishedSlot(QNetworkReply*))); - + QNetworkRequest header(QUrl("http://hedgewars.org/feedback/?submit")); header.setRawHeader("Content-Length", QString::number(body.size()).toAscii()); header.setRawHeader("Content-Type", "application/x-www-form-urlencoded"); - + nam->post(header, body); } diff -r f2d57e987ba9 -r 4821897a0f10 QTfrontend/ui/widget/flowlayout.cpp --- a/QTfrontend/ui/widget/flowlayout.cpp Fri Jan 25 12:54:24 2013 +0100 +++ b/QTfrontend/ui/widget/flowlayout.cpp Fri Jan 25 13:59:27 2013 +0100 @@ -41,150 +41,150 @@ #include #include "flowlayout.h" - - FlowLayout::FlowLayout(QWidget *parent, int margin, int hSpacing, int vSpacing) - : QLayout(parent), m_hSpace(hSpacing), m_vSpace(vSpacing) - { - setContentsMargins(margin, margin, margin, margin); - } - FlowLayout::FlowLayout(int margin, int hSpacing, int vSpacing) - : m_hSpace(hSpacing), m_vSpace(vSpacing) - { - setContentsMargins(margin, margin, margin, margin); - } +FlowLayout::FlowLayout(QWidget *parent, int margin, int hSpacing, int vSpacing) + : QLayout(parent), m_hSpace(hSpacing), m_vSpace(vSpacing) +{ + setContentsMargins(margin, margin, margin, margin); +} + +FlowLayout::FlowLayout(int margin, int hSpacing, int vSpacing) + : m_hSpace(hSpacing), m_vSpace(vSpacing) +{ + setContentsMargins(margin, margin, margin, margin); +} - FlowLayout::~FlowLayout() - { - QLayoutItem *item; - while ((item = takeAt(0))) - delete item; - } +FlowLayout::~FlowLayout() +{ + QLayoutItem *item; + while ((item = takeAt(0))) + delete item; +} - void FlowLayout::addItem(QLayoutItem *item) - { - itemList.append(item); - } +void FlowLayout::addItem(QLayoutItem *item) +{ + itemList.append(item); +} - int FlowLayout::horizontalSpacing() const - { - if (m_hSpace >= 0) { - return m_hSpace; - } else { - return smartSpacing(QStyle::PM_LayoutHorizontalSpacing); - } - } +int FlowLayout::horizontalSpacing() const +{ + if (m_hSpace >= 0) { + return m_hSpace; + } else { + return smartSpacing(QStyle::PM_LayoutHorizontalSpacing); + } +} - int FlowLayout::verticalSpacing() const - { - if (m_vSpace >= 0) { - return m_vSpace; - } else { - return smartSpacing(QStyle::PM_LayoutVerticalSpacing); - } - } +int FlowLayout::verticalSpacing() const +{ + if (m_vSpace >= 0) { + return m_vSpace; + } else { + return smartSpacing(QStyle::PM_LayoutVerticalSpacing); + } +} - int FlowLayout::count() const - { - return itemList.size(); - } +int FlowLayout::count() const +{ + return itemList.size(); +} - QLayoutItem *FlowLayout::itemAt(int index) const - { - return itemList.value(index); - } +QLayoutItem *FlowLayout::itemAt(int index) const +{ + return itemList.value(index); +} - QLayoutItem *FlowLayout::takeAt(int index) - { - if (index >= 0 && index < itemList.size()) - return itemList.takeAt(index); - else - return 0; - } +QLayoutItem *FlowLayout::takeAt(int index) +{ + if (index >= 0 && index < itemList.size()) + return itemList.takeAt(index); + else + return 0; +} - Qt::Orientations FlowLayout::expandingDirections() const - { - return 0; - } +Qt::Orientations FlowLayout::expandingDirections() const +{ + return 0; +} - bool FlowLayout::hasHeightForWidth() const - { - return true; - } +bool FlowLayout::hasHeightForWidth() const +{ + return true; +} - int FlowLayout::heightForWidth(int width) const - { - int height = doLayout(QRect(0, 0, width, 0), true); - return height; - } +int FlowLayout::heightForWidth(int width) const +{ + int height = doLayout(QRect(0, 0, width, 0), true); + return height; +} - void FlowLayout::setGeometry(const QRect &rect) - { - QLayout::setGeometry(rect); - doLayout(rect, false); - } +void FlowLayout::setGeometry(const QRect &rect) +{ + QLayout::setGeometry(rect); + doLayout(rect, false); +} - QSize FlowLayout::sizeHint() const - { - return minimumSize(); - } +QSize FlowLayout::sizeHint() const +{ + return minimumSize(); +} - QSize FlowLayout::minimumSize() const - { - QSize size; - QLayoutItem *item; - foreach (item, itemList) - size = size.expandedTo(item->minimumSize()); +QSize FlowLayout::minimumSize() const +{ + QSize size; + QLayoutItem *item; + foreach (item, itemList) + size = size.expandedTo(item->minimumSize()); - size += QSize(2*margin(), 2*margin()); - return size; - } + size += QSize(2*margin(), 2*margin()); + return size; +} - int FlowLayout::doLayout(const QRect &rect, bool testOnly) const - { - int left, top, right, bottom; - getContentsMargins(&left, &top, &right, &bottom); - QRect effectiveRect = rect.adjusted(+left, +top, -right, -bottom); - int x = effectiveRect.x(); - int y = effectiveRect.y(); - int lineHeight = 0; +int FlowLayout::doLayout(const QRect &rect, bool testOnly) const +{ + int left, top, right, bottom; + getContentsMargins(&left, &top, &right, &bottom); + QRect effectiveRect = rect.adjusted(+left, +top, -right, -bottom); + int x = effectiveRect.x(); + int y = effectiveRect.y(); + int lineHeight = 0; - QLayoutItem *item; - foreach (item, itemList) { - QWidget *wid = item->widget(); - int spaceX = horizontalSpacing(); - if (spaceX == -1) - spaceX = wid->style()->layoutSpacing( - QSizePolicy::PushButton, QSizePolicy::PushButton, Qt::Horizontal); - int spaceY = verticalSpacing(); - if (spaceY == -1) - spaceY = wid->style()->layoutSpacing( - QSizePolicy::PushButton, QSizePolicy::PushButton, Qt::Vertical); - int nextX = x + item->sizeHint().width() + spaceX; - if (nextX - spaceX > effectiveRect.right() && lineHeight > 0) { - x = effectiveRect.x(); - y = y + lineHeight + spaceY; - nextX = x + item->sizeHint().width() + spaceX; - lineHeight = 0; - } + QLayoutItem *item; + foreach (item, itemList) { + QWidget *wid = item->widget(); + int spaceX = horizontalSpacing(); + if (spaceX == -1) + spaceX = wid->style()->layoutSpacing( + QSizePolicy::PushButton, QSizePolicy::PushButton, Qt::Horizontal); + int spaceY = verticalSpacing(); + if (spaceY == -1) + spaceY = wid->style()->layoutSpacing( + QSizePolicy::PushButton, QSizePolicy::PushButton, Qt::Vertical); + int nextX = x + item->sizeHint().width() + spaceX; + if (nextX - spaceX > effectiveRect.right() && lineHeight > 0) { + x = effectiveRect.x(); + y = y + lineHeight + spaceY; + nextX = x + item->sizeHint().width() + spaceX; + lineHeight = 0; + } - if (!testOnly) - item->setGeometry(QRect(QPoint(x, y), item->sizeHint())); + if (!testOnly) + item->setGeometry(QRect(QPoint(x, y), item->sizeHint())); - x = nextX; - lineHeight = qMax(lineHeight, item->sizeHint().height()); - } - return y + lineHeight - rect.y() + bottom; - } - int FlowLayout::smartSpacing(QStyle::PixelMetric pm) const - { - QObject *parent = this->parent(); - if (!parent) { - return -1; - } else if (parent->isWidgetType()) { - QWidget *pw = static_cast(parent); - return pw->style()->pixelMetric(pm, 0, pw); - } else { - return static_cast(parent)->spacing(); - } - } + x = nextX; + lineHeight = qMax(lineHeight, item->sizeHint().height()); + } + return y + lineHeight - rect.y() + bottom; +} +int FlowLayout::smartSpacing(QStyle::PixelMetric pm) const +{ + QObject *parent = this->parent(); + if (!parent) { + return -1; + } else if (parent->isWidgetType()) { + QWidget *pw = static_cast(parent); + return pw->style()->pixelMetric(pm, 0, pw); + } else { + return static_cast(parent)->spacing(); + } +} diff -r f2d57e987ba9 -r 4821897a0f10 QTfrontend/ui/widget/gamecfgwidget.cpp --- a/QTfrontend/ui/widget/gamecfgwidget.cpp Fri Jan 25 12:54:24 2013 +0100 +++ b/QTfrontend/ui/widget/gamecfgwidget.cpp Fri Jan 25 13:59:27 2013 +0100 @@ -262,7 +262,7 @@ if (schemeData(18).toBool()) result |= 0x00080000; // ai survival if (schemeData(19).toBool()) - result |= 0x00100000; // infinite attacks + result |= 0x00100000; // infinite attacks if (schemeData(20).toBool()) result |= 0x00200000; // reset weaps if (schemeData(21).toBool()) diff -r f2d57e987ba9 -r 4821897a0f10 QTfrontend/ui/widget/hatbutton.cpp --- a/QTfrontend/ui/widget/hatbutton.cpp Fri Jan 25 12:54:24 2013 +0100 +++ b/QTfrontend/ui/widget/hatbutton.cpp Fri Jan 25 13:59:27 2013 +0100 @@ -25,48 +25,48 @@ HatButton::HatButton(QWidget* parent) : QPushButton(parent) { - setIconSize(QSize(32, 37)); - setFixedSize(44, 44); + setIconSize(QSize(32, 37)); + setFixedSize(44, 44); - m_hatModel = DataManager::instance().hatModel(); - connect(this, SIGNAL(clicked()), this, SLOT(showPrompt())); + m_hatModel = DataManager::instance().hatModel(); + connect(this, SIGNAL(clicked()), this, SLOT(showPrompt())); - setCurrentIndex(0); + setCurrentIndex(0); } void HatButton::setCurrentIndex(int index) { - m_hat = m_hatModel->index(index, 0); - setWhatsThis(QString(tr("Change hat (%1)")).arg(m_hat.data(Qt::DisplayRole).toString())); - setToolTip(m_hat.data(Qt::DisplayRole).toString()); - setIcon(m_hat.data(Qt::DecorationRole).value()); + m_hat = m_hatModel->index(index, 0); + setWhatsThis(QString(tr("Change hat (%1)")).arg(m_hat.data(Qt::DisplayRole).toString())); + setToolTip(m_hat.data(Qt::DisplayRole).toString()); + setIcon(m_hat.data(Qt::DecorationRole).value()); } int HatButton::currentIndex() { - return m_hat.row(); + return m_hat.row(); } void HatButton::setCurrentHat(const QString & name) { - QList hats = m_hatModel->findItems(name); + QList hats = m_hatModel->findItems(name); - if (hats.count() > 0) - setCurrentIndex(hats[0]->row()); + if (hats.count() > 0) + setCurrentIndex(hats[0]->row()); } QString HatButton::currentHat() const { - return m_hat.data(Qt::DisplayRole).toString(); + return m_hat.data(Qt::DisplayRole).toString(); } void HatButton::showPrompt() { - HatPrompt prompt(currentIndex(), this); - int hatID = prompt.exec() - 1; // Since 0 means canceled, so all indexes are +1'd - if (hatID < 0) return; + HatPrompt prompt(currentIndex(), this); + int hatID = prompt.exec() - 1; // Since 0 means canceled, so all indexes are +1'd + if (hatID < 0) return; - setCurrentIndex(hatID); - emit currentIndexChanged(hatID); - emit currentHatChanged(currentHat()); + setCurrentIndex(hatID); + emit currentIndexChanged(hatID); + emit currentHatChanged(currentHat()); } diff -r f2d57e987ba9 -r 4821897a0f10 QTfrontend/ui/widget/hatbutton.h --- a/QTfrontend/ui/widget/hatbutton.h Fri Jan 25 12:54:24 2013 +0100 +++ b/QTfrontend/ui/widget/hatbutton.h Fri Jan 25 13:59:27 2013 +0100 @@ -37,16 +37,16 @@ QString currentHat() const; private: - QModelIndex m_hat; - HatModel * m_hatModel; + QModelIndex m_hat; + HatModel * m_hatModel; signals: - void currentIndexChanged(int); - void currentHatChanged(const QString &); + void currentIndexChanged(int); + void currentHatChanged(const QString &); public slots: - void setCurrentIndex(int index); - void setCurrentHat(const QString & name); + void setCurrentIndex(int index); + void setCurrentHat(const QString & name); private slots: void showPrompt(); diff -r f2d57e987ba9 -r 4821897a0f10 QTfrontend/ui/widget/hatprompt.cpp --- a/QTfrontend/ui/widget/hatprompt.cpp Fri Jan 25 12:54:24 2013 +0100 +++ b/QTfrontend/ui/widget/hatprompt.cpp Fri Jan 25 13:59:27 2013 +0100 @@ -37,31 +37,31 @@ HatPrompt::HatPrompt(int currentIndex, QWidget* parent) : QDialog(parent) { - setModal(true); - setWindowFlags(Qt::Sheet); - setWindowModality(Qt::WindowModal); - setMinimumSize(550, 430); - resize(550, 430); - setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); + setModal(true); + setWindowFlags(Qt::Sheet); + setWindowModality(Qt::WindowModal); + setMinimumSize(550, 430); + resize(550, 430); + setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); - setStyleSheet("QPushButton { padding: 5px; margin-top: 10px; }"); + setStyleSheet("QPushButton { padding: 5px; margin-top: 10px; }"); - // Hat model, and a model for setting a filter - HatModel * hatModel = DataManager::instance().hatModel(); - filterModel = new QSortFilterProxyModel(); - filterModel->setSourceModel(hatModel); - filterModel->setFilterCaseSensitivity(Qt::CaseInsensitive); + // Hat model, and a model for setting a filter + HatModel * hatModel = DataManager::instance().hatModel(); + filterModel = new QSortFilterProxyModel(); + filterModel->setSourceModel(hatModel); + filterModel->setFilterCaseSensitivity(Qt::CaseInsensitive); - // Grid - QGridLayout * dialogLayout = new QGridLayout(this); - dialogLayout->setSpacing(0); - dialogLayout->setColumnStretch(1, 1); + // Grid + QGridLayout * dialogLayout = new QGridLayout(this); + dialogLayout->setSpacing(0); + dialogLayout->setColumnStretch(1, 1); - QHBoxLayout * topLayout = new QHBoxLayout(); + QHBoxLayout * topLayout = new QHBoxLayout(); - // Help/prompt message at top - QLabel * lblDesc = new QLabel(tr("Select a hat")); - lblDesc->setObjectName("lblDesc"); + // Help/prompt message at top + QLabel * lblDesc = new QLabel(tr("Select a hat")); + lblDesc->setObjectName("lblDesc"); lblDesc->setStyleSheet("#lblDesc { color: #130F2A; background: #F6CB1C; border: solid 4px #F6CB1C; border-top-left-radius: 10px; padding: 4px 10px;}"); lblDesc->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); lblDesc->setFixedHeight(24); @@ -99,71 +99,71 @@ topLayout->addWidget(corner, 0, Qt::AlignBottom); topLayout->addStretch(1); - // Cancel button (closes dialog) - QPushButton * btnCancel = new QPushButton(tr("Cancel")); - connect(btnCancel, SIGNAL(clicked()), this, SLOT(reject())); + // Cancel button (closes dialog) + QPushButton * btnCancel = new QPushButton(tr("Cancel")); + connect(btnCancel, SIGNAL(clicked()), this, SLOT(reject())); - // Select button - QPushButton * btnSelect = new QPushButton(tr("Use selected hat")); - btnSelect->setDefault(true); - connect(btnSelect, SIGNAL(clicked()), this, SLOT(onAccepted())); + // Select button + QPushButton * btnSelect = new QPushButton(tr("Use selected hat")); + btnSelect->setDefault(true); + connect(btnSelect, SIGNAL(clicked()), this, SLOT(onAccepted())); - // Add hats - list = new HatListView(); - list->setModel(filterModel); - list->setViewMode(QListView::IconMode); - list->setResizeMode(QListView::Adjust); - list->setMovement(QListView::Static); - list->setEditTriggers(QAbstractItemView::NoEditTriggers); - list->setSpacing(8); - list->setWordWrap(true); - list->setSelectionMode(QAbstractItemView::SingleSelection); - list->setObjectName("hatList"); - list->setCurrentIndex(filterModel->index(currentIndex, 0)); - connect(list, SIGNAL(activated(const QModelIndex &)), this, SLOT(hatChosen(const QModelIndex &))); - connect(list, SIGNAL(clicked(const QModelIndex &)), this, SLOT(hatChosen(const QModelIndex &))); + // Add hats + list = new HatListView(); + list->setModel(filterModel); + list->setViewMode(QListView::IconMode); + list->setResizeMode(QListView::Adjust); + list->setMovement(QListView::Static); + list->setEditTriggers(QAbstractItemView::NoEditTriggers); + list->setSpacing(8); + list->setWordWrap(true); + list->setSelectionMode(QAbstractItemView::SingleSelection); + list->setObjectName("hatList"); + list->setCurrentIndex(filterModel->index(currentIndex, 0)); + connect(list, SIGNAL(activated(const QModelIndex &)), this, SLOT(hatChosen(const QModelIndex &))); + connect(list, SIGNAL(clicked(const QModelIndex &)), this, SLOT(hatChosen(const QModelIndex &))); - // Add elements to layouts - dialogLayout->addLayout(topLayout, 0, 0, 1, 3); - dialogLayout->addWidget(list, 1, 0, 1, 3); - dialogLayout->addWidget(btnCancel, 2, 0, 1, 1, Qt::AlignLeft); - dialogLayout->addWidget(btnSelect, 2, 2, 1, 1, Qt::AlignRight); + // Add elements to layouts + dialogLayout->addLayout(topLayout, 0, 0, 1, 3); + dialogLayout->addWidget(list, 1, 0, 1, 3); + dialogLayout->addWidget(btnCancel, 2, 0, 1, 1, Qt::AlignLeft); + dialogLayout->addWidget(btnSelect, 2, 2, 1, 1, Qt::AlignRight); } void HatPrompt::moveUp() { - list->setCurrentIndex(list->moveCursor(QAbstractItemView::MoveUp, Qt::NoModifier)); + list->setCurrentIndex(list->moveCursor(QAbstractItemView::MoveUp, Qt::NoModifier)); } void HatPrompt::moveDown() { - list->setCurrentIndex(list->moveCursor(QAbstractItemView::MoveDown, Qt::NoModifier)); + list->setCurrentIndex(list->moveCursor(QAbstractItemView::MoveDown, Qt::NoModifier)); } void HatPrompt::moveLeft() { - list->setCurrentIndex(list->moveCursor(QAbstractItemView::MoveLeft, Qt::NoModifier)); + list->setCurrentIndex(list->moveCursor(QAbstractItemView::MoveLeft, Qt::NoModifier)); } void HatPrompt::moveRight() { - list->setCurrentIndex(list->moveCursor(QAbstractItemView::MoveRight, Qt::NoModifier)); + list->setCurrentIndex(list->moveCursor(QAbstractItemView::MoveRight, Qt::NoModifier)); } void HatPrompt::onAccepted() { - hatChosen(list->currentIndex()); + hatChosen(list->currentIndex()); } // When a hat is selected void HatPrompt::hatChosen(const QModelIndex & index) { - done(filterModel->mapToSource(index).row() + 1); // Since returning 0 means canceled + done(filterModel->mapToSource(index).row() + 1); // Since returning 0 means canceled } // When the text in the filter text box is changed void HatPrompt::filterChanged(const QString & text) { - filterModel->setFilterFixedString(text); - list->setCurrentIndex(filterModel->index(0, 0)); + filterModel->setFilterFixedString(text); + list->setCurrentIndex(filterModel->index(0, 0)); } diff -r f2d57e987ba9 -r 4821897a0f10 QTfrontend/ui/widget/hatprompt.h --- a/QTfrontend/ui/widget/hatprompt.h Fri Jan 25 12:54:24 2013 +0100 +++ b/QTfrontend/ui/widget/hatprompt.h Fri Jan 25 13:59:27 2013 +0100 @@ -30,9 +30,9 @@ class HatListView : public QListView { - friend class HatPrompt; + friend class HatPrompt; - public: + public: HatListView(QWidget* parent = 0) : QListView(parent){} }; @@ -49,7 +49,7 @@ QSortFilterProxyModel * filterModel; private slots: - void onAccepted(); + void onAccepted(); void hatChosen(const QModelIndex & index); void filterChanged(const QString & text); void moveUp(); diff -r f2d57e987ba9 -r 4821897a0f10 QTfrontend/ui/widget/keybinder.cpp --- a/QTfrontend/ui/widget/keybinder.cpp Fri Jan 25 12:54:24 2013 +0100 +++ b/QTfrontend/ui/widget/keybinder.cpp Fri Jan 25 13:59:27 2013 +0100 @@ -38,12 +38,12 @@ { this->defaultText = defaultText; enableSignal = false; - + // Two-column tab layout QHBoxLayout * pageKeysLayout = new QHBoxLayout(this); pageKeysLayout->setSpacing(0); pageKeysLayout->setContentsMargins(0, 0, 0, 0); - + // Table for category list QVBoxLayout * catListContainer = new QVBoxLayout(); catListContainer->setContentsMargins(10, 10, 10, 10); @@ -122,12 +122,12 @@ { // Add stretch at end of previous layout if (curLayout != NULL) curLayout->insertStretch(-1, 1); - + // Category list item QListWidgetItem * catItem = new QListWidgetItem(HWApplication::translate("binds (categories)", cbinds[i].category)); catItem->setSizeHint(catSize); catList->addItem(catItem); - + // Create new page curPage = new QWidget(); curLayout = new QVBoxLayout(curPage); @@ -170,7 +170,7 @@ comboBox->setModel((QAbstractItemModel*)DataManager::instance().bindsModel()); comboBox->setVisible(false); comboBox->setFixedWidth(200); - + // Table row int row = curTable->rowCount(); QTableWidgetItem * nameCell = new QTableWidgetItem(HWApplication::translate("binds", cbinds[i].name)); @@ -241,7 +241,7 @@ QComboBox * box = bindCellComboBoxMappings->value(item); QTableWidget * table = item->tableWidget(); QFrame * frame = box->findChild(); - + box->showPopup(); frame->move( frame->x() + table->horizontalHeader()->sectionSize(0), @@ -279,7 +279,7 @@ void KeyBinder::resetInterface() { enableSignal = false; - + catList->setCurrentItem(catList->item(1)); changeBindingsPage(1); if (selectedBindTable != NULL) @@ -287,7 +287,7 @@ selectedBindTable->clearSelection(); selectedBindTable = NULL; } - + // Default bind text DataManager::instance().bindsModel()->item(0)->setData(defaultText, Qt::DisplayRole); for (int i = 0; i < BINDS_NUMBER; i++) diff -r f2d57e987ba9 -r 4821897a0f10 QTfrontend/ui/widget/lineeditcursor.cpp --- a/QTfrontend/ui/widget/lineeditcursor.cpp Fri Jan 25 12:54:24 2013 +0100 +++ b/QTfrontend/ui/widget/lineeditcursor.cpp Fri Jan 25 13:59:27 2013 +0100 @@ -22,14 +22,14 @@ void LineEditCursor::keyPressEvent(QKeyEvent * event) { - if (event->key() == Qt::Key_Up) - emit moveUp(); - else if (event->key() == Qt::Key_Down) - emit moveDown(); - else if (event->key() == Qt::Key_Left) - emit moveLeft(); - else if (event->key() == Qt::Key_Right) - emit moveRight(); - else - QLineEdit::keyPressEvent(event); + if (event->key() == Qt::Key_Up) + emit moveUp(); + else if (event->key() == Qt::Key_Down) + emit moveDown(); + else if (event->key() == Qt::Key_Left) + emit moveLeft(); + else if (event->key() == Qt::Key_Right) + emit moveRight(); + else + QLineEdit::keyPressEvent(event); } diff -r f2d57e987ba9 -r 4821897a0f10 QTfrontend/ui/widget/mapContainer.cpp --- a/QTfrontend/ui/widget/mapContainer.cpp Fri Jan 25 12:54:24 2013 +0100 +++ b/QTfrontend/ui/widget/mapContainer.cpp Fri Jan 25 13:59:27 2013 +0100 @@ -889,7 +889,7 @@ { if (master == m_master) return; m_master = master; - + foreach (QWidget *widget, m_childWidgets) widget->setEnabled(master); } diff -r f2d57e987ba9 -r 4821897a0f10 QTfrontend/ui/widget/seedprompt.cpp --- a/QTfrontend/ui/widget/seedprompt.cpp Fri Jan 25 12:54:24 2013 +0100 +++ b/QTfrontend/ui/widget/seedprompt.cpp Fri Jan 25 13:59:27 2013 +0100 @@ -28,58 +28,58 @@ SeedPrompt::SeedPrompt(QWidget* parent, const QString & seed, bool editable) : QDialog(parent) { - setModal(true); - setWindowFlags(Qt::Sheet); - setWindowModality(Qt::WindowModal); - setMinimumSize(360, 160); - resize(360, 160); - setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); + setModal(true); + setWindowFlags(Qt::Sheet); + setWindowModality(Qt::WindowModal); + setMinimumSize(360, 160); + resize(360, 160); + setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); - // Layout - QVBoxLayout * dialogLayout = new QVBoxLayout(this); + // Layout + QVBoxLayout * dialogLayout = new QVBoxLayout(this); - // Label - QLabel * label = new QLabel(tr("The map seed is the basis for all random values generated by the game.")); - label->setWordWrap(true); - dialogLayout->addWidget(label, 0); + // Label + QLabel * label = new QLabel(tr("The map seed is the basis for all random values generated by the game.")); + label->setWordWrap(true); + dialogLayout->addWidget(label, 0); - // Input box - editBox = new QLineEdit(); - editBox->setText(seed); - editBox->setReadOnly(!editable); - editBox->setStyleSheet("QLineEdit { padding: 3px; }"); - dialogLayout->addWidget(editBox, 1); + // Input box + editBox = new QLineEdit(); + editBox->setText(seed); + editBox->setReadOnly(!editable); + editBox->setStyleSheet("QLineEdit { padding: 3px; }"); + dialogLayout->addWidget(editBox, 1); - dialogLayout->addStretch(1); + dialogLayout->addStretch(1); - // Buttons - QHBoxLayout * buttonLayout = new QHBoxLayout(); - buttonLayout->addStretch(1); - dialogLayout->addLayout(buttonLayout); - if (editable) - { - QPushButton * btnCancel = new QPushButton(tr("Cancel")); - QPushButton * btnOkay = new QPushButton(tr("Set seed")); - connect(btnCancel, SIGNAL(clicked()), this, SLOT(reject())); - connect(btnOkay, SIGNAL(clicked()), this, SLOT(accept())); - buttonLayout->addWidget(btnCancel); - buttonLayout->addWidget(btnOkay); - btnOkay->setDefault(true); - } - else - { - QPushButton * btnClose = new QPushButton(tr("Close")); - connect(btnClose, SIGNAL(clicked()), this, SLOT(reject())); - buttonLayout->addWidget(btnClose); - btnClose->setDefault(true); - } + // Buttons + QHBoxLayout * buttonLayout = new QHBoxLayout(); + buttonLayout->addStretch(1); + dialogLayout->addLayout(buttonLayout); + if (editable) + { + QPushButton * btnCancel = new QPushButton(tr("Cancel")); + QPushButton * btnOkay = new QPushButton(tr("Set seed")); + connect(btnCancel, SIGNAL(clicked()), this, SLOT(reject())); + connect(btnOkay, SIGNAL(clicked()), this, SLOT(accept())); + buttonLayout->addWidget(btnCancel); + buttonLayout->addWidget(btnOkay); + btnOkay->setDefault(true); + } + else + { + QPushButton * btnClose = new QPushButton(tr("Close")); + connect(btnClose, SIGNAL(clicked()), this, SLOT(reject())); + buttonLayout->addWidget(btnClose); + btnClose->setDefault(true); + } - setStyleSheet("QPushButton { padding: 5px; }"); + setStyleSheet("QPushButton { padding: 5px; }"); - connect(this, SIGNAL(accepted()), this, SLOT(setSeed())); + connect(this, SIGNAL(accepted()), this, SLOT(setSeed())); } void SeedPrompt::setSeed() { - emit seedSelected(editBox->text()); + emit seedSelected(editBox->text()); } diff -r f2d57e987ba9 -r 4821897a0f10 QTfrontend/ui/widget/seedprompt.h --- a/QTfrontend/ui/widget/seedprompt.h Fri Jan 25 12:54:24 2013 +0100 +++ b/QTfrontend/ui/widget/seedprompt.h Fri Jan 25 13:59:27 2013 +0100 @@ -31,13 +31,13 @@ SeedPrompt(QWidget* parent, const QString & seed, bool editable); signals: - void seedSelected(const QString & seed); + void seedSelected(const QString & seed); private slots: - void setSeed(); + void setSeed(); private: - QLineEdit * editBox; + QLineEdit * editBox; }; #endif // SEEDPROMPT_H diff -r f2d57e987ba9 -r 4821897a0f10 QTfrontend/ui/widget/themeprompt.cpp --- a/QTfrontend/ui/widget/themeprompt.cpp Fri Jan 25 12:54:24 2013 +0100 +++ b/QTfrontend/ui/widget/themeprompt.cpp Fri Jan 25 13:59:27 2013 +0100 @@ -32,29 +32,29 @@ ThemePrompt::ThemePrompt(QWidget* parent) : QDialog(parent) { - setModal(true); - setWindowFlags(Qt::Sheet); - setWindowModality(Qt::WindowModal); - setMinimumSize(550, 430); - resize(550, 430); - setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); + setModal(true); + setWindowFlags(Qt::Sheet); + setWindowModality(Qt::WindowModal); + setMinimumSize(550, 430); + resize(550, 430); + setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); - // Grid - QVBoxLayout * dialogLayout = new QVBoxLayout(this); - dialogLayout->setSpacing(0); + // Grid + QVBoxLayout * dialogLayout = new QVBoxLayout(this); + dialogLayout->setSpacing(0); - // Help/prompt message at top - QLabel * lblDesc = new QLabel(tr("Select a theme for this map")); + // Help/prompt message at top + QLabel * lblDesc = new QLabel(tr("Select a theme for this map")); lblDesc->setStyleSheet("color: #130F2A; background: #F6CB1C; border: solid 4px #F6CB1C; border-top-left-radius: 10px; border-top-right-radius: 10px; padding: auto 20px;"); lblDesc->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); lblDesc->setFixedHeight(24); lblDesc->setMinimumWidth(0); - // Scroll area and container for theme icons - QWidget * themesContainer = new QWidget(); - FlowLayout * themesGrid = new FlowLayout(); - themesContainer->setLayout(themesGrid); - QScrollArea * scrollArea = new QScrollArea(); + // Scroll area and container for theme icons + QWidget * themesContainer = new QWidget(); + FlowLayout * themesGrid = new FlowLayout(); + themesContainer->setLayout(themesGrid); + QScrollArea * scrollArea = new QScrollArea(); scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); scrollArea->setObjectName("scrollArea"); scrollArea->setStyleSheet("QScrollBar, #scrollArea { background-color: #130F2A; } #scrollArea { border-color: #F6CB1C; border-width: 3px; border-top-width: 0; border-style: solid; border-bottom-left-radius: 10px; border-bottom-right-radius: 10px; }"); @@ -62,40 +62,40 @@ scrollArea->setFrameShape(QFrame::NoFrame); scrollArea->setWidget(themesContainer); - // Cancel button (closes dialog) - QPushButton * btnCancel = new QPushButton(tr("Cancel")); - btnCancel->setStyleSheet("padding: 5px; margin-top: 10px;"); - connect(btnCancel, SIGNAL(clicked()), this, SLOT(reject())); + // Cancel button (closes dialog) + QPushButton * btnCancel = new QPushButton(tr("Cancel")); + btnCancel->setStyleSheet("padding: 5px; margin-top: 10px;"); + connect(btnCancel, SIGNAL(clicked()), this, SLOT(reject())); - // Add elements to layouts - dialogLayout->addWidget(lblDesc, 0); - dialogLayout->addWidget(scrollArea, 1); - dialogLayout->addWidget(btnCancel, 0, Qt::AlignLeft); + // Add elements to layouts + dialogLayout->addWidget(lblDesc, 0); + dialogLayout->addWidget(scrollArea, 1); + dialogLayout->addWidget(btnCancel, 0, Qt::AlignLeft); - // Tooltip label for theme name - lblToolTip = new QLabel(this); + // Tooltip label for theme name + lblToolTip = new QLabel(this); - // Add theme buttons - ThemeModel * themes = DataManager::instance().themeModel(); - for (int i = 0; i < themes->rowCount(); i++) - { - QModelIndex index = themes->index(i, 0); - QToolButton * btn = new QToolButton(); - bool dlc = themes->data(index, Qt::UserRole + 2).toBool(); - btn->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); - btn->setIcon(qVariantValue(themes->data(index, Qt::UserRole))); - btn->setText((dlc ? "*" : "") + themes->data(index, Qt::DisplayRole).toString()); - btn->setIconSize(QSize(60, 60)); - btn->setProperty("themeID", QVariant(i)); - btn->setStyleSheet("padding: 2px;"); - connect(btn, SIGNAL(clicked()), this, SLOT(themeClicked())); - themesGrid->addWidget(btn); - } + // Add theme buttons + ThemeModel * themes = DataManager::instance().themeModel(); + for (int i = 0; i < themes->rowCount(); i++) + { + QModelIndex index = themes->index(i, 0); + QToolButton * btn = new QToolButton(); + bool dlc = themes->data(index, Qt::UserRole + 2).toBool(); + btn->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); + btn->setIcon(qVariantValue(themes->data(index, Qt::UserRole))); + btn->setText((dlc ? "*" : "") + themes->data(index, Qt::DisplayRole).toString()); + btn->setIconSize(QSize(60, 60)); + btn->setProperty("themeID", QVariant(i)); + btn->setStyleSheet("padding: 2px;"); + connect(btn, SIGNAL(clicked()), this, SLOT(themeClicked())); + themesGrid->addWidget(btn); + } } // When a theme is selected void ThemePrompt::themeClicked() { - QWidget * btn = (QWidget*)sender(); - done(btn->property("themeID").toInt() + 1); // Since returning 0 means canceled + QWidget * btn = (QWidget*)sender(); + done(btn->property("themeID").toInt() + 1); // Since returning 0 means canceled } diff -r f2d57e987ba9 -r 4821897a0f10 QTfrontend/util/MessageDialog.cpp --- a/QTfrontend/util/MessageDialog.cpp Fri Jan 25 12:54:24 2013 +0100 +++ b/QTfrontend/util/MessageDialog.cpp Fri Jan 25 13:59:27 2013 +0100 @@ -30,7 +30,7 @@ int MessageDialog::ShowMessage(const QString & msg, const QString & title, QMessageBox::Icon icon, QWidget * parent) { - QMessageBox msgMsg(parent); + QMessageBox msgMsg(parent); msgMsg.setIcon(icon); msgMsg.setWindowTitle(title.isEmpty() ? QMessageBox::tr("Hedgewars") : title); msgMsg.setText(msg); diff -r f2d57e987ba9 -r 4821897a0f10 QTfrontend/util/MessageDialog.h --- a/QTfrontend/util/MessageDialog.h Fri Jan 25 12:54:24 2013 +0100 +++ b/QTfrontend/util/MessageDialog.h Fri Jan 25 13:59:27 2013 +0100 @@ -26,10 +26,10 @@ class MessageDialog { - public: - static int ShowErrorMessage(const QString & msg, QWidget * parent = 0); - static int ShowInfoMessage(const QString & msg, QWidget * parent = 0); - static int ShowMessage(const QString & msg, const QString & title = QString(), QMessageBox::Icon icon = QMessageBox::NoIcon, QWidget * parent = 0); + public: + static int ShowErrorMessage(const QString & msg, QWidget * parent = 0); + static int ShowInfoMessage(const QString & msg, QWidget * parent = 0); + static int ShowMessage(const QString & msg, const QString & title = QString(), QMessageBox::Icon icon = QMessageBox::NoIcon, QWidget * parent = 0); }; #endif diff -r f2d57e987ba9 -r 4821897a0f10 project_files/hedgewars.pro --- a/project_files/hedgewars.pro Fri Jan 25 12:54:24 2013 +0100 +++ b/project_files/hedgewars.pro Fri Jan 25 13:59:27 2013 +0100 @@ -93,7 +93,6 @@ ../QTfrontend/sdlkeys.h \ ../QTfrontend/ui/mouseoverfilter.h \ ../QTfrontend/ui/widget/qpushbuttonwithsound.h \ - ../QTfrontend/ui/page/pagefeedback.h \ ../QTfrontend/model/roomslistmodel.h \ ../QTfrontend/ui/dialog/input_password.h \ ../QTfrontend/ui/widget/colorwidget.h \