Humble Bundle support
[GameHub.git] / src / utils / Settings.vala
blob025a2dc5430ee268237e90c9a8fdc529b5b19b56
1 using Gtk;
2 using GLib;
3 using Granite;
5 namespace GameHub.Settings
7 public enum WindowState
9 NORMAL = 0,
10 MAXIMIZED = 1,
11 FULLSCREEN = 2
14 public class SavedState: Granite.Services.Settings
16 public int window_width { get; set; }
17 public int window_height { get; set; }
18 public WindowState window_state { get; set; }
19 public int window_x { get; set; }
20 public int window_y { get; set; }
22 public SavedState()
24 base(ProjectConfig.PROJECT_NAME + ".saved-state");
27 private static SavedState? instance;
28 public static unowned SavedState get_instance()
30 if(instance == null)
32 instance = new SavedState();
34 return instance;
38 public class UI: Granite.Services.Settings
40 public bool dark_theme { get; set; }
42 public UI()
44 base(ProjectConfig.PROJECT_NAME + ".ui");
47 private static UI? instance;
48 public static unowned UI get_instance()
50 if(instance == null)
52 instance = new UI();
54 return instance;
58 namespace Auth
60 public class Steam: Granite.Services.Settings
62 public bool authenticated { get; set; }
63 public string api_key { get; set; }
65 public Steam()
67 base(ProjectConfig.PROJECT_NAME + ".auth.steam");
70 private static Steam? instance;
71 public static unowned Steam get_instance()
73 if(instance == null)
75 instance = new Steam();
77 return instance;
81 public class GOG: Granite.Services.Settings
83 public bool authenticated { get; set; }
84 public string access_token { get; set; }
85 public string refresh_token { get; set; }
87 public GOG()
89 base(ProjectConfig.PROJECT_NAME + ".auth.gog");
92 private static GOG? instance;
93 public static unowned GOG get_instance()
95 if(instance == null)
97 instance = new GOG();
99 return instance;
103 public class Humble: Granite.Services.Settings
105 public bool authenticated { get; set; }
106 public string access_token { get; set; }
108 public Humble()
110 base(ProjectConfig.PROJECT_NAME + ".auth.humble");
113 private static Humble? instance;
114 public static unowned Humble get_instance()
116 if(instance == null)
118 instance = new Humble();
120 return instance;