diff options
author | Stig Bjørlykke <stig@bjorlykke.org> | 2018-10-09 11:46:00 +0200 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2018-10-10 04:46:28 +0000 |
commit | e1fc60ddaecaa914e384ae8bc9bf46cca0096df2 (patch) | |
tree | b05c9cf0dc1868925e2d8919603ef87469b13625 /ui/qt/coloring_rules_dialog.cpp | |
parent | eade1c52cba529f10a2e3133b78c4ddd30ea52e6 (diff) |
Qt: Add back pathLabel in some dialogs
Add the pathLabel for Coloring Rules, Decode As, Display Filters
and Capture Filter. Put the absolute file path into the pathLabel
if the file exists. This aligns with UAT dialogs and frames.
Change-Id: I72bd06e31bab220de0a0ef8df99df9a4daed667c
Reviewed-on: https://code.wireshark.org/review/30089
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'ui/qt/coloring_rules_dialog.cpp')
-rw-r--r-- | ui/qt/coloring_rules_dialog.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/ui/qt/coloring_rules_dialog.cpp b/ui/qt/coloring_rules_dialog.cpp index 4d4ea5653f..3358a9250a 100644 --- a/ui/qt/coloring_rules_dialog.cpp +++ b/ui/qt/coloring_rules_dialog.cpp @@ -20,12 +20,14 @@ #include "wsutil/filesystem.h" #include "wireshark_application.h" +#include "ui/qt/utils/qt_ui_utils.h" #include "ui/qt/widgets/copy_from_profile_menu.h" #include "ui/qt/widgets/wireshark_file_dialog.h" #include <QColorDialog> #include <QMessageBox> #include <QPushButton> +#include <QUrl> /* * @file Coloring Rules dialog @@ -58,6 +60,14 @@ ColoringRulesDialog::ColoringRulesDialog(QWidget *parent, QString add_filter) : ui->coloringRulesTreeView->resizeColumnToContents(i); } +#ifdef Q_OS_MAC + ui->newToolButton->setAttribute(Qt::WA_MacSmallSize, true); + ui->deleteToolButton->setAttribute(Qt::WA_MacSmallSize, true); + ui->copyToolButton->setAttribute(Qt::WA_MacSmallSize, true); + ui->clearToolButton->setAttribute(Qt::WA_MacSmallSize, true); + ui->pathLabel->setAttribute(Qt::WA_MacSmallSize, true); +#endif + connect(ui->coloringRulesTreeView->selectionModel(), SIGNAL(selectionChanged(const QItemSelection &, const QItemSelection &)), this, SLOT(colorRuleSelectionChanged(const QItemSelection &, const QItemSelection &))); connect(&colorRuleDelegate_, SIGNAL(invalidField(const QModelIndex&, const QString&)), @@ -75,12 +85,20 @@ ColoringRulesDialog::ColoringRulesDialog(QWidget *parent, QString add_filter) : export_button_->setToolTip(tr("Save filters in a file.")); QPushButton *copy_button = ui->buttonBox->addButton(tr("Copy from"), QDialogButtonBox::ActionRole); - copy_from_menu_ = new CopyFromProfileMenu("colorfilters"); + copy_from_menu_ = new CopyFromProfileMenu(COLORFILTERS_FILE_NAME); copy_button->setMenu(copy_from_menu_); copy_button->setToolTip(tr("Copy coloring rules from another profile.")); copy_button->setEnabled(copy_from_menu_->haveProfiles()); connect(copy_from_menu_, SIGNAL(triggered(QAction *)), this, SLOT(copyFromProfile(QAction *))); + QString abs_path = gchar_free_to_qstring(get_persconffile_path(COLORFILTERS_FILE_NAME, TRUE)); + if (file_exists(abs_path.toUtf8().constData())) { + ui->pathLabel->setText(abs_path); + ui->pathLabel->setUrl(QUrl::fromLocalFile(abs_path).toString()); + ui->pathLabel->setToolTip(tr("Open ") + COLORFILTERS_FILE_NAME); + ui->pathLabel->setEnabled(true); + } + if (!add_filter.isEmpty()) { colorRuleModel_.addColor(false, add_filter, palette().color(QPalette::Text), palette().color(QPalette::Base)); |