[cinnamon] patch bluetooth applet

leigh123linux leigh123linux at fedoraproject.org
Tue Sep 18 08:18:39 UTC 2012


commit ad412f76d7571997ae4917858ca8f64137c3727d
Author: leigh123linux <leigh123linux at googlemail.com>
Date:   Tue Sep 18 09:18:11 2012 +0100

    patch bluetooth applet

 bluetooth_applet.patch |  113 ++++++++++++++++++++++++++++++++++++++++++++++++
 cinnamon.spec          |    9 +++-
 2 files changed, 121 insertions(+), 1 deletions(-)
---
diff --git a/bluetooth_applet.patch b/bluetooth_applet.patch
new file mode 100644
index 0000000..d393df1
--- /dev/null
+++ b/bluetooth_applet.patch
@@ -0,0 +1,113 @@
+--- a/files/usr/share/cinnamon/applets/bluetooth at cinnamon.org/applet.js
++++ b/files/usr/share/cinnamon/applets/bluetooth at cinnamon.org/applet.js
+@@ -1,17 +1,7 @@
+ const Applet = imports.ui.applet;
+ const Clutter = imports.gi.Clutter;
+ const GLib = imports.gi.GLib;
+-var Bluetooth;
+-try {
+-    Bluetooth = imports.gi.GnomeBluetooth;
+-    new Bluetooth.Applet(); // try the 3.6 ABI
+-    global.logError("Bluetooth Gnome 3.6 ABI");
+-}
+-catch(e) {
+-    // Fallback to the 3.4 ABI
+-    Bluetooth = imports.gi.GnomeBluetoothApplet;
+-    global.logError("Bluetooth Gnome 3.4 ABI");
+-}
++const GnomeBluetooth = imports.gi.GnomeBluetooth;
+ const Lang = imports.lang;
+ const St = imports.gi.St;
+ 
+@@ -216,17 +206,17 @@ MyApplet.prototype = {
+             this.set_applet_tooltip(_("Bluetooth"));
+                         
+             GLib.spawn_command_line_sync ('pkill -f "^bluetooth-applet$"');
+-            this._applet = new Bluetooth.Applet();
++            this._applet = new GnomeBluetoothApplet.Applet();
+ 
+             this._killswitch = new PopupMenu.PopupSwitchMenuItem(_("Bluetooth"), false);
+             this._applet.connect('notify::killswitch-state', Lang.bind(this, this._updateKillswitch));
+             this._killswitch.connect('toggled', Lang.bind(this, function() {
+                 let current_state = this._applet.killswitch_state;
+-                if (current_state != Bluetooth.KillswitchState.HARD_BLOCKED &&
+-                    current_state != Bluetooth.KillswitchState.NO_ADAPTER) {
++                if (current_state != GnomeBluetooth.KillswitchState.HARD_BLOCKED &&
++                    current_state != GnomeBluetooth.KillswitchState.NO_ADAPTER) {
+                     this._applet.killswitch_state = this._killswitch.state ?
+-                        Bluetooth.KillswitchState.UNBLOCKED:
+-                        Bluetooth.KillswitchState.SOFT_BLOCKED;
++                        GnomeBluetooth.KillswitchState.UNBLOCKED:
++                        GnomeBluetooth.KillswitchState.SOFT_BLOCKED;
+                 } else
+                     this._killswitch.setToggleState(false);
+             }));
+@@ -290,10 +280,10 @@ MyApplet.prototype = {
+    
+     _updateKillswitch: function() {
+         let current_state = this._applet.killswitch_state;
+-        let on = current_state == Bluetooth.KillswitchState.UNBLOCKED;
+-        let has_adapter = current_state != Bluetooth.KillswitchState.NO_ADAPTER;
+-        let can_toggle = current_state != Bluetooth.KillswitchState.NO_ADAPTER &&
+-                         current_state != Bluetooth.KillswitchState.HARD_BLOCKED;
++        let on = current_state == GnomeBluetooth.KillswitchState.UNBLOCKED;
++        let has_adapter = current_state != GnomeBluetooth.KillswitchState.NO_ADAPTER;
++        let can_toggle = current_state != GnomeBluetooth.KillswitchState.NO_ADAPTER &&
++                         current_state != GnomeBluetooth.KillswitchState.HARD_BLOCKED;
+ 
+         this._killswitch.setToggleState(on);
+         if (can_toggle)
+@@ -352,7 +342,7 @@ MyApplet.prototype = {
+     },
+ 
+     _updateDeviceItem: function(item, device) {
+-        if (!device.can_connect && device.capabilities == Bluetooth.Capabilities.NONE) {
++        if (!device.can_connect && device.capabilities == GnomeBluetoothApplet.Capabilities.NONE) {
+             item.destroy();
+             return;
+         }
+@@ -381,7 +371,7 @@ MyApplet.prototype = {
+     },
+ 
+     _createDeviceItem: function(device) {
+-        if (!device.can_connect && device.capabilities == Bluetooth.Capabilities.NONE)
++        if (!device.can_connect && device.capabilities == GnomeBluetoothApplet.Capabilities.NONE)
+             return null;
+         let item = new PopupMenu.PopupSubMenuMenuItem(device.alias);
+ 
+@@ -436,12 +426,12 @@ MyApplet.prototype = {
+             item.menu.addMenuItem(item._connectedMenuitem);
+         }
+ 
+-        if (device.capabilities & Bluetooth.Capabilities.OBEX_PUSH) {
++        if (device.capabilities & GnomeBluetoothApplet.Capabilities.OBEX_PUSH) {
+             item.menu.addAction(_("Send Files..."), Lang.bind(this, function() {
+                 this._applet.send_to_address(device.bdaddr, device.alias);
+             }));
+         }
+-        if (device.capabilities & Bluetooth.Capabilities.OBEX_FILE_TRANSFER) {
++        if (device.capabilities & GnomeBluetoothApplet.Capabilities.OBEX_FILE_TRANSFER) {
+             item.menu.addAction(_("Browse Files..."), Lang.bind(this, function(event) {
+                 this._applet.browse_address(device.bdaddr, event.get_time(),
+                     Lang.bind(this, function(applet, result) {
+@@ -459,15 +449,15 @@ MyApplet.prototype = {
+         }
+ 
+         switch (device.type) {
+-        case Bluetooth.Type.KEYBOARD:
++        case GnomeBluetoothApplet.Type.KEYBOARD:
+             item.menu.addSettingsAction(_("Keyboard Settings"), 'gnome-keyboard-panel.desktop');
+             break;
+-        case Bluetooth.Type.MOUSE:
++        case GnomeBluetoothApplet.Type.MOUSE:
+             item.menu.addSettingsAction(_("Mouse Settings"), 'gnome-mouse-panel.desktop');
+             break;
+-        case Bluetooth.Type.HEADSET:
+-        case Bluetooth.Type.HEADPHONES:
+-        case Bluetooth.Type.OTHER_AUDIO:
++        case GnomeBluetoothApplet.Type.HEADSET:
++        case GnomeBluetoothApplet.Type.HEADPHONES:
++        case GnomeBluetoothApplet.Type.OTHER_AUDIO:
+             item.menu.addSettingsAction(_("Sound Settings"), 'gnome-sound-panel.desktop');
+             break;
+         default:
diff --git a/cinnamon.spec b/cinnamon.spec
index eb7dd02..7c74f7b 100644
--- a/cinnamon.spec
+++ b/cinnamon.spec
@@ -8,7 +8,7 @@
 
 Name:           cinnamon
 Version:        1.6.0
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        Window management and application launching for GNOME
 
 Group:          User Interface/Desktops
@@ -30,6 +30,7 @@ Patch1:         cinnamon-1.5.0_datetime_setting.patch
 Patch2:         cinnamon-1.4.1_f17_favourite-apps-firefox.patch
 Patch3:         fedora_icon.patch
 Patch4:         nemo.patch
+Patch5:         bluetooth_applet.patch
 
 # upstream patches and pending pulls
 
@@ -124,6 +125,9 @@ The emphasis is put on making users feel at home and providing
 # use nautilus instead of nemo
 %patch4 -p1
 
+# fix bluetooth applet
+%patch5 -p1
+
 # upstream patches and pending pulls
 
 
@@ -224,6 +228,9 @@ fi
 
 
 %changelog
+* Tue Sep 18 2012 Leigh Scott <leigh123linux at googlemail.com> - 1.6.0-2
+- patch bluetooth applet
+
 * Mon Sep 17 2012 Leigh Scott <leigh123linux at googlemail.com> - 1.6.0-1
 - update to 1.6.0 release
 - drop upstream patches


More information about the scm-commits mailing list