| |   |
| Name: Top Bar Ringer Switch |
| Version: 1.3.5.2-4 |
| Author: frause |
| Description: Adds icon to top bar when ringer switch is activated. If my Top Bar Icon And Percent Small White patch is installed, the percent value is removed when the mute icon is displayed to reduce witdh of the icon row. (MIT license) |
|
|
| --- /usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js.orig Fri Jan 15 23:04:41 2010 |
| +++ /usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js Fri Jan 15 23:30:12 2010 |
| @@ -2870,7 +2871,15 @@ |
| diff --git a/usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js b/usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js |
| index 6fdbb39..edcecee 100644 |
| --- a/usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js |
| +++ b/usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js |
| @@ -60,6 +60,9 @@ var BarAssistant = Class.create({ |
| //Initialize and Subscribe for Storage / Media Mode Notification. |
| this.storageInit(); |
| |
| + // Initialize and Subscribe for Ringer Switch Status |
| + this.initOnServerStart("com.palm.keys", this.ringerStatus.bind(this)); |
| + |
| //Initialize and Subscribe for Power Off Notification. |
| this.powerOffInit(); |
| |
| @@ -2999,6 +3002,32 @@ showAudioAlert: function(volume,showringer,audioTarget) { |
| } |
| 10 | 17 | }, |
| 11 | 18 | |
| audioInit: function() { |
| - |
| + |
| + this.controller.serviceRequest('palm://com.palm.audio/ringtone', { |
| +ringerStatus: function() { |
| + this.controller.serviceRequest('palm://com.palm.keys/switches', { |
| 16 | 21 | + method:'status', |
| + parameters: {subscribe:true}, |
| + onSuccess: function(response) { |
| + this.displayMutedIcon(!response['ringer switch']); |
| + parameters: {"subscribe":true}, |
| + onSuccess: function(payload) { |
| + this.controller.serviceRequest('palm://com.palm.audio/media', { |
| + method:'status', |
| + onSuccess: function(response) { |
| + this.displayMutedIcon(!response['ringer switch']); |
| + }.bind(this) |
| + }); |
| 20 | 30 | + }.bind(this) |
| 21 | 31 | + }); |
| + |
| //Subscribe to Audio Manager for Phone status Notifications. |
| this.audioPhoneNotificationSession = new Mojo.Service.Request('palm://com.palm.audio/phone', { |
| method: 'status', |
| @@ -2902,6 +2911,17 @@ |
| return; |
| |
| this.handleAudioNotifications(payload,'phone'); |
| 30 | 32 | +}, |
| 31 | 33 | + |
| 32 | 34 | +displayMutedIcon: function(mute) { |
| … | … | |
| 40 | 40 | + $('ringer').className = 'on'; |
| 41 | 41 | + $('batpercent').className = 'show'; |
| 42 | 42 | + } |
| }, |
| |
| handleMediaAudioNotifications: function(payload) { |
| --- /usr/lib/luna/system/luna-systemui/app/views/bar/bar-scene.html.orig Fri Jan 15 23:17:58 2010 |
| +++ /usr/lib/luna/system/luna-systemui/app/views/bar/bar-scene.html Fri Jan 15 22:57:11 2010 |
| +}, |
| + |
| dataImportInit: function() { |
| //Subscribe to Data Srevice status Notifications. |
| this.dataImportNotificationSession = new Mojo.Service.Request('palm://com.palm.dataimport/', { |
| diff --git a/usr/lib/luna/system/luna-systemui/app/views/bar/bar-scene.html b/usr/lib/luna/system/luna-systemui/app/views/bar/bar-scene.html |
| index c1daf79..4b574ae 100644 |
| --- a/usr/lib/luna/system/luna-systemui/app/views/bar/bar-scene.html |
| +++ b/usr/lib/luna/system/luna-systemui/app/views/bar/bar-scene.html |
| 48 | 52 | @@ -19,6 +19,8 @@ |
| 49 | 53 | <div id="devicemenu"> |
| 50 | 54 | <div id="power"> |
| … | … | |
| 58 | 58 | <div id="rssi"> |
| 59 | 59 | </div> |
| 60 | 60 | <div id="roaming"> |
| --- /usr/lib/luna/system/luna-systemui/stylesheets/systemui.css.orig Fri Jan 15 23:20:50 2010 |
| +++ /usr/lib/luna/system/luna-systemui/stylesheets/systemui.css Fri Jan 15 23:31:21 2010 |
| @@ -122,6 +122,7 @@ |
| diff --git a/usr/lib/luna/system/luna-systemui/stylesheets/systemui.css b/usr/lib/luna/system/luna-systemui/stylesheets/systemui.css |
| index 0917ee7..7a0cd64 100644 |
| --- a/usr/lib/luna/system/luna-systemui/stylesheets/systemui.css |
| +++ b/usr/lib/luna/system/luna-systemui/stylesheets/systemui.css |
| @@ -122,6 +122,7 @@ body.palm-default { |
| 64 | 66 | #tty, |
| 65 | 67 | #hac, |
| 66 | 68 | #callforward, |
| … | … | |
| 70 | 70 | #gps { |
| 71 | 71 | float: right; |
| 72 | 72 | height: 20px; |
| @@ -217,6 +218,21 @@ |
| @@ -217,6 +218,21 @@ body.palm-default { |
| 74 | 74 | background: url(../images/battery-charged.png) center center no-repeat; |
| 75 | 75 | } |
| 76 | 76 | |
| … | … | |
| 79 | 79 | + margin-left: 2px; |
| 80 | 80 | +} |
| 81 | 81 | +#ringer.off { |
| + background: url(../../../../../palm/applications/com.palm.app.clock/images/prefs-mute.png) center left no-repeat; |
| + background: url(../../../../../palm/applications/com.palm.app.soundsandalerts/images/prefs-mute.png) center left no-repeat; |
| 83 | 83 | +} |
| 84 | 84 | +#ringer.on { |
| 85 | 85 | + display: none; |