Long press is long press.
[tweakr] / maemo-tweaks.c
index 1fbff09..9679937 100644 (file)
@@ -4,6 +4,7 @@
 
 #include <hildon-cp-plugin/hildon-cp-plugin-interface.h>
 #include <gtk/gtk.h>
+#include <hildon/hildon-note.h>
 
 #include "maemo-tweaks-types.h"
 #include "libmaemo-tweaks-section/maemo-tweaks-section.h"
@@ -17,7 +18,7 @@ GtkWidget *create_dialog (GtkWindow *parent)
         ("Maemo 5 Tweaks",
          parent,
          GTK_DIALOG_MODAL | GTK_DIALOG_NO_SEPARATOR,
-         GTK_STOCK_OK,
+         GTK_STOCK_SAVE,
          GTK_RESPONSE_OK,
          GTK_STOCK_CANCEL,
          GTK_RESPONSE_CANCEL,
@@ -37,6 +38,7 @@ osso_return_t execute (osso_context_t *osso, gpointer data,
     guint n_sections;
     GList *sections = NULL;
     gint i;
+    gboolean requires_restart = FALSE;
 
     manager = g_object_new (MAEMO_TWEAKS_TYPE_MODULE_MANAGER,
                             "module-path", MODULES_DIR,
@@ -67,10 +69,10 @@ osso_return_t execute (osso_context_t *osso, gpointer data,
     if (response == GTK_RESPONSE_OK)
     {
         /* Save all settings */
-        g_list_foreach (sections, (GFunc) maemo_tweaks_section_save, NULL);
+        g_list_foreach (sections, (GFunc) maemo_tweaks_section_save,
+                        &requires_restart);
     }
 
-
     gtk_widget_destroy (GTK_WIDGET (dialog));
     g_object_unref (manager);
     if (sections)
@@ -79,6 +81,17 @@ osso_return_t execute (osso_context_t *osso, gpointer data,
         g_list_free (sections);
     }
 
+    if (requires_restart)
+    {
+        GtkWidget *note;
+
+        note = hildon_note_new_information
+            (GTK_WINDOW (data), "Some of the settings you have changed"
+             " will take effect only after you restart your device.");
+        gtk_dialog_run (GTK_DIALOG (note));
+        gtk_widget_destroy (note);
+    }
+
     return OSSO_OK;
 }