From 49c209d077d51df7a0fdce5b69df820b5f4539bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Tue, 21 Jun 2016 02:05:21 +0200 Subject: [PATCH] firewall: Warn earlier and improve message on empty service name for TCP/UDP Fixes QubesOS/qubes-issues#2093 --- qubesmanager/firewall.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/qubesmanager/firewall.py b/qubesmanager/firewall.py index 28847f4..36440a9 100644 --- a/qubesmanager/firewall.py +++ b/qubesmanager/firewall.py @@ -88,6 +88,14 @@ class NewFwRuleDlg (QDialog, ui_newfwruledlg.Ui_NewFwRuleDlg): self.populate_combos() self.serviceComboBox.setInsertPolicy(QComboBox.InsertAtTop) + def accept(self): + if self.tcp_radio.isChecked() or self.udp_radio.isChecked(): + if len(self.serviceComboBox.currentText()) == 0: + msg = QMessageBox() + msg.warning(self, "Firewall rule", + "You need to fill service name/port for TCP/UDP rule") + return + QDialog.accept(self) def populate_combos(self): example_addresses = [