Skip to content
This repository has been archived by the owner on Jan 16, 2023. It is now read-only.

Commit

Permalink
Indentation fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
phw committed Apr 15, 2014
1 parent 48d6d97 commit 8239664
Showing 1 changed file with 39 additions and 39 deletions.
78 changes: 39 additions & 39 deletions gnome-shell-extension/extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,63 +44,63 @@ const CameraStatusButton = new Lang.Class({
Extends: PanelMenu.Button,

_init: function() {
this.parent(0.0, _("Webcam status"));

let icon = new St.Icon({ icon_name: 'camera-web-symbolic',
this.parent(0.0, _("Webcam status"));
let icon = new St.Icon({ icon_name: 'camera-web-symbolic',
style_class: 'system-status-icon' });
this.actor.add_child(icon);

this.camera_is_on = false;

this._proxy = new WebcamStatusDbusProxy(
Gio.DBus.session,
'com.uploadedlobster.WebcamAccessMonitor',
'/com/uploadedlobster/WebcamAccessMonitor');
this._proxy = new WebcamStatusDbusProxy(
Gio.DBus.session,
'com.uploadedlobster.WebcamAccessMonitor',
'/com/uploadedlobster/WebcamAccessMonitor');

this._setupWatch();
this._checkCameraIsActive();
this._setupWatch();
this._checkCameraIsActive();
},

_setupWatch: function() {
this._changedSignalId = this._proxy.connectSignal(
'stateChanged', Lang.bind(this, this._onStateChange));
this._changedSignalId = this._proxy.connectSignal(
'stateChanged', Lang.bind(this, this._onStateChange));
},

_onStateChange: function(emitter, senderName, parameters) {
// parameters is a tuple of type (si), e.g. ('/dev/video0', 1)
let device = parameters[0][0]
let state = parameters[0][1];
log('DEBUG: Camera device ' + device + ' changed state ' + state);
this._updateCameraStatus(state == 1);
// parameters is a tuple of type (si), e.g. ('/dev/video0', 1)
let device = parameters[0][0]
let state = parameters[0][1];
log('DEBUG: Camera device ' + device + ' changed state ' + state);
this._updateCameraStatus(state == 1);
},

_checkCameraIsActive: function() {
this._proxy.getAllDeviceStatesRemote(
Lang.bind(this, function(result, excp) {
[result] = result
var status = true;
for (var device in result) {
log('DEBUG: Camera device ' + device + ' state ' + result[device]);
status &= result[device] == 1;
}

this._updateCameraStatus(status);
}));
this._proxy.getAllDeviceStatesRemote(
Lang.bind(this, function(result, excp) {
[result] = result
var status = true;
for (var device in result) {
log('DEBUG: Camera device ' + device + ' state ' + result[device]);
status &= result[device] == 1;
}

this._updateCameraStatus(status);
}));
},

_updateCameraStatus: function(status) {
if (this.camera_is_on != status) {
this.camera_is_on = status;

// if (this.camera_is_on) {
// Main.notify("Webcam activated");
// }
// else {
// Main.notify("Webcam deactivated");
// }
}
this.actor.visible = this.camera_is_on;
if (this.camera_is_on != status) {
this.camera_is_on = status;

// if (this.camera_is_on) {
// Main.notify("Webcam activated");
// }
// else {
// Main.notify("Webcam deactivated");
// }
}
this.actor.visible = this.camera_is_on;
},
});

Expand Down

0 comments on commit 8239664

Please sign in to comment.