lyx_mirror/src/frontends/qt4/GuiInfo.cpp

98 lines
1.6 KiB
C++
Raw Normal View History

/**
* \file GuiInfo.cpp
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
* \author Abdelrazak Younes
*
* Full author contact details are available in file CREDITS.
*/
#include <config.h>
#include "GuiInfo.h"
#include "qt_helpers.h"
#include "Buffer.h"
#include "buffer_funcs.h"
#include "BufferParams.h"
#include "BufferView.h"
#include "Cursor.h"
#include "FuncRequest.h"
#include "insets/InsetInfo.h"
#include "support/debug.h"
using namespace std;
namespace lyx {
namespace frontend {
/////////////////////////////////////////////////////////////////
//
// GuiInfo
//
/////////////////////////////////////////////////////////////////
GuiInfo::GuiInfo(GuiView & lv)
: DialogView(lv, "info", qt_("Info"))
{
setupUi(this);
}
void GuiInfo::on_closePB_clicked()
{
hide();
}
void GuiInfo::applyView()
{
InsetInfo * ii = static_cast<InsetInfo *>(inset(INFO_CODE));
if (!ii)
return;
// FIXME: update the inset contents
updateLabels(bufferview()->buffer());
bufferview()->updateMetrics();
bufferview()->buffer().changed();
}
void GuiInfo::updateView()
{
InsetInfo * ii = static_cast<InsetInfo *>(inset(INFO_CODE));
if (!ii) {
// FIXME: A New button to create an InsetInfo at the cursor location
// would be nice.
enableView(false);
return;
}
//FIXME: update the controls.
}
void GuiInfo::enableView(bool enable)
{
//FIXME: enable controls that need enabling.
}
void GuiInfo::dispatchParams()
{
}
Dialog * createGuiInfo(GuiView & lv) { return new GuiInfo(lv); }
} // namespace frontend
} // namespace lyx
#include "GuiInfo_moc.cpp"