23 #include "miscserversetuppanel.h" 24 #include "ui_miscserversetuppanel.h" 26 #include "configuration/doomseekerconfig.h" 28 #include "plugins/engineplugin.h" 29 #include "serverapi/gamecreateparams.h" 31 DClass<MiscServerSetupPanel> :
public Ui::MiscServerSetupPanel
34 bool anythingAvailable;
43 d->anythingAvailable =
false;
45 d->cbHidePasswords->setChecked(gConfig.doomseeker.bHidePasswords);
48 MiscServerSetupPanel::~MiscServerSetupPanel()
54 params.setEmail(d->leEmail->text());
55 params.setMotd(d->pteMOTD->toPlainText());
56 params.setConnectPassword(d->leConnectPassword->text());
57 params.setIngamePassword(d->leJoinPassword->text());
58 params.setRconPassword(d->leRConPassword->text());
59 params.setUrl(d->leURL->text());
62 bool MiscServerSetupPanel::isAnythingAvailable()
const 64 return d->anythingAvailable;
67 void MiscServerSetupPanel::loadConfig(
Ini &config)
70 d->leURL->setText(misc[
"URL"]);
71 d->leEmail->setText(misc[
"eMail"]);
72 d->leConnectPassword->setText(misc[
"connectPassword"]);
73 d->leJoinPassword->setText(misc[
"joinPassword"]);
74 d->leRConPassword->setText(misc[
"RConPassword"]);
75 d->pteMOTD->document()->setPlainText(misc[
"MOTD"]);
78 void MiscServerSetupPanel::saveConfig(
Ini &config)
81 misc[
"URL"] = d->leURL->text();
82 misc[
"eMail"] = d->leEmail->text();
83 misc[
"connectPassword"] = d->leConnectPassword->text();
84 misc[
"joinPassword"] = d->leJoinPassword->text();
85 misc[
"RConPassword"] = d->leRConPassword->text();
86 misc[
"MOTD"] = d->pteMOTD->toPlainText();
89 void MiscServerSetupPanel::setupForEngine(
const EnginePlugin *engine)
91 d->anythingAvailable =
false;
94 visible = engine->data()->allowsConnectPassword;
95 d->labelConnectPassword->setVisible(visible);
96 d->leConnectPassword->setVisible(visible);
97 d->anythingAvailable = visible || d->anythingAvailable;
99 visible = engine->data()->allowsEmail;
100 d->labelEmail->setVisible(visible);
101 d->leEmail->setVisible(visible);
102 d->anythingAvailable = visible || d->anythingAvailable;
104 visible = engine->data()->allowsJoinPassword;
105 d->labelJoinPassword->setVisible(visible);
106 d->leJoinPassword->setVisible(visible);
107 d->anythingAvailable = visible || d->anythingAvailable;
109 visible = engine->data()->allowsMOTD;
110 d->labelMOTD->setVisible(visible);
111 d->pteMOTD->setVisible(visible);
112 d->anythingAvailable = visible || d->anythingAvailable;
114 visible = engine->data()->allowsRConPassword;
115 d->labelRConPassword->setVisible(visible);
116 d->leRConPassword->setVisible(visible);
117 d->anythingAvailable = visible || d->anythingAvailable;
119 visible = engine->data()->allowsURL;
120 d->labelURL->setVisible(visible);
121 d->leURL->setVisible(visible);
122 d->anythingAvailable = visible || d->anythingAvailable;
125 void MiscServerSetupPanel::setHidePasswords(
bool hide)
127 QLineEdit::EchoMode echoMode = hide ? QLineEdit::Password : QLineEdit::Normal;
128 d->leConnectPassword->setEchoMode(echoMode);
129 d->leJoinPassword->setEchoMode(echoMode);
130 d->leRConPassword->setEchoMode(echoMode);
Game parametrization data used when creating new games.
INI section representation.
IniSection section(const QString &name)
Access configuration file section.