Skip to content

Commit

Permalink
New. If System have kdialog, yad, zenity then file chooser use this c…
Browse files Browse the repository at this point in the history
…ommand to get save file dir i Generate report
  • Loading branch information
eloaders committed Dec 29, 2013
1 parent bcb1d02 commit acede36
Showing 1 changed file with 22 additions and 7 deletions.
29 changes: 22 additions & 7 deletions src/i-nex/.src/FReport_Gen.class
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,28 @@ Endif
End

Public Sub ButtonBox1_Click()
Dialog.Title = "Choose a file"
Dialog.Filter = ["*.txt", "Text files"]
Dialog.SaveFile
ButtonBox1.Text = Dialog.Path
If Exist(ButtonBox1.Text, True) Then
Shell "rm " & Dialog.Path & "" Wait
Endif
Dim savefile As String

If ChkPrm.ChkExec("kdialog") = True Then
Exec ["kdialog", "--getsaveurl", "~/", ".txt"] Wait To savefile
ButtonBox1.Text = Replace(savefile, "file://", "")
Else If ChkPrm.ChkExec("yad") = True Then
Exec ["yad", "--width=600", "--height=500", "--align=center", "--file-selection", "--filename=report.txt", "--file-filter=*.txt"] Wait To savefile
ButtonBox1.Text = Replace(savefile, "file://", "")
Else If ChkPrm.ChkExec("zenity") = True Then
Exec ["zenity", "--file-selection", "--confirm-overwrite", "--filename=report.txt", "--file-filter=*.txt"] Wait To savefile
ButtonBox1.Text = Replace(savefile, "file://", "")
Else
Dialog.Title = "Choose a file"
Dialog.Filter = ["*.txt", "Text files"]
Dialog.SaveFile
ButtonBox1.Text = Dialog.Path
Endif

If Exist(ButtonBox1.Text, True) Then
Try Kill ButtonBox1.Text
Endif

End

Public Sub Button2_Click()
Expand Down

0 comments on commit acede36

Please sign in to comment.