Commit ef23f879 authored by Cosimo Cecchi's avatar Cosimo Cecchi

view: remove unused Connect To Server Link action

This was supposed to be used with "nautilus links", which is a feature
we don't have anymore. In fact, the code was commented out since the GIO
transition, and is basically unused.
Remove it completely.
parent 133db531
......@@ -97,7 +97,6 @@
#define NAUTILUS_ACTION_REDO "Redo"
#define NAUTILUS_ACTION_RESET_TO_DEFAULTS "Reset to Defaults"
#define NAUTILUS_ACTION_CONNECT_TO_SERVER "Connect to Server"
#define NAUTILUS_ACTION_CONNECT_TO_SERVER_LINK "Connect To Server Link"
#define NAUTILUS_ACTION_MOUNT_VOLUME "Mount Volume"
#define NAUTILUS_ACTION_UNMOUNT_VOLUME "Unmount Volume"
#define NAUTILUS_ACTION_EJECT_VOLUME "Eject Volume"
......
......@@ -7133,135 +7133,6 @@ action_location_detect_media_callback (GtkAction *action,
nautilus_file_poll_for_media (file);
}
static void
connect_to_server_response_callback (GtkDialog *dialog,
int response_id,
gpointer data)
{
#ifdef GIO_CONVERSION_DONE
GtkEntry *entry;
char *uri;
const char *name;
char *icon;
entry = GTK_ENTRY (data);
switch (response_id) {
case GTK_RESPONSE_OK:
uri = g_object_get_data (G_OBJECT (dialog), "link-uri");
icon = g_object_get_data (G_OBJECT (dialog), "link-icon");
name = gtk_entry_get_text (entry);
gnome_vfs_connect_to_server (uri, (char *)name, icon);
gtk_widget_destroy (GTK_WIDGET (dialog));
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 ();
}
#endif
/* FIXME: the above code should make a server connection permanent */
gtk_widget_destroy (GTK_WIDGET (dialog));
}
static void
entry_activate_callback (GtkEntry *entry,
gpointer user_data)
{
GtkDialog *dialog;
dialog = GTK_DIALOG (user_data);
gtk_dialog_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
}
static void
action_connect_to_server_link_callback (GtkAction *action,
gpointer data)
{
NautilusFile *file;
GList *selection;
NautilusView *view;
char *uri;
NautilusIconInfo *icon;
const char *icon_name;
char *name;
GtkWidget *dialog;
GtkWidget *label;
GtkWidget *entry;
GtkWidget *box;
char *title;
view = NAUTILUS_VIEW (data);
selection = nautilus_view_get_selection (view);
if (g_list_length (selection) != 1) {
nautilus_file_list_free (selection);
return;
}
file = NAUTILUS_FILE (selection->data);
uri = nautilus_file_get_activation_uri (file);
icon = nautilus_file_get_icon (file, NAUTILUS_ICON_SIZE_STANDARD, 0);
icon_name = nautilus_icon_info_get_used_name (icon);
name = nautilus_file_get_display_name (file);
if (uri != NULL) {
title = g_strdup_printf (_("Connect to Server %s"), name);
dialog = gtk_dialog_new_with_buttons (title,
nautilus_view_get_containing_window (view),
0,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
_("_Connect"), GTK_RESPONSE_OK,
NULL);
g_object_set_data_full (G_OBJECT (dialog), "link-uri", g_strdup (uri), g_free);
g_object_set_data_full (G_OBJECT (dialog), "link-icon", g_strdup (icon_name), g_free);
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), 2);
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
gtk_widget_show (box);
gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))),
box, TRUE, TRUE, 0);
label = gtk_label_new_with_mnemonic (_("Link _name:"));
gtk_widget_show (label);
gtk_box_pack_start (GTK_BOX (box), label, TRUE, TRUE, 12);
entry = gtk_entry_new ();
if (name) {
gtk_entry_set_text (GTK_ENTRY (entry), name);
}
g_signal_connect (entry,
"activate",
G_CALLBACK (entry_activate_callback),
dialog);
gtk_widget_show (entry);
gtk_label_set_mnemonic_widget (GTK_LABEL (label), entry);
gtk_box_pack_start (GTK_BOX (box), entry, TRUE, TRUE, 12);
gtk_dialog_set_default_response (GTK_DIALOG (dialog),
GTK_RESPONSE_OK);
g_signal_connect (dialog, "response",
G_CALLBACK (connect_to_server_response_callback),
entry);
gtk_widget_show (dialog);
}
g_free (uri);
g_object_unref (icon);
g_free (name);
}
static void
action_location_open_alternate_callback (GtkAction *action,
gpointer callback_data)
......@@ -7592,10 +7463,6 @@ static const GtkActionEntry directory_view_entries[] = {
/* label, accelerator */ N_("Reset View to _Defaults"), NULL,
/* tooltip */ N_("Reset sorting order and zoom level to match preferences for this view"),
G_CALLBACK (action_reset_to_defaults_callback) },
/* name, stock id */ { NAUTILUS_ACTION_CONNECT_TO_SERVER_LINK, NULL,
/* label, accelerator */ N_("Connect To This Server"), NULL,
/* tooltip */ N_("Make a permanent connection to this server"),
G_CALLBACK (action_connect_to_server_link_callback) },
/* name, stock id */ { NAUTILUS_ACTION_MOUNT_VOLUME, NULL,
/* label, accelerator */ N_("_Mount"), NULL,
/* tooltip */ N_("Mount the selected volume"),
......@@ -7977,18 +7844,14 @@ file_should_show_foreach (NautilusFile *file,
gboolean *show_mount,
gboolean *show_unmount,
gboolean *show_eject,
gboolean *show_connect,
gboolean *show_start,
gboolean *show_stop,
gboolean *show_poll,
GDriveStartStopType *start_stop_type)
{
char *uri;
*show_mount = FALSE;
*show_unmount = FALSE;
*show_eject = FALSE;
*show_connect = FALSE;
*show_start = FALSE;
*show_stop = FALSE;
*show_poll = FALSE;
......@@ -8020,19 +7883,6 @@ file_should_show_foreach (NautilusFile *file,
}
*start_stop_type = nautilus_file_get_start_stop_type (file);
if (nautilus_file_is_nautilus_link (file)) {
uri = nautilus_file_get_activation_uri (file);
if (uri != NULL &&
(g_str_has_prefix (uri, "ftp:") ||
g_str_has_prefix (uri, "ssh:") ||
g_str_has_prefix (uri, "sftp:") ||
g_str_has_prefix (uri, "dav:") ||
g_str_has_prefix (uri, "davs:"))) {
*show_connect = TRUE;
}
g_free (uri);
}
}
static void
......@@ -8250,7 +8100,6 @@ real_update_menus_volumes (NautilusView *view,
gboolean show_mount;
gboolean show_unmount;
gboolean show_eject;
gboolean show_connect;
gboolean show_start;
gboolean show_stop;
gboolean show_poll;
......@@ -8267,7 +8116,6 @@ real_update_menus_volumes (NautilusView *view,
show_mount = (selection != NULL);
show_unmount = (selection != NULL);
show_eject = (selection != NULL);
show_connect = (selection != NULL && selection_count == 1);
show_start = (selection != NULL && selection_count == 1);
show_stop = (selection != NULL && selection_count == 1);
show_poll = (selection != NULL && selection_count == 1);
......@@ -8275,14 +8123,13 @@ real_update_menus_volumes (NautilusView *view,
self_start_stop_type = G_DRIVE_START_STOP_TYPE_UNKNOWN;
for (l = selection; l != NULL && (show_mount || show_unmount
|| show_eject || show_connect
|| show_eject
|| show_start || show_stop
|| show_poll);
l = l->next) {
gboolean show_mount_one;
gboolean show_unmount_one;
gboolean show_eject_one;
gboolean show_connect_one;
gboolean show_start_one;
gboolean show_stop_one;
gboolean show_poll_one;
......@@ -8292,7 +8139,6 @@ real_update_menus_volumes (NautilusView *view,
&show_mount_one,
&show_unmount_one,
&show_eject_one,
&show_connect_one,
&show_start_one,
&show_stop_one,
&show_poll_one,
......@@ -8301,16 +8147,11 @@ real_update_menus_volumes (NautilusView *view,
show_mount &= show_mount_one;
show_unmount &= show_unmount_one;
show_eject &= show_eject_one;
show_connect &= show_connect_one;
show_start &= show_start_one;
show_stop &= show_stop_one;
show_poll &= show_poll_one;
}
action = gtk_action_group_get_action (view->details->dir_action_group,
NAUTILUS_ACTION_CONNECT_TO_SERVER_LINK);
gtk_action_set_visible (action, show_connect);
action = gtk_action_group_get_action (view->details->dir_action_group,
NAUTILUS_ACTION_MOUNT_VOLUME);
gtk_action_set_visible (action, show_mount);
......@@ -8482,7 +8323,6 @@ real_update_location_menu_volumes (NautilusView *view)
gboolean show_mount;
gboolean show_unmount;
gboolean show_eject;
gboolean show_connect;
gboolean show_start;
gboolean show_stop;
gboolean show_poll;
......@@ -8496,7 +8336,6 @@ real_update_location_menu_volumes (NautilusView *view)
&show_mount,
&show_unmount,
&show_eject,
&show_connect,
&show_start,
&show_stop,
&show_poll,
......
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