[nautilus] Don't show the browse button for the connect to server standalone



commit 9cecb29d60afb3627946f109bf25641cbf99bdc0
Author: William Jon McCann <jmccann redhat com>
Date:   Mon Aug 27 16:50:59 2012 -0400

    Don't show the browse button for the connect to server standalone
    
    https://bugzilla.gnome.org/show_bug.cgi?id=682637

 src/nautilus-connect-server-dialog.c |    9 +++++++++
 src/nautilus-connect-server-dialog.h |    6 ++++--
 src/nautilus-connect-server.c        |    2 ++
 3 files changed, 15 insertions(+), 2 deletions(-)
---
diff --git a/src/nautilus-connect-server-dialog.c b/src/nautilus-connect-server-dialog.c
index b5c7b4a..21a88b1 100644
--- a/src/nautilus-connect-server-dialog.c
+++ b/src/nautilus-connect-server-dialog.c
@@ -45,6 +45,7 @@ struct _NautilusConnectServerDialogDetails {
 	GtkWidget *menu;
 	GtkWidget *remove_menu_item;
 	GtkWidget *clear_menu_item;
+	GtkWidget *browse_button;
 
 	char **supported;
 };
@@ -59,6 +60,13 @@ enum {
 G_DEFINE_TYPE (NautilusConnectServerDialog, nautilus_connect_server_dialog,
 	       GTK_TYPE_DIALOG)
 
+void
+nautilus_connect_server_dialog_set_show_browse (NautilusConnectServerDialog *dialog,
+						gboolean                     show)
+{
+	gtk_widget_set_visible (dialog->details->browse_button, show);
+}
+
 GFile *
 nautilus_connect_server_dialog_get_location (NautilusConnectServerDialog *dialog)
 {
@@ -684,6 +692,7 @@ nautilus_connect_server_dialog_init (NautilusConnectServerDialog *dialog)
 					GTK_RESPONSE_ACCEPT);
 	gtk_button_box_set_child_secondary (GTK_BUTTON_BOX (gtk_dialog_get_action_area (GTK_DIALOG (dialog))),
 					    button, TRUE);
+	dialog->details->browse_button = button;
 
 	gtk_dialog_add_button (GTK_DIALOG (dialog),
 			       GTK_STOCK_CANCEL,
diff --git a/src/nautilus-connect-server-dialog.h b/src/nautilus-connect-server-dialog.h
index e42c4b8..9f8cbd2 100644
--- a/src/nautilus-connect-server-dialog.h
+++ b/src/nautilus-connect-server-dialog.h
@@ -56,7 +56,9 @@ struct _NautilusConnectServerDialogClass {
 
 GType nautilus_connect_server_dialog_get_type (void);
 
-GtkWidget * nautilus_connect_server_dialog_new          (NautilusWindow *window);
-GFile *     nautilus_connect_server_dialog_get_location (NautilusConnectServerDialog *dialog);
+GtkWidget * nautilus_connect_server_dialog_new             (NautilusWindow *window);
+GFile *     nautilus_connect_server_dialog_get_location    (NautilusConnectServerDialog *dialog);
+void        nautilus_connect_server_dialog_set_show_browse (NautilusConnectServerDialog *dialog,
+							    gboolean                     show);
 
 #endif /* NAUTILUS_CONNECT_SERVER_DIALOG_H */
diff --git a/src/nautilus-connect-server.c b/src/nautilus-connect-server.c
index 5bfc769..acdda73 100644
--- a/src/nautilus-connect-server.c
+++ b/src/nautilus-connect-server.c
@@ -165,6 +165,8 @@ main (int argc, char *argv[])
 	g_option_context_free (context);
 
 	dialog = nautilus_connect_server_dialog_new (NULL);
+	nautilus_connect_server_dialog_set_show_browse (NAUTILUS_CONNECT_SERVER_DIALOG (dialog), FALSE);
+
 	gtk_window_set_default_icon_name ("folder-remote-symbolic");
 
 	g_signal_connect (dialog, "response",



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]