4 XCSoar Glide Computer - http://www.xcsoar.org/
5 Copyright (C) 2000-2013 The XCSoar Project
6 A detailed list of copyright holders can be found in the file "AUTHORS".
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License
10 as published by the Free Software Foundation; either version 2
11 of the License, or (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 #include "PageSettings.hpp"
25 #include "InfoBoxes/InfoBoxSettings.hpp"
26 #include "Language/Language.hpp"
33 PageLayout::MakeTitle(const InfoBoxSettings
&info_box_settings
,
34 TCHAR
*buffer
, const bool concise
) const
37 _tcscpy(buffer
, _T("---"));
42 case PageLayout::Main::MAP
:
45 case PageLayout::Main::FLARM_RADAR
:
46 _tcscpy(buffer
, _("FLARM radar"));
49 case PageLayout::Main::THERMAL_ASSISTANT
:
50 _tcscpy(buffer
, _("Thermal assistant"));
53 case PageLayout::Main::MAX
:
57 if (infobox_config
.enabled
) {
58 _tcscpy(buffer
, concise
? _("Info") : _("Map and InfoBoxes"));
60 if (!infobox_config
.auto_switch
&&
61 infobox_config
.panel
< InfoBoxSettings::MAX_PANELS
) {
62 _tcscat(buffer
, _T(" "));
64 gettext(info_box_settings
.panels
[infobox_config
.panel
].name
));
68 _tcscat(buffer
, _T(" "));
69 _tcscat(buffer
, _("Auto"));
71 _tcscat(buffer
, _T(" ("));
72 _tcscat(buffer
, _("Auto"));
73 _tcscat(buffer
, _T(")"));
78 _tcscpy(buffer
, _("Info Hide"));
80 _tcscpy(buffer
, _("Map (Full screen)"));
87 case Bottom::CROSS_SECTION
:
88 // TODO: better text and translate
89 _tcscat(buffer
, _T(", XS"));
98 PageSettings::SetDefaults()
100 pages
[0] = PageLayout::Default();
101 pages
[1] = PageLayout::FullScreen();
103 std::fill(pages
.begin() + 2, pages
.end(), PageLayout::Undefined());
107 distinct_zoom
= false;
111 PageSettings::Compress()
113 auto last
= std::remove_if(pages
.begin(), pages
.end(),
114 [](const PageLayout
&layout
) {
115 return !layout
.IsDefined();
117 std::fill(last
, pages
.end(), PageLayout::Undefined());
118 n_pages
= std::distance(pages
.begin(), last
);