Qt: Cleanup push/pop Infos
Currently push pop is propagated by a massive load of signals which partly are also propagated through parent objects. This moves the status handling to WiresharkApplication, also pathlining future moves to move status to different classes or use additional methods of status information Change-Id: Ibcb2c98688f1adf40dce1483f336596ef992bb06 Reviewed-on: https://code.wireshark.org/review/35071 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Roland Knall <rknall@gmail.com>
This commit is contained in:
parent
ba62446a6a
commit
3c8c392b9d
|
@ -25,6 +25,7 @@
|
|||
#include <QKeyEvent>
|
||||
|
||||
#include <ui/qt/utils/qt_ui_utils.h>
|
||||
#include <ui/qt/wireshark_application.h>
|
||||
|
||||
// To do:
|
||||
// - Fill in currently resolved address.
|
||||
|
@ -153,7 +154,7 @@ void AddressEditorFrame::on_buttonBox_accepted()
|
|||
QString name = ui->nameLineEdit->text();
|
||||
if (!cf_add_ip_name_from_string(cap_file_, addr.toUtf8().constData(), name.toUtf8().constData())) {
|
||||
QString error_msg = tr("Can't assign %1 to %2").arg(name).arg(addr);
|
||||
emit editAddressStatus(error_msg);
|
||||
wsApp->pushStatus(WiresharkApplication::TemporaryStatus, error_msg);
|
||||
ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -33,7 +33,6 @@ public slots:
|
|||
|
||||
signals:
|
||||
void showNameResolutionPreferences(const QString module_name);
|
||||
void editAddressStatus(const QString &status);
|
||||
void redissectPackets();
|
||||
|
||||
protected:
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
#include <ui/recent.h>
|
||||
|
||||
#include <ui/preference_utils.h>
|
||||
#include <ui/qt/wireshark_application.h>
|
||||
|
||||
#include "column_editor_frame.h"
|
||||
#include <ui_column_editor_frame.h>
|
||||
|
@ -167,11 +168,11 @@ void ColumnEditorFrame::keyPressEvent(QKeyEvent *event)
|
|||
if (ui->buttonBox->button(QDialogButtonBox::Ok)->isEnabled()) {
|
||||
on_buttonBox_accepted();
|
||||
} else if (ui->fieldsNameLineEdit->syntaxState() == SyntaxLineEdit::Empty) {
|
||||
emit pushFilterSyntaxStatus(tr("Missing fields."));
|
||||
wsApp->pushStatus(WiresharkApplication::FilterSyntax, tr("Missing fields."));
|
||||
} else if (ui->fieldsNameLineEdit->syntaxState() != SyntaxLineEdit::Valid) {
|
||||
emit pushFilterSyntaxStatus(tr("Invalid fields."));
|
||||
wsApp->pushStatus(WiresharkApplication::FilterSyntax, tr("Invalid fields."));
|
||||
} else if (ui->occurrenceLineEdit->syntaxState() == SyntaxLineEdit::Invalid) {
|
||||
emit pushFilterSyntaxStatus(tr("Invalid occurrence value."));
|
||||
wsApp->pushStatus(WiresharkApplication::FilterSyntax, tr("Invalid occurrence value."));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,7 +27,6 @@ public:
|
|||
|
||||
signals:
|
||||
void columnEdited();
|
||||
void pushFilterSyntaxStatus(const QString&);
|
||||
|
||||
protected:
|
||||
virtual void showEvent(QShowEvent *event);
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
|
||||
#include <ui/qt/models/uat_model.h>
|
||||
#include <ui/qt/models/pref_models.h>
|
||||
#include <ui/qt/wireshark_application.h>
|
||||
|
||||
#include <QPushButton>
|
||||
#include <QKeyEvent>
|
||||
|
@ -169,11 +170,11 @@ void FilterExpressionFrame::keyPressEvent(QKeyEvent *event)
|
|||
if (ui->buttonBox->button(QDialogButtonBox::Ok)->isEnabled()) {
|
||||
on_buttonBox_accepted();
|
||||
} else if (ui->labelLineEdit->text().length() == 0) {
|
||||
emit pushFilterSyntaxStatus(tr("Missing label."));
|
||||
wsApp->pushStatus(WiresharkApplication::FilterSyntax, tr("Missing label."));
|
||||
} else if (ui->displayFilterLineEdit->syntaxState() == SyntaxLineEdit::Empty) {
|
||||
emit pushFilterSyntaxStatus(tr("Missing filter expression."));
|
||||
wsApp->pushStatus(WiresharkApplication::FilterSyntax, tr("Missing filter expression."));
|
||||
} else if (ui->displayFilterLineEdit->syntaxState() != SyntaxLineEdit::Valid) {
|
||||
emit pushFilterSyntaxStatus(tr("Invalid filter expression."));
|
||||
wsApp->pushStatus(WiresharkApplication::FilterSyntax, tr("Invalid filter expression."));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,7 +30,6 @@ public:
|
|||
signals:
|
||||
void showPreferencesDialog(QString pane_name);
|
||||
void filterExpressionsChanged();
|
||||
void pushFilterSyntaxStatus(const QString&);
|
||||
|
||||
protected:
|
||||
virtual void showEvent(QShowEvent *event);
|
||||
|
|
|
@ -41,16 +41,6 @@
|
|||
|
||||
// XXX - The GTK+ code assigns priorities to these and pushes/pops accordingly.
|
||||
|
||||
enum StatusContext {
|
||||
STATUS_CTX_MAIN,
|
||||
STATUS_CTX_FILE,
|
||||
STATUS_CTX_FIELD,
|
||||
STATUS_CTX_BYTE,
|
||||
STATUS_CTX_FILTER,
|
||||
STATUS_CTX_PROGRESS,
|
||||
STATUS_CTX_TEMPORARY
|
||||
};
|
||||
|
||||
Q_DECLARE_METATYPE(ProfileDialog::ProfileAction)
|
||||
|
||||
// If we ever add support for multiple windows this will need to be replaced.
|
||||
|
@ -72,7 +62,7 @@ statusbar_push_temporary_msg(const gchar *msg_format, ...)
|
|||
push_msg.vsprintf(msg_format, ap);
|
||||
va_end(ap);
|
||||
|
||||
cur_main_status_bar_->pushTemporaryStatus(push_msg);
|
||||
wsApp->pushStatus(WiresharkApplication::TemporaryStatus, push_msg);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -195,7 +185,7 @@ void MainStatusBar::showExpert() {
|
|||
void MainStatusBar::captureFileClosing() {
|
||||
expert_button_->hide();
|
||||
progress_frame_.captureFileClosing();
|
||||
popFieldStatus();
|
||||
popGenericStatus(STATUS_CTX_FIELD);
|
||||
}
|
||||
|
||||
void MainStatusBar::expertUpdate() {
|
||||
|
@ -241,11 +231,11 @@ void MainStatusBar::expertUpdate() {
|
|||
void MainStatusBar::setFileName(CaptureFile &cf)
|
||||
{
|
||||
if (cf.isValid()) {
|
||||
popFileStatus();
|
||||
popGenericStatus(STATUS_CTX_FILE);
|
||||
QString msgtip = QString("%1 (%2)")
|
||||
.arg(cf.capFile()->filename)
|
||||
.arg(file_size_to_qstring(cf.capFile()->f_datalen));
|
||||
pushFileStatus(cf.fileName(), msgtip);
|
||||
pushGenericStatus(STATUS_CTX_FILE, cf.fileName(), msgtip);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -271,7 +261,7 @@ void MainStatusBar::selectedFieldChanged(FieldInformation * finfo)
|
|||
QString item_info;
|
||||
|
||||
if ( ! finfo ) {
|
||||
pushFieldStatus(item_info);
|
||||
pushGenericStatus(STATUS_CTX_FIELD, item_info);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -297,38 +287,7 @@ void MainStatusBar::selectedFieldChanged(FieldInformation * finfo)
|
|||
}
|
||||
}
|
||||
|
||||
pushFieldStatus(item_info);
|
||||
}
|
||||
|
||||
void MainStatusBar::pushTemporaryStatus(const QString &message) {
|
||||
info_status_.pushText(message, STATUS_CTX_TEMPORARY);
|
||||
}
|
||||
|
||||
void MainStatusBar::popTemporaryStatus() {
|
||||
info_status_.popText(STATUS_CTX_TEMPORARY);
|
||||
}
|
||||
|
||||
void MainStatusBar::pushFileStatus(const QString &message, const QString &messagetip) {
|
||||
info_status_.pushText(message, STATUS_CTX_FILE);
|
||||
info_status_.setToolTip(messagetip);
|
||||
expertUpdate();
|
||||
}
|
||||
|
||||
void MainStatusBar::popFileStatus() {
|
||||
info_status_.popText(STATUS_CTX_FILE);
|
||||
info_status_.setToolTip(QString());
|
||||
}
|
||||
|
||||
void MainStatusBar::pushFieldStatus(const QString &message) {
|
||||
if (message.isEmpty()) {
|
||||
popFieldStatus();
|
||||
} else {
|
||||
info_status_.pushText(message, STATUS_CTX_FIELD);
|
||||
}
|
||||
}
|
||||
|
||||
void MainStatusBar::popFieldStatus() {
|
||||
info_status_.popText(STATUS_CTX_FIELD);
|
||||
pushGenericStatus(STATUS_CTX_FIELD, item_info);
|
||||
}
|
||||
|
||||
void MainStatusBar::highlightedFieldChanged(FieldInformation * finfo)
|
||||
|
@ -350,46 +309,43 @@ void MainStatusBar::highlightedFieldChanged(FieldInformation * finfo)
|
|||
.arg(finfo->headerInfo().abbreviation);
|
||||
}
|
||||
|
||||
pushByteStatus(hint);
|
||||
pushGenericStatus(STATUS_CTX_BYTE, hint);
|
||||
}
|
||||
|
||||
void MainStatusBar::pushByteStatus(const QString &message)
|
||||
void MainStatusBar::pushGenericStatus(StatusContext status, const QString &message, const QString &messagetip)
|
||||
{
|
||||
if (message.isEmpty()) {
|
||||
popByteStatus();
|
||||
} else {
|
||||
info_status_.pushText(message, STATUS_CTX_BYTE);
|
||||
}
|
||||
LabelStack * stack = &info_status_;
|
||||
|
||||
if ( status == STATUS_CTX_MAIN )
|
||||
stack = &packet_status_;
|
||||
|
||||
if ( message.isEmpty() && status != STATUS_CTX_FILE && status != STATUS_CTX_TEMPORARY && status != STATUS_CTX_PROGRESS )
|
||||
popGenericStatus(status);
|
||||
else
|
||||
stack->pushText(message, status);
|
||||
|
||||
stack->setToolTip(messagetip);
|
||||
|
||||
if ( status == STATUS_CTX_FILTER || status == STATUS_CTX_FILE )
|
||||
expertUpdate();
|
||||
|
||||
if ( status == STATUS_CTX_PROGRESS )
|
||||
progress_frame_.showBusy(true, false, NULL);
|
||||
}
|
||||
|
||||
void MainStatusBar::popByteStatus()
|
||||
void MainStatusBar::popGenericStatus(StatusContext status)
|
||||
{
|
||||
info_status_.popText(STATUS_CTX_BYTE);
|
||||
}
|
||||
LabelStack * stack = &info_status_;
|
||||
|
||||
void MainStatusBar::pushFilterStatus(const QString &message) {
|
||||
if (message.isEmpty()) {
|
||||
popFilterStatus();
|
||||
} else {
|
||||
info_status_.pushText(message, STATUS_CTX_FILTER);
|
||||
}
|
||||
expertUpdate();
|
||||
}
|
||||
if ( status == STATUS_CTX_MAIN )
|
||||
stack = &packet_status_;
|
||||
|
||||
void MainStatusBar::popFilterStatus() {
|
||||
info_status_.popText(STATUS_CTX_FILTER);
|
||||
}
|
||||
stack->setToolTip(QString());
|
||||
|
||||
void MainStatusBar::pushPacketStatus(const QString &message) {
|
||||
if (message.isEmpty()) {
|
||||
popPacketStatus();
|
||||
} else {
|
||||
packet_status_.pushText(message, STATUS_CTX_MAIN);
|
||||
}
|
||||
}
|
||||
stack->popText(status);
|
||||
|
||||
void MainStatusBar::popPacketStatus() {
|
||||
packet_status_.popText(STATUS_CTX_MAIN);
|
||||
if ( status == STATUS_CTX_PROGRESS )
|
||||
progress_frame_.hide();
|
||||
}
|
||||
|
||||
void MainStatusBar::setProfileName()
|
||||
|
@ -397,20 +353,6 @@ void MainStatusBar::setProfileName()
|
|||
profile_status_.setText(tr("Profile: %1").arg(get_profile_name()));
|
||||
}
|
||||
|
||||
void MainStatusBar::pushBusyStatus(const QString &message, const QString &messagetip)
|
||||
{
|
||||
info_status_.pushText(message, STATUS_CTX_PROGRESS);
|
||||
info_status_.setToolTip(messagetip);
|
||||
progress_frame_.showBusy(true, false, NULL);
|
||||
}
|
||||
|
||||
void MainStatusBar::popBusyStatus()
|
||||
{
|
||||
info_status_.popText(STATUS_CTX_PROGRESS);
|
||||
info_status_.setToolTip(QString());
|
||||
progress_frame_.hide();
|
||||
}
|
||||
|
||||
void MainStatusBar::pushProgressStatus(const QString &message, bool animate, bool terminate_is_stop, gboolean *stop_flag)
|
||||
{
|
||||
info_status_.pushText(message, STATUS_CTX_PROGRESS);
|
||||
|
@ -422,12 +364,6 @@ void MainStatusBar::updateProgressStatus(int value)
|
|||
progress_frame_.setValue(value);
|
||||
}
|
||||
|
||||
void MainStatusBar::popProgressStatus()
|
||||
{
|
||||
info_status_.popText(STATUS_CTX_PROGRESS);
|
||||
progress_frame_.hide();
|
||||
}
|
||||
|
||||
void MainStatusBar::selectedFrameChanged(int)
|
||||
{
|
||||
showCaptureStatistics();
|
||||
|
@ -498,8 +434,6 @@ void MainStatusBar::showCaptureStatistics()
|
|||
if (packets_str.isEmpty()) {
|
||||
packets_str = tr("No Packets");
|
||||
}
|
||||
popPacketStatus();
|
||||
pushPacketStatus(packets_str);
|
||||
}
|
||||
|
||||
void MainStatusBar::updateCaptureStatistics(capture_session *cap_session)
|
||||
|
@ -713,7 +647,7 @@ void MainStatusBar::captureEventHandler(CaptureEvent ev)
|
|||
case CaptureEvent::Finished:
|
||||
case CaptureEvent::Failed:
|
||||
case CaptureEvent::Stopped:
|
||||
popFileStatus();
|
||||
popGenericStatus(STATUS_CTX_FILE);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
|
@ -40,6 +40,17 @@ public:
|
|||
void setFileName(CaptureFile &cf);
|
||||
|
||||
protected:
|
||||
|
||||
enum StatusContext {
|
||||
STATUS_CTX_MAIN,
|
||||
STATUS_CTX_FILE,
|
||||
STATUS_CTX_FIELD,
|
||||
STATUS_CTX_BYTE,
|
||||
STATUS_CTX_FILTER,
|
||||
STATUS_CTX_PROGRESS,
|
||||
STATUS_CTX_TEMPORARY
|
||||
};
|
||||
|
||||
virtual void changeEvent(QEvent* event);
|
||||
|
||||
private:
|
||||
|
@ -58,6 +69,9 @@ private:
|
|||
|
||||
void showCaptureStatistics();
|
||||
|
||||
void pushGenericStatus(StatusContext status, const QString &message, const QString &messagetip = QString());
|
||||
void popGenericStatus(StatusContext status);
|
||||
|
||||
signals:
|
||||
void showExpertInfo();
|
||||
void editCaptureComment();
|
||||
|
@ -67,21 +81,8 @@ public slots:
|
|||
void setCaptureFile(capture_file *cf);
|
||||
void selectedFieldChanged(FieldInformation *);
|
||||
void highlightedFieldChanged(FieldInformation *);
|
||||
void pushTemporaryStatus(const QString &message);
|
||||
void popTemporaryStatus();
|
||||
void pushFileStatus(const QString &message, const QString &messagetip = QString());
|
||||
void popFileStatus();
|
||||
void pushFieldStatus(const QString &message);
|
||||
void popFieldStatus();
|
||||
void pushByteStatus(const QString &message);
|
||||
void popByteStatus();
|
||||
void pushFilterStatus(const QString &message);
|
||||
void popFilterStatus();
|
||||
void pushBusyStatus(const QString &message, const QString &messagetip = QString());
|
||||
void popBusyStatus();
|
||||
void pushProgressStatus(const QString &message, bool animate, bool terminate_is_stop = false, gboolean *stop_flag = NULL);
|
||||
void updateProgressStatus(int value);
|
||||
void popProgressStatus();
|
||||
void selectedFrameChanged(int);
|
||||
|
||||
void updateCaptureStatistics(capture_session * cap_session);
|
||||
|
@ -90,14 +91,13 @@ public slots:
|
|||
void captureEventHandler(CaptureEvent ev);
|
||||
|
||||
private slots:
|
||||
void pushPacketStatus(const QString &message);
|
||||
void popPacketStatus();
|
||||
|
||||
void toggleBackground(bool enabled);
|
||||
void setProfileName();
|
||||
void switchToProfile();
|
||||
void manageProfile();
|
||||
void showProfileMenu(const QPoint &global_pos, Qt::MouseButton button);
|
||||
|
||||
friend WiresharkApplication;
|
||||
};
|
||||
|
||||
#endif // MAIN_STATUS_BAR_H
|
||||
|
|
|
@ -398,8 +398,6 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||
main_ui_->displayFilterToolBar->addWidget(filter_expression_toolbar_);
|
||||
|
||||
#if defined(HAVE_LIBNL) && defined(HAVE_NL80211)
|
||||
connect(wireless_frame_, SIGNAL(pushAdapterStatus(const QString&)),
|
||||
main_ui_->statusBar, SLOT(pushTemporaryStatus(const QString&)));
|
||||
connect(wireless_frame_, SIGNAL(showWirelessPreferences(QString)),
|
||||
this, SLOT(showPreferencesDialog(QString)));
|
||||
#endif
|
||||
|
@ -412,21 +410,13 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||
// https://bugreports.qt-project.org/browse/QTBUG-7174
|
||||
|
||||
main_ui_->searchFrame->hide();
|
||||
connect(main_ui_->searchFrame, SIGNAL(pushFilterSyntaxStatus(const QString&)),
|
||||
main_ui_->statusBar, SLOT(pushTemporaryStatus(const QString&)));
|
||||
connect(main_ui_->searchFrame, SIGNAL(visibilityChanged(bool)),
|
||||
main_ui_->actionEditFindPacket, SLOT(setChecked(bool)));
|
||||
|
||||
main_ui_->addressEditorFrame->hide();
|
||||
main_ui_->columnEditorFrame->hide();
|
||||
connect(main_ui_->columnEditorFrame, SIGNAL(pushFilterSyntaxStatus(const QString&)),
|
||||
main_ui_->statusBar, SLOT(pushTemporaryStatus(const QString&)));
|
||||
main_ui_->preferenceEditorFrame->hide();
|
||||
connect(main_ui_->preferenceEditorFrame, SIGNAL(pushFilterSyntaxStatus(const QString&)),
|
||||
main_ui_->statusBar, SLOT(pushTemporaryStatus(const QString&)));
|
||||
main_ui_->filterExpressionFrame->hide();
|
||||
connect(main_ui_->filterExpressionFrame, SIGNAL(pushFilterSyntaxStatus(const QString&)),
|
||||
main_ui_->statusBar, SLOT(pushTemporaryStatus(const QString&)));
|
||||
|
||||
#ifndef HAVE_LIBPCAP
|
||||
main_ui_->menuCapture->setEnabled(false);
|
||||
|
@ -547,13 +537,7 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||
this, SLOT(startCapture()));
|
||||
connect(welcome_page_, SIGNAL(recentFileActivated(QString)),
|
||||
this, SLOT(openCaptureFile(QString)));
|
||||
connect(welcome_page_, SIGNAL(pushFilterSyntaxStatus(const QString&)),
|
||||
main_ui_->statusBar, SLOT(pushFilterStatus(const QString&)));
|
||||
connect(welcome_page_, SIGNAL(popFilterSyntaxStatus()),
|
||||
main_ui_->statusBar, SLOT(popFilterStatus()));
|
||||
|
||||
connect(main_ui_->addressEditorFrame, SIGNAL(editAddressStatus(QString)),
|
||||
main_ui_->statusBar, SLOT(pushTemporaryStatus(QString)));
|
||||
connect(main_ui_->addressEditorFrame, SIGNAL(redissectPackets()),
|
||||
this, SLOT(redissectPackets()));
|
||||
connect(main_ui_->addressEditorFrame, SIGNAL(showNameResolutionPreferences(QString)),
|
||||
|
@ -957,7 +941,7 @@ void MainWindow::dragEnterEvent(QDragEnterEvent *event)
|
|||
// We could alternatively call setAcceptDrops(!capture_in_progress)
|
||||
// in setMenusForCaptureInProgress but that wouldn't provide feedback.
|
||||
|
||||
main_ui_->statusBar->pushTemporaryStatus(tr("Unable to drop files during capture."));
|
||||
wsApp->pushStatus(WiresharkApplication::TemporaryStatus, tr("Unable to drop files during capture."));
|
||||
event->setDropAction(Qt::IgnoreAction);
|
||||
event->ignore();
|
||||
return;
|
||||
|
|
|
@ -91,6 +91,7 @@ class ProtoTree;
|
|||
class WirelessFrame;
|
||||
#endif
|
||||
class FilterExpressionToolBar;
|
||||
class WiresharkApplication;
|
||||
|
||||
class QAction;
|
||||
class QActionGroup;
|
||||
|
@ -683,6 +684,8 @@ private slots:
|
|||
|
||||
void extcap_options_finished(int result);
|
||||
void showExtcapOptionsDialog(QString & device_name);
|
||||
|
||||
friend WiresharkApplication;
|
||||
};
|
||||
|
||||
#endif // MAINWINDOW_H
|
||||
|
|
|
@ -576,7 +576,7 @@ void MainWindow::captureCaptureFailed(capture_session *) {
|
|||
|
||||
// Reset expert information indicator
|
||||
main_ui_->statusBar->captureFileClosing();
|
||||
main_ui_->statusBar->popFileStatus();
|
||||
wsApp->popStatus(WiresharkApplication::FileStatus);
|
||||
|
||||
setWindowIcon(wsApp->normalIcon());
|
||||
|
||||
|
@ -662,11 +662,11 @@ void MainWindow::captureEventHandler(CaptureEvent ev)
|
|||
case CaptureEvent::Merge:
|
||||
switch (ev.eventType()) {
|
||||
case CaptureEvent::Started:
|
||||
main_ui_->statusBar->popFileStatus();
|
||||
main_ui_->statusBar->pushFileStatus(tr("Merging files"), QString());
|
||||
wsApp->popStatus(WiresharkApplication::FileStatus);
|
||||
wsApp->pushStatus(WiresharkApplication::FileStatus, tr("Merging files"), QString());
|
||||
break;
|
||||
case CaptureEvent::Finished:
|
||||
main_ui_->statusBar->popFileStatus();
|
||||
wsApp->popStatus(WiresharkApplication::FileStatus);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -678,8 +678,8 @@ void MainWindow::captureEventHandler(CaptureEvent ev)
|
|||
case CaptureEvent::Started:
|
||||
{
|
||||
QFileInfo file_info(ev.filePath());
|
||||
main_ui_->statusBar->popFileStatus();
|
||||
main_ui_->statusBar->pushFileStatus(tr("Saving %1" UTF8_HORIZONTAL_ELLIPSIS).arg(file_info.fileName()));
|
||||
wsApp->popStatus(WiresharkApplication::FileStatus);
|
||||
wsApp->pushStatus(WiresharkApplication::FileStatus, tr("Saving %1" UTF8_HORIZONTAL_ELLIPSIS).arg(file_info.fileName()));
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
@ -744,10 +744,10 @@ void MainWindow::captureFileReadStarted(const QString &action) {
|
|||
/* Set up main window for a capture file. */
|
||||
// main_set_for_capture_file(TRUE);
|
||||
|
||||
main_ui_->statusBar->popFileStatus();
|
||||
wsApp->popStatus(WiresharkApplication::FileStatus);
|
||||
QString msg = QString(tr("%1: %2")).arg(action).arg(capture_file_.fileName());
|
||||
QString msgtip = QString();
|
||||
main_ui_->statusBar->pushFileStatus(msg, msgtip);
|
||||
wsApp->pushStatus(WiresharkApplication::FileStatus, msg, msgtip);
|
||||
showCapture();
|
||||
main_ui_->actionAnalyzeReloadLuaPlugins->setEnabled(false);
|
||||
main_ui_->wirelessTimelineWidget->captureFileReadStarted(capture_file_.capFile());
|
||||
|
@ -808,7 +808,7 @@ void MainWindow::captureFileClosed() {
|
|||
|
||||
// Reset expert information indicator
|
||||
main_ui_->statusBar->captureFileClosing();
|
||||
main_ui_->statusBar->popFileStatus();
|
||||
wsApp->popStatus(WiresharkApplication::FileStatus);
|
||||
|
||||
setWSWindowTitle();
|
||||
setWindowIcon(wsApp->normalIcon());
|
||||
|
@ -835,7 +835,7 @@ void MainWindow::startCapture() {
|
|||
/* did the user ever select a capture interface before? */
|
||||
if (global_capture_opts.num_selected == 0) {
|
||||
QString msg = QString(tr("No interface selected"));
|
||||
main_ui_->statusBar->pushTemporaryStatus(msg);
|
||||
wsApp->pushStatus(WiresharkApplication::TemporaryStatus, msg);
|
||||
main_ui_->actionCaptureStart->setChecked(false);
|
||||
return;
|
||||
}
|
||||
|
@ -845,7 +845,7 @@ void MainWindow::startCapture() {
|
|||
// case, e.g. with QtMacExtras.
|
||||
if (!capture_filter_valid_) {
|
||||
QString msg = QString(tr("Invalid capture filter"));
|
||||
main_ui_->statusBar->pushTemporaryStatus(msg);
|
||||
wsApp->pushStatus(WiresharkApplication::TemporaryStatus, msg);
|
||||
main_ui_->actionCaptureStart->setChecked(false);
|
||||
return;
|
||||
}
|
||||
|
@ -878,10 +878,10 @@ void MainWindow::startCapture() {
|
|||
}
|
||||
g_string_append(interface_names, " ");
|
||||
|
||||
main_ui_->statusBar->popFileStatus();
|
||||
wsApp->popStatus(WiresharkApplication::FileStatus);
|
||||
QString msg = QString().sprintf("%s<live capture in progress>", interface_names->str);
|
||||
QString msgtip = QString().sprintf("to file: %s", (capture_opts->save_file) ? capture_opts->save_file : "");
|
||||
main_ui_->statusBar->pushFileStatus(msg, msgtip);
|
||||
wsApp->pushStatus(WiresharkApplication::FileStatus, msg, msgtip);
|
||||
g_string_free(interface_names, TRUE);
|
||||
|
||||
/* The capture succeeded, which means the capture filter syntax is
|
||||
|
@ -1938,7 +1938,7 @@ void MainWindow::actionEditCopyTriggered(MainWindow::CopySelected selection_type
|
|||
wsApp->clipboard()->setText(clip);
|
||||
} else {
|
||||
QString err = tr("Couldn't copy text. Try another item.");
|
||||
main_ui_->statusBar->pushTemporaryStatus(err);
|
||||
wsApp->pushStatus(WiresharkApplication::TemporaryStatus, err);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2396,7 +2396,7 @@ void MainWindow::colorizeConversation(bool create_rule)
|
|||
guint8 cc_num = colorize_action->data().toUInt();
|
||||
gchar *filter = conversation_filter_from_packet(pi);
|
||||
if (filter == NULL) {
|
||||
main_ui_->statusBar->pushTemporaryStatus(tr("Unable to build conversation filter."));
|
||||
wsApp->pushStatus(WiresharkApplication::TemporaryStatus, tr("Unable to build conversation filter."));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -2632,7 +2632,7 @@ void MainWindow::matchFieldFilter(FilterAction::Action action, FilterAction::Act
|
|||
QString err = tr("No filter available. Try another ");
|
||||
err.append(packet_list_->contextMenuActive() ? "column" : "item");
|
||||
err.append(".");
|
||||
main_ui_->statusBar->pushTemporaryStatus(err);
|
||||
wsApp->pushStatus(WiresharkApplication::TemporaryStatus, err);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -3498,14 +3498,14 @@ void MainWindow::goToConversationFrame(bool go_next) {
|
|||
* coloring */
|
||||
filter = conversation_filter_from_packet(pi);
|
||||
if (filter == NULL) {
|
||||
main_ui_->statusBar->pushTemporaryStatus(tr("Unable to build conversation filter."));
|
||||
wsApp->pushStatus(WiresharkApplication::TemporaryStatus, tr("Unable to build conversation filter."));
|
||||
g_free(filter);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!dfilter_compile(filter, &dfcode, NULL)) {
|
||||
/* The attempt failed; report an error. */
|
||||
main_ui_->statusBar->pushTemporaryStatus(tr("Error compiling filter for this conversation."));
|
||||
wsApp->pushStatus(WiresharkApplication::TemporaryStatus, tr("Error compiling filter for this conversation."));
|
||||
g_free(filter);
|
||||
return;
|
||||
}
|
||||
|
@ -3514,7 +3514,7 @@ void MainWindow::goToConversationFrame(bool go_next) {
|
|||
|
||||
if (!found_packet) {
|
||||
/* We didn't find a packet */
|
||||
main_ui_->statusBar->pushTemporaryStatus(tr("No previous/next packet in conversation."));
|
||||
wsApp->pushStatus(WiresharkApplication::TemporaryStatus, tr("No previous/next packet in conversation."));
|
||||
}
|
||||
|
||||
dfilter_free(dfcode);
|
||||
|
@ -3592,7 +3592,7 @@ void MainWindow::on_actionCaptureStart_triggered()
|
|||
#ifdef HAVE_LIBPCAP
|
||||
if (global_capture_opts.num_selected == 0) {
|
||||
QString err_msg = tr("No Interface Selected");
|
||||
main_ui_->statusBar->pushTemporaryStatus(err_msg);
|
||||
wsApp->pushStatus(WiresharkApplication::TemporaryStatus, err_msg);
|
||||
main_ui_->actionCaptureStart->setChecked(false);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -242,7 +242,7 @@ void PreferenceEditorFrame::keyPressEvent(QKeyEvent *event)
|
|||
if (ui->buttonBox->button(QDialogButtonBox::Ok)->isEnabled()) {
|
||||
on_buttonBox_accepted();
|
||||
} else if (ui->preferenceLineEdit->syntaxState() == SyntaxLineEdit::Invalid) {
|
||||
emit pushFilterSyntaxStatus(tr("Invalid value."));
|
||||
wsApp->pushStatus(WiresharkApplication::FilterSyntax, tr("Invalid value."));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,7 +33,6 @@ public slots:
|
|||
|
||||
signals:
|
||||
void showProtocolPreferences(const QString module_name);
|
||||
void pushFilterSyntaxStatus(const QString&);
|
||||
|
||||
protected:
|
||||
virtual void showEvent(QShowEvent *event);
|
||||
|
|
|
@ -373,13 +373,13 @@ void SearchFrame::on_findButton_clicked()
|
|||
case df_search_:
|
||||
if (!dfilter_compile(sf_ui_->searchLineEdit->text().toUtf8().constData(), &dfp, NULL)) {
|
||||
err_string = tr("Invalid filter.");
|
||||
emit pushFilterSyntaxStatus(err_string);
|
||||
wsApp->pushStatus(WiresharkApplication::FilterSyntax, err_string);
|
||||
return;
|
||||
}
|
||||
|
||||
if (dfp == NULL) {
|
||||
err_string = tr("That filter doesn't test anything.");
|
||||
emit pushFilterSyntaxStatus(err_string);
|
||||
wsApp->pushStatus(WiresharkApplication::FilterSyntax, err_string);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
|
@ -387,7 +387,7 @@ void SearchFrame::on_findButton_clicked()
|
|||
bytes = convert_string_to_hex(sf_ui_->searchLineEdit->text().toUtf8().constData(), &nbytes);
|
||||
if (bytes == NULL) {
|
||||
err_string = tr("That's not a valid hex string.");
|
||||
emit pushFilterSyntaxStatus(err_string);
|
||||
wsApp->pushStatus(WiresharkApplication::FilterSyntax, err_string);
|
||||
return;
|
||||
}
|
||||
cap_file_->hex = TRUE;
|
||||
|
@ -396,7 +396,7 @@ void SearchFrame::on_findButton_clicked()
|
|||
case regex_search_:
|
||||
if (sf_ui_->searchLineEdit->text().isEmpty()) {
|
||||
err_string = tr("You didn't specify any text for which to search.");
|
||||
emit pushFilterSyntaxStatus(err_string);
|
||||
wsApp->pushStatus(WiresharkApplication::FilterSyntax, err_string);
|
||||
return;
|
||||
}
|
||||
cap_file_->string = TRUE;
|
||||
|
@ -414,14 +414,14 @@ void SearchFrame::on_findButton_clicked()
|
|||
break;
|
||||
default:
|
||||
err_string = tr("No valid character set selected. Please report this to the development team.");
|
||||
emit pushFilterSyntaxStatus(err_string);
|
||||
wsApp->pushStatus(WiresharkApplication::FilterSyntax, err_string);
|
||||
return;
|
||||
}
|
||||
string = convert_string_case(sf_ui_->searchLineEdit->text().toUtf8().constData(), cap_file_->case_type);
|
||||
break;
|
||||
default:
|
||||
err_string = tr("No valid search type selected. Please report this to the development team.");
|
||||
emit pushFilterSyntaxStatus(err_string);
|
||||
wsApp->pushStatus(WiresharkApplication::FilterSyntax, err_string);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -437,7 +437,7 @@ void SearchFrame::on_findButton_clicked()
|
|||
break;
|
||||
default:
|
||||
err_string = tr("No valid search area selected. Please report this to the development team.");
|
||||
emit pushFilterSyntaxStatus(err_string);
|
||||
wsApp->pushStatus(WiresharkApplication::FilterSyntax, err_string);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -451,12 +451,12 @@ void SearchFrame::on_findButton_clicked()
|
|||
if (!found_packet) {
|
||||
/* We didn't find a packet */
|
||||
err_string = tr("No packet contained those bytes.");
|
||||
emit pushFilterSyntaxStatus(err_string);
|
||||
wsApp->pushStatus(WiresharkApplication::FilterSyntax, err_string);
|
||||
return;
|
||||
}
|
||||
} else if (cap_file_->string) {
|
||||
if (search_type == regex_search_ && !cap_file_->regex) {
|
||||
emit pushFilterSyntaxStatus(regex_error_);
|
||||
wsApp->pushStatus(WiresharkApplication::FilterSyntax, regex_error_);
|
||||
return;
|
||||
}
|
||||
if (cap_file_->summary_data) {
|
||||
|
@ -465,7 +465,7 @@ void SearchFrame::on_findButton_clicked()
|
|||
g_free(string);
|
||||
if (!found_packet) {
|
||||
err_string = tr("No packet contained that string in its Info column.");
|
||||
emit pushFilterSyntaxStatus(err_string);
|
||||
wsApp->pushStatus(WiresharkApplication::FilterSyntax, err_string);
|
||||
return;
|
||||
}
|
||||
} else if (cap_file_->decode_data) {
|
||||
|
@ -474,7 +474,7 @@ void SearchFrame::on_findButton_clicked()
|
|||
g_free(string);
|
||||
if (!found_packet) {
|
||||
err_string = tr("No packet contained that string in its dissected display.");
|
||||
emit pushFilterSyntaxStatus(err_string);
|
||||
wsApp->pushStatus(WiresharkApplication::FilterSyntax, err_string);
|
||||
return;
|
||||
}
|
||||
} else if (cap_file_->packet_data && string) {
|
||||
|
@ -483,7 +483,7 @@ void SearchFrame::on_findButton_clicked()
|
|||
g_free(string);
|
||||
if (!found_packet) {
|
||||
err_string = tr("No packet contained that string in its converted data.");
|
||||
emit pushFilterSyntaxStatus(err_string);
|
||||
wsApp->pushStatus(WiresharkApplication::FilterSyntax, err_string);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -493,7 +493,7 @@ void SearchFrame::on_findButton_clicked()
|
|||
dfilter_free(dfp);
|
||||
if (!found_packet) {
|
||||
err_string = tr("No packet matched that filter.");
|
||||
emit pushFilterSyntaxStatus(err_string);
|
||||
wsApp->pushStatus(WiresharkApplication::FilterSyntax, err_string);
|
||||
g_free(bytes);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -36,9 +36,6 @@ public slots:
|
|||
void setCaptureFile(capture_file *cf);
|
||||
void findFrameWithFilter(QString &filter);
|
||||
|
||||
signals:
|
||||
void pushFilterSyntaxStatus(const QString&);
|
||||
|
||||
protected:
|
||||
virtual void keyPressEvent(QKeyEvent *event);
|
||||
void changeEvent(QEvent* event);
|
||||
|
|
|
@ -83,10 +83,6 @@ WelcomePage::WelcomePage(QWidget *parent) :
|
|||
connect(welcome_ui_->interfaceFrame, SIGNAL(itemSelectionChanged()), this, SLOT(interfaceSelected()));
|
||||
connect(welcome_ui_->captureFilterComboBox->lineEdit(), SIGNAL(textEdited(QString)),
|
||||
this, SLOT(captureFilterTextEdited(QString)));
|
||||
connect(welcome_ui_->captureFilterComboBox, SIGNAL(pushFilterSyntaxStatus(const QString&)),
|
||||
this, SIGNAL(pushFilterSyntaxStatus(const QString&)));
|
||||
connect(welcome_ui_->captureFilterComboBox, SIGNAL(popFilterSyntaxStatus()),
|
||||
this, SIGNAL(popFilterSyntaxStatus()));
|
||||
connect(welcome_ui_->captureFilterComboBox, SIGNAL(captureFilterSyntaxChanged(bool)),
|
||||
this, SIGNAL(captureFilterSyntaxChanged(bool)));
|
||||
connect(welcome_ui_->captureFilterComboBox, SIGNAL(startCapture()),
|
||||
|
|
|
@ -61,8 +61,6 @@ private:
|
|||
signals:
|
||||
void startCapture();
|
||||
void recentFileActivated(QString cfile);
|
||||
void pushFilterSyntaxStatus(const QString&);
|
||||
void popFilterSyntaxStatus();
|
||||
void captureFilterSyntaxChanged(bool valid);
|
||||
void showExtcapOptions(QString &device_name);
|
||||
void interfacesChanged();
|
||||
|
|
|
@ -39,10 +39,6 @@ CaptureFilterCombo::CaptureFilterCombo(QWidget *parent, bool plain) :
|
|||
|
||||
connect(this, &CaptureFilterCombo::interfacesChanged, cf_edit_,
|
||||
static_cast<void (CaptureFilterEdit::*)()>(&CaptureFilterEdit::checkFilter));
|
||||
connect(cf_edit_, &CaptureFilterEdit::pushFilterSyntaxStatus,
|
||||
this, &CaptureFilterCombo::pushFilterSyntaxStatus);
|
||||
connect(cf_edit_, &CaptureFilterEdit::popFilterSyntaxStatus,
|
||||
this, &CaptureFilterCombo::popFilterSyntaxStatus);
|
||||
connect(cf_edit_, &CaptureFilterEdit::captureFilterSyntaxChanged,
|
||||
this, &CaptureFilterCombo::captureFilterSyntaxChanged);
|
||||
connect(cf_edit_, &CaptureFilterEdit::startCapture, this, &CaptureFilterCombo::startCapture);
|
||||
|
|
|
@ -26,8 +26,6 @@ public:
|
|||
|
||||
signals:
|
||||
void interfacesChanged();
|
||||
void pushFilterSyntaxStatus(const QString&);
|
||||
void popFilterSyntaxStatus();
|
||||
void captureFilterSyntaxChanged(bool valid);
|
||||
void startCapture();
|
||||
|
||||
|
|
|
@ -319,7 +319,7 @@ void CaptureFilterEdit::checkFilter(const QString& filter)
|
|||
actions_->checkedAction()->setChecked(false);
|
||||
|
||||
setSyntaxState(Busy);
|
||||
popFilterSyntaxStatus();
|
||||
wsApp->popStatus(WiresharkApplication::FilterSyntax);
|
||||
setToolTip(QString());
|
||||
bool empty = filter.isEmpty();
|
||||
|
||||
|
@ -420,7 +420,7 @@ void CaptureFilterEdit::setFilterSyntaxState(QString filter, int state, QString
|
|||
if (filter.compare(text()) == 0) { // The user hasn't changed the filter
|
||||
setSyntaxState((SyntaxState)state);
|
||||
if (!err_msg.isEmpty()) {
|
||||
emit pushFilterSyntaxStatus(err_msg);
|
||||
wsApp->pushStatus(WiresharkApplication::FilterSyntax, err_msg);
|
||||
setToolTip(err_msg);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -67,8 +67,6 @@ private:
|
|||
void buildCompletionList(const QString& primitive_word);
|
||||
|
||||
signals:
|
||||
void pushFilterSyntaxStatus(const QString&);
|
||||
void popFilterSyntaxStatus();
|
||||
void captureFilterSyntaxChanged(bool valid);
|
||||
void startCapture();
|
||||
void addBookmark(const QString filter);
|
||||
|
|
|
@ -125,11 +125,6 @@ DisplayFilterEdit::DisplayFilterEdit(QWidget *parent, DisplayFilterEditType type
|
|||
connect(wsApp, &WiresharkApplication::displayFilterListChanged, this, &DisplayFilterEdit::updateBookmarkMenu);
|
||||
connect(wsApp, SIGNAL(preferencesChanged()), this, SLOT(checkFilter()));
|
||||
|
||||
/*
|
||||
connect(df_edit, SIGNAL(pushFilterSyntaxStatus(const QString&)), main_ui_->statusBar, SLOT(pushFilterStatus(const QString&)));
|
||||
connect(df_edit, SIGNAL(popFilterSyntaxStatus()), main_ui_->statusBar, SLOT(popFilterStatus()));
|
||||
*/
|
||||
|
||||
connect(wsApp, SIGNAL(appInitialized()), this, SLOT(connectToMainWindow()));
|
||||
}
|
||||
|
||||
|
@ -349,15 +344,14 @@ void DisplayFilterEdit::checkFilter(const QString& filter_text)
|
|||
switch (syntaxState()) {
|
||||
case Deprecated:
|
||||
{
|
||||
emit pushFilterSyntaxStatus(syntaxErrorMessage());
|
||||
wsApp->pushStatus(WiresharkApplication::FilterSyntax, syntaxErrorMessage());
|
||||
setToolTip(syntaxErrorMessage());
|
||||
break;
|
||||
}
|
||||
case Invalid:
|
||||
{
|
||||
QString invalidMsg(tr("Invalid filter: "));
|
||||
invalidMsg.append(syntaxErrorMessage());
|
||||
emit pushFilterSyntaxStatus(invalidMsg);
|
||||
QString invalidMsg = tr("Invalid filter: ").append(syntaxErrorMessage());
|
||||
wsApp->pushStatus(WiresharkApplication::FilterSyntax, syntaxErrorMessage());
|
||||
setToolTip(invalidMsg);
|
||||
break;
|
||||
}
|
||||
|
@ -472,14 +466,14 @@ void DisplayFilterEdit::buildCompletionList(const QString &field_word)
|
|||
{
|
||||
// Push a hint about the current field.
|
||||
if (syntaxState() == Valid) {
|
||||
emit popFilterSyntaxStatus();
|
||||
wsApp->popStatus(WiresharkApplication::FilterSyntax);
|
||||
|
||||
header_field_info *hfinfo = proto_registrar_get_byname(field_word.toUtf8().constData());
|
||||
if (hfinfo) {
|
||||
QString cursor_field_msg = QString("%1: %2")
|
||||
.arg(hfinfo->name)
|
||||
.arg(ftype_pretty_name(hfinfo->type));
|
||||
emit pushFilterSyntaxStatus(cursor_field_msg);
|
||||
wsApp->pushStatus(WiresharkApplication::FilterSyntax, cursor_field_msg);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -297,6 +297,8 @@ void WirelessFrame::setInterfaceInfo()
|
|||
|
||||
if (cur_iface.isEmpty() || cur_chan_idx < 0 || cur_type_idx < 0) return;
|
||||
|
||||
QString err_str;
|
||||
|
||||
#if defined(HAVE_LIBNL) && defined(HAVE_NL80211) && defined(HAVE_LIBPCAP)
|
||||
int frequency = ui->channelComboBox->itemData(cur_chan_idx).toInt();
|
||||
int chan_type = ui->channelTypeComboBox->itemData(cur_type_idx).toInt();
|
||||
|
@ -325,8 +327,7 @@ void WirelessFrame::setInterfaceInfo()
|
|||
|
||||
/* Parse the error msg */
|
||||
if (ret) {
|
||||
QString err_str = tr("Unable to set channel or offset.");
|
||||
emit pushAdapterStatus(err_str);
|
||||
err_str = tr("Unable to set channel or offset.");
|
||||
}
|
||||
#elif defined(HAVE_AIRPCAP)
|
||||
int frequency = ui->channelComboBox->itemData(cur_chan_idx).toInt();
|
||||
|
@ -334,18 +335,20 @@ void WirelessFrame::setInterfaceInfo()
|
|||
if (frequency < 0 || chan_type < 0) return;
|
||||
|
||||
if (ws80211_set_freq(cur_iface.toUtf8().constData(), frequency, chan_type, -1, -1) != 0) {
|
||||
QString err_str = tr("Unable to set channel or offset.");
|
||||
emit pushAdapterStatus(err_str);
|
||||
err_str = tr("Unable to set channel or offset.");
|
||||
}
|
||||
#endif
|
||||
|
||||
if (cur_fcs_idx >= 0) {
|
||||
if (ws80211_set_fcs_validation(cur_iface.toUtf8().constData(), (enum ws80211_fcs_validation) cur_fcs_idx) != 0) {
|
||||
QString err_str = tr("Unable to set FCS validation behavior.");
|
||||
emit pushAdapterStatus(err_str);
|
||||
err_str = tr("Unable to set FCS validation behavior.");
|
||||
}
|
||||
}
|
||||
|
||||
if (!err_str.isEmpty()) {
|
||||
wsApp->pushStatus(WiresharkApplication::TemporaryStatus, err_str);
|
||||
}
|
||||
|
||||
getInterfaceInfo();
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,6 @@ public:
|
|||
void setCaptureInProgress(bool capture_in_progress);
|
||||
|
||||
signals:
|
||||
void pushAdapterStatus(const QString&);
|
||||
void showWirelessPreferences(const QString wlan_module_name);
|
||||
|
||||
protected:
|
||||
|
|
|
@ -69,6 +69,9 @@
|
|||
|
||||
#include <ui/qt/capture_file.h>
|
||||
|
||||
#include <ui/qt/main_window.h>
|
||||
#include <ui_main_window.h>
|
||||
|
||||
#include <QAction>
|
||||
#include <QApplication>
|
||||
#include <QColorDialog>
|
||||
|
@ -1370,6 +1373,74 @@ void WiresharkApplication::captureEventHandler(CaptureEvent ev)
|
|||
}
|
||||
}
|
||||
|
||||
void WiresharkApplication::pushStatus(StatusInfo status, const QString &message, const QString &messagetip)
|
||||
{
|
||||
if ( ! mainWindow() || ! qobject_cast<MainWindow *>(mainWindow()) )
|
||||
return;
|
||||
|
||||
MainWindow * mw = qobject_cast<MainWindow *>(mainWindow());
|
||||
if ( ! mw->main_ui_ || ! mw->main_ui_->statusBar )
|
||||
return;
|
||||
|
||||
MainStatusBar * bar = mw->main_ui_->statusBar;
|
||||
|
||||
switch(status)
|
||||
{
|
||||
case FilterSyntax:
|
||||
bar->pushGenericStatus(MainStatusBar::STATUS_CTX_FILTER, message);
|
||||
break;
|
||||
case FieldStatus:
|
||||
bar->pushGenericStatus(MainStatusBar::STATUS_CTX_FIELD, message);
|
||||
break;
|
||||
case FileStatus:
|
||||
bar->pushGenericStatus(MainStatusBar::STATUS_CTX_FILE, message, messagetip);
|
||||
break;
|
||||
case ByteStatus:
|
||||
bar->pushGenericStatus(MainStatusBar::STATUS_CTX_BYTE, message);
|
||||
break;
|
||||
case BusyStatus:
|
||||
bar->pushGenericStatus(MainStatusBar::STATUS_CTX_PROGRESS, message, messagetip);
|
||||
break;
|
||||
case TemporaryStatus:
|
||||
bar->pushGenericStatus(MainStatusBar::STATUS_CTX_TEMPORARY, message);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void WiresharkApplication::popStatus(StatusInfo status)
|
||||
{
|
||||
if ( ! mainWindow() || ! qobject_cast<MainWindow *>(mainWindow()) )
|
||||
return;
|
||||
|
||||
MainWindow * mw = qobject_cast<MainWindow *>(mainWindow());
|
||||
if ( ! mw->main_ui_ || ! mw->main_ui_->statusBar )
|
||||
return;
|
||||
|
||||
MainStatusBar * bar = mw->main_ui_->statusBar;
|
||||
|
||||
switch(status)
|
||||
{
|
||||
case FilterSyntax:
|
||||
bar->popGenericStatus(MainStatusBar::STATUS_CTX_FILTER);
|
||||
break;
|
||||
case FieldStatus:
|
||||
bar->popGenericStatus(MainStatusBar::STATUS_CTX_FIELD);
|
||||
break;
|
||||
case FileStatus:
|
||||
bar->popGenericStatus(MainStatusBar::STATUS_CTX_FILE);
|
||||
break;
|
||||
case ByteStatus:
|
||||
bar->popGenericStatus(MainStatusBar::STATUS_CTX_BYTE);
|
||||
break;
|
||||
case BusyStatus:
|
||||
bar->popGenericStatus(MainStatusBar::STATUS_CTX_PROGRESS);
|
||||
break;
|
||||
case TemporaryStatus:
|
||||
bar->popGenericStatus(MainStatusBar::STATUS_CTX_TEMPORARY);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Editor modelines
|
||||
*
|
||||
|
|
|
@ -72,6 +72,15 @@ public:
|
|||
CaptureOptionsDialog
|
||||
};
|
||||
|
||||
enum StatusInfo {
|
||||
FilterSyntax,
|
||||
FieldStatus,
|
||||
FileStatus,
|
||||
BusyStatus,
|
||||
ByteStatus,
|
||||
TemporaryStatus
|
||||
};
|
||||
|
||||
void registerUpdate(register_action_e action, const char *message);
|
||||
void emitAppSignal(AppSignal signal);
|
||||
// Emitting app signals (PacketDissectionChanged in particular) from
|
||||
|
@ -129,6 +138,9 @@ public:
|
|||
|
||||
void zoomTextFont(int zoomLevel);
|
||||
|
||||
void pushStatus(StatusInfo sinfo, const QString &message, const QString &messagetip = QString());
|
||||
void popStatus(StatusInfo sinfo);
|
||||
|
||||
private:
|
||||
bool initialized_;
|
||||
bool is_reloading_lua_;
|
||||
|
|
Loading…
Reference in New Issue