Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement to Open File Script Interface - File Filter #606

Closed
aaronlyons opened this issue Oct 18, 2017 · 0 comments
Closed

Enhancement to Open File Script Interface - File Filter #606

aaronlyons opened this issue Oct 18, 2017 · 0 comments
Assignees
Labels
Milestone

Comments

@aaronlyons
Copy link
Contributor

@aaronlyons aaronlyons commented Oct 18, 2017

A quick enhancement to Script Module to add the file filter as an optional parameter to the script module. This will allow for further customization of the dialog by the end user.

QT File Dialog Class - getOpenFileName

filter parameter added to code from script_module_gui.rb

    def save_file_dialog(directory = Cosmos::USERPATH, message = "Save File", filter = "All Files (*.*)")
      _get_main_thread_gui {|window| Qt::FileDialog.getSaveFileName(window, message, directory, filter) }
    end

    def open_file_dialog(directory = Cosmos::USERPATH, message = "Open File", filter = "All Files (*.*)")
      _get_main_thread_gui {|window| Qt::FileDialog.getOpenFileName(window, message, directory, filter) }
    end

    def open_files_dialog(directory = Cosmos::USERPATH, message = "Open File(s)", filter = "All Files (*.*)")
      _get_main_thread_gui {|window| Qt::FileDialog.getOpenFileNames(window, message, directory, filter) }
    end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

3 participants
You can’t perform that action at this time.