Drop support for guarddog and add support for kcm_ufw and gufw ufw GUI's

This commit is contained in:
Silvan Calarco 2011-11-01 02:03:53 +01:00
parent 8b50015775
commit 5a49c9cdcd

View File

@ -72,7 +72,7 @@ class SystemTrayIcon(QtGui.QSystemTrayIcon):
networkFirewallEnableAction = networkFirewallMenu.addAction(QtGui.QIcon.fromTheme("security-high"),_("Enable")) networkFirewallEnableAction = networkFirewallMenu.addAction(QtGui.QIcon.fromTheme("security-high"),_("Enable"))
self.connect(networkFirewallEnableAction, SIGNAL("triggered()"), self.networkFirewallEnable) self.connect(networkFirewallEnableAction, SIGNAL("triggered()"), self.networkFirewallEnable)
self.connect(networkFirewallEnableProcess, SIGNAL("finished(int,QProcess::ExitStatus)"), self.networkFirewallEnableMessage) 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) self.connect(networkFirewallConfigureAction, SIGNAL("triggered()"), self.networkFirewallConfigure)
networkProxyAction = networkMenu.addAction(QtGui.QIcon.fromTheme("network-server"),_("Proxy...")) networkProxyAction = networkMenu.addAction(QtGui.QIcon.fromTheme("network-server"),_("Proxy..."))
self.connect(networkProxyAction, SIGNAL("triggered()"), self.networkProxy) self.connect(networkProxyAction, SIGNAL("triggered()"), self.networkProxy)
@ -157,7 +157,7 @@ class SystemTrayIcon(QtGui.QSystemTrayIcon):
self.showMessage("Firewall", _("Could not disable firewall")) self.showMessage("Firewall", _("Could not disable firewall"))
def networkFirewallEnable(self): def networkFirewallEnable(self):
networkFirewallEnableProcess.start("sudo",['/sbin/service','iptables','start']) networkFirewallEnableProcess.start("sudo",['/usr/sbin/ufw','enable'])
def networkFirewallEnableMessage(self,status): def networkFirewallEnableMessage(self,status):
if (status == QtCore.QProcess.NormalExit): if (status == QtCore.QProcess.NormalExit):
@ -166,8 +166,10 @@ class SystemTrayIcon(QtGui.QSystemTrayIcon):
self.showMessage("Firewall", _("Could not enable firewall")) self.showMessage("Firewall", _("Could not enable firewall"))
def networkFirewallConfigure(self): def networkFirewallConfigure(self):
networkFirewallConfigureProcess.execute("sudo", if desktop_session == 'kde':
QtCore.QStringList(list(set(['/opt/kde3/bin/guarddog'])))) networkFirewallConfigureProcess.execute("/opt/kde/bin/kcmshell4", QtCore.QStringList(list(set(['ufw']))))
else:
networkFirewallConfigureProcess.execute("/usr/bin/gufw")
def networkProxy(self): def networkProxy(self):
networkProxyProcess.execute("/opt/kde/bin/kcmshell4", networkProxyProcess.execute("/opt/kde/bin/kcmshell4",