~darkxst/ubuntu/saucy/gnome-shell/upstart_log

« back to all changes in this revision

Viewing changes to js/ui/status/bluetooth.js

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2013-05-31 12:01:12 UTC
  • mfrom: (1.1.49) (19.1.36 experimental)
  • Revision ID: package-import@ubuntu.com-20130531120112-ew91khxf051x9i2r
Tags: 3.8.2-1ubuntu1
* Merge with Debian (LP: #1185869, #1185721). Remaining changes:
  - debian/control.in:
    + Build-depend on libsystemd-login-dev & libsystemd-daemon-dev
    + Depend on gdm instead of gdm3
    + Don't recommend gnome-session-fallback
  - debian/patches/40_change-pam-name-to-match-gdm.patch:
  - debian/patches/revert-suspend-break.patch:
    + Disabled, not needed on Ubuntu
  - debian/patches/ubuntu-lightdm-user-switching.patch:
    + Allow user switching when using LightDM. Thanks Gerhard Stein
      for rebasing against gnome-shell 3.8!
  - debian/patches/ubuntu_lock_on_suspend.patch
    + Respect Ubuntu's lock-on-suspend setting.
      Disabled until it can be rewritten.
  - debian/patches/git_relock_screen_after_crash.patch:
    + Add Upstream fix for unlocked session after crash (LP: #1064584)
* Note that the new GNOME Classic mode (which requires installing
  gnome-shell-extensions) won't work until gnome-session 3.8 is
  available in Ubuntu

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
 
10
10
const Main = imports.ui.main;
11
11
const MessageTray = imports.ui.messageTray;
 
12
const NotificationDaemon = imports.ui.notificationDaemon;
12
13
const PanelMenu = imports.ui.panelMenu;
13
14
const PopupMenu = imports.ui.popupMenu;
14
15
 
55
56
        this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());
56
57
 
57
58
        this._fullMenuItems = [new PopupMenu.PopupSeparatorMenuItem(),
58
 
                               new PopupMenu.PopupMenuItem(_("Send Files to Device...")),
59
 
                               new PopupMenu.PopupMenuItem(_("Set up a New Device...")),
 
59
                               new PopupMenu.PopupMenuItem(_("Send Files to Device…")),
 
60
                               new PopupMenu.PopupMenuItem(_("Set Up a New Device…")),
60
61
                               new PopupMenu.PopupSeparatorMenuItem()];
61
62
        this._hasDevices = false;
62
63
 
80
81
        this._applet.connect('notify::show-full-menu', Lang.bind(this, this._updateFullMenu));
81
82
        this._updateFullMenu();
82
83
 
83
 
        this.menu.addSettingsAction(_("Bluetooth Settings"), 'bluetooth-properties.desktop');
 
84
        this.menu.addSettingsAction(_("Bluetooth Settings"), 'gnome-bluetooth-panel.desktop');
84
85
 
85
86
        this._applet.connect('pincode-request', Lang.bind(this, this._pinRequest));
86
87
        this._applet.connect('confirm-request', Lang.bind(this, this._confirmRequest));
235
236
        }
236
237
 
237
238
        if (device.capabilities & GnomeBluetoothApplet.Capabilities.OBEX_PUSH) {
238
 
            item.menu.addAction(_("Send Files..."), Lang.bind(this, function() {
 
239
            item.menu.addAction(_("Send Files…"), Lang.bind(this, function() {
239
240
                this._applet.send_to_address(device.bdaddr, device.alias);
240
241
            }));
241
242
        }
242
 
        if (device.capabilities & GnomeBluetoothApplet.Capabilities.OBEX_FILE_TRANSFER) {
243
 
            item.menu.addAction(_("Browse Files..."), Lang.bind(this, function(event) {
244
 
                this._applet.browse_address(device.bdaddr, event.get_time(),
245
 
                    Lang.bind(this, function(applet, result) {
246
 
                        try {
247
 
                            applet.browse_address_finish(result);
248
 
                        } catch (e) {
249
 
                            this._ensureSource();
250
 
                            this._source.notify(new MessageTray.Notification(this._source,
251
 
                                 _("Bluetooth"),
252
 
                                 _("Error browsing device"),
253
 
                                 { body: _("The requested device cannot be browsed, error is '%s'").format(e) }));
254
 
                        }
255
 
                    }));
256
 
            }));
257
 
        }
258
243
 
259
244
        switch (device.type) {
260
245
        case GnomeBluetoothApplet.Type.KEYBOARD:
302
287
    _ensureSource: function() {
303
288
        if (!this._source) {
304
289
            this._source = new MessageTray.Source(_("Bluetooth"), 'bluetooth-active');
 
290
            this._source.policy = new NotificationDaemon.NotificationApplicationPolicy('gnome-bluetooth-panel');
305
291
            Main.messageTray.add(this._source);
306
292
        }
307
293
    },
369
355
    _init: function(source, applet, device_path, name, long_name, pin) {
370
356
        this.parent(source,
371
357
                    _("Bluetooth"),
 
358
                    /* Translators: argument is the device short name */
372
359
                    _("Pairing confirmation for %s").format(name),
373
360
                    { customContent: true });
374
361
        this.setResident(true);
378
365
        this.addBody(_("Device %s wants to pair with this computer").format(long_name));
379
366
        this.addBody(_("Please confirm whether the PIN '%06d' matches the one on the device.").format(pin));
380
367
 
 
368
        /* Translators: this is the verb, not the noun */
381
369
        this.addButton('matches', _("Matches"));
382
370
        this.addButton('does-not-match', _("Does not match"));
383
371
 
460
448
            return this._entry.clutter_text.text.length == 6;
461
449
        else
462
450
            return true;
463
 
    },
464
 
 
465
 
    grabFocus: function(lockTray) {
466
 
        this.parent(lockTray);
467
 
        global.stage.set_key_focus(this._entry);
468
451
    }
469
452
});