mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-21 04:44:25 -04:00
Added Chunk size and Number of Chunks to DetailsDialog
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2131 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
ef21de908c
commit
656aa9db5d
4 changed files with 115 additions and 22 deletions
|
@ -36,6 +36,8 @@
|
|||
#include <QStandardItemModel>
|
||||
|
||||
#include "util/misc.h"
|
||||
#include <rsiface/rsfiles.h>
|
||||
#include <rsiface/rstypes.h>
|
||||
|
||||
/** Default constructor */
|
||||
DetailsDialog::DetailsDialog(QWidget *parent, Qt::WFlags flags)
|
||||
|
@ -60,6 +62,8 @@ DetailsDialog::DetailsDialog(QWidget *parent, Qt::WFlags flags)
|
|||
_coheader->resizeSection ( 0, 100 );
|
||||
_coheader->resizeSection ( 1, 240 );
|
||||
_coheader->resizeSection ( 2, 100 );
|
||||
|
||||
updateDisplay();
|
||||
|
||||
|
||||
}
|
||||
|
@ -85,6 +89,7 @@ void DetailsDialog::on_cancel_dButton_clicked()
|
|||
void
|
||||
DetailsDialog::show()
|
||||
{
|
||||
ui.tabWidget->setCurrentIndex(0);
|
||||
if (!this->isVisible()) {
|
||||
QDialog::show();
|
||||
} else {
|
||||
|
@ -180,3 +185,34 @@ void DetailsDialog::setLink(const QString & link)
|
|||
{
|
||||
ui.Linktext->setText(link);
|
||||
}
|
||||
|
||||
void DetailsDialog::showEvent(QShowEvent *event)
|
||||
{
|
||||
updateDisplay();
|
||||
}
|
||||
|
||||
void DetailsDialog::updateDisplay()
|
||||
{
|
||||
|
||||
bool ok=true ;
|
||||
FileInfo nfo ;
|
||||
if(!rsFiles->FileDetails(_file_hash, RS_FILE_HINTS_DOWNLOAD, nfo))
|
||||
ok = false ;
|
||||
FileChunksInfo info ;
|
||||
if(!rsFiles->FileDownloadChunksDetails(_file_hash, info))
|
||||
ok = false ;
|
||||
|
||||
if(ok)
|
||||
{
|
||||
uint32_t blockSize = info.chunk_size ;
|
||||
|
||||
ui.chunksizelabel->setText(misc::friendlyUnit(blockSize));
|
||||
ui.numberofchunkslabel->setText(QString::number(info.chunks.size()));
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue