mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-03-01 11:21:25 -05:00
added some visualization of mapping on disk for debugging purpose
git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-SparseFileStorage@6088 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
d96052c442
commit
30a3fe7b06
@ -44,6 +44,7 @@ FileTransferInfoWidget::FileTransferInfoWidget(QWidget * /*parent*/, Qt::WFlags
|
|||||||
QRect TaskGraphRect = geometry();
|
QRect TaskGraphRect = geometry();
|
||||||
maxWidth = TaskGraphRect.width();
|
maxWidth = TaskGraphRect.width();
|
||||||
maxHeight = 0;
|
maxHeight = 0;
|
||||||
|
draw_file_map = false ;
|
||||||
pixmap = QPixmap(size());
|
pixmap = QPixmap(size());
|
||||||
pixmap.fill(this, 0, 0);
|
pixmap.fill(this, 0, 0);
|
||||||
|
|
||||||
@ -62,6 +63,12 @@ void FileTransferInfoWidget::resizeEvent(QResizeEvent */*event*/)
|
|||||||
|
|
||||||
updateDisplay();
|
updateDisplay();
|
||||||
}
|
}
|
||||||
|
void FileTransferInfoWidget::toggleDisplayMode(bool b)
|
||||||
|
{
|
||||||
|
draw_file_map = b ;
|
||||||
|
updateDisplay();
|
||||||
|
}
|
||||||
|
|
||||||
void FileTransferInfoWidget::updateDisplay()
|
void FileTransferInfoWidget::updateDisplay()
|
||||||
{
|
{
|
||||||
//std::cout << "In TaskGraphPainterWidget::updateDisplay()" << std::endl ;
|
//std::cout << "In TaskGraphPainterWidget::updateDisplay()" << std::endl ;
|
||||||
@ -110,7 +117,7 @@ void FileTransferInfoWidget::paintEvent(QPaintEvent */*event*/)
|
|||||||
void FileTransferInfoWidget::draw(const FileInfo& nfo,const FileChunksInfo& info,QPainter *painter)
|
void FileTransferInfoWidget::draw(const FileInfo& nfo,const FileChunksInfo& info,QPainter *painter)
|
||||||
{
|
{
|
||||||
x=0;
|
x=0;
|
||||||
y=0;
|
y=5;
|
||||||
int blocks = info.chunks.size() ;
|
int blocks = info.chunks.size() ;
|
||||||
uint64_t fileSize = info.file_size ;
|
uint64_t fileSize = info.file_size ;
|
||||||
uint32_t blockSize = info.chunk_size ;
|
uint32_t blockSize = info.chunk_size ;
|
||||||
@ -123,6 +130,8 @@ void FileTransferInfoWidget::draw(const FileInfo& nfo,const FileChunksInfo& info
|
|||||||
painter->drawText(0,y,tr("Chunk map") + ":") ;
|
painter->drawText(0,y,tr("Chunk map") + ":") ;
|
||||||
y += block_sep ;
|
y += block_sep ;
|
||||||
|
|
||||||
|
QPixmap variablePixmap(downloadedPixmap) ;
|
||||||
|
|
||||||
// draw the chunk map
|
// draw the chunk map
|
||||||
//
|
//
|
||||||
for (int i=0;i<blocks;i++)
|
for (int i=0;i<blocks;i++)
|
||||||
@ -134,6 +143,16 @@ void FileTransferInfoWidget::draw(const FileInfo& nfo,const FileChunksInfo& info
|
|||||||
}
|
}
|
||||||
QRectF target(x, y, 12.0, 12.0);
|
QRectF target(x, y, 12.0, 12.0);
|
||||||
|
|
||||||
|
if(draw_file_map)
|
||||||
|
{
|
||||||
|
if(i<info.chunks_on_disk.size())
|
||||||
|
variablePixmap.fill(QColor::fromHsv(int(300*info.chunks_on_disk[i]/(float)blocks),200,255)) ;
|
||||||
|
else
|
||||||
|
variablePixmap.fill(QColor::fromHsv(int(300*i/(float)blocks),0,128)) ;
|
||||||
|
|
||||||
|
painter->drawPixmap(target,variablePixmap,source) ;
|
||||||
|
}
|
||||||
|
else
|
||||||
switch(info.chunks[i])
|
switch(info.chunks[i])
|
||||||
{
|
{
|
||||||
case FileChunksInfo::CHUNK_DONE: painter->drawPixmap(target, downloadedPixmap, source);
|
case FileChunksInfo::CHUNK_DONE: painter->drawPixmap(target, downloadedPixmap, source);
|
||||||
|
@ -39,6 +39,10 @@ public:
|
|||||||
void setFileHash(const std::string& hash) { _file_hash = hash ; }
|
void setFileHash(const std::string& hash) { _file_hash = hash ; }
|
||||||
|
|
||||||
virtual void updateDisplay() ; // update from RsAutoUpdateWidget
|
virtual void updateDisplay() ; // update from RsAutoUpdateWidget
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void toggleDisplayMode(bool) ;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void draw(const FileInfo& nfo,const FileChunksInfo& details,QPainter *painter) ;
|
void draw(const FileInfo& nfo,const FileChunksInfo& details,QPainter *painter) ;
|
||||||
|
|
||||||
@ -56,6 +60,7 @@ private:
|
|||||||
QPixmap downloadingPixmap;
|
QPixmap downloadingPixmap;
|
||||||
QPixmap notDownloadPixmap;
|
QPixmap notDownloadPixmap;
|
||||||
QPixmap checkingPixmap;
|
QPixmap checkingPixmap;
|
||||||
|
bool draw_file_map ;
|
||||||
|
|
||||||
std::string _file_hash ;
|
std::string _file_hash ;
|
||||||
};
|
};
|
||||||
|
@ -303,6 +303,9 @@ TransfersDialog::TransfersDialog(QWidget *parent)
|
|||||||
|
|
||||||
QObject::connect(ui.downloadList->selectionModel(),SIGNAL(selectionChanged (const QItemSelection&, const QItemSelection&)),this,SLOT(showFileDetails())) ;
|
QObject::connect(ui.downloadList->selectionModel(),SIGNAL(selectionChanged (const QItemSelection&, const QItemSelection&)),this,SLOT(showFileDetails())) ;
|
||||||
|
|
||||||
|
ftiw->toggleDisplayMode(ui.diskMap_CB->isChecked()) ;
|
||||||
|
connect(ui.diskMap_CB, SIGNAL(toggled(bool)), ftiw, SLOT( toggleDisplayMode(bool)));
|
||||||
|
|
||||||
ui.tabWidget->addTab( new TurtleRouterStatistics(), tr("Router Statistics")) ;
|
ui.tabWidget->addTab( new TurtleRouterStatistics(), tr("Router Statistics")) ;
|
||||||
|
|
||||||
ui.tabWidget->addTab( new TurtleRouterDialog(), tr("Router Requests")) ;
|
ui.tabWidget->addTab( new TurtleRouterDialog(), tr("Router Requests")) ;
|
||||||
|
@ -166,7 +166,7 @@
|
|||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>1</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="uploadsTab">
|
<widget class="QWidget" name="uploadsTab">
|
||||||
<attribute name="icon">
|
<attribute name="icon">
|
||||||
@ -228,8 +228,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>100</width>
|
<width>598</width>
|
||||||
<height>30</height>
|
<height>91</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@ -282,6 +282,19 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="0" column="4">
|
||||||
|
<spacer name="horizontalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>368</width>
|
||||||
|
<height>13</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
<item row="0" column="3">
|
<item row="0" column="3">
|
||||||
<layout class="QGridLayout">
|
<layout class="QGridLayout">
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
@ -303,19 +316,6 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="4">
|
|
||||||
<spacer name="horizontalSpacer">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>368</width>
|
|
||||||
<height>13</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="2">
|
<item row="0" column="2">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
<item>
|
<item>
|
||||||
@ -337,6 +337,13 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="0" column="5">
|
||||||
|
<widget class="QCheckBox" name="diskMap_CB">
|
||||||
|
<property name="text">
|
||||||
|
<string>Show disk map</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
@ -164,10 +164,10 @@ sshserver {
|
|||||||
}
|
}
|
||||||
|
|
||||||
INCLUDEPATH += $$LIBSSH_DIR/include/
|
INCLUDEPATH += $$LIBSSH_DIR/include/
|
||||||
#LIBS += $$LIBSSH_DIR/build/src/libssh.a
|
LIBS += $$LIBSSH_DIR/build/src/libssh.a
|
||||||
#LIBS += $$LIBSSH_DIR/build/src/threads/libssh_threads.a
|
LIBS += $$LIBSSH_DIR/build/src/threads/libssh_threads.a
|
||||||
LIBS += -lssh
|
#LIBS += -lssh
|
||||||
LIBS += -lssh_threads
|
#LIBS += -lssh_threads
|
||||||
|
|
||||||
HEADERS += ssh/rssshd.h
|
HEADERS += ssh/rssshd.h
|
||||||
SOURCES += ssh/rssshd.cc
|
SOURCES += ssh/rssshd.cc
|
||||||
|
Loading…
x
Reference in New Issue
Block a user