aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt/main_window.cpp
diff options
context:
space:
mode:
authorEvan Huus <eapache@gmail.com>2013-09-03 13:29:09 +0000
committerEvan Huus <eapache@gmail.com>2013-09-03 13:29:09 +0000
commita795048300164707cd7b6ae1b7c4fee61b07ba6e (patch)
treecb7643a583a81e9797edf88dae6766c49cbed258 /ui/qt/main_window.cpp
parent78529b20389846c46c96ad78f533ccb9feafac91 (diff)
Correctly update the pane layout whenever the preferences are changed, you no
longer need to restart for that to take effect. Hopefully I got all the slot ordering right. svn path=/trunk/; revision=51720
Diffstat (limited to 'ui/qt/main_window.cpp')
-rw-r--r--ui/qt/main_window.cpp79
1 files changed, 2 insertions, 77 deletions
diff --git a/ui/qt/main_window.cpp b/ui/qt/main_window.cpp
index 5614166f18..c3d6d5920c 100644
--- a/ui/qt/main_window.cpp
+++ b/ui/qt/main_window.cpp
@@ -105,6 +105,8 @@ MainWindow::MainWindow(QWidget *parent) :
setFeaturesEnabled(false);
connect(wsApp, SIGNAL(appInitialized()), this, SLOT(setFeaturesEnabled()));
+ connect(wsApp, SIGNAL(preferencesChanged()), this, SLOT(layoutPanes()));
+
connect(wsApp, SIGNAL(updateRecentItemStatus(const QString &, qint64, bool)), this, SLOT(updateRecentFiles()));
updateRecentFiles();
@@ -286,83 +288,6 @@ MainWindow::~MainWindow()
delete main_ui_;
}
-void MainWindow::layoutPanes()
-{
- QSplitter *parents[3];
-
- if (master_split_ != NULL) {
- main_ui_->mainStack->removeWidget(master_split_);
- }
- delete master_split_;
- delete extra_split_;
-
- master_split_ = new QSplitter(main_ui_->mainStack);
- master_split_->setObjectName(QString::fromUtf8("splitterMaster"));
-
- extra_split_ = new QSplitter(main_ui_->mainStack);
- extra_split_->setObjectName(QString::fromUtf8("splitterExtra"));
-
- switch(prefs.gui_layout_type) {
- case(layout_type_5):
- master_split_->setOrientation(Qt::Vertical);
- parents[0] = master_split_;
- parents[1] = master_split_;
- parents[2] = master_split_;
- break;
- case(layout_type_2):
- master_split_->setOrientation(Qt::Vertical);
- extra_split_->setOrientation(Qt::Horizontal);
- parents[0] = master_split_;
- parents[1] = extra_split_;
- parents[2] = extra_split_;
- break;
- case(layout_type_1):
- master_split_->setOrientation(Qt::Vertical);
- extra_split_->setOrientation(Qt::Horizontal);
- parents[0] = extra_split_;
- parents[1] = extra_split_;
- parents[2] = master_split_;
- break;
- case(layout_type_4):
- master_split_->setOrientation(Qt::Horizontal);
- extra_split_->setOrientation(Qt::Vertical);
- parents[0] = master_split_;
- parents[1] = extra_split_;
- parents[2] = extra_split_;
- break;
- case(layout_type_3):
- master_split_->setOrientation(Qt::Horizontal);
- extra_split_->setOrientation(Qt::Vertical);
- parents[0] = extra_split_;
- parents[1] = extra_split_;
- parents[2] = master_split_;
- break;
- case(layout_type_6):
- master_split_->setOrientation(Qt::Horizontal);
- parents[0] = master_split_;
- parents[1] = master_split_;
- parents[2] = master_split_;
- break;
- default:
- g_assert_not_reached();
- }
-
- if (parents[0] == extra_split_) {
- master_split_->addWidget(extra_split_);
- }
-
- parents[0]->addWidget(packet_list_);
-
- if (parents[2] == extra_split_) {
- master_split_->addWidget(extra_split_);
- }
-
- parents[1]->addWidget(proto_tree_);
- parents[2]->addWidget(byte_view_tab_);
-
- main_ui_->mainStack->addWidget(master_split_);
-}
-
void MainWindow::setPipeInputHandler(gint source, gpointer user_data, int *child_process, pipe_input_cb_t input_cb)
{
pipe_source_ = source;