mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-28 18:42:20 -04:00
Added freeze option in NetworkView (Modified patch from K. Eisentraut)
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6879 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
e04283f3af
commit
5304865fc4
5 changed files with 41 additions and 1 deletions
|
@ -57,6 +57,7 @@ NetworkView::NetworkView(QWidget *parent)
|
||||||
/* Hide Settings frame */
|
/* Hide Settings frame */
|
||||||
connect( ui.maxFriendLevelSB, SIGNAL(valueChanged(int)), this, SLOT(setMaxFriendLevel(int)));
|
connect( ui.maxFriendLevelSB, SIGNAL(valueChanged(int)), this, SLOT(setMaxFriendLevel(int)));
|
||||||
connect( ui.edgeLengthSB, SIGNAL(valueChanged(int)), this, SLOT(setEdgeLength(int)));
|
connect( ui.edgeLengthSB, SIGNAL(valueChanged(int)), this, SLOT(setEdgeLength(int)));
|
||||||
|
connect( ui.freezeCheckBox, SIGNAL(toggled(bool)), this, SLOT(setFreezeState(bool)));
|
||||||
|
|
||||||
_should_update = true ;
|
_should_update = true ;
|
||||||
}
|
}
|
||||||
|
@ -96,6 +97,15 @@ void NetworkView::clear()
|
||||||
update() ;
|
update() ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void NetworkView::setFreezeState(bool freeze)
|
||||||
|
{
|
||||||
|
#ifdef DEBUG_NETWORKVIEW
|
||||||
|
std::cerr << " NetworkView::setFreezeState(" << freeze << ")" << std::endl;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
ui.graphicsView->setFreeze(freeze);
|
||||||
|
}
|
||||||
|
|
||||||
class NodeInfo
|
class NodeInfo
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -49,6 +49,8 @@ class NetworkView : public RsAutoUpdatePage
|
||||||
void changedFoFCheckBox( );
|
void changedFoFCheckBox( );
|
||||||
void redraw();
|
void redraw();
|
||||||
|
|
||||||
|
void setFreezeState(bool);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
void clear();
|
void clear();
|
||||||
|
|
|
@ -91,6 +91,13 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="0" column="6">
|
||||||
|
<widget class="QCheckBox" name="freezeCheckBox">
|
||||||
|
<property name="text">
|
||||||
|
<string>Freeze</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
|
|
@ -121,7 +121,7 @@ void fourn(double data[],unsigned long nn[],unsigned long ndim,int isign)
|
||||||
#undef SWAP
|
#undef SWAP
|
||||||
|
|
||||||
GraphWidget::GraphWidget(QWidget *)
|
GraphWidget::GraphWidget(QWidget *)
|
||||||
: timerId(0)
|
: timerId(0), mIsFrozen(false)
|
||||||
{
|
{
|
||||||
// QGraphicsScene *scene = new QGraphicsScene(QRectF(0,0,500,500),this);
|
// QGraphicsScene *scene = new QGraphicsScene(QRectF(0,0,500,500),this);
|
||||||
// scene->setItemIndexMethod(QGraphicsScene::NoIndex);
|
// scene->setItemIndexMethod(QGraphicsScene::NoIndex);
|
||||||
|
@ -305,6 +305,12 @@ void GraphWidget::timerEvent(QTimerEvent *event)
|
||||||
if(!isVisible())
|
if(!isVisible())
|
||||||
return ;
|
return ;
|
||||||
|
|
||||||
|
if (mIsFrozen)
|
||||||
|
{
|
||||||
|
update();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
static const int S = 256 ;
|
static const int S = 256 ;
|
||||||
static double *forceMap = new double[2*S*S] ;
|
static double *forceMap = new double[2*S*S] ;
|
||||||
|
|
||||||
|
@ -437,3 +443,13 @@ void GraphWidget::scaleView(qreal scaleFactor)
|
||||||
|
|
||||||
scale(scaleFactor, scaleFactor);
|
scale(scaleFactor, scaleFactor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GraphWidget::setFreeze(bool freeze)
|
||||||
|
{
|
||||||
|
mIsFrozen = freeze;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool GraphWidget::isFrozen() const
|
||||||
|
{
|
||||||
|
return mIsFrozen;
|
||||||
|
}
|
||||||
|
|
|
@ -78,6 +78,10 @@ public:
|
||||||
void snapshotNodesPositions() ;
|
void snapshotNodesPositions() ;
|
||||||
void clearNodesPositions() ;
|
void clearNodesPositions() ;
|
||||||
void clearGraph() ;
|
void clearGraph() ;
|
||||||
|
|
||||||
|
void setFreeze(bool freeze);
|
||||||
|
bool isFrozen() const;
|
||||||
|
|
||||||
virtual void itemMoved();
|
virtual void itemMoved();
|
||||||
|
|
||||||
void setEdgeLength(uint32_t l) ;
|
void setEdgeLength(uint32_t l) ;
|
||||||
|
@ -96,6 +100,7 @@ private:
|
||||||
int timerId;
|
int timerId;
|
||||||
//Node *centerNode;
|
//Node *centerNode;
|
||||||
bool mDeterminedBB ;
|
bool mDeterminedBB ;
|
||||||
|
bool mIsFrozen;
|
||||||
|
|
||||||
std::vector<Node *> _nodes ;
|
std::vector<Node *> _nodes ;
|
||||||
std::map<std::pair<NodeId,NodeId>,Edge *> _edges ;
|
std::map<std::pair<NodeId,NodeId>,Edge *> _edges ;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue