@@ -874,11 +874,11 @@ def reset_filters(self):
874874 def import_filters (self , import_path = None ):
875875 if import_path is None :
876876 # Debug
877- logging .info ("Asking for location for export " )
877+ logging .info ("Asking for location for import " )
878878 import_path = QFileDialog .getOpenFileName (parent = self .Root_Window ,
879879 dir = FF_Files .USER_FOLDER ,
880- caption = "Export File Find Search" ,
881- filter = "*.FFFilter; *.FFSearch" )[0 ]
880+ caption = "Import Filer or Search" ,
881+ filter = "File Find Filter or Search ( *.FFFilter *.FFSearch) " )[0 ]
882882
883883 # If opened file is a search
884884 if import_path .endswith (".FFSearch" ):
@@ -943,15 +943,24 @@ def import_filters(self, import_path=None):
943943 def export_filters (self ):
944944 # Debug
945945 logging .info ("Request location for export" )
946- export_path = QFileDialog .getSaveFileName (parent = self .Root_Window ,
947- dir = FF_Files .USER_FOLDER ,
948- caption = "Export File Find Search" ,
949- filter = "File Find Filter Preset (*.FFFilter);;"
950- "JSON (JavaScript Object Notation) (*.json)" )[0 ]
946+ export_dialog = QFileDialog .getSaveFileName (parent = self .Root_Window ,
947+ dir = FF_Files .USER_FOLDER ,
948+ caption = "Export File Find Search" ,
949+ filter = "File Find Filter Preset (*.FFFilter);;"
950+ "JSON (JavaScript Object Notation) (*.json)" )[0 ]
951+ export_path = export_dialog [0 ]
952+
951953 # If User pressed "Cancel"
952954 if export_path == "" :
953955 return
954956
957+ # If the suffix wasn't added, add it
958+ if not (export_path .endswith (".FFFilter" ) or export_path .endswith (".json" )):
959+ if "FFFilter" in export_dialog [1 ]:
960+ export_path += ".FFFilter"
961+ else :
962+ export_path += ".json"
963+
955964 # Debug
956965 logging .info (f"Exporting all filters to { export_path } , with { FF_Files .FF_FILTER_VERSION = } ..." )
957966 # Making user folder compatible
0 commit comments