コード例 #1
0
ファイル: main_toolbar.c プロジェクト: DHODoS/wireshark
static void
plugin_if_maintoolbar_goto_frame(gconstpointer user_data)
{
    if (user_data) {
        GHashTable * data_set = (GHashTable *) user_data;
        gpointer framenr;

        if (g_hash_table_lookup_extended(data_set, "frame_nr", NULL, &framenr)) {
            if (GPOINTER_TO_UINT(framenr) != 0)
                cf_goto_frame(&cfile, GPOINTER_TO_UINT(framenr));
        }
    }
}
コード例 #2
0
void ExportObjectDialog::on_objectTree_currentItemChanged(QTreeWidgetItem *item, QTreeWidgetItem *)
{
    if (!item) {
        if (save_bt_) save_bt_->setEnabled(false);
        return;
    }

    if (save_bt_) save_bt_->setEnabled(true);

    export_object_entry_t *entry = item->data(0, Qt::UserRole).value<export_object_entry_t *>();
    if (entry && !file_closed_) {
        cf_goto_frame(cap_file_.capFile(), entry->pkt_num);
    }
}
コード例 #3
0
void SCTPGraphDialog::graphClicked(QCPAbstractPlottable* plottable, QMouseEvent* event)
{
    frame_num = 0;
    int i=0;
    double times = ui->sctpPlot->xAxis->pixelToCoord(event->pos().x());
    if (plottable->name().contains("TSN", Qt::CaseInsensitive)) {
        for (i = 0; i < xt.size(); i++) {
            if (times <= xt.value(i)) {
                frame_num = ft.at(i);
                break;
            }
        }
    } else if (plottable->name().contains("SACK", Qt::CaseInsensitive)) {
        for (i = 0; i < xs.size(); i++) {
            if (times <= xs.value(i)) {
                frame_num = fs.at(i);
                break;
            }
        }
    } else if (plottable->name().contains("DUP", Qt::CaseInsensitive)) {
        for (i = 0; i < xd.size(); i++) {
            if (times <= xd.value(i)) {
                frame_num = fd.at(i);
                break;
            }
        }
    } else if (plottable->name().contains("NR_GAP", Qt::CaseInsensitive)) {
        for (i = 0; i < xn.size(); i++) {
            if (times <= xn.value(i)) {
                frame_num = fn.at(i);
                break;
            }
        }
    } else if (plottable->name().contains("GAP", Qt::CaseInsensitive)) {
        for (i = 0; i < xs.size(); i++) {
            if (times <= xs.value(i)) {
                frame_num = fs.at(i);
                break;
            }
        }
    }
    if (cap_file_ && frame_num > 0) {
        cf_goto_frame(cap_file_, frame_num);
    }
    ui->hintLabel->setText(QString(tr("<small><i>%1: %2 Time: %3 secs </i></small>"))
                           .arg(plottable->name())
                           .arg(floor(ui->sctpPlot->yAxis->pixelToCoord(event->pos().y()) + 0.5))
                           .arg(ui->sctpPlot->xAxis->pixelToCoord(event->pos().x())));
}
コード例 #4
0
/* Redraw all byte view windows. */
void
redraw_packet_bytes_all(void)
{
    if (cfile.current_frame != NULL)
        redraw_packet_bytes( byte_nb_ptr_gbl, cfile.current_frame, cfile.finfo_selected);

    redraw_packet_bytes_packet_wins();

    /* XXX - this is a hack, to workaround a bug in GTK2.x!
       when changing the font size, even refilling of the corresponding
       gtk_text_buffer doesn't seem to trigger an update.
       The only workaround is to freshly select the frame, which will remove any
       existing notebook tabs and "restart" the whole byte view again. */
    if (cfile.current_frame != NULL) {
        cfile.current_row = -1;
        cf_goto_frame(&cfile, cfile.current_frame->num);
    }
}
コード例 #5
0
static void packet_history_forward(void) {
    GList *next;

    if(history_current) {
        next = g_list_next(history_current);

        /* do we have a forward entry? */
        if(next) {
            history_current = next;

            /* goto that packet but don't change history */
            ignore_jump = TRUE;
            cf_goto_frame(&cfile, GPOINTER_TO_INT(next->data));
            ignore_jump = FALSE;
        }
    }

    adjust_menus();
}
コード例 #6
0
static void packet_history_back(void) {
    GList *previous;

    if(history_current) {
        previous = g_list_previous(history_current);

        /* do we have a previous entry */
        if(previous) {
            history_current = previous;

            /* goto that packet but don't change history */
            ignore_jump = TRUE;
            cf_goto_frame(&cfile, GPOINTER_TO_INT(previous->data));
            ignore_jump = FALSE;
        }
    }

    adjust_menus();
}
コード例 #7
0
void WirelessTimeline::mouseReleaseEvent(QMouseEvent *event)
{
    QPointF localPos = event->localPos();
    qreal offset = localPos.x() - start_x;

    /* if this was a drag, ignore it */
    if (std::abs(offset) > 3)
        return;

    /* this was a click */
    guint num = find_packet(localPos.x());
    if (num == 0)
        return;

    frame_data *fdata = frame_data_sequence_find(cfile.provider.frames, num);
    if (!fdata->passed_dfilter && fdata->prev_dis_num > 0)
        num = fdata->prev_dis_num;

    cf_goto_frame(&cfile, num);
}
コード例 #8
0
void SCTPGraphArwndDialog::graphClicked(QCPAbstractPlottable* plottable, QMouseEvent* event)
{
    if (plottable->name().contains("Arwnd", Qt::CaseInsensitive)) {
        double times = ui->sctpPlot->xAxis->pixelToCoord(event->pos().x());
        int i=0;
        for (i = 0; i < xa.size(); i++) {
            if (times <= xa.value(i)) {
                frame_num = fa.at(i);
                break;
            }
        }
        if (cap_file_ && frame_num > 0) {
            cf_goto_frame(cap_file_, frame_num);
        }

        ui->hintLabel->setText(QString(tr("<small><i>Graph %1: a_rwnd=%2 Time=%3 secs </i></small>"))
                               .arg(plottable->name())
                               .arg(ya.value(i))
                               .arg(xa.value(i)));
    }
}
コード例 #9
0
void SCTPGraphByteDialog::graphClicked(QCPAbstractPlottable* plottable, QMouseEvent* event)
{
    if (plottable->name().contains(tr("Bytes"), Qt::CaseInsensitive)) {
        double bytes = ui->sctpPlot->yAxis->pixelToCoord(event->pos().y());
        int i;
        for (i = 0; i < yb.size(); i++) {
            if (bytes <= yb.value(i)) {
                frame_num = fb.at(i);
                break;
            }
        }
        if (cap_file_ && frame_num > 0) {
            cf_goto_frame(cap_file_, frame_num);
        }

        ui->hintLabel->setText(QString(tr("<small><i>Graph %1: Received bytes=%2 Time=%3 secs </i></small>"))
                               .arg(plottable->name())
                               .arg(yb.value(i))
                               .arg(xb.value(i)));
    }
}