2016-11-24 14:37:01 +00:00
|
|
|
/* conversation_colorize_action.cpp
|
|
|
|
*
|
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
|
|
|
* Copyright 1998 Gerald Combs
|
|
|
|
*
|
2018-04-30 07:47:58 +00:00
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
*/
|
2016-11-24 14:37:01 +00:00
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
#include <glib.h>
|
|
|
|
#include <epan/packet_info.h>
|
|
|
|
#include <epan/proto_data.h>
|
|
|
|
#include <epan/packet.h>
|
|
|
|
#include <wsutil/utf8_entities.h>
|
|
|
|
#include "export_object_action.h"
|
|
|
|
|
|
|
|
#include <QMenu>
|
|
|
|
|
2017-07-25 14:15:18 +00:00
|
|
|
#include <ui/qt/utils/qt_ui_utils.h>
|
2016-11-24 14:37:01 +00:00
|
|
|
|
|
|
|
ExportObjectAction::ExportObjectAction(QObject *parent, register_eo_t *eo) :
|
|
|
|
QAction(parent),
|
|
|
|
eo_(eo)
|
|
|
|
{
|
|
|
|
if (eo_) {
|
2019-11-17 19:02:20 +00:00
|
|
|
setText(QString("%1%2").arg(proto_get_protocol_short_name(find_protocol_by_id(get_eo_proto_id(eo)))).arg(UTF8_HORIZONTAL_ELLIPSIS));
|
2016-11-24 14:37:01 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-03-28 08:04:50 +00:00
|
|
|
void ExportObjectAction::captureFileEvent(CaptureEvent e)
|
2016-11-24 14:37:01 +00:00
|
|
|
{
|
2019-11-17 19:02:20 +00:00
|
|
|
if (e.captureContext() == CaptureEvent::File)
|
2017-12-22 12:58:02 +00:00
|
|
|
{
|
2019-11-17 19:02:20 +00:00
|
|
|
if (e.eventType() == CaptureEvent::Opened)
|
2017-12-22 12:58:02 +00:00
|
|
|
setEnabled(true);
|
2019-11-17 19:02:20 +00:00
|
|
|
else if (e.eventType() == CaptureEvent::Closed)
|
2017-12-22 12:58:02 +00:00
|
|
|
setEnabled(false);
|
|
|
|
}
|
2016-11-24 14:37:01 +00:00
|
|
|
}
|