summaryrefslogtreecommitdiffstats
path: root/ui/qt/capture_info_dialog.h
blob: da30d04ec4bddeaeea738d0a348c3fedf0496a4f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/** @file
 *
 * Wireshark - Network traffic analyzer
 * By Gerald Combs <gerald@wireshark.org>
 * Copyright 1998 Gerald Combs
 *
 * SPDX-License-Identifier: GPL-2.0-or-later
 */

#ifndef CAPTURE_INFO_DIALOG_H
#define CAPTURE_INFO_DIALOG_H

#include "geometry_state_dialog.h"

#include <QAbstractTableModel>
#include <QElapsedTimer>

struct _capture_info;
struct _capture_session;

namespace Ui {
class CaptureInfoDialog;
}

class CaptureInfoModel : public QAbstractTableModel
{
    Q_OBJECT

public:
    explicit CaptureInfoModel(struct _capture_info *cap_info, QObject * parent = Q_NULLPTR);
    virtual ~CaptureInfoModel() {}
    void updateInfo();

    virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
    virtual int columnCount(const QModelIndex &parent = QModelIndex()) const;
    virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
//    virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;

private:
    struct _capture_info *cap_info_;
    int samples_;
    QMap<int, int> last_count_;
    QMap<int, QList<int> > points_;
    int last_other_;
    QList<int> other_points_;
};

class CaptureInfoDialog : public GeometryStateDialog
{
    Q_OBJECT

public:
    explicit CaptureInfoDialog(struct _capture_info *cap_info, struct _capture_session *cap_session, QWidget *parent = 0);
    ~CaptureInfoDialog();
    void updateInfo(void);

signals:

public slots:

private slots:
    void stopCapture();

private:
    Ui::CaptureInfoDialog *ui;
    struct _capture_info *cap_info_;
    struct _capture_session *cap_session_;
    CaptureInfoModel *ci_model_;
    QElapsedTimer duration_;
};

#endif // CAPTURE_INFO_DIALOG_H