var list = mce_ini_parse ();
- var dialog = new LedPatternDialog (list);
+ var dialog = new LedPatternDialog (list, osso);
dialog.set_transient_for (window);
int response = dialog.run ();
dialog.destroy ();
+ string command = null;
if (response == Gtk.ResponseType.OK) {
mce_ini_store (list);
+ Hildon.Banner.show_information (window, null, "Applying changes and restarting MCE ...");
+ command = "sudo /usr/bin/led-pattern-helper save %s".printf ("/tmp/mce.ini");
+ } else if (response == LedPatternDialog.Response.RESTORE) {
+ Hildon.Banner.show_information (window, null, "Restoring defaults and restarting MCE ...");
+ command = "sudo /usr/bin/led-pattern-helper save %s".printf ("/etc/mce/mce.ini.orig");
+ }
+ if (command != null) {
+ try {
+ int exit_status;
+ string error;
+ Process.spawn_command_line_sync (command, null, out error, out exit_status);
+ if (exit_status != 0) {
+ var information = "Exit status: %d\n%s".printf (exit_status, error);
+ var note = new Hildon.Note.information (window, information);
+ note.run ();
+ }
+ } catch (SpawnError e) {
+ Hildon.Banner.show_information (null, null, e.message);
+ }
}
return Osso.Status.OK;