allpy
changeset 842:d60f272dc921
blocks3d/wt: suggest better filenames for downloading
If input alignment provided, name of input alignment file is
concatenated with ".html" and used as name of output file.
Otherwise "blocks3d.html" name is used
author | boris (kodomo) <bnagaev@gmail.com> |
---|---|
date | Wed, 20 Jul 2011 02:38:59 +0400 |
parents | ac136d182556 |
children | 3a712982ceb8 |
files | blocks3d/wt/blocks3d-wt-widget.C blocks3d/wt/blocks3d-wt-widget.h blocks3d/wt/config.h |
diffstat | 3 files changed, 7 insertions(+), 1 deletions(-) [+] |
line diff
1.1 --- a/blocks3d/wt/blocks3d-wt-widget.C Wed Jul 20 02:02:50 2011 +0400 1.2 +++ b/blocks3d/wt/blocks3d-wt-widget.C Wed Jul 20 02:38:59 2011 +0400 1.3 @@ -22,7 +22,8 @@ 1.4 std::list<std::string> current_taks; 1.5 1.6 Blocks3DWidget::Blocks3DWidget(Wt::WContainerWidget* parent) : 1.7 - Wt::WContainerWidget(parent) 1.8 + Wt::WContainerWidget(parent), 1.9 + suggested_file_name(Malakite::suggested_file_name) 1.10 { 1.11 alignment_upload = new Wt::WFileUpload(); 1.12 alignment_textarea = new Wt::WTextArea(); 1.13 @@ -164,6 +165,7 @@ 1.14 { 1.15 textarea_from_file(alignment_textarea, 1.16 alignment_upload->spoolFileName().c_str()); 1.17 + suggested_file_name = alignment_upload->clientFileName() + ".html"; 1.18 } 1.19 1.20 void Blocks3DWidget::conformity_uploaded() 1.21 @@ -333,6 +335,7 @@ 1.22 new Wt::WText(" | ", results_panel); 1.23 Wt::WFileResource* html_download = 1.24 new Wt::WFileResource("application/html", tempfile_html, this); 1.25 + html_download->suggestFileName(suggested_file_name); 1.26 new Wt::WAnchor(html_download, tr("Download"), results_panel); 1.27 1.28 new Wt::WBreak(results_panel);
2.1 --- a/blocks3d/wt/blocks3d-wt-widget.h Wed Jul 20 02:02:50 2011 +0400 2.2 +++ b/blocks3d/wt/blocks3d-wt-widget.h Wed Jul 20 02:38:59 2011 +0400 2.3 @@ -49,6 +49,7 @@ 2.4 std::string tempfile_check; 2.5 std::string tempfile_sh; 2.6 std::string tempfile_ppid; 2.7 + Wt::WString suggested_file_name; 2.8 2.9 static bool is_completed(std::string tempfile_check); 2.10
3.1 --- a/blocks3d/wt/config.h Wed Jul 20 02:02:50 2011 +0400 3.2 +++ b/blocks3d/wt/config.h Wed Jul 20 02:38:59 2011 +0400 3.3 @@ -13,6 +13,8 @@ 3.4 3.5 const char* const tempfile_sh = "run.sh"; 3.6 3.7 +const char* const suggested_file_name = "blocks3d.html"; 3.8 + 3.9 namespace defaults 3.10 { 3.11