- 'net nickname' and 'server address' options are on PageNet
- Don't set bots process thread pointer to nil
--- a/QTfrontend/gameuiconfig.cpp Mon Aug 14 14:49:40 2006 +0000
+++ b/QTfrontend/gameuiconfig.cpp Wed Aug 16 11:41:00 2006 +0000
@@ -68,7 +68,11 @@
} else
if (str.startsWith("nick "))
{
- Form->ui.pageOptions->editNetNick->setText(str.mid(5));
+ Form->ui.pageNet->editNetNick->setText(str.mid(5));
+ } else
+ if (str.startsWith("ip "))
+ {
+ Form->ui.pageNet->editIP->setText(str.mid(3));
}
}
settings.close();
@@ -97,7 +101,8 @@
stream << "resolution " << Form->ui.pageOptions->CBResolution->currentIndex() << endl;
stream << "fullscreen " << Form->ui.pageOptions->CBFullscreen->isChecked() << endl;
stream << "sound " << Form->ui.pageOptions->CBEnableSound->isChecked() << endl;
- stream << "nick " << Form->ui.pageOptions->editNetNick->text() << endl;
+ stream << "nick " << Form->ui.pageNet->editNetNick->text() << endl;
+ stream << "ip " << Form->ui.pageNet->editIP->text() << endl;
settings.close();
}
--- a/QTfrontend/hwform.cpp Mon Aug 14 14:49:40 2006 +0000
+++ b/QTfrontend/hwform.cpp Wed Aug 16 11:41:00 2006 +0000
@@ -206,7 +206,8 @@
connect(hwnet, SIGNAL(AddGame(const QString &)), this, SLOT(AddGame(const QString &)));
connect(hwnet, SIGNAL(EnteredGame()), this, SLOT(NetGameEnter()));
connect(hwnet, SIGNAL(ChangeInTeams(const QStringList &)), this, SLOT(ChangeInNetTeams(const QStringList &)));
- hwnet->Connect("172.19.5.168", 6667, ui.pageOptions->editNetNick->text());
+ hwnet->Connect(ui.pageNet->editIP->text(), 6667, ui.pageNet->editNetNick->text());
+ config->SaveOptions();
}
void HWForm::NetDisconnect()
--- a/QTfrontend/pages.cpp Mon Aug 14 14:49:40 2006 +0000
+++ b/QTfrontend/pages.cpp Wed Aug 16 11:41:00 2006 +0000
@@ -331,21 +331,6 @@
CBEnableSound->setText(QCheckBox::tr("Enable sound"));
GBAlayout->addWidget(CBEnableSound, 0, 2);
- NNGroupBox = new QGroupBox(this);
- NNGroupBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
- NNGroupBox->setTitle(QGroupBox::tr("Net nick"));
- pageLayout->addWidget(NNGroupBox, 2, 0, 1, 3);
-
- QGridLayout * GBNlayout = new QGridLayout(NNGroupBox);
- label = new QLabel(NNGroupBox);
- label->setText(QLabel::tr("Net nick"));
- GBNlayout->addWidget(label, 0, 0);
-
- editNetNick = new QLineEdit(NNGroupBox);
- editNetNick->setMaxLength(30);
- editNetNick->setText(QLineEdit::tr("unnamed"));
- GBNlayout->addWidget(editNetNick, 0, 1);
-
pageLayout->addWidget(new QWidget(), 3, 0, 1, 3);
BtnSaveOptions = new QPushButton(this);
@@ -362,14 +347,43 @@
PageNet::PageNet(QWidget* parent) : QWidget(parent)
{
QFont * font14 = new QFont("MS Shell Dlg", 14);
+ QGridLayout * pageLayout = new QGridLayout(this);
+ pageLayout->setColumnStretch(0, 1);
+ pageLayout->setColumnStretch(1, 1);
+ pageLayout->setColumnStretch(2, 1);
+
+ NNGroupBox = new QGroupBox(this);
+ NNGroupBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
+ NNGroupBox->setTitle(QGroupBox::tr("Net options"));
+ pageLayout->addWidget(NNGroupBox, 1, 1);
+
+ QGridLayout * GBNlayout = new QGridLayout(NNGroupBox);
+ labelNN = new QLabel(NNGroupBox);
+ labelNN->setText(QLabel::tr("Net nick"));
+ GBNlayout->addWidget(labelNN, 0, 0);
+
+ editNetNick = new QLineEdit(NNGroupBox);
+ editNetNick->setMaxLength(20);
+ editNetNick->setText(QLineEdit::tr("unnamed"));
+ GBNlayout->addWidget(editNetNick, 0, 1);
+
+ labelIP = new QLabel(NNGroupBox);
+ labelIP->setText(QLabel::tr("Server address"));
+ GBNlayout->addWidget(labelIP, 1, 0);
+
+ editIP = new QLineEdit(NNGroupBox);
+ editIP->setMaxLength(50);
+ GBNlayout->addWidget(editIP, 1, 1);
+
BtnNetConnect = new QPushButton(this);
- BtnNetConnect->setGeometry(QRect(250, 140, 161, 41));
BtnNetConnect->setFont(*font14);
BtnNetConnect->setText(QPushButton::tr("Connect"));
+ pageLayout->addWidget(BtnNetConnect, 2, 2);
+
BtnBack = new QPushButton(this);
- BtnBack->setGeometry(QRect(250, 390, 161, 41));
BtnBack->setFont(*font14);
BtnBack->setText(QPushButton::tr("Back"));
+ pageLayout->addWidget(BtnBack, 2, 0);
}
PageNetChat::PageNetChat(QWidget* parent) : QWidget(parent)
--- a/QTfrontend/pages.h Mon Aug 14 14:49:40 2006 +0000
+++ b/QTfrontend/pages.h Wed Aug 16 11:41:00 2006 +0000
@@ -149,12 +149,9 @@
QPushButton *BtnEditTeam;
QComboBox *CBTeamName;
QGroupBox *AGGroupBox;
- QGroupBox *NNGroupBox;
QComboBox *CBResolution;
QCheckBox *CBEnableSound;
QCheckBox *CBFullscreen;
- QLabel *label;
- QLineEdit *editNetNick;
QPushButton *BtnSaveOptions;
};
@@ -167,6 +164,11 @@
QPushButton *BtnBack;
QPushButton *BtnNetConnect;
+ QGroupBox *NNGroupBox;
+ QLabel *labelNN;
+ QLineEdit *editNetNick;
+ QLabel *labelIP;
+ QLineEdit * editIP;
};
class PageNetChat : public QWidget
--- a/hedgewars/uAI.pas Mon Aug 14 14:49:40 2006 +0000
+++ b/hedgewars/uAI.pas Wed Aug 16 11:41:00 2006 +0000
@@ -255,8 +255,7 @@
end
end;
-Me.State:= Me.State and not gstHHThinking;
-ThinkThread:= nil
+Me.State:= Me.State and not gstHHThinking
end;
procedure StartThink(Me: PGear);