equal
deleted
inserted
replaced
128 setNetPasswordLength(passLength); |
128 setNetPasswordLength(passLength); |
129 } |
129 } |
130 |
130 |
131 delete netHost; |
131 delete netHost; |
132 netHost = new QString(value("net/ip", "").toString()); |
132 netHost = new QString(value("net/ip", "").toString()); |
133 netPort = value("net/port", 46631).toUInt(); |
133 netPort = value("net/port", NETGAME_DEFAULT_PORT).toUInt(); |
134 |
134 |
135 Form->ui.pageNetServer->leServerDescr->setText(value("net/servername", "hedgewars server").toString()); |
135 Form->ui.pageNetServer->leServerDescr->setText(value("net/servername", "hedgewars server").toString()); |
136 Form->ui.pageNetServer->sbPort->setValue(value("net/serverport", 46631).toUInt()); |
136 Form->ui.pageNetServer->sbPort->setValue(value("net/serverport", NETGAME_DEFAULT_PORT).toUInt()); |
137 |
137 |
138 Form->ui.pageOptions->CBShowFPS->setChecked(value("fps/show", false).toBool()); |
138 Form->ui.pageOptions->CBShowFPS->setChecked(value("fps/show", false).toBool()); |
139 Form->ui.pageOptions->fpsedit->setValue(value("fps/limit", 27).toUInt()); |
139 Form->ui.pageOptions->fpsedit->setValue(value("fps/limit", 27).toUInt()); |
140 |
140 |
141 Form->ui.pageOptions->CBAltDamage->setChecked(value("misc/altdamage", false).toBool()); |
141 Form->ui.pageOptions->CBAltDamage->setChecked(value("misc/altdamage", false).toBool()); |
215 } |
215 } |
216 |
216 |
217 void GameUIConfig::resizeToConfigValues() |
217 void GameUIConfig::resizeToConfigValues() |
218 { |
218 { |
219 // fill 2/3 of the screen desktop |
219 // fill 2/3 of the screen desktop |
220 const QRect deskSize = QApplication::desktop()->screenGeometry(-1); |
220 const QRect deskSize = HWApplication::desktop()->screenGeometry(-1); |
221 Form->resize(value("frontend/width", qMin(qMax(deskSize.width()*2/3,800),deskSize.width())).toUInt(), |
221 Form->resize(value("frontend/width", qMin(qMax(deskSize.width()*2/3,800),deskSize.width())).toUInt(), |
222 value("frontend/height", qMin(qMax(deskSize.height()*2/3,600),deskSize.height())).toUInt()); |
222 value("frontend/height", qMin(qMax(deskSize.height()*2/3,600),deskSize.height())).toUInt()); |
223 |
223 |
224 // move the window to the center of the screen |
224 // move the window to the center of the screen |
225 QPoint center = QApplication::desktop()->availableGeometry(-1).center(); |
225 QPoint center = HWApplication::desktop()->availableGeometry(-1).center(); |
226 center.setX(center.x() - (Form->width()/2)); |
226 center.setX(center.x() - (Form->width()/2)); |
227 center.setY(center.y() - (Form->height()/2)); |
227 center.setY(center.y() - (Form->height()/2)); |
228 Form->move(center); |
228 Form->move(center); |
229 } |
229 } |
230 |
230 |