annotate src/gui/translate/config.cc @ 118:39521c47c7a3

*: another huge megacommit, SORRY The torrents page works a lot better now Added the edit option to the anime list right click menu Vectorized currently playing files Available player and extensions are now loaded at runtime from files in (dotpath)/players.json and (dotpath)/extensions.json These paths are not permanent and will likely be moved to (dotpath)/recognition ... ... ...
author Paper <mrpapersonic@gmail.com>
date Tue, 07 Nov 2023 23:40:54 -0500
parents 29e2840d9b7b
children 71832ffe425a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
91
29e2840d9b7b *: oops
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
1 #include "core/config.h"
29e2840d9b7b *: oops
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
2 #include "gui/translate/config.h"
29e2840d9b7b *: oops
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
3
29e2840d9b7b *: oops
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
4 namespace Translate {
29e2840d9b7b *: oops
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
5
29e2840d9b7b *: oops
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
6 Themes ToTheme(const std::string& theme) {
29e2840d9b7b *: oops
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
7 const std::unordered_map<std::string, Themes> map = {
29e2840d9b7b *: oops
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
8 {"Default", Themes::OS },
29e2840d9b7b *: oops
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
9 {"Light", Themes::LIGHT},
29e2840d9b7b *: oops
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
10 {"Dark", Themes::DARK }
29e2840d9b7b *: oops
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
11 };
29e2840d9b7b *: oops
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
12
29e2840d9b7b *: oops
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
13 if (map.find(theme) == map.end())
29e2840d9b7b *: oops
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
14 return Themes::OS;
29e2840d9b7b *: oops
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
15 return map.at(theme);
29e2840d9b7b *: oops
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
16 }
29e2840d9b7b *: oops
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
17
29e2840d9b7b *: oops
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
18 std::string ToString(const Themes& theme) {
29e2840d9b7b *: oops
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
19 switch (theme) {
29e2840d9b7b *: oops
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
20 default:
29e2840d9b7b *: oops
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
21 case Themes::OS: return "Default";
29e2840d9b7b *: oops
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
22 case Themes::LIGHT: return "Light";
29e2840d9b7b *: oops
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
23 case Themes::DARK: return "Dark";
29e2840d9b7b *: oops
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
24 }
29e2840d9b7b *: oops
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
25 }
29e2840d9b7b *: oops
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
26
29e2840d9b7b *: oops
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
27 }