Use SAVE as a button.
[tweakr] / modules / maemo-tweaks-desktop.c
index 39754c5..541c852 100644 (file)
@@ -152,7 +152,7 @@ GtkWidget * _build_snap_to_grid (void)
 
     hildon_button_set_title (HILDON_BUTTON (button),
                              "Snap desktop icons to grid");
-
+    gtk_button_set_alignment (GTK_BUTTON (button), 0.0f, 0.5f);
     hildon_picker_button_set_selector (HILDON_PICKER_BUTTON (button),
                                        HILDON_TOUCH_SELECTOR (selector));
 
@@ -221,13 +221,22 @@ maemo_tweaks_desktop_section_dispose (GObject *obj)
 
 static void _save (MaemoTweaksSection *section)
 {
-    gint active =
-        hildon_picker_button_get_active
-            (HILDON_PICKER_BUTTON
-             (MAEMO_TWEAKS_DESKTOP_SECTION (section)->snap_button));
-
-    g_key_file_set_integer (MAEMO_TWEAKS_DESKTOP_SECTION (section)->ini,
-                            "edit_mode", "snap_grid_size",
-                            snap_values [active]);
+    gchar *argv[3];
+    gint active;
+
+    active = hildon_picker_button_get_active
+        (HILDON_PICKER_BUTTON (MAEMO_TWEAKS_DESKTOP_SECTION
+                               (section)->snap_button));
+
+    argv[0] = g_strdup ("/usr/bin/maemo-tweaks-desktop-save");
+    argv[1] = g_strdup_printf ("%d", snap_values[active]);
+    argv[2] = NULL;
+
+    g_spawn_sync ("/home/user", argv, NULL,
+                  G_SPAWN_STDOUT_TO_DEV_NULL | G_SPAWN_STDERR_TO_DEV_NULL,
+                  NULL, NULL, NULL, NULL, NULL, NULL);
+
+    g_free (argv[0]);
+    g_free (argv[1]);
 }