PacketList and ProtoTree need access to MainWindow at initialization

time in order to fill in their respective context menus. R52386 broke
that. Fix it and add comments about handling reparenting. Fixes bug
9265.

svn path=/trunk/; revision=52600
This commit is contained in:
Gerald Combs 2013-10-14 16:54:41 +00:00
parent 1eb36c1119
commit 13c1c9daf7
3 changed files with 6 additions and 6 deletions

View File

@ -178,12 +178,11 @@ MainWindow::MainWindow(QWidget *parent) :
#endif
master_split_.setObjectName(tr("splitterMaster"));
extra_split_.setObjectName(tr("splitterExtra"));
main_ui_->mainStack->addWidget(&master_split_);
empty_pane_.setObjectName(tr("emptyPane"));
empty_pane_.setParent(&master_split_);
packet_list_ = new PacketList(&master_split_);
packet_list_->setParent(&master_split_);
proto_tree_ = new ProtoTree(&master_split_);
proto_tree_->setHeaderHidden(true);
@ -197,11 +196,8 @@ MainWindow::MainWindow(QWidget *parent) :
packet_list_->setByteViewTab(byte_view_tab_);
packet_list_->installEventFilter(this);
main_ui_->mainStack->addWidget(&master_split_);
main_welcome_ = main_ui_->welcomePage;
connect(wsApp, SIGNAL(captureCapturePrepared(capture_session *)),
this, SLOT(captureCapturePrepared(capture_session *)));
connect(wsApp, SIGNAL(captureCaptureUpdateStarted(capture_session *)),

View File

@ -241,6 +241,8 @@ PacketList::PacketList(QWidget *parent) :
setModel(packet_list_model_);
packet_list_model_->setColorEnabled(recent.packet_list_colorize);
// XXX We might want to reimplement setParent() and fill in the context
// menu there.
ctx_menu_.addAction(window()->findChild<QAction *>("actionEditMarkPacket"));
ctx_menu_.addAction(window()->findChild<QAction *>("actionEditIgnorePacket"));
ctx_menu_.addAction(window()->findChild<QAction *>("actionEditSetTimeReference"));

View File

@ -164,6 +164,8 @@ ProtoTree::ProtoTree(QWidget *parent) :
setAccessibleName(tr("Packet details"));
setUniformRowHeights(true);
// XXX We might want to reimplement setParent() and fill in the context
// menu there.
ctx_menu_.addAction(window()->findChild<QAction *>("actionViewExpandSubtrees"));
ctx_menu_.addAction(window()->findChild<QAction *>("actionViewExpandAll"));
ctx_menu_.addAction(window()->findChild<QAction *>("actionViewCollapseAll"));