static void
gtk_app_chooser_dialog_response (GtkDialog *dialog,
                                 gint       response_id,
                                 gpointer   user_data)
{
  GtkAppChooserDialog *self = GTK_APP_CHOOSER_DIALOG (dialog);

  switch (response_id)
    {
    case GTK_RESPONSE_OK:
      add_or_find_application (self);
      break;
    default :
      break;
    }
}
static void
gtk_app_chooser_dialog_response (GtkDialog *dialog,
                                 gint       response_id,
                                 gpointer   user_data)
{
  GtkAppChooserDialog *self = GTK_APP_CHOOSER_DIALOG (dialog);

  switch (response_id)
    {
    case GTK_RESPONSE_OK:
      add_or_find_application (self);
      break;
    case GTK_RESPONSE_CANCEL:
    case GTK_RESPONSE_DELETE_EVENT:
      self->priv->dismissed = TRUE;
    default:
      break;
    }
}
static void
response_cb (CajaOpenWithDialog *dialog,
             int response_id,
             gpointer data)
{
    GAppInfo *application;

    switch (response_id)
    {
    case RESPONSE_OPEN:
        if (check_application (dialog))
        {
            application = add_or_find_application (dialog);

            if (application)
            {
                emit_application_selected (dialog, application);
                g_object_unref (application);

                gtk_widget_destroy (GTK_WIDGET (dialog));
            }
        }

        break;
    case RESPONSE_REMOVE:
        if (dialog->details->selected_app_info != NULL)
        {
            if (g_app_info_delete (dialog->details->selected_app_info))
            {
                GtkTreeModel *model;
                GtkTreeIter iter;
                GAppInfo *info, *selected;

                selected = dialog->details->selected_app_info;
                dialog->details->selected_app_info = NULL;

                model = GTK_TREE_MODEL (dialog->details->program_list_store);
                if (gtk_tree_model_get_iter_first (model, &iter))
                {
                    do
                    {
                        gtk_tree_model_get (model, &iter,
                                            COLUMN_APP_INFO, &info,
                                            -1);
                        if (g_app_info_equal (selected, info))
                        {
                            gtk_list_store_remove (dialog->details->program_list_store, &iter);
                            break;
                        }
                    }
                    while (gtk_tree_model_iter_next (model, &iter));
                }

                g_object_unref (selected);
            }
        }
        break;
    case GTK_RESPONSE_NONE:
    case GTK_RESPONSE_DELETE_EVENT:
    case GTK_RESPONSE_CANCEL:
        gtk_widget_destroy (GTK_WIDGET (dialog));
        break;
    default :
        g_assert_not_reached ();
    }

}