Fix Bug 9873: 'Qt: right-clicking on toolbars only shows checkmarks'
Add the text descriptions for the two toolbars: "Main Toolbar" and "Display Filter", so the right-click context menu shows what you're removing/adding. And add a View->Toolbar sub-menu, with checkable "Main Toolbar" and "Display Filter" entries, which enable you to show/hide the toolbars via the menu. If someone has/prefers better names for these things, I'm all ears. Change-Id: I55b9fbaed2ef6dca3260fa9dfdddd7dad95d05c4 Reviewed-on: https://code.wireshark.org/review/608 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
This commit is contained in:
parent
d89195d1b8
commit
db1fddb40b
|
@ -263,6 +263,8 @@ private slots:
|
|||
void on_actionEditPreferences_triggered();
|
||||
|
||||
void on_actionViewReload_triggered();
|
||||
void on_actionViewToolbarMainToolbar_triggered();
|
||||
void on_actionViewToolbarDisplayFilter_triggered();
|
||||
|
||||
void on_actionGoGoToPacket_triggered();
|
||||
void resetPreviousFocus();
|
||||
|
|
|
@ -28,7 +28,16 @@
|
|||
</sizepolicy>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<property name="margin">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
|
@ -59,7 +68,7 @@
|
|||
<item>
|
||||
<widget class="QLineEdit" name="goToLineEdit">
|
||||
<property name="inputMask">
|
||||
<string>900000000; </string>
|
||||
<string>900000000</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -97,7 +106,7 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>960</width>
|
||||
<height>27</height>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="menuFile">
|
||||
|
@ -220,12 +229,21 @@
|
|||
<property name="title">
|
||||
<string>&View</string>
|
||||
</property>
|
||||
<widget class="QMenu" name="menuToolbars">
|
||||
<property name="title">
|
||||
<string>Toolbars</string>
|
||||
</property>
|
||||
<addaction name="actionViewToolbarMainToolbar"/>
|
||||
<addaction name="actionViewToolbarDisplayFilter"/>
|
||||
</widget>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionViewExpandSubtrees"/>
|
||||
<addaction name="actionViewExpandAll"/>
|
||||
<addaction name="actionViewCollapseAll"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionViewReload"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="menuToolbars"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuAnalyze">
|
||||
<property name="title">
|
||||
|
@ -395,6 +413,9 @@
|
|||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Main Toolbar</string>
|
||||
</property>
|
||||
<property name="movable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
|
@ -425,6 +446,9 @@
|
|||
</widget>
|
||||
<widget class="MainStatusBar" name="statusBar"/>
|
||||
<widget class="QToolBar" name="displayFilterToolBar">
|
||||
<property name="windowTitle">
|
||||
<string>Display Filter Toolbar</string>
|
||||
</property>
|
||||
<property name="movable">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
|
@ -1527,6 +1551,34 @@
|
|||
<string>Export PDUs to File</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionViewToolbarMainToolbar">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Main Toolbar</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Show/hide the main toolbar</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionViewToolbarDisplayFilter">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Display Filter</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Show/hide the display filter toolbar</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<customwidgets>
|
||||
|
@ -1573,5 +1625,37 @@
|
|||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>mainToolBar</sender>
|
||||
<signal>visibilityChanged(bool)</signal>
|
||||
<receiver>actionViewToolbarMainToolbar</receiver>
|
||||
<slot>setChecked(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>479</x>
|
||||
<y>39</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>-1</x>
|
||||
<y>-1</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>displayFilterToolBar</sender>
|
||||
<signal>visibilityChanged(bool)</signal>
|
||||
<receiver>actionViewToolbarDisplayFilter</receiver>
|
||||
<slot>setChecked(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>479</x>
|
||||
<y>64</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>-1</x>
|
||||
<y>-1</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
|
|
|
@ -1585,6 +1585,30 @@ void MainWindow::on_actionViewReload_triggered()
|
|||
cf_reload(&cfile);
|
||||
}
|
||||
|
||||
// gets called when user checks/unchecks the View->Toolbar->Main Toolbar
|
||||
void MainWindow::on_actionViewToolbarMainToolbar_triggered()
|
||||
{
|
||||
// just checking for isChecked() was sufficient here, but I was worried about a loop
|
||||
// so I'm checking both conditions
|
||||
if (main_ui_->actionViewToolbarMainToolbar->isChecked() && !main_ui_->mainToolBar->isVisible()) {
|
||||
main_ui_->mainToolBar->show();
|
||||
} else if (!main_ui_->actionViewToolbarMainToolbar->isChecked() && main_ui_->mainToolBar->isVisible()) {
|
||||
main_ui_->mainToolBar->hide();
|
||||
}
|
||||
}
|
||||
|
||||
// gets called when user checks/unchecks the View->Toolbar->Display Filter
|
||||
void MainWindow::on_actionViewToolbarDisplayFilter_triggered()
|
||||
{
|
||||
// just checking for isChecked() was sufficient here, but I was worried about a loop
|
||||
// so I'm checking both conditions
|
||||
if (main_ui_->actionViewToolbarDisplayFilter->isChecked() && !main_ui_->displayFilterToolBar->isVisible()) {
|
||||
main_ui_->displayFilterToolBar->show();
|
||||
} else if (!main_ui_->actionViewToolbarDisplayFilter->isChecked() && main_ui_->displayFilterToolBar->isVisible()) {
|
||||
main_ui_->displayFilterToolBar->hide();
|
||||
}
|
||||
}
|
||||
|
||||
// Expand / collapse slots in proto_tree
|
||||
|
||||
// Go Menu
|
||||
|
|
Loading…
Reference in New Issue