aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2020-07-17 13:45:01 +0200
committerAnders Broman <a.broman58@gmail.com>2020-07-18 04:02:23 +0000
commite1df757c46a08358b5c589ad1f96b1ddb45fe693 (patch)
treecf64984e419500a13b7121861bd36ad0e614a06e
parent6432e18b2a4ea0793dfbc8cf057bcc7dbf028ea8 (diff)
Qt: Improve status bar messages
Use pushStatus() in C++ code, improve translation support and end each message with a dot. Change-Id: I3f673da4736c3fe49203048da282afa1abf92337 Reviewed-on: https://code.wireshark.org/review/37887 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
-rw-r--r--ui/qt/address_editor_frame.cpp2
-rw-r--r--ui/qt/interface_toolbar.cpp4
-rw-r--r--ui/qt/main_window_slots.cpp12
-rw-r--r--ui/qt/models/packet_list_model.cpp2
-rw-r--r--ui/qt/widgets/wireless_timeline.cpp8
5 files changed, 13 insertions, 15 deletions
diff --git a/ui/qt/address_editor_frame.cpp b/ui/qt/address_editor_frame.cpp
index f9f1027ebb..e5c918e28a 100644
--- a/ui/qt/address_editor_frame.cpp
+++ b/ui/qt/address_editor_frame.cpp
@@ -169,7 +169,7 @@ void AddressEditorFrame::on_buttonBox_accepted()
QString addr = ui->addressComboBox->currentText();
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);
+ QString error_msg = tr("Can't assign %1 to %2.").arg(name).arg(addr);
wsApp->pushStatus(WiresharkApplication::TemporaryStatus, error_msg);
ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
return;
diff --git a/ui/qt/interface_toolbar.cpp b/ui/qt/interface_toolbar.cpp
index 55c2469cd4..a970f8be8f 100644
--- a/ui/qt/interface_toolbar.cpp
+++ b/ui/qt/interface_toolbar.cpp
@@ -14,7 +14,7 @@
#include "interface_toolbar.h"
#include <ui/qt/widgets/interface_toolbar_lineedit.h>
#include "simple_dialog.h"
-#include "ui/main_statusbar.h"
+#include "wireshark_application.h"
#include <ui_interface_toolbar.h>
#include "capture_opts.h"
@@ -555,7 +555,7 @@ void InterfaceToolbar::controlReceived(QString ifname, int num, int command, QBy
break;
case commandStatusMessage:
- statusbar_push_temporary_msg("%s", payload.data());
+ wsApp->pushStatus(WiresharkApplication::TemporaryStatus, payload);
break;
case commandInformationMessage:
diff --git a/ui/qt/main_window_slots.cpp b/ui/qt/main_window_slots.cpp
index 26e0353ae2..6ae4238e36 100644
--- a/ui/qt/main_window_slots.cpp
+++ b/ui/qt/main_window_slots.cpp
@@ -663,7 +663,7 @@ void MainWindow::captureEventHandler(CaptureEvent ev)
switch (ev.eventType()) {
case CaptureEvent::Started:
wsApp->popStatus(WiresharkApplication::FileStatus);
- wsApp->pushStatus(WiresharkApplication::FileStatus, tr("Merging files"), QString());
+ wsApp->pushStatus(WiresharkApplication::FileStatus, tr("Merging files."), QString());
break;
case CaptureEvent::Finished:
wsApp->popStatus(WiresharkApplication::FileStatus);
@@ -832,7 +832,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"));
+ QString msg = QString(tr("No interface selected."));
wsApp->pushStatus(WiresharkApplication::TemporaryStatus, msg);
main_ui_->actionCaptureStart->setChecked(false);
return;
@@ -842,7 +842,7 @@ void MainWindow::startCapture() {
// toolbar buttons and menu items. This may not be the
// case, e.g. with QtMacExtras.
if (!capture_filter_valid_) {
- QString msg = QString(tr("Invalid capture filter"));
+ QString msg = QString(tr("Invalid capture filter."));
wsApp->pushStatus(WiresharkApplication::TemporaryStatus, msg);
main_ui_->actionCaptureStart->setChecked(false);
return;
@@ -2724,9 +2724,7 @@ void MainWindow::matchFieldFilter(FilterAction::Action action, FilterAction::Act
}
if (field_filter.isEmpty()) {
- QString err = tr("No filter available. Try another ");
- err.append(packet_list_->contextMenuActive() ? "column" : "item");
- err.append(".");
+ QString err = tr("No filter available. Try another %1.").arg(packet_list_->contextMenuActive() ? tr("column") : tr("item"));
wsApp->pushStatus(WiresharkApplication::TemporaryStatus, err);
return;
}
@@ -3704,7 +3702,7 @@ void MainWindow::on_actionCaptureStart_triggered()
#ifdef HAVE_LIBPCAP
if (global_capture_opts.num_selected == 0) {
- QString err_msg = tr("No Interface Selected");
+ QString err_msg = tr("No Interface Selected.");
wsApp->pushStatus(WiresharkApplication::TemporaryStatus, err_msg);
main_ui_->actionCaptureStart->setChecked(false);
return;
diff --git a/ui/qt/models/packet_list_model.cpp b/ui/qt/models/packet_list_model.cpp
index 12d057e0fd..7e1a6da30a 100644
--- a/ui/qt/models/packet_list_model.cpp
+++ b/ui/qt/models/packet_list_model.cpp
@@ -357,7 +357,7 @@ void PacketListModel::sort(int column, Qt::SortOrder order)
// XXX Use updateProgress instead. We'd have to switch from std::sort to
// something we can interrupt.
if (!col_title.isEmpty()) {
- QString busy_msg = tr("Sorting \"%1\"").arg(col_title);
+ QString busy_msg = tr("Sorting \"%1\"" UTF8_HORIZONTAL_ELLIPSIS).arg(col_title);
wsApp->pushStatus(WiresharkApplication::BusyStatus, busy_msg);
}
diff --git a/ui/qt/widgets/wireless_timeline.cpp b/ui/qt/widgets/wireless_timeline.cpp
index 787fb36452..2a68cd764b 100644
--- a/ui/qt/widgets/wireless_timeline.cpp
+++ b/ui/qt/widgets/wireless_timeline.cpp
@@ -48,8 +48,6 @@
#include "packet_list.h"
#include <ui/qt/models/packet_list_model.h>
-#include "ui/main_statusbar.h"
-
/* we start rendering this number of microseconds left of the left edge - to ensure
* NAV lines are drawn correctly, and that small errors in time order don't prevent some
* frames from being rendered.
@@ -259,11 +257,13 @@ void WirelessTimeline::captureFileReadFinished()
for (guint32 n = 1; n < cfile.count; n++) {
struct wlan_radio *w = get_wlan_radio(n);
if (w->start_tsf == 0 || w->end_tsf == 0) {
- statusbar_push_temporary_msg("Packet number %u does not include TSF timestamp, not showing timeline.", n);
+ QString err = tr("Packet number %1 does not include TSF timestamp, not showing timeline.").arg(n);
+ wsApp->pushStatus(WiresharkApplication::TemporaryStatus, err);
return;
}
if (w->ifs < -RENDER_EARLY) {
- statusbar_push_temporary_msg("Packet number %u has large negative jump in TSF, not showing timeline. Perhaps TSF reference point is set wrong?", n);
+ QString err = tr("Packet number %u has large negative jump in TSF, not showing timeline. Perhaps TSF reference point is set wrong?").arg(n);
+ wsApp->pushStatus(WiresharkApplication::TemporaryStatus, err);
return;
}
}