@@ -633,16 +633,15 @@ def getFileName(self):
633633 macro = self .stack .currentWidget ().objectName ()
634634 dirct = self [macro ][2 ].get ('PATH' )
635635 defaultfilename = self [macro ][2 ].get ('DEFAULT' )
636+
636637 mess = {'NAME' :self .load_dialog_code ,'ID' :'%s__' % self .objectName (),
637638 'TITLE' :'Load Macro' ,
638- 'FILENAME' :'%s_data.txt' % str (self .stack .currentWidget ().objectName ()),
639639 'EXTENSIONS' :'Text Files (*.txt);;ALL Files (*.*)'
640640 }
641641 if not defaultfilename is None :
642642 mess ['FILENAME' ] = defaultfilename
643643 else :
644- pass
645- #mess['FILENAME'] = '{}_data.txt'.format( str(self.stack.currentWidget().objectName()))
644+ mess ['FILENAME' ] = '{}_data.txt' .format ( str (self .stack .currentWidget ().objectName ()))
646645 if not dirct is None :
647646 mess ['DIRECTORY' ] = dirct
648647 STATUS .emit ('dialog-request' , mess )
@@ -651,9 +650,20 @@ def getFileName(self):
651650 # do this so the system is consistent and things like dialog
652651 # placement are done.
653652 def getSaveFileName (self ):
653+ macro = self .stack .currentWidget ().objectName ()
654+ dirct = self [macro ][2 ].get ('PATH' )
655+ defaultfilename = self [macro ][2 ].get ('DEFAULT' )
656+
654657 mess = {'NAME' :self .save_dialog_code ,'ID' :'%s__' % self .objectName (),
655- 'TITLE' :'Save Macro' , 'FILENAME' :'%s_data.txt' % str (self .stack .currentWidget ().objectName ()),
656- 'EXTENSIONS' :'Text Files (*.txt);;ALL Files (*.*)' }
658+ 'TITLE' :'Save Macro' ,
659+ 'EXTENSIONS' :'Text Files (*.txt);;ALL Files (*.*)'
660+ }
661+ if not defaultfilename is None :
662+ mess ['FILENAME' ] = defaultfilename
663+ else :
664+ mess ['FILENAME' ] = '{}_data.txt' .format ( str (self .stack .currentWidget ().objectName ()))
665+ if not dirct is None :
666+ mess ['DIRECTORY' ] = dirct
657667 STATUS .emit ('dialog-request' , mess )
658668
659669 # process the STATUS return message from dialogs
0 commit comments