Skip to content

Commit

Permalink
Include file dialog, and fix #7
Browse files Browse the repository at this point in the history
  • Loading branch information
severinsimmler committed Apr 18, 2018
1 parent e40c901 commit a91032a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions application/gui.py
Expand Up @@ -43,6 +43,14 @@ def provide_gui(application):
webview = PyQt5.QtWebEngineWidgets.QWebEngineView()

def download_requested(item):
options = PyQt5.QtWidgets.QFileDialog.Options()
options |= PyQt5.QtWidgets.QFileDialog.DontUseNativeDialog
path = PyQt5.QtWidgets.QFileDialog.getSaveFileName(None,
"Select destination folder and file name",
"",
"Zip files (*.zip)",
options=options)[0]
item.setPath(path + '.zip')
item.accept()

webview.page().profile().downloadRequested.connect(download_requested)
Expand Down
2 changes: 1 addition & 1 deletion application/templates/model.html
Expand Up @@ -8,7 +8,7 @@
<a href="{{ url_for('help') }}"><i class="icon-question-sign icon-white"></i> Help</a>
</li>
<li>
<a href="http://127.0.0.1:5000/model/download"><i class="icon-download icon-white"></i> Save Graphics and Tables to Download Folder</a>
<a href="http://127.0.0.1:5000/model/download"><i class="icon-download icon-white"></i> Save Graphics and Tables</a>
</li>
</ul>
{% endblock %}
Expand Down

0 comments on commit a91032a

Please sign in to comment.