openFileDialog=wx.FileDialog(self,_("Select the picture to be uploaded"),"","",_("Image files (*.png, *.jpg, *.gif)|*.png; *.jpg; *.gif"),wx.FD_OPEN|wx.FD_FILE_MUST_EXIST)
ifopenFileDialog.ShowModal()==wx.ID_CANCEL:
returnNone
dsc=self.ask_description()
return(openFileDialog.GetPath(),dsc)
defask_description(self):
dlg=wx.TextEntryDialog(self,_("please provide a description"),_("Description"))
dlg.ShowModal()
result=dlg.GetValue()
dlg.Destroy()
returnresult
defget_audio(self):
openFileDialog=wx.FileDialog(self,_("Select the audio file to be uploaded"),"","",_("Audio files (*.mp3)|*.mp3"),wx.FD_OPEN|wx.FD_FILE_MUST_EXIST)
openFileDialog=wx.FileDialog(self,_("Select the file to be uploaded. All extensions are allowed except .mp3 and .exe."),"","",_("All files (*.*)|*.*"),wx.FD_OPEN|wx.FD_FILE_MUST_EXIST)
ifopenFileDialog.ShowModal()==wx.ID_CANCEL:
returnNone
returnopenFileDialog.GetPath()
definvalid_attachment(self):
returnwx.MessageDialog(None,_("The file you are trying to upload contains an extension that is not allowed by VK."),_("Error"),style=wx.ICON_ERROR).ShowModal()