aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-09-18 12:57:37 -0300
committerGitHub <noreply@github.com>2018-09-18 12:57:37 -0300
commitc32d2bbe191a7549748fc44f438c2a3b7906b6dc (patch)
tree271e3a744d46f6d6d3068ba62c5b31d47023dc13
parentd95cf28ed7c69c896ba7d8f33452bce1e571884c (diff)
parent2ba02b7f99a05655feca585c27bd2e55bcefe014 (diff)
Merge pull request #25 from mchehab/schemas
More fixes for camorama schemas
-rw-r--r--data/camorama.schemas.in37
-rw-r--r--src/callbacks.c3
-rw-r--r--src/interface.h47
-rw-r--r--src/main.c12
4 files changed, 74 insertions, 25 deletions
diff --git a/data/camorama.schemas.in b/data/camorama.schemas.in
index 4453f15..d248247 100644
--- a/data/camorama.schemas.in
+++ b/data/camorama.schemas.in
@@ -14,6 +14,30 @@
</schema>
<schema>
+ <key>/schemas/apps/camorama/width</key>
+ <applyto>/apps/camorama/width</applyto>
+ <owner>camorama</owner>
+ <type>int</type>
+ <default>0</default>
+ <locale name="C">
+ <short>Image width</short>
+ <long>Image width used by the camera. Zero means autoselect</long>
+ </locale>
+ </schema>
+
+ <schema>
+ <key>/schemas/apps/camorama/height</key>
+ <applyto>/apps/camorama/height</applyto>
+ <owner>camorama</owner>
+ <type>int</type>
+ <default>0</default>
+ <locale name="C">
+ <short>Image height</short>
+ <long>Image height used by the camera. Zero means autoselect</long>
+ </locale>
+ </schema>
+
+ <schema>
<key>/schemas/apps/camorama/preferences/append_ts_to_file</key>
<applyto>/apps/camorama/preferences/append_ts_to_file</applyto>
<owner>camorama</owner>
@@ -112,6 +136,19 @@
</schema>
<schema>
+ <key>/schemas/apps/camorama/preferences/remote_uri</key>
+ <applyto>/apps/camorama/preferences/remote_uri</applyto>
+ <owner>camorama</owner>
+ <type>string</type>
+ <default>your-username</default>
+ <locale name="C">
+ <short>Complete URI used to store image snapshots remotely</short>
+ <long>The complete URI of the last successful access to a remote
+ server, including protocol, host and remote directory</long>
+ </locale>
+ </schema>
+
+ <schema>
<key>/schemas/apps/camorama/preferences/remote_append_ts_to_file</key>
<applyto>/apps/camorama/preferences/remote_append_ts_to_file</applyto>
<owner>camorama</owner>
diff --git a/src/callbacks.c b/src/callbacks.c
index 1e81fba..7966014 100644
--- a/src/callbacks.c
+++ b/src/callbacks.c
@@ -394,6 +394,9 @@ void set_image_scale(cam_t *cam)
gtk_window_set_title(GTK_WINDOW(GTK_WIDGET(gtk_builder_get_object(cam->xml, "main_window"))),
title);
g_free(title);
+
+ gconf_client_set_int(cam->gc, GCONF_WIDTH, cam->width, NULL);
+ gconf_client_set_int(cam->gc, GCONF_HEIGHT, cam->height, NULL);
}
void on_change_size_activate(GtkWidget *widget, cam_t *cam)
diff --git a/src/interface.h b/src/interface.h
index 6c89cd5..7083b38 100644
--- a/src/interface.h
+++ b/src/interface.h
@@ -1,24 +1,27 @@
-#define GCONF_PARENT "/apps/camorama/preferences"
+#define GCONF_PARENT "/apps/camorama"
+#define GCONF_PREFS GCONF_PARENT "/preferences"
#define GCONF_DEVICE GCONF_PARENT "/device"
-#define GCONF_SAVE_DIR GCONF_PARENT "/save_dir"
-#define GCONF_SAVE_FILE GCONF_PARENT "/save_file"
-#define GCONF_FILE_TYPE GCONF_PARENT "/file_type"
-#define GCONF_TIMESTAMP GCONF_PARENT "/timestamp"
-#define GCONF_HOSTNAME GCONF_PARENT "/hostname"
-#define GCONF_REMOTE_PROTO GCONF_PARENT "/remote_proto"
-#define GCONF_REMOTE_SAVE_DIR GCONF_PARENT "/remote_save_dir"
-#define GCONF_REMOTE_SAVE_FILE GCONF_PARENT "/remote_save_file"
-#define GCONF_REMOTE_FILE_TYPE GCONF_PARENT "/remote_file_type"
-#define GCONF_REMOTE_TIMESTAMP GCONF_PARENT "/remote_timestamp"
-#define GCONF_LOCAL_CAPTURE GCONF_PARENT "/local_capture"
-#define GCONF_REMOTE_CAPTURE GCONF_PARENT "/remote_capture"
-#define GCONF_LOCAL_APPEND_TS GCONF_PARENT "/append_ts_to_file"
-#define GCONF_REMOTE_APPEND_TS GCONF_PARENT "/remote_append_ts_to_file"
-#define GCONF_TIMESTAMP_STRING GCONF_PARENT "/timestamp_string"
-#define GCONF_USE_CUSTOM_STRING GCONF_PARENT "/use_custom_string"
-#define GCONF_DRAWDATE GCONF_PARENT "/drawdate"
-#define GCONF_AUTO_CAPTURE GCONF_PARENT "/auto_capture"
-#define GCONF_AUTO_CAPTURE_INTERVAL GCONF_PARENT "/auto_capture_interval"
-#define GCONF_SHOW_ADJUSTMENTS GCONF_PARENT "/show_adjustments"
-#define GCONF_SHOW_EFFECTS GCONF_PARENT "/show_effects"
+#define GCONF_WIDTH GCONF_PARENT "/width"
+#define GCONF_HEIGHT GCONF_PARENT "/height"
+#define GCONF_SAVE_DIR GCONF_PREFS "/save_dir"
+#define GCONF_SAVE_FILE GCONF_PREFS "/save_file"
+#define GCONF_FILE_TYPE GCONF_PREFS "/file_type"
+#define GCONF_TIMESTAMP GCONF_PREFS "/timestamp"
+#define GCONF_HOSTNAME GCONF_PREFS "/hostname"
+#define GCONF_REMOTE_PROTO GCONF_PREFS "/remote_proto"
+#define GCONF_REMOTE_SAVE_DIR GCONF_PREFS "/remote_save_dir"
+#define GCONF_REMOTE_SAVE_FILE GCONF_PREFS "/remote_save_file"
+#define GCONF_REMOTE_FILE_TYPE GCONF_PREFS "/remote_file_type"
+#define GCONF_REMOTE_TIMESTAMP GCONF_PREFS "/remote_timestamp"
+#define GCONF_LOCAL_CAPTURE GCONF_PREFS "/local_capture"
+#define GCONF_REMOTE_CAPTURE GCONF_PREFS "/remote_capture"
+#define GCONF_LOCAL_APPEND_TS GCONF_PREFS "/append_ts_to_file"
+#define GCONF_REMOTE_APPEND_TS GCONF_PREFS "/remote_append_ts_to_file"
+#define GCONF_TIMESTAMP_STRING GCONF_PREFS "/timestamp_string"
+#define GCONF_USE_CUSTOM_STRING GCONF_PREFS "/use_custom_string"
+#define GCONF_DRAWDATE GCONF_PREFS "/drawdate"
+#define GCONF_AUTO_CAPTURE GCONF_PREFS "/auto_capture"
+#define GCONF_AUTO_CAPTURE_INTERVAL GCONF_PREFS "/auto_capture_interval"
+#define GCONF_SHOW_ADJUSTMENTS GCONF_PREFS "/show_adjustments"
+#define GCONF_SHOW_EFFECTS GCONF_PREFS "/show_effects"
diff --git a/src/main.c b/src/main.c
index 6447f51..d49e1f2 100644
--- a/src/main.c
+++ b/src/main.c
@@ -129,9 +129,6 @@ static void activate(GtkApplication *app)
cam->debug = buggery;
- cam->width = x;
- cam->height = y;
-
get_geometry(cam);
if (ver) {
@@ -221,6 +218,15 @@ static void activate(GtkApplication *app)
NULL);
cam->show_effects = gconf_client_get_bool(cam->gc,
GCONF_SHOW_EFFECTS, NULL);
+ if (x)
+ cam->width = x;
+ else
+ cam->width = gconf_client_get_int(cam->gc, GCONF_WIDTH, NULL);
+
+ if (y)
+ cam->height = y;
+ else
+ cam->height = gconf_client_get_int(cam->gc, GCONF_HEIGHT, NULL);
if (use_read)
cam->dev = v4l2_open(cam->video_dev, O_RDWR);

Privacy Policy