23 #define IMG_CLOSE ":/images/22x22/edit-delete.png" 24 #define IMG_ZOOM ":/images/22x22/page-zoom.png" 26 #define CLOSED_CIRCUIT_REMOVE_DELAY 3000 27 #define FAILED_CIRCUIT_REMOVE_DELAY 5000 28 #define CLOSED_STREAM_REMOVE_DELAY 3000 29 #define FAILED_STREAM_REMOVE_DELAY 4000 37 setHeaderLabels(QStringList() << tr(
"Connection") << tr(
"Status"));
40 connect(
this, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)),
47 vApp->createShortcut(QKeySequence::Delete,
this,
this,
55 setHeaderLabels(QStringList() << tr(
"Connection") << tr(
"Status"));
56 for (
int i = 0;
i < topLevelItemCount();
i++) {
75 QTreeWidgetItem *item = itemAt(pos);
79 if (!item->parent()) {
86 QAction *zoomAct =
new QAction(QIcon(
IMG_ZOOM),
87 tr(
"Zoom to Circuit"),
this);
88 QAction *closeAct =
new QAction(QIcon(
IMG_CLOSE),
89 tr(
"Close Circuit (Del)"),
this);
90 #if defined(USE_MARBLE) 92 menu.addAction(zoomAct);
95 menu.addAction(closeAct);
99 QAction* action = menu.exec(mapToGlobal(pos));
100 if (action == closeAct)
102 else if (action == zoomAct)
111 QAction *closeAct =
new QAction(QIcon(
IMG_CLOSE),
112 tr(
"Close Stream (Del)"),
this);
113 menu.addAction(closeAct);
117 QAction* action = menu.exec(mapToGlobal(pos));
118 if (action == closeAct)
127 QList<QTreeWidgetItem *> items = selectedItems();
128 foreach (QTreeWidgetItem *item, items) {
129 if (!item->parent()) {
152 addTopLevelItem(item);
234 QList<StreamItem *> streams = circuit->
streams();
248 delete takeTopLevelItem(indexOfTopLevelItem(circuit));
283 QTreeWidget::clear();
293 int numCircs = topLevelItemCount();
294 for (
int i = 0;
i < numCircs;
i++) {
296 if (circid == circuit->
id()) {
308 int numCircs = topLevelItemCount();
311 for (
int i = 0;
i < numCircs;
i++) {
313 numStreams = circuit->childCount();
315 for (
int j = 0; j < numStreams; j++) {
317 if (streamid == stream->
id()) {
328 QTreeWidgetItem *prev)
335 if (!cur->parent()) {
353 int numCircs = topLevelItemCount();
356 for (
int i = 0;
i < numCircs;
i++) {
QList< StreamItem * > streams() const
void removeStream(StreamItem *stream)
void update(const Circuit &circuit)
void addStream(StreamItem *stream)
stop errmsg connect(const QHostAddress &address, quint16 port)
CircuitId circuitId() const
QList< Circuit > CircuitList
void update(const Stream &stream)