aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt/preferences_dialog.cpp
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2017-02-16 15:08:06 +0100
committerStig Bjørlykke <stig@bjorlykke.org>2017-02-16 20:53:00 +0000
commit384c26622b0adc7eda415ba6e2a9fc704cd27794 (patch)
treed3967da649ac35e49adedaf69fe254ccbcc967b6 /ui/qt/preferences_dialog.cpp
parent7e9b7b596728e6d1ab1ab5dc01e6a24a3bfafd6b (diff)
Qt: Preserve pane sizes when layout content changed
Preserve pane sizes when rearranging layout content in the preferences dialog. Change-Id: I2af2a60424a7bf94f1f92e7c63e6a1823985b60d Reviewed-on: https://code.wireshark.org/review/20145 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Diffstat (limited to 'ui/qt/preferences_dialog.cpp')
-rw-r--r--ui/qt/preferences_dialog.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/ui/qt/preferences_dialog.cpp b/ui/qt/preferences_dialog.cpp
index cca797affc..deb4a4baf4 100644
--- a/ui/qt/preferences_dialog.cpp
+++ b/ui/qt/preferences_dialog.cpp
@@ -870,7 +870,10 @@ void PreferencesDialog::on_buttonBox_accepted()
gchar* err = NULL;
gboolean must_redissect = FALSE;
- layout_type_e old_layout_type = prefs.gui_layout_type;
+ QVector<unsigned> old_layout = QVector<unsigned>() << prefs.gui_layout_type
+ << prefs.gui_layout_content_1
+ << prefs.gui_layout_content_2
+ << prefs.gui_layout_content_3;
// XXX - We should validate preferences as the user changes them, not here.
// XXX - We're also too enthusiastic about setting must_redissect.
@@ -878,7 +881,12 @@ void PreferencesDialog::on_buttonBox_accepted()
// return; /* Errors in some preference setting - already reported */
prefs_modules_foreach_submodules(NULL, module_prefs_unstash, (gpointer) &must_redissect);
- if (prefs.gui_layout_type != old_layout_type) {
+ QVector<unsigned> new_layout = QVector<unsigned>() << prefs.gui_layout_type
+ << prefs.gui_layout_content_1
+ << prefs.gui_layout_content_2
+ << prefs.gui_layout_content_3;
+
+ if (new_layout[0] != old_layout[0]) {
// Layout type changed, reset sizes
recent.gui_geometry_main_upper_pane = 0;
recent.gui_geometry_main_lower_pane = 0;
@@ -928,7 +936,7 @@ void PreferencesDialog::on_buttonBox_accepted()
}
wsApp->queueAppSignal(WiresharkApplication::PreferencesChanged);
- if (prefs.gui_layout_type != old_layout_type) {
+ if (new_layout != old_layout) {
wsApp->queueAppSignal(WiresharkApplication::RecentPreferencesRead);
}
}