From de217179d3a7f8ab6aa90ebe5eab878b84de1c3b Mon Sep 17 00:00:00 2001 From: csoler Date: Fri, 19 Feb 2010 22:46:21 +0000 Subject: [PATCH] additional info into FileTransferInfoWidget git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2375 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- retroshare-gui/src/gui/FileTransferInfoWidget.cpp | 8 ++++++-- retroshare-gui/src/gui/FileTransferInfoWidget.h | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/retroshare-gui/src/gui/FileTransferInfoWidget.cpp b/retroshare-gui/src/gui/FileTransferInfoWidget.cpp index 04490c197..117179372 100644 --- a/retroshare-gui/src/gui/FileTransferInfoWidget.cpp +++ b/retroshare-gui/src/gui/FileTransferInfoWidget.cpp @@ -90,7 +90,7 @@ void FileTransferInfoWidget::updateDisplay() x = blocks%columns*chunk_square_size; maxHeight = y+150+info.active_chunks.size()*(block_sep+text_height); // warning: this should be computed from the different size parameter and the number of objects drawn, otherwise the last objects to be displayed will be truncated. - draw(info,&painter) ; + draw(nfo,info,&painter) ; } pixmap2 = pixmap; } @@ -104,7 +104,7 @@ void FileTransferInfoWidget::paintEvent(QPaintEvent *event) pixmap = pixmap2; } -void FileTransferInfoWidget::draw(const FileChunksInfo& info,QPainter *painter) +void FileTransferInfoWidget::draw(const FileInfo& nfo,const FileChunksInfo& info,QPainter *painter) { x=0; y=0; @@ -216,12 +216,16 @@ void FileTransferInfoWidget::draw(const FileChunksInfo& info,QPainter *painter) painter->setPen(QColor::fromRgb(0,0,0)) ; y += text_height ; painter->drawText(0,y,tr("File info:")) ; y += block_sep ; + y += text_height ; painter->drawText(20,y,tr("File hash: ")) ; painter->drawText(tab_size,y,QString::fromStdString(nfo.hash)) ; + y += block_sep ; y += text_height ; painter->drawText(20,y,tr("File size: ")) ; painter->drawText(tab_size,y,QString::number(info.file_size)) ; y += block_sep ; y += text_height ; painter->drawText(20,y,tr("Chunk size: ")) ; painter->drawText(tab_size,y,QString::number(info.chunk_size)) ; y += block_sep ; y += text_height ; painter->drawText(20,y,tr("Number of chunks: ")) ; painter->drawText(tab_size,y,QString::number(info.chunks.size())) ; y += block_sep ; + y += text_height ; painter->drawText(20,y,tr("Transfered: ")) ; painter->drawText(tab_size,y,QString::number(nfo.transfered)) ; + y += block_sep ; y += text_height ; painter->drawText(20,y,tr("Number of sources: ")) ; painter->drawText(tab_size,y,QString::number(info.compressed_peer_availability_maps.size())) ; y += block_sep ; y += text_height ; painter->drawText(20,y,tr("Chunk strategy: ")) ; painter->drawText(tab_size,y,(info.strategy==FileChunksInfo::CHUNK_STRATEGY_RANDOM)?"Random":"Streaming") ; diff --git a/retroshare-gui/src/gui/FileTransferInfoWidget.h b/retroshare-gui/src/gui/FileTransferInfoWidget.h index d7e2f7d56..c2f1b88da 100644 --- a/retroshare-gui/src/gui/FileTransferInfoWidget.h +++ b/retroshare-gui/src/gui/FileTransferInfoWidget.h @@ -27,6 +27,7 @@ #include "RsAutoUpdatePage.h" class FileChunksInfo ; +class FileInfo ; class FileTransferInfoWidget : public RsAutoUpdatePage { @@ -39,7 +40,7 @@ public: virtual void updateDisplay() ; // update from RsAutoUpdateWidget protected: - void draw(const FileChunksInfo& details,QPainter *painter) ; + void draw(const FileInfo& nfo,const FileChunksInfo& details,QPainter *painter) ; virtual void paintEvent(QPaintEvent *); virtual void resizeEvent(QResizeEvent *event);