~ubuntu-branches/ubuntu/trusty/manaplus/trusty-proposed

« back to all changes in this revision

Viewing changes to src/gui/serverdialog.cpp

  • Committer: Package Import Robot
  • Author(s): Patrick Matthäi, Andrei Karas, Patrick Matthäi
  • Date: 2013-05-18 21:06:29 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20130518210629-3trtowluum0tekob
Tags: 1.3.5.12-1
[ Andrei Karas ]
* Add new files to copyright file.

[ Patrick Matthäi ]
* New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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))
164
166
    {
165
167
    }
166
168
 
171
173
 
172
174
        ServersListModel *const model = static_cast<ServersListModel *const>(
173
175
            mListModel);
 
176
        Graphics *const g = static_cast<Graphics*>(graphics);
174
177
 
175
178
        updateAlpha();
176
179
 
201
204
            ServerInfo info = model->getServer(i);
202
205
 
203
206
            if (mSelected == i)
204
 
                graphics->setColor(mForegroundSelectedColor);
 
207
            {
 
208
                g->setColorAll(mForegroundSelectedColor,
 
209
                    mForegroundSelectedColor2);
 
210
            }
205
211
            else
206
 
                graphics->setColor(mForegroundColor);
 
212
            {
 
213
                g->setColorAll(mForegroundColor, mForegroundColor2);
 
214
            }
207
215
 
208
216
            int top;
209
217
            int x = mPadding;
225
233
 
226
234
            if (info.version.first > 0)
227
235
            {
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);
231
239
            }
239
247
private:
240
248
    gcn::Color mHighlightColor;
241
249
    gcn::Color mNotSupportedColor;
 
250
    gcn::Color mNotSupportedColor2;
242
251
};
243
252
 
244
253
 
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(),
251
261
    mMutex(),
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)
268
284
{
269
285
    if (isSafeMode)
 
286
    {
 
287
        // TRANSLATORS: servers dialog name
270
288
        setCaption(_("Choose Your Server  *** SAFE MODE ***"));
 
289
    }
271
290
 
272
291
    setWindowName("ServerDialog");
273
292
 
274
293
    setCloseButton(true);
275
294
 
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");
503
523
        }
504
524
        else if (mDownloadStatus == DOWNLOADING_IN_PROGRESS)
505
525
        {
 
526
            // TRANSLATORS: servers dialog label
506
527
            mDescription->setCaption(strprintf(_("Downloading server list..."
507
528
                "%2.2f%%"), static_cast<double>(mDownloadProgress * 100)));
508
529
        }
509
530
        else if (mDownloadStatus == DOWNLOADING_IDLE)
510
531
        {
 
532
            // TRANSLATORS: servers dialog label
511
533
            mDescription->setCaption(_("Waiting for server..."));
512
534
        }
513
535
        else if (mDownloadStatus == DOWNLOADING_PREPARING)
514
536
        {
 
537
            // TRANSLATORS: servers dialog label
515
538
            mDescription->setCaption(_("Preparing download"));
516
539
        }
517
540
        else if (mDownloadStatus == DOWNLOADING_ERROR)
518
541
        {
 
542
            // TRANSLATORS: servers dialog label
519
543
            mDescription->setCaption(_("Error retreiving server list!"));
520
544
        }
521
545
    }
606
630
        if (meetsMinimumVersion)
607
631
            version.clear();
608
632
        else if (version.empty())
 
633
        {
 
634
            // TRANSLATORS: servers dialog label
609
635
            version = _("requires a newer version");
 
636
        }
610
637
        else
 
638
        {
 
639
            // TRANSLATORS: servers dialog label
611
640
            version = strprintf(_("requires v%s"), version.c_str());
 
641
        }
612
642
 
613
643
        gcn::Font *font = gui->getFont();
614
644