diff --git a/ui/qt/main.cpp b/ui/qt/main.cpp index d2720f7a97..ad8f68668a 100644 --- a/ui/qt/main.cpp +++ b/ui/qt/main.cpp @@ -517,6 +517,14 @@ int main(int argc, char *argv[]) QTextCodec::setCodecForTr(utf8codec); #endif + // Init the main window (and splash) + main_w = new(MainWindow); + main_w->show(); + // We may not need a queued connection here but it would seem to make sense + // to force the issue. + main_w->connect(&ws_app, SIGNAL(openCaptureFile(QString&)), + main_w, SLOT(openCaptureFile(QString&))); + // XXX Should the remaining code be in WiresharkApplcation::WiresharkApplication? #ifdef HAVE_LIBPCAP #if defined(_WIN32) || defined(HAVE_PCAP_CREATE) @@ -810,15 +818,6 @@ int main(int argc, char *argv[]) splash_update(RA_PREFERENCES, NULL, NULL); prefs_p = ws_app.readConfigurationFiles (&gdp_path, &dp_path); - main_w = new(MainWindow); -// w->setEnabled(false); - main_w->show(); - // We may not need a queued connection here but it would seem to make sense - // to force the issue. - main_w->connect(&ws_app, SIGNAL(openCaptureFile(QString&)), - main_w, SLOT(openCaptureFile(QString&))); - - splash_update(RA_LISTENERS, NULL, NULL); /* Register all tap listeners; we do this before we parse the arguments, @@ -918,6 +917,7 @@ int main(int argc, char *argv[]) #endif /* HAVE_LIBPCAP */ // w->setEnabled(true); + main_w->layoutPanes(); wsApp->allSystemsGo(); g_log(LOG_DOMAIN_MAIN, G_LOG_LEVEL_INFO, "Wireshark is up and ready to go"); diff --git a/ui/qt/main_window.cpp b/ui/qt/main_window.cpp index b483bcacc2..5614166f18 100644 --- a/ui/qt/main_window.cpp +++ b/ui/qt/main_window.cpp @@ -167,7 +167,22 @@ MainWindow::MainWindow(QWidget *parent) : connect(update_action, SIGNAL(triggered()), this, SLOT(on_actionHelpCheckForUpdates_triggered())); #endif - layoutPanes(); + packet_list_ = new PacketList(main_ui_->mainStack); + + proto_tree_ = new ProtoTree(main_ui_->mainStack); + proto_tree_->setHeaderHidden(true); + proto_tree_->installEventFilter(this); + + byte_view_tab_ = new ByteViewTab(main_ui_->mainStack); + byte_view_tab_->setTabPosition(QTabWidget::South); + byte_view_tab_->setDocumentMode(true); + + packet_list_->setProtoTree(proto_tree_); + packet_list_->setByteViewTab(byte_view_tab_); + packet_list_->installEventFilter(this); + + master_split_ = NULL; + extra_split_ = NULL; main_welcome_ = main_ui_->welcomePage; @@ -275,6 +290,12 @@ 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")); @@ -326,20 +347,6 @@ void MainWindow::layoutPanes() g_assert_not_reached(); } - packet_list_ = new PacketList(main_ui_->mainStack); - - proto_tree_ = new ProtoTree(main_ui_->mainStack); - proto_tree_->setHeaderHidden(true); - proto_tree_->installEventFilter(this); - - byte_view_tab_ = new ByteViewTab(main_ui_->mainStack); - byte_view_tab_->setTabPosition(QTabWidget::South); - byte_view_tab_->setDocumentMode(true); - - packet_list_->setProtoTree(proto_tree_); - packet_list_->setByteViewTab(byte_view_tab_); - packet_list_->installEventFilter(this); - if (parents[0] == extra_split_) { master_split_->addWidget(extra_split_); } diff --git a/ui/qt/main_window.h b/ui/qt/main_window.h index e36e639af1..696239cd6e 100644 --- a/ui/qt/main_window.h +++ b/ui/qt/main_window.h @@ -70,6 +70,7 @@ public: explicit MainWindow(QWidget *parent = 0); ~MainWindow(); void setPipeInputHandler(gint source, gpointer user_data, int *child_process, pipe_input_cb_t input_cb); + void layoutPanes(); protected: bool eventFilter(QObject *obj, QEvent *event); @@ -179,7 +180,6 @@ private slots: void pipeActivated(int source); void pipeNotifierDestroyed(); void stopCapture(); - void layoutPanes(); void updateRecentFiles(); void recentActionTriggered();