Add frame number to packet comment dialog

Bug: 14185
Change-Id: I9f52999339d3c34502d4e046e22f05a83fa773bb
Reviewed-on: https://code.wireshark.org/review/24330
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
Michael Mann 2017-11-09 20:58:38 -05:00
parent fd46a58581
commit cb7e896a4a
3 changed files with 10 additions and 4 deletions

View File

@ -2237,7 +2237,7 @@ void MainWindow::on_actionEditTimeShift_triggered()
void MainWindow::on_actionEditPacketComment_triggered()
{
PacketCommentDialog pc_dialog(this, packet_list_->packetComment());
PacketCommentDialog pc_dialog(capture_file_.capFile()->current_frame->num, this, packet_list_->packetComment());
if (pc_dialog.exec() == QDialog::Accepted) {
packet_list_->setPacketComment(pc_dialog.text());
updateForUnsavedChanges();

View File

@ -24,13 +24,17 @@
#include "wireshark_application.h"
PacketCommentDialog::PacketCommentDialog(QWidget *parent, QString comment) :
PacketCommentDialog::PacketCommentDialog(guint32 frame, QWidget *parent, QString comment) :
GeometryStateDialog(parent),
pc_ui_(new Ui::PacketCommentDialog)
{
QString title = QString(tr("Packet %1 Comment"))
.arg(frame);
pc_ui_->setupUi(this);
loadGeometry();
setWindowTitle(wsApp->windowTitleString(tr("Packet Comment")));
setWindowTitle(wsApp->windowTitleString(title));
pc_ui_->commentTextEdit->setPlainText(comment);
}

View File

@ -22,6 +22,8 @@
#ifndef PACKET_COMMENT_DIALOG_H
#define PACKET_COMMENT_DIALOG_H
#include <glib.h>
#include "geometry_state_dialog.h"
namespace Ui {
@ -33,7 +35,7 @@ class PacketCommentDialog : public GeometryStateDialog
Q_OBJECT
public:
explicit PacketCommentDialog(QWidget *parent = 0, QString comment = QString());
explicit PacketCommentDialog(guint32 frame, QWidget *parent = 0, QString comment = QString());
~PacketCommentDialog();
QString text();