Ejemplo n.º 1
0
static void
main_window_response (GtkWidget *widget,
                      gint response_id,
                      AppearanceData *data)
{
  if (response_id == GTK_RESPONSE_CLOSE ||
      response_id == GTK_RESPONSE_DELETE_EVENT)
  {
    gtk_main_quit ();

    themes_shutdown (data);
    style_shutdown (data);
    desktop_shutdown (data);
    font_shutdown (data);
    support_shutdown (data);

    g_object_unref (data->thumb_factory);
    g_object_unref (data->settings);
    g_object_unref (data->wp_settings);
    g_object_unref (data->caja_settings);
    g_object_unref (data->interface_settings);
    g_object_unref (data->marco_settings);
    g_object_unref (data->mouse_settings);
#ifdef HAVE_XFT2
    g_object_unref (data->font_settings);
#endif /* HAVE_XFT2 */
    g_object_unref (data->ui);
  }
  else if (response_id == GTK_RESPONSE_HELP)
  {
      GtkNotebook *nb;
      gint pindex;

      nb = GTK_NOTEBOOK (appearance_capplet_get_widget (data, "main_notebook"));
      pindex = gtk_notebook_get_current_page (nb);

      switch (pindex)
      {
        case 0: /* theme */
          capplet_help (GTK_WINDOW (widget), "goscustdesk-12");
          break;
        case 1: /* background */
          capplet_help (GTK_WINDOW (widget), "goscustdesk-7");
          break;
        case 2: /* fonts */
          capplet_help (GTK_WINDOW (widget), "goscustdesk-38");
          break;
        case 3: /* interface */
          capplet_help (GTK_WINDOW (widget), "goscustuserinter-2");
          break;
        default:
          capplet_help (GTK_WINDOW (widget), "prefs-look-and-feel");
          break;
       }
  }
}
static void
close_cb(GtkWidget* window, gint response, MateDACapplet* capplet)
{
    if (response == GTK_RESPONSE_HELP)
    {
        capplet_help(GTK_WINDOW(window), "prefs-preferredapps");
    }
    else
    {
        set_changed(GTK_COMBO_BOX(capplet->web_combo_box), capplet, capplet->web_browsers, DA_TYPE_WEB_BROWSER);
        set_changed(GTK_COMBO_BOX(capplet->mail_combo_box), capplet, capplet->mail_readers, DA_TYPE_EMAIL);
        set_changed(GTK_COMBO_BOX(capplet->file_combo_box), capplet, capplet->file_managers, DA_TYPE_FILE);
        set_changed(GTK_COMBO_BOX(capplet->text_combo_box), capplet, capplet->text_editors, DA_TYPE_TEXT);
        set_changed(GTK_COMBO_BOX(capplet->media_combo_box), capplet, capplet->media_players, DA_TYPE_MEDIA);
        set_changed(GTK_COMBO_BOX(capplet->video_combo_box), capplet, capplet->video_players, DA_TYPE_VIDEO);
        set_changed(GTK_COMBO_BOX(capplet->term_combo_box), capplet, capplet->terminals, DA_TYPE_TERMINAL);
        set_changed(GTK_COMBO_BOX(capplet->visual_combo_box), capplet, capplet->visual_ats, DA_TYPE_VISUAL);
        set_changed(GTK_COMBO_BOX(capplet->mobility_combo_box), capplet, capplet->mobility_ats, DA_TYPE_MOBILITY);
        set_changed(GTK_COMBO_BOX(capplet->image_combo_box), capplet, capplet->image_viewers, DA_TYPE_IMAGE);
        set_changed(GTK_COMBO_BOX(capplet->document_combo_box), capplet, capplet->document_viewers, DA_TYPE_DOCUMENT);
        set_changed(GTK_COMBO_BOX(capplet->word_combo_box), capplet, capplet->word_editors, DA_TYPE_WORD);
        set_changed(GTK_COMBO_BOX(capplet->spreadsheet_combo_box), capplet, capplet->spreadsheet_editors, DA_TYPE_SPREADSHEET);

        gtk_widget_destroy(window);
        gtk_main_quit();
    }
}
static void
cb_details_response (GtkDialog *dialog, gint response_id)
{
  if (response_id == GTK_RESPONSE_HELP) {
    capplet_help (GTK_WINDOW (dialog),
		  "goscustdesk-38");
  } else
    gtk_widget_hide (GTK_WIDGET (dialog));
}
static void
dialog_response_cb (GtkDialog *dialog, gint response_id, gpointer data)
{
	if (response_id == GTK_RESPONSE_HELP)
		capplet_help (GTK_WINDOW (dialog),
			      "goscustperiph-5");
	else
		gtk_main_quit ();
}
static void
dialog_response (GtkWidget * widget,
		 gint response_id, guint data)
{
	if (response_id == GTK_RESPONSE_HELP)
		capplet_help (GTK_WINDOW (widget), "goscustperiph-2");
	else
		gtk_main_quit ();
}
static void
style_response_cb (GtkDialog *dialog, gint response_id)
{
  if (response_id == GTK_RESPONSE_HELP) {
    capplet_help (GTK_WINDOW (dialog), "goscustdesk-61");
  } else {
    gtk_widget_hide (GTK_WIDGET (dialog));
  }
}
static void
dialog_response_cb (GtkDialog *dialog, gint response_id, GConfChangeSet *changeset)
{
	if (response_id == GTK_RESPONSE_HELP)
		capplet_help (GTK_WINDOW (dialog),
			      "user-guide.xml",
			      "goscustperiph-5");
	else
		gtk_main_quit ();
}
static void
cb_details_dialog_response (GtkDialog *dialog, gint response_id)
{
	if (response_id == GTK_RESPONSE_HELP)
		capplet_help (GTK_WINDOW (dialog),
			      "goscustdesk-50");
	else {
		gtk_widget_destroy (GTK_WIDGET (dialog));
		details_dialog = NULL;
	}
}
static void
response_cb (GtkWidget *dialog_win,
             int    response_id,
             void      *data)
{

    if (response_id == GTK_RESPONSE_HELP) {
        capplet_help (GTK_WINDOW (dialog_win), "goscustdesk-58");
    } else {
        gtk_widget_destroy (dialog_win);
    }
}
static void
dialog_response_cb (GtkWidget *dialog, gint response_id, GConfChangeSet *changeset)
{
	if (response_id == GTK_RESPONSE_HELP) {
		capplet_help (GTK_WINDOW (dialog),
			"user-guide.xml",
			"goscustmulti-2");
		return;
	}

	gtk_widget_destroy (dialog);
}
static void close_cb(GtkWidget* window, gint response, gpointer user_data)
{
	if (response == GTK_RESPONSE_HELP)
	{
		capplet_help (GTK_WINDOW (window), "prefs-preferredapps");
	}
	else
	{
		gtk_widget_destroy (window);
		gtk_main_quit ();
	}
}
static void
cb_dialog_response (GtkDialog *dialog, gint response_id)
{
	if (response_id == GTK_RESPONSE_HELP)
		capplet_help (GTK_WINDOW (dialog),
			"goscustdesk-50");
	else if (response_id == GTK_RESPONSE_CLOSE || response_id == GTK_RESPONSE_DELETE_EVENT)
	{
		if (ignore_hosts) {
			g_slist_foreach (ignore_hosts, (GFunc) g_free, NULL);
			g_slist_free (ignore_hosts);
		}

		gtk_main_quit ();
	}
}
static void
chooser_response_cb (GtkDialog * dialog, gint response, gpointer data)
{
	switch (response) {
	case GTK_RESPONSE_HELP:
		capplet_help (GTK_WINDOW (dialog),
			      "prefs-keyboard#prefs-keyboard-layoutoptions");
		break;
	case GTK_RESPONSE_CLOSE:{
			/* just cleanup */
			GSList *expanders_list =
			    g_object_get_data (G_OBJECT (dialog),
					       EXPANDERS_PROP);
			g_object_set_data (G_OBJECT (dialog),
					   EXPANDERS_PROP, NULL);
			g_slist_free (expanders_list);

			gtk_widget_destroy (GTK_WIDGET (dialog));
			chooser_dialog = NULL;
		}
		break;
	}
}