From 5a49c9cdcd1dbaa467cac6d41b3c0259356b5530 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Tue, 1 Nov 2011 02:03:53 +0100 Subject: [PATCH] Drop support for guarddog and add support for kcm_ufw and gufw ufw GUI's --- src/mambatray | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/mambatray b/src/mambatray index 32b58de..88bd676 100755 --- a/src/mambatray +++ b/src/mambatray @@ -72,7 +72,7 @@ class SystemTrayIcon(QtGui.QSystemTrayIcon): networkFirewallEnableAction = networkFirewallMenu.addAction(QtGui.QIcon.fromTheme("security-high"),_("Enable")) self.connect(networkFirewallEnableAction, SIGNAL("triggered()"), self.networkFirewallEnable) self.connect(networkFirewallEnableProcess, SIGNAL("finished(int,QProcess::ExitStatus)"), self.networkFirewallEnableMessage) - networkFirewallConfigureAction = networkFirewallMenu.addAction(QtGui.QIcon("/opt/kde3/share/icons/locolor/32x32/apps/guarddog.png"),_("Configure...")) + networkFirewallConfigureAction = networkFirewallMenu.addAction(QtGui.QIcon.fromTheme("security-medium"),_("Configure...")) self.connect(networkFirewallConfigureAction, SIGNAL("triggered()"), self.networkFirewallConfigure) networkProxyAction = networkMenu.addAction(QtGui.QIcon.fromTheme("network-server"),_("Proxy...")) self.connect(networkProxyAction, SIGNAL("triggered()"), self.networkProxy) @@ -157,7 +157,7 @@ class SystemTrayIcon(QtGui.QSystemTrayIcon): self.showMessage("Firewall", _("Could not disable firewall")) def networkFirewallEnable(self): - networkFirewallEnableProcess.start("sudo",['/sbin/service','iptables','start']) + networkFirewallEnableProcess.start("sudo",['/usr/sbin/ufw','enable']) def networkFirewallEnableMessage(self,status): if (status == QtCore.QProcess.NormalExit): @@ -166,8 +166,10 @@ class SystemTrayIcon(QtGui.QSystemTrayIcon): self.showMessage("Firewall", _("Could not enable firewall")) def networkFirewallConfigure(self): - networkFirewallConfigureProcess.execute("sudo", - QtCore.QStringList(list(set(['/opt/kde3/bin/guarddog'])))) + if desktop_session == 'kde': + networkFirewallConfigureProcess.execute("/opt/kde/bin/kcmshell4", QtCore.QStringList(list(set(['ufw'])))) + else: + networkFirewallConfigureProcess.execute("/usr/bin/gufw") def networkProxy(self): networkProxyProcess.execute("/opt/kde/bin/kcmshell4",