Separate window creation from the laying out of the list/tree/byte panes. This

more-or-less restores the correct splash behaviour on startup.

svn path=/trunk/; revision=51719
This commit is contained in:
Evan Huus 2013-09-03 12:53:32 +00:00
parent 16cbf7d4cf
commit 78529b2038
3 changed files with 32 additions and 25 deletions

View File

@ -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");

View File

@ -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_);
}

View File

@ -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();