File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed
Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -879,28 +879,28 @@ def str2bool(s):
879879 m1 = md5sum (f )
880880 if m1 and m != m1 :
881881 warnings2 .append (_ ("File %r was modified since it was written by PNCconf" ) % f )
882+
883+ # no warnings ? return to pncconf APP
882884 if not warnings and not warnings2 : return
885+
883886 if warnings2 :
884887 warnings .append ("" )
885888 warnings .append (_ ("Saving this configuration file will discard configuration changes made outside PNCconf." ))
886889 if warnings :
887890 warnings = warnings + warnings2
888891 self .pncconf_loaded_version = self ._pncconf_version
889- if app :
890- dialog = gtk .MessageDialog (app .widgets .window1 ,
891- gtk .DIALOG_MODAL | gtk .DialogFlags .DESTROY_WITH_PARENT ,
892- gtk .MESSAGE_WARNING , gtk .ButtonsType .OK ,
893- "\n " .join (warnings ))
894- dialog .show_all ()
895- dialog .run ()
896- dialog .destroy ()
892+
893+ # if we have a GUI running, pop a dialog
894+ # else print to terminal
895+ if not app is None :
896+ _APP .warning_dialog ("\n " .join (warnings ), True )
897897 else :
898898 for para in warnings :
899899 for line in textwrap .wrap (para , 78 ): print (line )
900900 print ()
901901 print ()
902902 if force : return
903- response = input (_ ("Continue? " ))
903+ response = input (_ ("Continue? (y/n) " ))
904904 if response [0 ] not in _ ("yY" ): raise SystemExit (1 )
905905
906906 def add_md5sum (self , filename , mode = "r" ):
You can’t perform that action at this time.
0 commit comments