Move the log trigger menu item into it's own menu, and remove the menu when unloading the plugin.

--HG--
branch : gsoc2014-dfighter
This commit is contained in:
dfighter1985 2014-06-09 17:55:45 +02:00
parent d4ee31ed63
commit a86605f8d8
2 changed files with 8 additions and 2 deletions

View file

@ -45,6 +45,7 @@ namespace Plugin
CLogPlugin::CLogPlugin(QWidget *parent): QDockWidget(parent)
{
m_ui.setupUi(this);
logMenu = NULL;
}
CLogPlugin::~CLogPlugin()
@ -63,6 +64,9 @@ namespace Plugin
NLMISC::InfoLog->removeDisplayer(m_displayer);
delete m_displayer;
delete logMenu;
logMenu = NULL;
delete m_libContext;
m_libContext = NULL;
}
@ -82,13 +86,13 @@ namespace Plugin
Core::ICore *core = Core::ICore::instance();
Core::MenuManager *menuManager = core->menuManager();
QMenu *viewMenu = menuManager->menu(Core::Constants::M_VIEW);
QMainWindow *wnd = Core::ICore::instance()->mainWindow();
wnd->addDockWidget(Qt::RightDockWidgetArea, this);
hide();
viewMenu->addAction(this->toggleViewAction());
logMenu = menuManager->menuBar()->addMenu( "Log" );
logMenu->addAction(toggleViewAction());
}
void CLogPlugin::setNelContext(NLMISC::INelContext *nelContext)

View file

@ -85,6 +85,8 @@ namespace Plugin
NLQT::CQtDisplayer *m_displayer;
QMenu *logMenu;
};
} // namespace Plugin