~dylanmccall/ubuntuone-client-gnome/publish-and-copy-link

« back to all changes in this revision

Viewing changes to nautilus/context-menu.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:
26
26
#include <glib/gi18n-lib.h>
27
27
#include <libsyncdaemon/libsyncdaemon.h>
28
28
#include "context-menu.h"
29
 
#include "location-widget.h"
30
29
#include "share-dialog.h"
31
30
 
32
31
typedef struct {
163
162
                syncdaemon_shares_interface_delete (interface, data->path);
164
163
}
165
164
 
166
 
static void
167
 
toggle_location_cb (NautilusMenuItem *item, gpointer user_data)
168
 
{
169
 
#ifdef HAVE_NAUTILUS_30
170
 
    GSettings *settings;
171
 
    settings = g_settings_new (SETTINGS_DOMAIN);
172
 
    g_settings_set_boolean (settings, SETTINGS_SHOWN_KEY, !ubuntuone_is_location_bar_enabled ());
173
 
    g_object_unref (settings);
174
 
#else
175
 
        GConfClient *conf_client;
176
 
 
177
 
        conf_client = gconf_client_get_default ();
178
 
        gconf_client_set_bool (conf_client, EXPANDER_SHOWN_KEY, !ubuntuone_is_location_bar_enabled (), NULL);
179
 
    g_object_unref (conf_client);
180
 
#endif
181
 
}
182
 
 
183
165
gboolean
184
166
check_share_offer_pending (UbuntuOneNautilus *uon, const gchar *path)
185
167
{
334
316
 
335
317
        /* UDF logic
336
318
         *
337
 
         * XXX: clean this up and separate the logic out and reuse this
338
 
         * and locationbar somewhere (libsd?)
 
319
         * XXX: clean this up and separate the logic out and reuse elsewhere
339
320
         */
340
321
        menu_item = NULL;
341
322
 
448
429
        nautilus_menu_append_item (submenu, menu_item);
449
430
        nautilus_menu_append_item (submenu, urlitem);
450
431
 
451
 
        /* location bar enable/disable */
452
 
        if (ubuntuone_is_location_bar_enabled ()) {
453
 
                menu_item = nautilus_menu_item_new ("ubuntuone-location-hide",
454
 
                                                    _("Hide _Ribbon"),
455
 
                                                    _("Do not show the Ubuntu One ribbon"
456
 
                                                      " in selected folders"),
457
 
                                                    "ubuntuone");
458
 
        } else {
459
 
                menu_item = nautilus_menu_item_new ("ubuntuone-location-show",
460
 
                                                    _("Show _Ribbon in Some Folders"),
461
 
                                                    _("Show the Ubuntu One ribbon"
462
 
                                                      " in selected folders"),
463
 
                                                    "ubuntuone");
464
 
        }
465
 
 
466
 
        g_signal_connect (menu_item, "activate",
467
 
                          G_CALLBACK (toggle_location_cb), cb_data);
468
 
        nautilus_menu_append_item (submenu, menu_item);
469
 
 
470
432
        g_free (path);
471
433
        return root_item;
472
434
}