1 #include "dlg_register.h"
2 
3 #include "pb/serverinfo_user.pb.h"
4 #include "settingscache.h"
5 
6 #include <QCheckBox>
7 #include <QDebug>
8 #include <QDialogButtonBox>
9 #include <QGridLayout>
10 #include <QHBoxLayout>
11 #include <QLabel>
12 #include <QMessageBox>
13 
DlgRegister(QWidget * parent)14 DlgRegister::DlgRegister(QWidget *parent) : QDialog(parent)
15 {
16     ServersSettings &servers = SettingsCache::instance().servers();
17     hostLabel = new QLabel(tr("&Host:"));
18     hostEdit = new QLineEdit(servers.getHostname("server.cockatrice.us"));
19     hostLabel->setBuddy(hostEdit);
20 
21     portLabel = new QLabel(tr("&Port:"));
22     portEdit = new QLineEdit(servers.getPort("4747"));
23     portLabel->setBuddy(portEdit);
24 
25     playernameLabel = new QLabel(tr("Player &name:"));
26     playernameEdit = new QLineEdit(servers.getPlayerName("Player"));
27     playernameLabel->setBuddy(playernameEdit);
28 
29     passwordLabel = new QLabel(tr("P&assword:"));
30     passwordEdit = new QLineEdit(servers.getPassword());
31     passwordLabel->setBuddy(passwordEdit);
32     passwordEdit->setEchoMode(QLineEdit::Password);
33 
34     passwordConfirmationLabel = new QLabel(tr("Password (again):"));
35     passwordConfirmationEdit = new QLineEdit();
36     passwordConfirmationLabel->setBuddy(passwordConfirmationEdit);
37     passwordConfirmationEdit->setEchoMode(QLineEdit::Password);
38 
39     emailLabel = new QLabel(tr("Email:"));
40     emailEdit = new QLineEdit();
41     emailLabel->setBuddy(emailEdit);
42 
43     emailConfirmationLabel = new QLabel(tr("Email (again):"));
44     emailConfirmationEdit = new QLineEdit();
45     emailConfirmationLabel->setBuddy(emailConfirmationEdit);
46 
47     countryLabel = new QLabel(tr("Country:"));
48     countryEdit = new QComboBox();
49     countryLabel->setBuddy(countryEdit);
50     countryEdit->insertItem(0, tr("Undefined"));
51     countryEdit->addItem(QPixmap("theme:countries/ad"), "ad");
52     countryEdit->addItem(QPixmap("theme:countries/ae"), "ae");
53     countryEdit->addItem(QPixmap("theme:countries/af"), "af");
54     countryEdit->addItem(QPixmap("theme:countries/ag"), "ag");
55     countryEdit->addItem(QPixmap("theme:countries/ai"), "ai");
56     countryEdit->addItem(QPixmap("theme:countries/al"), "al");
57     countryEdit->addItem(QPixmap("theme:countries/am"), "am");
58     countryEdit->addItem(QPixmap("theme:countries/ao"), "ao");
59     countryEdit->addItem(QPixmap("theme:countries/aq"), "aq");
60     countryEdit->addItem(QPixmap("theme:countries/ar"), "ar");
61     countryEdit->addItem(QPixmap("theme:countries/as"), "as");
62     countryEdit->addItem(QPixmap("theme:countries/at"), "at");
63     countryEdit->addItem(QPixmap("theme:countries/au"), "au");
64     countryEdit->addItem(QPixmap("theme:countries/aw"), "aw");
65     countryEdit->addItem(QPixmap("theme:countries/ax"), "ax");
66     countryEdit->addItem(QPixmap("theme:countries/az"), "az");
67     countryEdit->addItem(QPixmap("theme:countries/ba"), "ba");
68     countryEdit->addItem(QPixmap("theme:countries/bb"), "bb");
69     countryEdit->addItem(QPixmap("theme:countries/bd"), "bd");
70     countryEdit->addItem(QPixmap("theme:countries/be"), "be");
71     countryEdit->addItem(QPixmap("theme:countries/bf"), "bf");
72     countryEdit->addItem(QPixmap("theme:countries/bg"), "bg");
73     countryEdit->addItem(QPixmap("theme:countries/bh"), "bh");
74     countryEdit->addItem(QPixmap("theme:countries/bi"), "bi");
75     countryEdit->addItem(QPixmap("theme:countries/bj"), "bj");
76     countryEdit->addItem(QPixmap("theme:countries/bl"), "bl");
77     countryEdit->addItem(QPixmap("theme:countries/bm"), "bm");
78     countryEdit->addItem(QPixmap("theme:countries/bn"), "bn");
79     countryEdit->addItem(QPixmap("theme:countries/bo"), "bo");
80     countryEdit->addItem(QPixmap("theme:countries/bq"), "bq");
81     countryEdit->addItem(QPixmap("theme:countries/br"), "br");
82     countryEdit->addItem(QPixmap("theme:countries/bs"), "bs");
83     countryEdit->addItem(QPixmap("theme:countries/bt"), "bt");
84     countryEdit->addItem(QPixmap("theme:countries/bv"), "bv");
85     countryEdit->addItem(QPixmap("theme:countries/bw"), "bw");
86     countryEdit->addItem(QPixmap("theme:countries/by"), "by");
87     countryEdit->addItem(QPixmap("theme:countries/bz"), "bz");
88     countryEdit->addItem(QPixmap("theme:countries/ca"), "ca");
89     countryEdit->addItem(QPixmap("theme:countries/cc"), "cc");
90     countryEdit->addItem(QPixmap("theme:countries/cd"), "cd");
91     countryEdit->addItem(QPixmap("theme:countries/cf"), "cf");
92     countryEdit->addItem(QPixmap("theme:countries/cg"), "cg");
93     countryEdit->addItem(QPixmap("theme:countries/ch"), "ch");
94     countryEdit->addItem(QPixmap("theme:countries/ci"), "ci");
95     countryEdit->addItem(QPixmap("theme:countries/ck"), "ck");
96     countryEdit->addItem(QPixmap("theme:countries/cl"), "cl");
97     countryEdit->addItem(QPixmap("theme:countries/cm"), "cm");
98     countryEdit->addItem(QPixmap("theme:countries/cn"), "cn");
99     countryEdit->addItem(QPixmap("theme:countries/co"), "co");
100     countryEdit->addItem(QPixmap("theme:countries/cr"), "cr");
101     countryEdit->addItem(QPixmap("theme:countries/cu"), "cu");
102     countryEdit->addItem(QPixmap("theme:countries/cv"), "cv");
103     countryEdit->addItem(QPixmap("theme:countries/cw"), "cw");
104     countryEdit->addItem(QPixmap("theme:countries/cx"), "cx");
105     countryEdit->addItem(QPixmap("theme:countries/cy"), "cy");
106     countryEdit->addItem(QPixmap("theme:countries/cz"), "cz");
107     countryEdit->addItem(QPixmap("theme:countries/de"), "de");
108     countryEdit->addItem(QPixmap("theme:countries/dj"), "dj");
109     countryEdit->addItem(QPixmap("theme:countries/dk"), "dk");
110     countryEdit->addItem(QPixmap("theme:countries/dm"), "dm");
111     countryEdit->addItem(QPixmap("theme:countries/do"), "do");
112     countryEdit->addItem(QPixmap("theme:countries/dz"), "dz");
113     countryEdit->addItem(QPixmap("theme:countries/ec"), "ec");
114     countryEdit->addItem(QPixmap("theme:countries/ee"), "ee");
115     countryEdit->addItem(QPixmap("theme:countries/eg"), "eg");
116     countryEdit->addItem(QPixmap("theme:countries/eh"), "eh");
117     countryEdit->addItem(QPixmap("theme:countries/er"), "er");
118     countryEdit->addItem(QPixmap("theme:countries/es"), "es");
119     countryEdit->addItem(QPixmap("theme:countries/et"), "et");
120     countryEdit->addItem(QPixmap("theme:countries/fi"), "fi");
121     countryEdit->addItem(QPixmap("theme:countries/fj"), "fj");
122     countryEdit->addItem(QPixmap("theme:countries/fk"), "fk");
123     countryEdit->addItem(QPixmap("theme:countries/fm"), "fm");
124     countryEdit->addItem(QPixmap("theme:countries/fo"), "fo");
125     countryEdit->addItem(QPixmap("theme:countries/fr"), "fr");
126     countryEdit->addItem(QPixmap("theme:countries/ga"), "ga");
127     countryEdit->addItem(QPixmap("theme:countries/gb"), "gb");
128     countryEdit->addItem(QPixmap("theme:countries/gd"), "gd");
129     countryEdit->addItem(QPixmap("theme:countries/ge"), "ge");
130     countryEdit->addItem(QPixmap("theme:countries/gf"), "gf");
131     countryEdit->addItem(QPixmap("theme:countries/gg"), "gg");
132     countryEdit->addItem(QPixmap("theme:countries/gh"), "gh");
133     countryEdit->addItem(QPixmap("theme:countries/gi"), "gi");
134     countryEdit->addItem(QPixmap("theme:countries/gl"), "gl");
135     countryEdit->addItem(QPixmap("theme:countries/gm"), "gm");
136     countryEdit->addItem(QPixmap("theme:countries/gn"), "gn");
137     countryEdit->addItem(QPixmap("theme:countries/gp"), "gp");
138     countryEdit->addItem(QPixmap("theme:countries/gq"), "gq");
139     countryEdit->addItem(QPixmap("theme:countries/gr"), "gr");
140     countryEdit->addItem(QPixmap("theme:countries/gs"), "gs");
141     countryEdit->addItem(QPixmap("theme:countries/gt"), "gt");
142     countryEdit->addItem(QPixmap("theme:countries/gu"), "gu");
143     countryEdit->addItem(QPixmap("theme:countries/gw"), "gw");
144     countryEdit->addItem(QPixmap("theme:countries/gy"), "gy");
145     countryEdit->addItem(QPixmap("theme:countries/hk"), "hk");
146     countryEdit->addItem(QPixmap("theme:countries/hm"), "hm");
147     countryEdit->addItem(QPixmap("theme:countries/hn"), "hn");
148     countryEdit->addItem(QPixmap("theme:countries/hr"), "hr");
149     countryEdit->addItem(QPixmap("theme:countries/ht"), "ht");
150     countryEdit->addItem(QPixmap("theme:countries/hu"), "hu");
151     countryEdit->addItem(QPixmap("theme:countries/id"), "id");
152     countryEdit->addItem(QPixmap("theme:countries/ie"), "ie");
153     countryEdit->addItem(QPixmap("theme:countries/il"), "il");
154     countryEdit->addItem(QPixmap("theme:countries/im"), "im");
155     countryEdit->addItem(QPixmap("theme:countries/in"), "in");
156     countryEdit->addItem(QPixmap("theme:countries/io"), "io");
157     countryEdit->addItem(QPixmap("theme:countries/iq"), "iq");
158     countryEdit->addItem(QPixmap("theme:countries/ir"), "ir");
159     countryEdit->addItem(QPixmap("theme:countries/is"), "is");
160     countryEdit->addItem(QPixmap("theme:countries/it"), "it");
161     countryEdit->addItem(QPixmap("theme:countries/je"), "je");
162     countryEdit->addItem(QPixmap("theme:countries/jm"), "jm");
163     countryEdit->addItem(QPixmap("theme:countries/jo"), "jo");
164     countryEdit->addItem(QPixmap("theme:countries/jp"), "jp");
165     countryEdit->addItem(QPixmap("theme:countries/ke"), "ke");
166     countryEdit->addItem(QPixmap("theme:countries/kg"), "kg");
167     countryEdit->addItem(QPixmap("theme:countries/kh"), "kh");
168     countryEdit->addItem(QPixmap("theme:countries/ki"), "ki");
169     countryEdit->addItem(QPixmap("theme:countries/km"), "km");
170     countryEdit->addItem(QPixmap("theme:countries/kn"), "kn");
171     countryEdit->addItem(QPixmap("theme:countries/kp"), "kp");
172     countryEdit->addItem(QPixmap("theme:countries/kr"), "kr");
173     countryEdit->addItem(QPixmap("theme:countries/kw"), "kw");
174     countryEdit->addItem(QPixmap("theme:countries/ky"), "ky");
175     countryEdit->addItem(QPixmap("theme:countries/kz"), "kz");
176     countryEdit->addItem(QPixmap("theme:countries/la"), "la");
177     countryEdit->addItem(QPixmap("theme:countries/lb"), "lb");
178     countryEdit->addItem(QPixmap("theme:countries/lc"), "lc");
179     countryEdit->addItem(QPixmap("theme:countries/li"), "li");
180     countryEdit->addItem(QPixmap("theme:countries/lk"), "lk");
181     countryEdit->addItem(QPixmap("theme:countries/lr"), "lr");
182     countryEdit->addItem(QPixmap("theme:countries/ls"), "ls");
183     countryEdit->addItem(QPixmap("theme:countries/lt"), "lt");
184     countryEdit->addItem(QPixmap("theme:countries/lu"), "lu");
185     countryEdit->addItem(QPixmap("theme:countries/lv"), "lv");
186     countryEdit->addItem(QPixmap("theme:countries/ly"), "ly");
187     countryEdit->addItem(QPixmap("theme:countries/ma"), "ma");
188     countryEdit->addItem(QPixmap("theme:countries/mc"), "mc");
189     countryEdit->addItem(QPixmap("theme:countries/md"), "md");
190     countryEdit->addItem(QPixmap("theme:countries/me"), "me");
191     countryEdit->addItem(QPixmap("theme:countries/mf"), "mf");
192     countryEdit->addItem(QPixmap("theme:countries/mg"), "mg");
193     countryEdit->addItem(QPixmap("theme:countries/mh"), "mh");
194     countryEdit->addItem(QPixmap("theme:countries/mk"), "mk");
195     countryEdit->addItem(QPixmap("theme:countries/ml"), "ml");
196     countryEdit->addItem(QPixmap("theme:countries/mm"), "mm");
197     countryEdit->addItem(QPixmap("theme:countries/mn"), "mn");
198     countryEdit->addItem(QPixmap("theme:countries/mo"), "mo");
199     countryEdit->addItem(QPixmap("theme:countries/mp"), "mp");
200     countryEdit->addItem(QPixmap("theme:countries/mq"), "mq");
201     countryEdit->addItem(QPixmap("theme:countries/mr"), "mr");
202     countryEdit->addItem(QPixmap("theme:countries/ms"), "ms");
203     countryEdit->addItem(QPixmap("theme:countries/mt"), "mt");
204     countryEdit->addItem(QPixmap("theme:countries/mu"), "mu");
205     countryEdit->addItem(QPixmap("theme:countries/mv"), "mv");
206     countryEdit->addItem(QPixmap("theme:countries/mw"), "mw");
207     countryEdit->addItem(QPixmap("theme:countries/mx"), "mx");
208     countryEdit->addItem(QPixmap("theme:countries/my"), "my");
209     countryEdit->addItem(QPixmap("theme:countries/mz"), "mz");
210     countryEdit->addItem(QPixmap("theme:countries/na"), "na");
211     countryEdit->addItem(QPixmap("theme:countries/nc"), "nc");
212     countryEdit->addItem(QPixmap("theme:countries/ne"), "ne");
213     countryEdit->addItem(QPixmap("theme:countries/nf"), "nf");
214     countryEdit->addItem(QPixmap("theme:countries/ng"), "ng");
215     countryEdit->addItem(QPixmap("theme:countries/ni"), "ni");
216     countryEdit->addItem(QPixmap("theme:countries/nl"), "nl");
217     countryEdit->addItem(QPixmap("theme:countries/no"), "no");
218     countryEdit->addItem(QPixmap("theme:countries/np"), "np");
219     countryEdit->addItem(QPixmap("theme:countries/nr"), "nr");
220     countryEdit->addItem(QPixmap("theme:countries/nu"), "nu");
221     countryEdit->addItem(QPixmap("theme:countries/nz"), "nz");
222     countryEdit->addItem(QPixmap("theme:countries/om"), "om");
223     countryEdit->addItem(QPixmap("theme:countries/pa"), "pa");
224     countryEdit->addItem(QPixmap("theme:countries/pe"), "pe");
225     countryEdit->addItem(QPixmap("theme:countries/pf"), "pf");
226     countryEdit->addItem(QPixmap("theme:countries/pg"), "pg");
227     countryEdit->addItem(QPixmap("theme:countries/ph"), "ph");
228     countryEdit->addItem(QPixmap("theme:countries/pk"), "pk");
229     countryEdit->addItem(QPixmap("theme:countries/pl"), "pl");
230     countryEdit->addItem(QPixmap("theme:countries/pm"), "pm");
231     countryEdit->addItem(QPixmap("theme:countries/pn"), "pn");
232     countryEdit->addItem(QPixmap("theme:countries/pr"), "pr");
233     countryEdit->addItem(QPixmap("theme:countries/ps"), "ps");
234     countryEdit->addItem(QPixmap("theme:countries/pt"), "pt");
235     countryEdit->addItem(QPixmap("theme:countries/pw"), "pw");
236     countryEdit->addItem(QPixmap("theme:countries/py"), "py");
237     countryEdit->addItem(QPixmap("theme:countries/qa"), "qa");
238     countryEdit->addItem(QPixmap("theme:countries/re"), "re");
239     countryEdit->addItem(QPixmap("theme:countries/ro"), "ro");
240     countryEdit->addItem(QPixmap("theme:countries/rs"), "rs");
241     countryEdit->addItem(QPixmap("theme:countries/ru"), "ru");
242     countryEdit->addItem(QPixmap("theme:countries/rw"), "rw");
243     countryEdit->addItem(QPixmap("theme:countries/sa"), "sa");
244     countryEdit->addItem(QPixmap("theme:countries/sb"), "sb");
245     countryEdit->addItem(QPixmap("theme:countries/sc"), "sc");
246     countryEdit->addItem(QPixmap("theme:countries/sd"), "sd");
247     countryEdit->addItem(QPixmap("theme:countries/se"), "se");
248     countryEdit->addItem(QPixmap("theme:countries/sg"), "sg");
249     countryEdit->addItem(QPixmap("theme:countries/sh"), "sh");
250     countryEdit->addItem(QPixmap("theme:countries/si"), "si");
251     countryEdit->addItem(QPixmap("theme:countries/sj"), "sj");
252     countryEdit->addItem(QPixmap("theme:countries/sk"), "sk");
253     countryEdit->addItem(QPixmap("theme:countries/sl"), "sl");
254     countryEdit->addItem(QPixmap("theme:countries/sm"), "sm");
255     countryEdit->addItem(QPixmap("theme:countries/sn"), "sn");
256     countryEdit->addItem(QPixmap("theme:countries/so"), "so");
257     countryEdit->addItem(QPixmap("theme:countries/sr"), "sr");
258     countryEdit->addItem(QPixmap("theme:countries/ss"), "ss");
259     countryEdit->addItem(QPixmap("theme:countries/st"), "st");
260     countryEdit->addItem(QPixmap("theme:countries/sv"), "sv");
261     countryEdit->addItem(QPixmap("theme:countries/sx"), "sx");
262     countryEdit->addItem(QPixmap("theme:countries/sy"), "sy");
263     countryEdit->addItem(QPixmap("theme:countries/sz"), "sz");
264     countryEdit->addItem(QPixmap("theme:countries/tc"), "tc");
265     countryEdit->addItem(QPixmap("theme:countries/td"), "td");
266     countryEdit->addItem(QPixmap("theme:countries/tf"), "tf");
267     countryEdit->addItem(QPixmap("theme:countries/tg"), "tg");
268     countryEdit->addItem(QPixmap("theme:countries/th"), "th");
269     countryEdit->addItem(QPixmap("theme:countries/tj"), "tj");
270     countryEdit->addItem(QPixmap("theme:countries/tk"), "tk");
271     countryEdit->addItem(QPixmap("theme:countries/tl"), "tl");
272     countryEdit->addItem(QPixmap("theme:countries/tm"), "tm");
273     countryEdit->addItem(QPixmap("theme:countries/tn"), "tn");
274     countryEdit->addItem(QPixmap("theme:countries/to"), "to");
275     countryEdit->addItem(QPixmap("theme:countries/tr"), "tr");
276     countryEdit->addItem(QPixmap("theme:countries/tt"), "tt");
277     countryEdit->addItem(QPixmap("theme:countries/tv"), "tv");
278     countryEdit->addItem(QPixmap("theme:countries/tw"), "tw");
279     countryEdit->addItem(QPixmap("theme:countries/tz"), "tz");
280     countryEdit->addItem(QPixmap("theme:countries/ua"), "ua");
281     countryEdit->addItem(QPixmap("theme:countries/ug"), "ug");
282     countryEdit->addItem(QPixmap("theme:countries/um"), "um");
283     countryEdit->addItem(QPixmap("theme:countries/us"), "us");
284     countryEdit->addItem(QPixmap("theme:countries/uy"), "uy");
285     countryEdit->addItem(QPixmap("theme:countries/uz"), "uz");
286     countryEdit->addItem(QPixmap("theme:countries/va"), "va");
287     countryEdit->addItem(QPixmap("theme:countries/vc"), "vc");
288     countryEdit->addItem(QPixmap("theme:countries/ve"), "ve");
289     countryEdit->addItem(QPixmap("theme:countries/vg"), "vg");
290     countryEdit->addItem(QPixmap("theme:countries/vi"), "vi");
291     countryEdit->addItem(QPixmap("theme:countries/vn"), "vn");
292     countryEdit->addItem(QPixmap("theme:countries/vu"), "vu");
293     countryEdit->addItem(QPixmap("theme:countries/wf"), "wf");
294     countryEdit->addItem(QPixmap("theme:countries/ws"), "ws");
295     countryEdit->addItem(QPixmap("theme:countries/ye"), "ye");
296     countryEdit->addItem(QPixmap("theme:countries/yt"), "yt");
297     countryEdit->addItem(QPixmap("theme:countries/za"), "za");
298     countryEdit->addItem(QPixmap("theme:countries/zm"), "zm");
299     countryEdit->addItem(QPixmap("theme:countries/zw"), "zw");
300     countryEdit->setCurrentIndex(0);
301     QStringList countries = SettingsCache::instance().getCountries();
302     foreach (QString c, countries)
303         countryEdit->addItem(QPixmap("theme:countries/" + c.toLower()), c);
304 
305     realnameLabel = new QLabel(tr("Real name:"));
306     realnameEdit = new QLineEdit();
307     realnameLabel->setBuddy(realnameEdit);
308 
309     QGridLayout *grid = new QGridLayout;
310     grid->addWidget(hostLabel, 0, 0);
311     grid->addWidget(hostEdit, 0, 1);
312     grid->addWidget(portLabel, 1, 0);
313     grid->addWidget(portEdit, 1, 1);
314     grid->addWidget(playernameLabel, 2, 0);
315     grid->addWidget(playernameEdit, 2, 1);
316     grid->addWidget(passwordLabel, 3, 0);
317     grid->addWidget(passwordEdit, 3, 1);
318     grid->addWidget(passwordConfirmationLabel, 4, 0);
319     grid->addWidget(passwordConfirmationEdit, 4, 1);
320     grid->addWidget(emailLabel, 5, 0);
321     grid->addWidget(emailEdit, 5, 1);
322     grid->addWidget(emailConfirmationLabel, 6, 0);
323     grid->addWidget(emailConfirmationEdit, 6, 1);
324     grid->addWidget(countryLabel, 8, 0);
325     grid->addWidget(countryEdit, 8, 1);
326     grid->addWidget(realnameLabel, 9, 0);
327     grid->addWidget(realnameEdit, 9, 1);
328 
329     QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
330     connect(buttonBox, SIGNAL(accepted()), this, SLOT(actOk()));
331     connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
332 
333     QVBoxLayout *mainLayout = new QVBoxLayout;
334     mainLayout->addLayout(grid);
335     mainLayout->addWidget(buttonBox);
336     setLayout(mainLayout);
337 
338     setWindowTitle(tr("Register to server"));
339     setFixedHeight(sizeHint().height());
340     setMinimumWidth(300);
341 }
342 
actOk()343 void DlgRegister::actOk()
344 {
345     if (passwordEdit->text() != passwordConfirmationEdit->text()) {
346         QMessageBox::critical(this, tr("Registration Warning"), tr("Your passwords do not match, please try again."));
347         return;
348     } else if (emailConfirmationEdit->text() != emailEdit->text()) {
349         QMessageBox::critical(this, tr("Registration Warning"),
350                               tr("Your email addresses do not match, please try again."));
351         return;
352     }
353     if (playernameEdit->text().isEmpty()) {
354         QMessageBox::critical(this, tr("Registration Warning"), tr("The player name can't be empty."));
355         return;
356     }
357 
358     ServersSettings &servers = SettingsCache::instance().servers();
359     servers.setHostName(hostEdit->text());
360     servers.setPort(portEdit->text());
361     servers.setPlayerName(playernameEdit->text());
362     // always save the password so it will be picked up by the connect dialog
363     servers.setPassword(passwordEdit->text());
364 
365     accept();
366 }
367