Move nick edit to PageOptions
authorunc0rr
Thu, 13 Dec 2007 13:49:20 +0000
changeset 647 798c7dbf8bb8
parent 646 ed610c2cd0a4
child 648 fc5234aa6493
Move nick edit to PageOptions
QTfrontend/gameuiconfig.cpp
QTfrontend/hwform.cpp
QTfrontend/pages.cpp
QTfrontend/pages.h
--- a/QTfrontend/gameuiconfig.cpp	Thu Dec 13 12:39:26 2007 +0000
+++ b/QTfrontend/gameuiconfig.cpp	Thu Dec 13 13:49:20 2007 +0000
@@ -38,7 +38,7 @@
 
 	Form->ui.pageOptions->CBEnableSound->setChecked(value("audio/sound", true).toBool());
 
-	Form->ui.pageNet->editNetNick->setText(value("net/nick", QLineEdit::tr("unnamed")).toString());
+	Form->ui.pageOptions->editNetNick->setText(value("net/nick", QLineEdit::tr("unnamed")).toString());
 //	Form->ui.pageNet->editIP->setText(value("net/ip", "").toString());
 
 	Form->ui.pageOptions->CBShowFPS->setChecked(value("fps/show", false).toBool());
@@ -70,7 +70,7 @@
 
 	setValue("audio/sound", isSoundEnabled());
 
-	setValue("net/nick", Form->ui.pageNet->editNetNick->text());
+	setValue("net/nick", Form->ui.pageOptions->editNetNick->text());
 //	setValue("net/ip", Form->ui.pageNet->editIP->text());
 
 	setValue("fps/show", isShowFPSEnabled());
--- a/QTfrontend/hwform.cpp	Thu Dec 13 12:39:26 2007 +0000
+++ b/QTfrontend/hwform.cpp	Thu Dec 13 13:49:20 2007 +0000
@@ -349,7 +349,7 @@
 			  tr("OK"));
     return ;
   }
-  _NetConnect(curritem->text(), 46631, ui.pageNet->editNetNick->text());
+  _NetConnect(curritem->text(), 46631, ui.pageOptions->editNetNick->text());
 }
 
 void HWForm::_NetConnect(const QString & hostName, quint16 port, const QString & nick)
@@ -415,7 +415,7 @@
 {
   pnetserver = new HWNetServer;
   pnetserver->StartServer();
-  _NetConnect("localhost", pnetserver->getRunningPort(), ui.pageNet->editNetNick->text());
+  _NetConnect("localhost", pnetserver->getRunningPort(), ui.pageOptions->editNetNick->text());
 
   if (ui.pageNet->rbLocalGame->isChecked())
     pRegisterServer = new HWNetUdpServer(0, "hedgewars server", 46631);
--- a/QTfrontend/pages.cpp	Thu Dec 13 12:39:26 2007 +0000
+++ b/QTfrontend/pages.cpp	Thu Dec 13 13:49:20 2007 +0000
@@ -405,6 +405,20 @@
 	WeaponsButt->setText(QPushButton::tr("Weapons scheme"));
 	pageLayout->addWidget(WeaponsButt, 1, 0);
 
+	NNGroupBox = new QGroupBox(this);
+	NNGroupBox->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
+	NNGroupBox->setTitle(QGroupBox::tr("Net options"));
+	pageLayout->addWidget(NNGroupBox, 1, 2);
+
+	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);
 }
 
 PageNet::PageNet(QWidget* parent) : QWidget(parent)
@@ -420,21 +434,6 @@
 	BtnNetSvrStart->setText(QPushButton::tr("Start server"));
 	pageLayout->addWidget(BtnNetSvrStart, 3, 2);
 
-	NNGroupBox = new QGroupBox(this);
-	NNGroupBox->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
-	NNGroupBox->setTitle(QGroupBox::tr("Net options"));
-	pageLayout->addWidget(NNGroupBox, 0, 0);
-
-	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);
-
 	QGroupBox * NetTypeGroupBox = new QGroupBox(this);
 	NetTypeGroupBox->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
 	NetTypeGroupBox->setTitle(QGroupBox::tr("Connection type"));
--- a/QTfrontend/pages.h	Thu Dec 13 12:39:26 2007 +0000
+++ b/QTfrontend/pages.h	Thu Dec 13 13:49:20 2007 +0000
@@ -147,6 +147,9 @@
 	QCheckBox *CBAltDamage;
 	FPSEdit *fpsedit;
 	QPushButton *BtnSaveOptions;
+	QGroupBox *NNGroupBox;
+	QLabel *labelNN;
+	QLineEdit *editNetNick;
 };
 
 class PageNet : public QWidget
@@ -161,9 +164,6 @@
 	QPushButton *BtnBack;
 	QPushButton *BtnNetConnect;
 	QPushButton* BtnNetSvrStart;
-	QGroupBox *NNGroupBox;
-	QLabel *labelNN;
-	QLineEdit *editNetNick;
 	QRadioButton * rbLocalGame;
 	QRadioButton * rbInternetGame;