160
160
ServersListModel *const model) :
161
161
ListBox(widget, model, "serverslistbox.xml"),
162
162
mHighlightColor(getThemeColor(Theme::HIGHLIGHT)),
163
mNotSupportedColor(getThemeColor(Theme::SERVER_VERSION_NOT_SUPPORTED))
163
mNotSupportedColor(getThemeColor(Theme::SERVER_VERSION_NOT_SUPPORTED)),
164
mNotSupportedColor2(getThemeColor(
165
Theme::SERVER_VERSION_NOT_SUPPORTED_OUTLINE))
201
204
ServerInfo info = model->getServer(i);
203
206
if (mSelected == i)
204
graphics->setColor(mForegroundSelectedColor);
208
g->setColorAll(mForegroundSelectedColor,
209
mForegroundSelectedColor2);
206
graphics->setColor(mForegroundColor);
213
g->setColorAll(mForegroundColor, mForegroundColor2);
209
217
int x = mPadding;
226
234
if (info.version.first > 0)
228
graphics->setColor(mNotSupportedColor);
236
g->setColorAll(mNotSupportedColor, mNotSupportedColor2);
229
237
font2->drawString(graphics, info.version.second,
230
238
width - info.version.first - mPadding, top);
240
248
gcn::Color mHighlightColor;
241
249
gcn::Color mNotSupportedColor;
250
gcn::Color mNotSupportedColor2;
245
254
ServerDialog::ServerDialog(ServerInfo *const serverInfo,
246
255
const std::string &dir) :
256
// TRANSLATORS: servers dialog name
247
257
Window(_("Choose Your Server"), false, nullptr, "server.xml"),
248
258
gcn::ActionListener(),
249
259
gcn::KeyListener(),
250
260
gcn::SelectionListener(),
252
262
mDescription(new Label(this, std::string())),
263
// TRANSLATORS: servers dialog button
253
264
mQuitButton(new Button(this, _("Quit"), "quit", this)),
265
// TRANSLATORS: servers dialog button
254
266
mConnectButton(new Button(this, _("Connect"), "connect", this)),
267
// TRANSLATORS: servers dialog button
255
268
mAddEntryButton(new Button(this, _("Add"), "addEntry", this)),
269
// TRANSLATORS: servers dialog button
256
270
mEditEntryButton(new Button(this, _("Edit"), "editEntry", this)),
271
// TRANSLATORS: servers dialog button
257
272
mDeleteButton(new Button(this, _("Delete"), "remove", this)),
273
// TRANSLATORS: servers dialog button
258
274
mLoadButton(new Button(this, _("Load"), "load", this)),
259
275
mServers(ServerInfos()),
260
276
mServersListModel(new ServersListModel(&mServers, this)),
267
283
mPersistentIPCheckBox(nullptr)
287
// TRANSLATORS: servers dialog name
270
288
setCaption(_("Choose Your Server *** SAFE MODE ***"));
272
291
setWindowName("ServerDialog");
274
293
setCloseButton(true);
276
295
mPersistentIPCheckBox = new CheckBox(this,
296
// TRANSLATORS: servers dialog checkbox
277
297
_("Use same ip for game sub servers"),
278
298
config.getBoolValue("usePersistentIP"),
279
299
this, "persitent ip");
504
524
else if (mDownloadStatus == DOWNLOADING_IN_PROGRESS)
526
// TRANSLATORS: servers dialog label
506
527
mDescription->setCaption(strprintf(_("Downloading server list..."
507
528
"%2.2f%%"), static_cast<double>(mDownloadProgress * 100)));
509
530
else if (mDownloadStatus == DOWNLOADING_IDLE)
532
// TRANSLATORS: servers dialog label
511
533
mDescription->setCaption(_("Waiting for server..."));
513
535
else if (mDownloadStatus == DOWNLOADING_PREPARING)
537
// TRANSLATORS: servers dialog label
515
538
mDescription->setCaption(_("Preparing download"));
517
540
else if (mDownloadStatus == DOWNLOADING_ERROR)
542
// TRANSLATORS: servers dialog label
519
543
mDescription->setCaption(_("Error retreiving server list!"));
606
630
if (meetsMinimumVersion)
608
632
else if (version.empty())
634
// TRANSLATORS: servers dialog label
609
635
version = _("requires a newer version");
639
// TRANSLATORS: servers dialog label
611
640
version = strprintf(_("requires v%s"), version.c_str());
613
643
gcn::Font *font = gui->getFont();