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

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

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

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

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

Loading…
Cancel
Save