File tree 3 files changed +20
-1
lines changed
3 files changed +20
-1
lines changed Original file line number Diff line number Diff line change 1
1
<schemalist >
2
+ <enum id =" io.elementary.camera.settings.delay" >
3
+ <value nick =" DISABLED" value =" 0" />
4
+ <value nick =" 3_SEC" value =" 3" />
5
+ <value nick =" 5_SEC" value =" 5" />
6
+ <value nick =" 10_SEC" value =" 10" />
7
+ </enum >
2
8
<enum id =" io.elementary.camera.settings.mode" >
3
9
<value nick =" photo" value =" 0" />
4
10
<value nick =" video" value =" 1" />
5
11
</enum >
6
12
<schema path =" /io/elementary/camera/settings/" id =" io.elementary.camera.settings" >
13
+ <key name =" delay" enum =" io.elementary.camera.settings.delay" >
14
+ <default >"DISABLED"</default >
15
+ <summary >The timed delay before taking a photo</summary >
16
+ <description >The timed delay before taking a photo</description >
17
+ </key >
7
18
<key name =" mode" enum =" io.elementary.camera.settings.mode" >
8
19
<default >"photo"</default >
9
20
<summary >The mode of the camera, photo or video</summary >
Original file line number Diff line number Diff line change 20
20
*/
21
21
22
22
public class Camera.Application : Gtk .Application {
23
+ public static GLib . Settings settings;
23
24
public MainWindow ? main_window = null ;
24
25
26
+ static construct {
27
+ settings = new Settings (" io.elementary.camera.settings" );
28
+ }
29
+
25
30
construct {
26
31
Intl . setlocale (LocaleCategory . ALL , " " );
27
32
application_id = " io.elementary.camera" ;
Original file line number Diff line number Diff line change @@ -47,14 +47,17 @@ public class Camera.Widgets.TimerButton : Gtk.Button {
47
47
}
48
48
}
49
49
50
- public Delay delay = Delay . DISABLED ;
50
+ public Delay delay;
51
51
52
52
construct {
53
+ delay = (Delay ) Camera . Application . settings. get_enum (" delay" );
54
+
53
55
var timer_image = new Gtk .Image .from_icon_name (" timer-symbolic" , Gtk . IconSize . SMALL_TOOLBAR );
54
56
var timer_label = new Gtk .Label (delay. to_string ());
55
57
56
58
this . clicked. connect (() = > {
57
59
delay = delay. next ();
60
+ Camera . Application . settings. set_enum (" delay" , delay);
58
61
timer_label. label = delay. to_string ();
59
62
});
60
63
You can’t perform that action at this time.
0 commit comments