public static void RunIfAppropriate() { // Don't need to do anything if we're already the default if (!DefaultApplicationHelper.NeverAsk && !DefaultApplicationHelper.IsDefault) { if (DefaultApplicationHelper.RememberChoiceSchema.Get()) { // Not default, but were told to remember 'make default', so just make it default w/o the dialog DefaultApplicationHelper.MakeDefault(); } else { Banshee.Gui.Dialogs.DefaultApplicationHelperDialog dialog = new Banshee.Gui.Dialogs.DefaultApplicationHelperDialog(); try { if (!DefaultApplicationHelper.EverAskedSchema.Get()) { dialog.Remember = true; } int resp = dialog.Run(); DefaultApplicationHelper.RememberChoiceSchema.Set(dialog.Remember); if (resp == (int)Gtk.ResponseType.Yes) { DefaultApplicationHelper.MakeDefaultSchema.Set(true); DefaultApplicationHelper.MakeDefault(); } else { DefaultApplicationHelper.MakeDefaultSchema.Set(false); } DefaultApplicationHelper.EverAskedSchema.Set(true); } finally { dialog.Destroy(); } } } }
public static void RunIfAppropriate() { // Don't need to do anything if we're already the default if (!DefaultApplicationHelper.NeverAsk && !DefaultApplicationHelper.IsDefault) { if (DefaultApplicationHelper.RememberChoiceSchema.Get ()) { // Not default, but were told to remember 'make default', so just make it default w/o the dialog DefaultApplicationHelper.MakeDefault (); } else { Banshee.Gui.Dialogs.DefaultApplicationHelperDialog dialog = new Banshee.Gui.Dialogs.DefaultApplicationHelperDialog (); try { if (!DefaultApplicationHelper.EverAskedSchema.Get ()) { dialog.Remember = true; } int resp = dialog.Run (); DefaultApplicationHelper.RememberChoiceSchema.Set (dialog.Remember); if (resp == (int)Gtk.ResponseType.Yes) { DefaultApplicationHelper.MakeDefaultSchema.Set (true); DefaultApplicationHelper.MakeDefault (); } else { DefaultApplicationHelper.MakeDefaultSchema.Set (false); } DefaultApplicationHelper.EverAskedSchema.Set (true); } finally { dialog.Destroy (); } } } }