static void launch_pilot_settings (const char *extra_arg) { char *args[] = { "gpilotd-control-applet", (char *) extra_arg, NULL }; int pid; args[0] = g_find_program_in_path ("gpilotd-control-applet"); if (!args[0]) { e_notice (NULL, GTK_MESSAGE_ERROR, _("The GNOME Pilot tools do not appear to be installed on this system.")); return; } pid = gnome_execute_async (NULL, extra_arg ? 2 : 1, args); g_free (args[0]); if (pid == -1) e_notice (NULL, GTK_MESSAGE_ERROR, _("Error executing %s."), args[0]); }
static void already_running(void) { GtkWidget *dialog; GtkWidget *close; GtkWidget *prefs; gchar *accelerator; GError *err = NULL; gint response; accelerator = gconf_client_get_string(ocha_gconf_get_client(), OCHA_GCONF_ACCELERATOR_KEY, &err); if(accelerator==NULL) { accelerator=OCHA_GCONF_ACCELERATOR_KEY_DEFAULT; g_error_free(err); } dialog = gtk_message_dialog_new(NULL, 0/*flags*/, GTK_MESSAGE_INFO, GTK_BUTTONS_NONE, "Ocha is already active on your system. To start " "a new search, hit %s.\n\n" "Alternatively, you can open Ocha's preference panel " "or stop Ocha", accelerator); prefs=gtk_dialog_add_button(GTK_DIALOG(dialog), "Open Preferences", 1); gtk_button_set_image(GTK_BUTTON(prefs), gtk_image_new_from_stock(GTK_STOCK_PREFERENCES, GTK_ICON_SIZE_BUTTON)); gtk_dialog_add_button(GTK_DIALOG(dialog), "Stop Ocha", 2); close=gtk_dialog_add_button(GTK_DIALOG(dialog), "Close", 3); gtk_button_set_image(GTK_BUTTON(close), gtk_image_new_from_stock(GTK_STOCK_CLOSE, GTK_ICON_SIZE_BUTTON)); gtk_dialog_set_default_response(GTK_DIALOG(dialog), 3); response=gtk_dialog_run(GTK_DIALOG(dialog)); gtk_widget_destroy(dialog); switch(response) { case 1: /* preferences */ gnome_execute_async(NULL/*current dir*/, ocha_init_preferences_argc, ocha_init_preferences_argv); break; case 2: /* kill ocha */ ocha_init_kill(); gtk_main(); break; } }