diff options
author | Roland Knall <roland.knall@br-automation.com> | 2017-06-26 13:02:07 +0200 |
---|---|---|
committer | Roland Knall <rknall@gmail.com> | 2017-06-26 14:33:37 +0000 |
commit | 680d1df7a04fd7a72707ef319783984c5c148783 (patch) | |
tree | be282a7c47ba5d8a5ea22d7378a40adb61778f51 /ui/qt | |
parent | 707b78907487cbf2965521b31e6c3222e4d8459f (diff) | |
download | wireshark-680d1df7a04fd7a72707ef319783984c5c148783.tar.gz |
Fix Filter Tooltip button and frame
Make the frame into a two-row frame to better accomodate
the comments field, and reinstate the correct action for the
buttons
Change-Id: I171e4bc3c7f195b7179cd6b1c2ab4ab42ede9c04
Reviewed-on: https://code.wireshark.org/review/22405
Petri-Dish: Roland Knall <rknall@gmail.com>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Roland Knall <rknall@gmail.com>
Diffstat (limited to 'ui/qt')
-rw-r--r-- | ui/qt/filter_expression_frame.cpp | 6 | ||||
-rw-r--r-- | ui/qt/filter_expression_frame.h | 2 | ||||
-rw-r--r-- | ui/qt/filter_expression_frame.ui | 282 | ||||
-rw-r--r-- | ui/qt/filter_expressions_preferences_frame.cpp | 3 | ||||
-rw-r--r-- | ui/qt/main_window_slots.cpp | 2 |
5 files changed, 162 insertions, 133 deletions
diff --git a/ui/qt/filter_expression_frame.cpp b/ui/qt/filter_expression_frame.cpp index b67eba6adf..72e2ecf282 100644 --- a/ui/qt/filter_expression_frame.cpp +++ b/ui/qt/filter_expression_frame.cpp @@ -56,7 +56,6 @@ void FilterExpressionFrame::addExpression(const QString filter_text) return; } - ui->labelLineEdit->setText(tr("Apply this filter")); ui->displayFilterLineEdit->setText(filter_text); } @@ -79,7 +78,7 @@ void FilterExpressionFrame::updateWidgets() ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(ok_enable); } -void FilterExpressionFrame::on_filterExpressionPreferencesToolButton_clicked() +void FilterExpressionFrame::on_filterExpressionPreferencesPushButton_clicked() { on_buttonBox_rejected(); emit showPreferencesDialog(PreferencesDialog::ppFilterExpressions); @@ -97,6 +96,9 @@ void FilterExpressionFrame::on_buttonBox_accepted() QByteArray expr_ba = ui->displayFilterLineEdit->text().toUtf8(); QByteArray comment_ba = ui->commentLineEdit->text().toUtf8(); + if ( ui->labelLineEdit->text().length() == 0 ) + return; + filter_expression_new(label_ba.constData(), expr_ba.constData(), comment_ba.constData(), TRUE); on_buttonBox_rejected(); diff --git a/ui/qt/filter_expression_frame.h b/ui/qt/filter_expression_frame.h index ad3119d23b..2d65f9a596 100644 --- a/ui/qt/filter_expression_frame.h +++ b/ui/qt/filter_expression_frame.h @@ -51,7 +51,7 @@ private: private slots: void updateWidgets(); - void on_filterExpressionPreferencesToolButton_clicked(); + void on_filterExpressionPreferencesPushButton_clicked(); void on_labelLineEdit_textChanged(const QString); void on_buttonBox_accepted(); void on_buttonBox_rejected(); diff --git a/ui/qt/filter_expression_frame.ui b/ui/qt/filter_expression_frame.ui index df9691bfd9..b0d3e401f9 100644 --- a/ui/qt/filter_expression_frame.ui +++ b/ui/qt/filter_expression_frame.ui @@ -6,10 +6,22 @@ <rect> <x>0</x> <y>0</y> - <width>745</width> - <height>34</height> + <width>796</width> + <height>82</height> </rect> </property> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="maximumSize"> + <size> + <width>16777215</width> + <height>82</height> + </size> + </property> <property name="windowTitle"> <string>Frame</string> </property> @@ -19,140 +31,158 @@ <property name="frameShadow"> <enum>QFrame::Plain</enum> </property> - <layout class="QHBoxLayout" name="horizontalLayout" stretch="0,1,0,0,0,0,1,0,0"> - <property name="topMargin"> - <number>0</number> - </property> - <property name="bottomMargin"> - <number>0</number> - </property> + <layout class="QHBoxLayout" name="horizontalLayout_5"> <item> - <widget class="QToolButton" name="filterExpressionPreferencesToolButton"> - <property name="text"> - <string>Filter Expression Preferences…</string> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer_3"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>88</width> - <height>5</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QLabel" name="labelLabel"> - <property name="text"> - <string>Label:</string> - </property> - </widget> - </item> - <item> - <widget class="SyntaxLineEdit" name="labelLineEdit"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> - <horstretch>1</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>80</width> - <height>0</height> - </size> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer_2"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>5</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QLabel" name="filterLabel"> - <property name="text"> - <string>Filter:</string> - </property> - </widget> + <layout class="QVBoxLayout" name="verticalLayout_2"> + <item> + <widget class="QPushButton" name="filterExpressionPreferencesPushButton"> + <property name="text"> + <string>Filter Buttons Preferences…</string> + </property> + </widget> + </item> + <item> + <spacer name="verticalSpacer"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>5</height> + </size> + </property> + </spacer> + </item> + </layout> </item> <item> - <widget class="DisplayFilterEdit" name="displayFilterLineEdit"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> - <horstretch>1</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>80</width> - <height>0</height> - </size> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="commentLabel"> - <property name="text"> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_4"> + <item> + <layout class="QHBoxLayout" name="horizontalLayout"> + <item> + <widget class="QLabel" name="labelLabel"> + <property name="text"> + <string>Label:</string> + </property> + </widget> + </item> + <item> + <widget class="SyntaxLineEdit" name="labelLineEdit"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> + <horstretch>1</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>80</width> + <height>0</height> + </size> + </property> + <property name="placeholderText"> + <string>Enter a description for the filter button</string> + </property> + </widget> + </item> + </layout> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_2"> + <item> + <widget class="QLabel" name="filterLabel"> + <property name="text"> + <string>Filter:</string> + </property> + </widget> + </item> + <item> + <widget class="DisplayFilterEdit" name="displayFilterLineEdit"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> + <horstretch>1</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>80</width> + <height>0</height> + </size> + </property> + <property name="placeholderText"> + <string>Enter a filter expression to be applied</string> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_3"> + <item> + <widget class="QLabel" name="commentLabel"> + <property name="text"> <string>Comment:</string> - </property> - </widget> - </item> - <item> - <widget class="SyntaxLineEdit" name="commentLineEdit"> - <property name="sizePolicy"> + </property> + </widget> + </item> + <item> + <widget class="SyntaxLineEdit" name="commentLineEdit"> + <property name="sizePolicy"> <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> - <horstretch>1</horstretch> - <verstretch>0</verstretch> + <horstretch>1</horstretch> + <verstretch>0</verstretch> </sizepolicy> - </property> - <property name="minimumSize"> + </property> + <property name="minimumSize"> <size> - <width>80</width> - <height>0</height> + <width>80</width> + <height>0</height> </size> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>5</height> - </size> - </property> - </spacer> + </property> + <property name="placeholderText"> + <string>Enter a comment for the filter button</string> + </property> + </widget> + </item> + </layout> + </item> + </layout> </item> <item> - <widget class="QDialogButtonBox" name="buttonBox"> - <property name="maximumSize"> - <size> - <width>16777215</width> - <height>27</height> - </size> - </property> - <property name="standardButtons"> - <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> - </property> - </widget> + <layout class="QVBoxLayout" name="verticalLayout_3"> + <item> + <widget class="QDialogButtonBox" name="buttonBox"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="standardButtons"> + <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> + </property> + </widget> + </item> + <item> + <spacer name="verticalSpacer_2"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>5</height> + </size> + </property> + </spacer> + </item> + </layout> </item> </layout> </widget> diff --git a/ui/qt/filter_expressions_preferences_frame.cpp b/ui/qt/filter_expressions_preferences_frame.cpp index 1b47225797..9de6312a4d 100644 --- a/ui/qt/filter_expressions_preferences_frame.cpp +++ b/ui/qt/filter_expressions_preferences_frame.cpp @@ -110,9 +110,6 @@ void FilterExpressionsPreferencesFrame::setUat(epan_uat *uat) this, SLOT(modelRowsRemoved())); connect(ui->uatTreeView, SIGNAL(currentItemChanged(QModelIndex,QModelIndex)), this, SLOT(viewCurrentChanged(QModelIndex,QModelIndex))); - - connect(this, SIGNAL(rejected()), this, SLOT(rejectChanges())); - connect(this, SIGNAL(accepted()), this, SLOT(acceptChanges())); } setWindowTitle(title); diff --git a/ui/qt/main_window_slots.cpp b/ui/qt/main_window_slots.cpp index 02fbf3a65f..a6abdb4956 100644 --- a/ui/qt/main_window_slots.cpp +++ b/ui/qt/main_window_slots.cpp @@ -921,7 +921,7 @@ gboolean MainWindow::filter_expression_add_action(const void *key _U_, void *val dfb_action->setData(fe->expression); dfb_action->setProperty(dfe_property_, true); data->window->filter_expression_toolbar_->addAction(dfb_action); - connect(dfb_action, SIGNAL(data->window->triggered()), data->window, SLOT(data->window->displayFilterButtonClicked())); + connect(dfb_action, SIGNAL(triggered()), data->window, SLOT(displayFilterButtonClicked())); data->actions_added = true; return FALSE; } |