[nautilus/wip/gbsneto/other-locations: 2/4] application: drop connect to server dialog



commit 325313a988c52b1b6b78a2f9b1a3d2d85ffbacfe
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Tue Jun 16 17:14:57 2015 -0300

    application: drop connect to server dialog

 src/nautilus-application-actions.c |   12 -----
 src/nautilus-application.c         |   80 ++----------------------------------
 src/nautilus-application.h         |    3 -
 3 files changed, 4 insertions(+), 91 deletions(-)
---
diff --git a/src/nautilus-application-actions.c b/src/nautilus-application-actions.c
index 3caa09e..204ba08 100644
--- a/src/nautilus-application-actions.c
+++ b/src/nautilus-application-actions.c
@@ -50,17 +50,6 @@ action_new_window (GSimpleAction *action,
 }
 
 static void
-action_connect_to_server (GSimpleAction *action,
-                         GVariant *parameter,
-                         gpointer user_data)
-{
-       GtkApplication *application = user_data;
-
-       nautilus_application_connect_server (NAUTILUS_APPLICATION (application),
-                                            NAUTILUS_WINDOW (gtk_application_get_active_window 
(application)));
-}
-
-static void
 action_bookmarks (GSimpleAction *action,
                  GVariant *parameter,
                  gpointer user_data)
@@ -250,7 +239,6 @@ action_show_hide_sidebar (GSimpleAction *action,
 
 static GActionEntry app_entries[] = {
        { "new-window", action_new_window, NULL, NULL, NULL },
-       { "connect-to-server", action_connect_to_server, NULL, NULL, NULL },
        { "bookmarks", action_bookmarks, NULL, NULL, NULL },
        { "preferences", action_preferences, NULL, NULL, NULL },
        { "show-hide-sidebar", NULL, NULL, "true", action_show_hide_sidebar },
diff --git a/src/nautilus-application.c b/src/nautilus-application.c
index bde2330..9de9125 100644
--- a/src/nautilus-application.c
+++ b/src/nautilus-application.c
@@ -31,7 +31,6 @@
 
 #include "nautilus-application-actions.h"
 #include "nautilus-bookmarks-window.h"
-#include "nautilus-connect-server-dialog.h"
 #include "nautilus-dbus-manager.h"
 #include "nautilus-desktop-window.h"
 #include "nautilus-freedesktop-dbus.h"
@@ -78,8 +77,6 @@ struct _NautilusApplicationPriv {
 
        NautilusBookmarkList *bookmark_list;
 
-       GtkWidget *connect_server_window;
-
        NautilusShellSearchProvider *search_provider;
 
        GList *windows;
@@ -519,71 +516,6 @@ nautilus_application_open (GApplication *app,
        }
 }
 
-static gboolean
-go_to_server_cb (NautilusWindow *window,
-                GFile          *location,
-                GError         *error,
-                gpointer        user_data)
-{
-       gboolean retval;
-       NautilusFile *file;
-
-       if (error == NULL) {
-               file = nautilus_file_get_existing (location);
-               nautilus_connect_server_dialog_add_server (file);
-               nautilus_file_unref (file);
-
-               retval = TRUE;
-       } else {
-               retval = FALSE;
-       }
-
-       return retval;
-}
-
-static void
-on_connect_server_response (GtkDialog      *dialog,
-                           int             response,
-                           GtkApplication *application)
-{
-       if (response == GTK_RESPONSE_OK) {
-               GFile *location;
-               NautilusWindow *window = NAUTILUS_WINDOW (gtk_application_get_active_window (application));
-
-               location = nautilus_connect_server_dialog_get_location (NAUTILUS_CONNECT_SERVER_DIALOG 
(dialog));
-               if (location != NULL) {
-                       nautilus_window_slot_open_location_full (nautilus_window_get_active_slot (window),
-                                                                location,
-                                                                
NAUTILUS_WINDOW_OPEN_FLAG_USE_DEFAULT_LOCATION,
-                                                                NULL, go_to_server_cb, application);
-               }
-       }
-
-       gtk_widget_destroy (GTK_WIDGET (dialog));
-}
-
-GtkWidget *
-nautilus_application_connect_server (NautilusApplication *application,
-                                    NautilusWindow      *window)
-{
-       GtkWidget *dialog;
-
-       dialog = application->priv->connect_server_window;
-
-       if (dialog == NULL) {
-               dialog = nautilus_connect_server_dialog_new (window);
-               g_signal_connect (dialog, "response", G_CALLBACK (on_connect_server_response), application);
-               application->priv->connect_server_window = dialog;
-
-               g_object_add_weak_pointer (G_OBJECT (dialog),
-                                          (gpointer *) &application->priv->connect_server_window);
-       }
-
-       gtk_window_present (GTK_WINDOW (dialog));
-
-       return dialog;
-}
-
 static void
 nautilus_application_finalize (GObject *object)
 {
@@ -826,14 +758,10 @@ nautilus_application_command_line (GApplication            *application,
                g_action_group_activate_action (G_ACTION_GROUP (application),
                                                "open-desktop", NULL);
        } else if (g_variant_dict_contains (options, "no-desktop")) {
-               if (g_application_get_is_remote (application)) {
-                       DEBUG ("Not primary instance. Ignoring --no-desktop.");
-               } else {
-                       DEBUG ("Forcing desktop off, as requested");
-                       self->priv->desktop_override = TRUE;
-                       g_action_group_activate_action (G_ACTION_GROUP (application),
-                                                       "close-desktop", NULL);
-               }
+               DEBUG ("Forcing desktop off, as requested");
+               self->priv->desktop_override = TRUE;
+               g_action_group_activate_action (G_ACTION_GROUP (application),
+                                               "close-desktop", NULL);
        }
 
        if (g_variant_dict_contains (options, "no-default-window")) {
diff --git a/src/nautilus-application.h b/src/nautilus-application.h
index 3dd4af5..8ca0992 100644
--- a/src/nautilus-application.h
+++ b/src/nautilus-application.h
@@ -79,9 +79,6 @@ NautilusBookmarkList *
 void nautilus_application_edit_bookmarks (NautilusApplication *application,
                                          NautilusWindow      *window);
 
-GtkWidget * nautilus_application_connect_server (NautilusApplication *application,
-                                                NautilusWindow      *window);
-
 NautilusProgressUIHandler * nautilus_application_get_progress_ui_handler (NautilusApplication *application);
 
 #endif /* __NAUTILUS_APPLICATION_H__ */


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