@@ -22,7 +22,7 @@ use url::Url;
2222
2323use super :: pages:: { self , hypertext} ;
2424use crate :: common;
25- use crate :: common:: { glibctx, open_uri_externally , open_file_externally } ;
25+ use crate :: common:: { glibctx, open_file_externally , open_uri_externally } ;
2626use crate :: lossy_text_read:: * ;
2727use crate :: session_provider:: SessionProvider ;
2828
@@ -615,16 +615,21 @@ impl Tab {
615615 p. connect_local (
616616 "open" ,
617617 false ,
618- clone ! ( #[ weak( rename_to = this) ] self , #[ upgrade_or_panic] move |s| {
619- let s: String = s[ 1 ] . get( ) . unwrap( ) ;
620- let url = Url :: parse( & s) ;
621- if let Ok ( url) = url {
622- this. spawn_open_url( url) ;
623- } else {
624- log:: error!( "Invalid url {:?}" , url) ;
618+ clone ! (
619+ #[ weak( rename_to = this) ]
620+ self ,
621+ #[ upgrade_or_panic]
622+ move |s| {
623+ let s: String = s[ 1 ] . get( ) . unwrap( ) ;
624+ let url = Url :: parse( & s) ;
625+ if let Ok ( url) = url {
626+ this. spawn_open_url( url) ;
627+ } else {
628+ log:: error!( "Invalid url {:?}" , url) ;
629+ }
630+ None
625631 }
626- None
627- } ) ,
632+ ) ,
628633 ) ;
629634 p
630635 }
@@ -705,12 +710,18 @@ impl Tab {
705710 p. set_icon_name ( Some ( "dialog-error-symbolic" ) ) ;
706711
707712 let override_btn = gtk:: Button :: with_label ( "Trust New Certificate" ) ;
708- override_btn. connect_clicked ( clone ! ( #[ weak( rename_to = this) ] self , move |_| {
709- let url = Url :: parse( & this. url( ) ) . unwrap( ) ;
710-
711- this. session( ) . validator( ) . remove_known( url. host_str( ) . unwrap( ) ) ;
712- this. reload( ) ;
713- } ) ) ;
713+ override_btn. connect_clicked ( clone ! (
714+ #[ weak( rename_to = this) ]
715+ self ,
716+ move |_| {
717+ let url = Url :: parse( & this. url( ) ) . unwrap( ) ;
718+
719+ this. session( )
720+ . validator( )
721+ . remove_known( url. host_str( ) . unwrap( ) ) ;
722+ this. reload( ) ;
723+ }
724+ ) ) ;
714725 override_btn. set_halign ( gtk:: Align :: Center ) ;
715726 override_btn. add_css_class ( "destructive-action" ) ;
716727 override_btn. add_css_class ( "pill" ) ;
@@ -733,12 +744,18 @@ impl Tab {
733744 p. set_icon_name ( Some ( "dialog-error-symbolic" ) ) ;
734745
735746 let override_btn = gtk:: Button :: with_label ( "Continue" ) ;
736- override_btn. connect_clicked ( clone ! ( #[ weak( rename_to = this) ] self , move |_| {
737- let url = Url :: parse( & this. url( ) ) . unwrap( ) ;
738-
739- this. session( ) . validator( ) . override_trust( url. host_str( ) . unwrap( ) ) ;
740- this. reload( ) ;
741- } ) ) ;
747+ override_btn. connect_clicked ( clone ! (
748+ #[ weak( rename_to = this) ]
749+ self ,
750+ move |_| {
751+ let url = Url :: parse( & this. url( ) ) . unwrap( ) ;
752+
753+ this. session( )
754+ . validator( )
755+ . override_trust( url. host_str( ) . unwrap( ) ) ;
756+ this. reload( ) ;
757+ }
758+ ) ) ;
742759 override_btn. set_halign ( gtk:: Align :: Center ) ;
743760 override_btn. add_css_class ( "destructive-action" ) ;
744761 override_btn. add_css_class ( "pill" ) ;
0 commit comments