summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2014-12-09 16:54:17 -0800
committerGerald Combs <gerald@wireshark.org>2014-12-10 01:51:09 +0000
commite4b0141769a9a30b4d5c8da86a27eac5c612585c (patch)
treeed4dad2f5cfb6e9f994ff61ae85433459e66f6e2
parentc1d4a087778ccf68f991a7262e36734ac81a5fec (diff)
downloadwireshark-e4b0141769a9a30b4d5c8da86a27eac5c612585c.tar.gz
Qt: Obey main toolbar icon preferences.
Remove the preferences for the filter toolbar and mark them GTK+-only. Change-Id: Ie48b19aee29a1cfcea4c41ca6c08ddbba3102377 Reviewed-on: https://code.wireshark.org/review/5693 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
-rw-r--r--epan/prefs.h2
-rw-r--r--ui/qt/main_window.cpp1
-rw-r--r--ui/qt/main_window.h1
-rw-r--r--ui/qt/main_window_preferences_frame.cpp7
-rw-r--r--ui/qt/main_window_preferences_frame.h1
-rw-r--r--ui/qt/main_window_preferences_frame.ui57
-rw-r--r--ui/qt/main_window_slots.cpp15
7 files changed, 21 insertions, 63 deletions
diff --git a/epan/prefs.h b/epan/prefs.h
index 4619b117b6..c45a2a098e 100644
--- a/epan/prefs.h
+++ b/epan/prefs.h
@@ -150,7 +150,7 @@ typedef struct _e_prefs {
gint gui_ptree_expander_style;
gboolean gui_hex_dump_highlight_style;
gint gui_toolbar_main_style;
- gint gui_toolbar_filter_style;
+ gint gui_toolbar_filter_style; /* GTK only? */
gchar *gui_gtk2_font_name;
gchar *gui_qt_font_name;
color_t gui_marked_fg;
diff --git a/ui/qt/main_window.cpp b/ui/qt/main_window.cpp
index a1eea8a251..e2e10ca31b 100644
--- a/ui/qt/main_window.cpp
+++ b/ui/qt/main_window.cpp
@@ -186,6 +186,7 @@ MainWindow::MainWindow(QWidget *parent) :
connect(wsApp, SIGNAL(appInitialized()), this, SLOT(zoomText()));
connect(wsApp, SIGNAL(preferencesChanged()), this, SLOT(layoutPanes()));
+ connect(wsApp, SIGNAL(preferencesChanged()), this, SLOT(layoutToolbars()));
connect(wsApp, SIGNAL(preferencesChanged()), this, SLOT(zoomText()));
connect(wsApp, SIGNAL(recentFilesRead()), this, SLOT(loadWindowGeometry()));
diff --git a/ui/qt/main_window.h b/ui/qt/main_window.h
index 6472e357c4..b81d4f0e9b 100644
--- a/ui/qt/main_window.h
+++ b/ui/qt/main_window.h
@@ -183,6 +183,7 @@ public slots:
void filterPackets(QString& new_filter = *new QString(), bool force = false);
void updateForUnsavedChanges();
void layoutPanes();
+ void layoutToolbars();
void captureCapturePrepared(capture_session *cap_session);
void captureCaptureUpdateStarted(capture_session *cap_session);
diff --git a/ui/qt/main_window_preferences_frame.cpp b/ui/qt/main_window_preferences_frame.cpp
index a02894fd63..6d77b77f8d 100644
--- a/ui/qt/main_window_preferences_frame.cpp
+++ b/ui/qt/main_window_preferences_frame.cpp
@@ -143,9 +143,7 @@ void MainWindowPreferencesFrame::updateWidgets()
ui->autoScrollPercentageLineEdit->setText(QString::number(pref_auto_scroll_on_expand_->stashed_val.uint));
ui->mainToolbarComboBox->setCurrentIndex(pref_toolbar_main_style_->stashed_val.enumval);
- ui->filterToolbarComboBox->setCurrentIndex(pref_toolbar_filter_style_->stashed_val.enumval);
- QStringList filenames = QDir(":/i18n/").entryList(QStringList("wireshark_*.qm"));
for (int i = 0; i < ui->languageComboBox->count(); i += 1) {
if (QString(language) == ui->languageComboBox->itemData(i).toString()) {
ui->languageComboBox->setCurrentIndex(i);
@@ -228,11 +226,6 @@ void MainWindowPreferencesFrame::on_mainToolbarComboBox_currentIndexChanged(int
pref_toolbar_main_style_->stashed_val.enumval = index;
}
-void MainWindowPreferencesFrame::on_filterToolbarComboBox_currentIndexChanged(int index)
-{
- pref_toolbar_filter_style_->stashed_val.enumval = index;
-}
-
void MainWindowPreferencesFrame::on_languageComboBox_currentIndexChanged(int index)
{
if (language)
diff --git a/ui/qt/main_window_preferences_frame.h b/ui/qt/main_window_preferences_frame.h
index a29793dfc7..4ee39023d7 100644
--- a/ui/qt/main_window_preferences_frame.h
+++ b/ui/qt/main_window_preferences_frame.h
@@ -70,7 +70,6 @@ private slots:
void on_autoScrollCheckBox_toggled(bool checked);
void on_autoScrollPercentageLineEdit_textEdited(const QString &new_pct);
void on_mainToolbarComboBox_currentIndexChanged(int index);
- void on_filterToolbarComboBox_currentIndexChanged(int index);
void on_languageComboBox_currentIndexChanged(int index);
};
diff --git a/ui/qt/main_window_preferences_frame.ui b/ui/qt/main_window_preferences_frame.ui
index 7d4e901979..e4d817e1f7 100644
--- a/ui/qt/main_window_preferences_frame.ui
+++ b/ui/qt/main_window_preferences_frame.ui
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>425</width>
- <height>421</height>
+ <width>405</width>
+ <height>416</height>
</rect>
</property>
<property name="sizePolicy">
@@ -242,55 +242,6 @@
</layout>
</item>
<item>
- <layout class="QHBoxLayout" name="horizontalLayout_5">
- <item>
- <widget class="QLabel" name="label_6">
- <property name="text">
- <string>Filter toolbar style:</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QComboBox" name="filterToolbarComboBox">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <item>
- <property name="text">
- <string>Icons only</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Text only</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Icons &amp; Text</string>
- </property>
- </item>
- </widget>
- </item>
- <item>
- <spacer name="horizontalSpacer_5">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </item>
- <item>
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<widget class="QLabel" name="label_7">
@@ -347,9 +298,7 @@
</item>
</layout>
</widget>
- <resources>
- <include location="../../image/languages/languages.qrc"/>
- </resources>
+ <resources/>
<connections/>
<buttongroups>
<buttongroup name="openInButtonGroup"/>
diff --git a/ui/qt/main_window_slots.cpp b/ui/qt/main_window_slots.cpp
index 056fc0cbf5..5216c1a3b9 100644
--- a/ui/qt/main_window_slots.cpp
+++ b/ui/qt/main_window_slots.cpp
@@ -102,6 +102,7 @@
#include <QClipboard>
#include <QMessageBox>
#include <QMetaObject>
+#include <QToolBar>
#include <QDebug>
@@ -325,6 +326,20 @@ void MainWindow::layoutPanes()
}
}
+void MainWindow::layoutToolbars()
+{
+ Qt::ToolButtonStyle tbstyle = Qt::ToolButtonIconOnly;
+ switch (prefs.gui_toolbar_main_style) {
+ case TB_STYLE_TEXT:
+ tbstyle = Qt::ToolButtonTextOnly;
+ break;
+ case TB_STYLE_BOTH:
+ tbstyle = Qt::ToolButtonTextUnderIcon;
+ }
+
+ main_ui_->mainToolBar->setToolButtonStyle(tbstyle);
+}
+
void MainWindow::filterAction(QString &action_filter, FilterAction::Action action, FilterAction::ActionType type)
{
QString cur_filter, new_filter;