[PyKDE] Re: Savefile dialog (QFileDialog.getSaveFileName).

kakada hokkakada at khmeros.info
Wed Aug 23 05:32:36 BST 2006


Hi,

បានសរសេរ Lukáš Lalinský:
> Keo Sophon wrote:
>   
>> Hi,
>>
>> Does anyone know how to detect which button (Save or Cancel) that a user 
>> clicks on savefile dialog (QFileDialog.getSaveFileName)?
>>
>> On the other hands, how can I display only the All Supported Files, for 
>> example (xml, html, odt, po)? 
>>     
>
> fileName = QtGui.QFileDialog.getSaveFileName(self, "", "", "All Supported Files
> (*.xml *.html *.odt *.po)")
> if fileName:
>     # OK
>     print fileName
> else:
>     # Cancel
>     print "No file selected!"
>
> -Lukáš
>   
your solution is detecting the filename if it exist or not,  but not the
button (Save or Cancel).
Because if your filename isEmpty, either do you click OK nor Cancel;as
the result, you always get "No file selected"

Other solution?
da





More information about the PyQt mailing list