Commit d9acd8a1 authored by Alexander Larsson's avatar Alexander Larsson Committed by Alexander Larsson

Require glib 2.19.0

2008-10-13  Alexander Larsson  <alexl@redhat.com>

        * configure.in:
	Require glib 2.19.0
	
        * libnautilus-private/nautilus-open-with-dialog.c:
	Allow removal of custom applications (#545354)
	Patch from Matthias Clasen


svn path=/trunk/; revision=14724
parent a60444a5
2008-10-13 Alexander Larsson <alexl@redhat.com>
* configure.in:
Require glib 2.19.0
* libnautilus-private/nautilus-open-with-dialog.c:
Allow removal of custom applications (#545354)
Patch from Matthias Clasen
2008-10-13 Alexander Larsson <alexl@redhat.com>
* libnautilus-private/nautilus-open-with-dialog.c:
......
......@@ -3,7 +3,7 @@ AC_PREREQ(2.54)
dnl ===========================================================================
m4_define(eel_minver, 2.25.1)
m4_define(glib_minver, 2.17.5)
m4_define(glib_minver, 2.19.0)
m4_define(gnome_desktop_minver, 2.9.91)
m4_define(pango_minver, 1.1.2)
m4_define(gtk_minver, 2.13.0)
......
......@@ -72,7 +72,8 @@ enum {
};
enum {
RESPONSE_OPEN
RESPONSE_OPEN,
RESPONSE_REMOVE
};
enum {
......@@ -294,6 +295,33 @@ response_cb (NautilusOpenWithDialog *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:
......@@ -655,6 +683,9 @@ program_list_selection_changed (GtkTreeSelection *selection,
if (!gtk_tree_selection_get_selected (selection, &model, &iter)) {
gtk_widget_set_sensitive (dialog->details->button, FALSE);
gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog),
RESPONSE_REMOVE,
FALSE);
return;
}
......@@ -672,6 +703,9 @@ program_list_selection_changed (GtkTreeSelection *selection,
gtk_label_set_text (GTK_LABEL (dialog->details->desc_label),
sure_string (g_app_info_get_description (info)));
gtk_widget_set_sensitive (dialog->details->button, TRUE);
gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog),
RESPONSE_REMOVE,
g_app_info_can_delete (info));
if (dialog->details->selected_app_info) {
g_object_unref (dialog->details->selected_app_info);
......@@ -809,6 +843,13 @@ nautilus_open_with_dialog_instance_init (NautilusOpenWithDialog *dialog)
gtk_box_pack_start (GTK_BOX (hbox), dialog->details->button, FALSE, FALSE, 0);
gtk_widget_show (dialog->details->button);
gtk_dialog_add_button (GTK_DIALOG (dialog),
GTK_STOCK_REMOVE,
RESPONSE_REMOVE);
gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog),
RESPONSE_REMOVE,
FALSE);
gtk_dialog_add_button (GTK_DIALOG (dialog),
GTK_STOCK_CANCEL,
GTK_RESPONSE_CANCEL);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment