@@ -2273,41 +2273,35 @@ def fillDeviceTab(self, current_uri=None):
22732273
22742274 def on_firewall_read (self , data ):
22752275 f = self .firewall
2276- allowed = True
2276+ mdns_allowed = False
2277+
22772278 try :
2278- ipp_allowed = f .check_ipp_client_allowed ()
22792279 mdns_allowed = f .check_mdns_allowed ()
2280- allowed = (ipp_allowed and mdns_allowed )
22812280
2282- secondary_text = TEXT_adjust_firewall + "\n \n "
2283- if not ipp_allowed :
2284- secondary_text += ("- " +
2285- _ ("Allow all incoming IPP Browse packets" ) +
2286- "\n " )
2287- f .add_service (firewallsettings .IPP_CLIENT_SERVICE )
2288- if not mdns_allowed :
2289- secondary_text += ("- " +
2290- _ ("Allow all incoming mDNS traffic" ) + "\n " )
2291- f .add_service (firewallsettings .MDNS_SERVICE )
2281+ if mdns_allowed :
2282+ debugprint ("Firewall all OK, no changes needed" )
2283+ return
22922284
2293- if not allowed :
2294- debugprint ("Asking for permission to adjust firewall:\n %s" %
2295- secondary_text )
2296- dialog = Gtk .MessageDialog (parent = self .NewPrinterWindow ,
2297- modal = True , destroy_with_parent = True ,
2298- message_type = Gtk .MessageType .QUESTION ,
2299- buttons = Gtk .ButtonsType .NONE ,
2300- text = _ ("Adjust Firewall" ))
2301- dialog .format_secondary_markup (secondary_text )
2302- dialog .add_buttons (_ ("Do It Later" ), Gtk .ResponseType .NO ,
2303- _ ("Adjust Firewall" ), Gtk .ResponseType .YES )
2304- dialog .connect ('response' , self .adjust_firewall_response )
2305- dialog .show ()
2285+ secondary_text = TEXT_adjust_firewall + "\n \n "
2286+ secondary_text += ("- " +
2287+ _ ("Allow all incoming mDNS traffic" ) + "\n " )
2288+ f .add_service (firewallsettings .MDNS_SERVICE )
2289+
2290+ debugprint ("Asking for permission to adjust firewall:\n %s" %
2291+ secondary_text )
2292+ dialog = Gtk .MessageDialog (parent = self .NewPrinterWindow ,
2293+ modal = True , destroy_with_parent = True ,
2294+ message_type = Gtk .MessageType .QUESTION ,
2295+ buttons = Gtk .ButtonsType .NONE ,
2296+ text = _ ("Adjust Firewall" ))
2297+ dialog .format_secondary_markup (secondary_text )
2298+ dialog .add_buttons (_ ("Do It Later" ), Gtk .ResponseType .NO ,
2299+ _ ("Adjust Firewall" ), Gtk .ResponseType .YES )
2300+ dialog .connect ('response' , self .adjust_firewall_response )
2301+ dialog .show ()
23062302 except (dbus .DBusException , Exception ):
23072303 nonfatalException ()
23082304
2309- if allowed :
2310- debugprint ("Firewall all OK, no changes needed" )
23112305
23122306 def adjust_firewall_response (self , dialog , response ):
23132307 dialog .destroy ()
0 commit comments