File: settings.cpp

package info (click to toggle)
higan 098-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 11,904 kB
  • ctags: 13,286
  • sloc: cpp: 108,285; ansic: 778; makefile: 32; sh: 18
file content (26 lines) | stat: -rw-r--r-- 739 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
namespace hiro {

static Settings* settings = nullptr;

Settings::Settings() {
  geometry.append(geometry.frameX = 4, "FrameX");
  geometry.append(geometry.frameY = 24, "FrameY");
  geometry.append(geometry.frameWidth = 8, "FrameWidth");
  geometry.append(geometry.frameHeight = 28, "FrameHeight");
  geometry.append(geometry.menuHeight = 20, "MenuHeight");
  geometry.append(geometry.statusHeight = 20, "StatusHeight");
  append(geometry, "Geometry");
}

auto Settings::load() -> void {
  string path{configpath(), "hiro/"};
  Configuration::Document::load({path, "qt.bml"});
}

auto Settings::save() -> void {
  string path{configpath(), "hiro/"};
  directory::create(path, 0755);
  Configuration::Document::save({path, "qt.bml"});
}

}