~ubuntuone-control-tower/ubuntuone-client-gnome/stable-13-10

« back to all changes in this revision

Viewing changes to nautilus/ubuntuone-nautilus.c

  • Committer: Tarmac
  • Author(s): Rodney Dawes
  • Date: 2012-02-20 17:40:55 UTC
  • mfrom: (13.1.2 no-ribbons)
  • Revision ID: tarmac-20120220174055-99h7av2jh8f28lhf
Remove the location bar widget in the Nautilus extension

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
#include <libnautilus-extension/nautilus-file-info.h>
31
31
#include <libnautilus-extension/nautilus-info-provider.h>
32
32
#include <libnautilus-extension/nautilus-menu-provider.h>
33
 
#include <libnautilus-extension/nautilus-location-widget-provider.h>
34
33
#include <libsyncdaemon/libsyncdaemon.h>
35
34
#include "ubuntuone-nautilus.h"
36
35
#include "context-menu.h"
37
 
#include "location-widget.h"
38
36
 
39
37
/* We need to do this explicitly because older versions of nautilus
40
38
 * don't seem to do it for us
82
80
        iface->update_file_info = ubuntuone_nautilus_update_file_info;
83
81
}
84
82
 
85
 
/* LocationWidget provider */
86
 
static GtkWidget *
87
 
ubuntuone_nautilus_get_location_widget (NautilusLocationWidgetProvider * provider,
88
 
                                        const char * uri,
89
 
                                        GtkWidget * parent)
90
 
{
91
 
        UbuntuOneNautilus * uon;
92
 
        gchar *path;
93
 
        GtkWidget *location;
94
 
 
95
 
        /* if the bar is disabled, do nothing */
96
 
        if (!ubuntuone_is_location_bar_enabled ())
97
 
                return NULL;
98
 
 
99
 
        uon = UBUNTUONE_NAUTILUS (provider);
100
 
 
101
 
        /* If syncdaemon is not ready, do nothing */
102
 
        if (!syncdaemon_daemon_is_ready (uon->syncdaemon))
103
 
                return NULL;
104
 
 
105
 
        path = g_filename_from_uri (uri, NULL, NULL);
106
 
        if (!path)
107
 
                return NULL;
108
 
 
109
 
        location = location_widget_new (uon, path);
110
 
 
111
 
        g_free (path);
112
 
 
113
 
        return location;
114
 
}
115
 
 
116
 
static void
117
 
ubuntuone_nautilus_bar_provider_iface_init (NautilusLocationWidgetProviderIface * iface)
118
 
{
119
 
        iface->get_widget = ubuntuone_nautilus_get_location_widget;
120
 
}
121
 
 
122
83
/* Menu provider */
123
84
static GList *
124
85
ubuntuone_nautilus_get_menu_items (NautilusMenuProvider * provider,
241
202
                NULL
242
203
        };
243
204
 
244
 
        static const GInterfaceInfo bar_provider_iface_info = {
245
 
                (GInterfaceInitFunc) ubuntuone_nautilus_bar_provider_iface_init,
246
 
                NULL,
247
 
                NULL
248
 
        };
249
 
 
250
205
        static const GInterfaceInfo menu_provider_iface_info = {
251
206
                (GInterfaceInitFunc) ubuntuone_nautilus_menu_provider_iface_init,
252
207
                NULL,
263
218
                                     NAUTILUS_TYPE_INFO_PROVIDER,
264
219
                                     &info_provider_iface_info);
265
220
 
266
 
        g_type_module_add_interface (module,
267
 
                                     un_type,
268
 
                                     NAUTILUS_TYPE_LOCATION_WIDGET_PROVIDER,
269
 
                                     &bar_provider_iface_info);
270
 
 
271
221
        /* XXX Need to sign a request via DBus */
272
222
        g_type_module_add_interface (module,
273
223
                                     un_type,