/*
Copyright (C) 2006 Evan Teran
                   eteran@alum.rit.edu

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/

#include "References.h"
#include "DialogReferences.h"
#include "Debugger.h"
#include <QMenu>

//------------------------------------------------------------------------------
// Name: 
// Desc: 
//------------------------------------------------------------------------------
References::References() : m_Menu(0), m_Dialog(0) {
}

//------------------------------------------------------------------------------
// Name: 
// Desc: 
//------------------------------------------------------------------------------
References::~References() {
	delete m_Menu;
	delete m_Dialog;
}

//------------------------------------------------------------------------------
// Name: 
// Desc: 
//------------------------------------------------------------------------------
QMenu *References::menu(QWidget *parent) {

	if(m_Menu == 0) {
		m_Menu = new QMenu("Reference Searcher", parent);
		m_Menu->addAction ("&Reference Search", this, SLOT(doMenu()), QKeySequence("Ctrl+R"));
	}
	
	return m_Menu;
}

//------------------------------------------------------------------------------
// Name: 
// Desc: 
//------------------------------------------------------------------------------
void References::doMenu() {

	if(m_Dialog == 0) {
		m_Dialog = new DialogReferences(edb::v1::debuggerUI);
	}
	
	m_Dialog->show();
}

Q_EXPORT_PLUGIN2(References, References)
