Merge branch 'edit_label' into 'master'

nautilus-properties-window: Add a button to open gnome-disks

Closes #20

See merge request GNOME/nautilus!113
This commit is contained in:
Carlos Soriano 2018-03-14 15:24:23 +00:00
commit 0ccb8473eb

View file

@ -3095,6 +3095,30 @@ create_volume_usage_widget (NautilusPropertiesWindow *window)
return piewidget; return piewidget;
} }
static void
open_in_disks (GtkButton *button,
NautilusPropertiesWindow *self)
{
g_autofree char *message = NULL;
g_autoptr (GError) error = NULL;
g_autoptr (GAppInfo) app_info = NULL;
app_info = g_app_info_create_from_commandline ("gnome-disks",
NULL,
G_APP_INFO_CREATE_NONE,
NULL);
g_app_info_launch (app_info, NULL, NULL, &error);
if (error != NULL)
{
message = g_strdup_printf (_("Details: %s"), error->message);
eel_show_error_dialog (_("There was an error launching the application."),
message,
GTK_WINDOW (self));
}
}
static void static void
create_basic_page (NautilusPropertiesWindow *window) create_basic_page (NautilusPropertiesWindow *window)
{ {
@ -3102,6 +3126,7 @@ create_basic_page (NautilusPropertiesWindow *window)
GtkWidget *icon_pixmap_widget; GtkWidget *icon_pixmap_widget;
GtkWidget *volume_usage; GtkWidget *volume_usage;
GtkWidget *hbox, *vbox; GtkWidget *hbox, *vbox;
GtkWidget *button;
hbox = create_page_with_box (window->details->notebook, hbox = create_page_with_box (window->details->notebook,
GTK_ORIENTATION_HORIZONTAL, GTK_ORIENTATION_HORIZONTAL,
@ -3243,6 +3268,15 @@ create_basic_page (NautilusPropertiesWindow *window)
"width", 3, "width", 3,
NULL); NULL);
} }
/*Translators: Here Disks mean the name of application GNOME Disks.*/
button = gtk_button_new_with_label (_("Open in Disks"));
g_signal_connect (button, "clicked", G_CALLBACK (open_in_disks), NULL);
gtk_container_add_with_properties (GTK_CONTAINER (grid),
button,
"width", 3,
NULL);
gtk_widget_show_all (GTK_WIDGET (grid));
} }
} }