Revision: 1502
http://rigsofrods.svn.sourceforge.net/rigsofrods/?rev=1502&view=rev
Author: rorthomas
Date: 2010-07-26 13:45:32 +0000 (Mon, 26 Jul 2010)
Log Message:
-----------
improved installer: more verbose file indexing and title changing
Modified Paths:
--------------
trunk/source/installer/cevent.h
trunk/source/installer/wizard.cpp
trunk/source/installer/wizard.h
trunk/source/installer/wthread.cpp
Modified: trunk/source/installer/cevent.h
===================================================================
--- trunk/source/installer/cevent.h 2010-07-25 21:52:59 UTC (rev 1501)
+++ trunk/source/installer/cevent.h 2010-07-26 13:45:32 UTC (rev 1502)
@@ -73,6 +73,7 @@
MSE_UPDATE_SERVER,
MSE_UPDATE_TIME_LEFT,
MSE_UPDATE_CONCURR,
+ MSE_UPDATE_TITLE,
// for the download backends
MSE_DOWNLOAD_START,
Modified: trunk/source/installer/wizard.cpp
===================================================================
--- trunk/source/installer/wizard.cpp 2010-07-25 21:52:59 UTC (rev 1501)
+++ trunk/source/installer/wizard.cpp 2010-07-26 13:45:32 UTC (rev 1502)
@@ -946,14 +946,13 @@
isDone=false;
m_bitmap = wxBitmap(download_xpm);
wxBoxSizer *mainSizer = new wxBoxSizer(wxVERTICAL);
- wxStaticText *tst;
- mainSizer->Add(tst=new wxStaticText(this, wxID_ANY, _T("Downloading")), 0,
wxALL, 5);
- wxFont dfont=tst->GetFont();
+ mainSizer->Add(txtTitle=new wxStaticText(this, wxID_ANY,
_T("Downloading")), 0, wxALL, 5);
+ wxFont dfont=txtTitle->GetFont();
dfont.SetWeight(wxFONTWEIGHT_BOLD);
dfont.SetPointSize(dfont.GetPointSize()+3);
- tst->SetFont(dfont);
- tst->Wrap(TXTWRAP);
+ txtTitle->SetFont(dfont);
+ txtTitle->Wrap(TXTWRAP);
// status text and progress bar
@@ -1186,6 +1185,9 @@
case MSE_UPDATE_CONCURR:
txt_concurr->SetLabel(ev.GetString());
break;
+ case MSE_UPDATE_TITLE:
+ txtTitle->SetLabel(ev.GetString());
+ break;
case MSE_DONE:
// normal end
statusList->Append(wxT("Finished downloading."));
Modified: trunk/source/installer/wizard.h
===================================================================
--- trunk/source/installer/wizard.h 2010-07-25 21:52:59 UTC (rev 1501)
+++ trunk/source/installer/wizard.h 2010-07-26 13:45:32 UTC (rev 1502)
@@ -180,6 +180,7 @@
wxStaticText *txt_dltime, *txt_speed, *txt_traf, *txt_localpath,
*txt_server, *txt_remaintime, *txt_concurr, *txt_updver;
wxHyperlinkCtrl *hlink;
wxStaticText *txtFinish;
+ wxStaticText *txtTitle;
wxListBox *statusList;
wxGauge *progress;
HtmlWindow *htmlinfo;
Modified: trunk/source/installer/wthread.cpp
===================================================================
--- trunk/source/installer/wthread.cpp 2010-07-25 21:52:59 UTC (rev 1501)
+++ trunk/source/installer/wthread.cpp 2010-07-26 13:45:32 UTC (rev 1502)
@@ -175,9 +175,14 @@
updateCallback(MSE_UPDATE_PATH, ipath.string());
getSyncData();
+
+ updateCallback(MSE_UPDATE_TITLE, "Downloading ...");
sync();
+
recordDataUsage();
+ updateCallback(MSE_UPDATE_TITLE, "Finished!");
+
return (WsyncThread::ExitCode)0; // success
}
@@ -212,15 +217,24 @@
vector<string> files;
listFiles(path, files);
char tmp[256] = "";
+ updateCallback(MSE_UPDATE_TITLE, "Indexing local files ..");
sprintf(tmp, "indexing %d files ...", files.size());
LOG("%s\n", tmp);
updateCallback(MSE_STARTING, string(tmp));
int counter = 0, counterMax = files.size();
for(vector<string>::iterator it=files.begin(); it!=files.end(); it++,
counter++)
{
- updateCallback(MSE_UPDATE_PROGRESS, "",
float(counter)/float(counterMax));
+ string respath = *it;
+
+ boost::uintmax_t fileSize = 0;
+ try
+ {
+ fileSize = file_size(respath);
+ } catch(...)
+ {
+ }
+
// cut out root path
- string respath = *it;
if(respath.substr(0, rootpath.string().size()) ==
rootpath.string())
{
// this ensures that all paths start with /
@@ -242,6 +256,11 @@
if (found != string::npos)
continue;
+
+ sprintf(tmp, "%s (%s) ...", respath.c_str(),
formatFilesize(fileSize).c_str());
+ updateCallback(MSE_UPDATE_PROGRESS, string(tmp),
float(counter)/float(counterMax));
+ updateCallback(MSE_UPDATE_TEXT, string(tmp));
+
string resultHash = generateFileHash(it->c_str());
Hashentry entry(resultHash, file_size(*it));
@@ -316,6 +335,8 @@
LOG("local hashmap building done:\n");
debugOutputHashMap(hashMapLocal);
+ updateCallback(MSE_UPDATE_TITLE, "Getting remote streams ...");
+
// now fetch remote file-indexes
for(std::vector < stream_desc_t >::iterator it = streams.begin();
it!=streams.end(); it++)
{
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/
_______________________________________________
Rigsofrods-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rigsofrods-devel