Inital Import of asterisk_gosu into launcher, non-functional.

This commit is contained in:
2022-06-03 22:58:26 -05:00
parent fc968ffe32
commit c0eac0104b
12 changed files with 682 additions and 43 deletions

View File

@@ -8,7 +8,7 @@ class W3DHub
end
def execute_task
path = ask_file
path = W3DHub.ask_file
unless File.exist?(path) && !File.directory?(path)
fail!("File #{path.inspect} does not exist or is a directory")
@@ -21,30 +21,6 @@ class W3DHub
true
end
def ask_file(title: "Open File", filter: "*game*.exe")
if W3DHub.unix?
# search for command
cmds = %w{ zenity matedialog qarma kdialog }
command = cmds.find do |cmd|
cmd if system("which #{cmd}")
end
path = case File.basename(command)
when "zenity", "matedialog", "qarma"
`#{command} --file-selection --title "#{title}" --file-filter "#{filter}"`
when "kdialog"
`#{command} --title "#{title}" --getopenfilename . "#{filter}"`
else
raise "No known command found for system file selection dialog!"
end
path.strip
else
raise NotImplementedError
end
end
end
end
end