shw-merge
xSmurf 7 years ago
parent fc19ebc2ef
commit 2b7bed6fde

@ -39,14 +39,14 @@ const ConnectionMonitor = new Lang.Class({
},
_toggle: function() {
if(this._open)
if (this._open)
this.close();
else
this.open();
},
open: function() {
if(this._open) {
if (this._open) {
return;
}
this.actor.show();
@ -60,7 +60,7 @@ const ConnectionMonitor = new Lang.Class({
},
close: function() {
if(!this._open) {
if (!this._open) {
return;
}
this._open = false;

@ -156,7 +156,7 @@ const OptionList = new Lang.Class({
},
setOptionText: function(idx, text) {
if(this.items.length <= idx) {
if (this.items.length <= idx) {
//log("SGFW: attempt to setOptionText with idx = "+ idx + " when this.items.length = "+ this.items.length)
return;
}
@ -190,7 +190,7 @@ const OptionList = new Lang.Class({
for(let i = 0; i < options.length; i++) {
this._addOption(options[i], i)
}
if(this.items.length) {
if (this.items.length) {
this._optionSelected(this.items[0])
}
},
@ -208,7 +208,7 @@ const OptionList = new Lang.Class({
if (item == this._selected) {
return;
}
if(this._selected) {
if (this._selected) {
this._selected.actor.remove_style_pseudo_class('selected');
this._selected.setSelected(false);
}
@ -278,11 +278,11 @@ const ButtonGroup = new Lang.Class({
_setChecked: function(idx) {
if(idx == this._checked) {
if (idx == this._checked) {
return;
}
this._buttons[idx].add_style_pseudo_class('checked');
if(this._checked >= 0) {
if (this._checked >= 0) {
this._buttons[this._checked].remove_style_pseudo_class('checked');
}
this._checked = idx;
@ -344,7 +344,7 @@ const ExpandingSection = new Lang.Class({
},
activate: function(event) {
if(!this.isOpen) {
if (!this.isOpen) {
this.open();
} else {
this.close();
@ -352,7 +352,7 @@ const ExpandingSection = new Lang.Class({
},
set_child: function(child) {
if(this.child) {
if (this.child) {
this.child.destroy();
}
this.scroll.add_actor(child);
@ -365,10 +365,10 @@ const ExpandingSection = new Lang.Class({
},
open: function() {
if(this.isOpen) {
if (this.isOpen) {
return;
}
if(!this.child) {
if (!this.child) {
return;
}
this.isOpen = true;
@ -394,7 +394,7 @@ const ExpandingSection = new Lang.Class({
},
close: function() {
if(!this.isOpen) {
if (!this.isOpen) {
return;
}
this.isOpen = false;
@ -434,7 +434,7 @@ const PromptDialogHeader = new Lang.Class({
},
setTitle: function(text) {
if(!text) {
if (!text) {
text = "Unknown";
}
this.title.text = text;
@ -514,11 +514,11 @@ const PromptDialog = new Lang.Class({
},
sendReturnValue: function(allow) {
if(!this._invocation) {
if (!this._invocation) {
return;
}
let verb = "DENY";
if(allow) {
if (allow) {
verb = "ALLOW";
if (this.optionList.tlsGuard) {
verb = "ALLOW_TLSONLY";
@ -535,7 +535,7 @@ const PromptDialog = new Lang.Class({
ruleTarget: function() {
let base = "";
if(this._proto != "tcp") {
if (this._proto != "tcp") {
base = this._proto + ":";
}
switch(this.optionList.selectedIdx()) {
@ -589,7 +589,7 @@ const PromptDialog = new Lang.Class({
this.details.isOpen = false;
this.details.activate()
}
if(icon) {
if (icon) {
this.header.setIcon(icon, sandbox);
} else {
this.header.setIcon(path.split(/\//).pop(), sandbox);

@ -21,7 +21,7 @@ const FirewallSupport = new Lang.Class({
},
_destroyHandler: function() {
if(this.handler) {
if (this.handler) {
this.handler.destroy();
this.handler = null;
}

@ -24,7 +24,7 @@ const FirewallMenu = new Lang.Class({
_init: function() {
this.proxy = new FirewallProxy(Gio.DBus.system, "com.subgraph.Firewall",
"/com/subgraph/Firewall", Lang.bind(this, function(proxy, error) {
if(error) {
if (error) {
log(error.message);
return;
}
@ -36,14 +36,14 @@ const FirewallMenu = new Lang.Class({
this.createMenu();
this.menu.connect('open-state-changed', Lang.bind(this, this.openStateChanged));
let idx = this.findMenu(this.aggregate._power.menu);
if(idx >= 0) {
if (idx >= 0) {
this.aggregate.menu.addMenuItem(this.menu, idx);
}
},
openStateChanged: function() {
this.proxy.IsEnabledRemote(Lang.bind(this, function(result, err) {
if(err) {
if (err) {
log(err.message);
return;
}
@ -53,7 +53,7 @@ const FirewallMenu = new Lang.Class({
},
destroy: function() {
if(this.menu) {
if (this.menu) {
this.menu.destroy();
this.menu = null;
}
@ -62,7 +62,7 @@ const FirewallMenu = new Lang.Class({
findMenu: function(menu) {
let items = this.aggregate.menu._getMenuItems();
for(let i = 0; i < items.length; i++) {
if(items[i] == menu) {
if (items[i] == menu) {
return i;
}
}
@ -70,7 +70,7 @@ const FirewallMenu = new Lang.Class({
},
createMenu: function() {
if(this.menu) {
if (this.menu) {
this.menu.destroy();
}
this.menu = new PopupMenu.PopupMenuSection();
@ -86,7 +86,7 @@ const FirewallMenu = new Lang.Class({
},
onToggle: function() {
if(this.toggle.state) {
if (this.toggle.state) {
log("Toggle ON");
} else {
log("Toggle OFF");

Loading…
Cancel
Save