2001-10-09 15:20:10 +00:00
|
|
|
/**
|
|
|
|
* \file ControlShowFile.C
|
|
|
|
* Copyright 2001 The LyX Team.
|
|
|
|
* See the file COPYING.
|
|
|
|
*
|
|
|
|
* \author Herbert Voss <voss@perce.de>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
#include <fstream>
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma implementation
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "ViewBase.h"
|
|
|
|
#include "ButtonControllerBase.h"
|
|
|
|
#include "ControlShowFile.h"
|
|
|
|
#include "Dialogs.h"
|
|
|
|
#include "LyXView.h"
|
|
|
|
#include "BufferView.h"
|
|
|
|
#include "gettext.h"
|
|
|
|
#include "support/filetools.h" // FileSearch
|
|
|
|
|
|
|
|
ControlShowFile::ControlShowFile(LyXView & lv, Dialogs & d)
|
2002-01-16 14:47:58 +00:00
|
|
|
: ControlDialogBI(lv, d)
|
2001-10-09 15:20:10 +00:00
|
|
|
{
|
|
|
|
d_.showFile.connect(SigC::slot(this, &ControlShowFile::showFile));
|
|
|
|
}
|
|
|
|
|
|
|
|
void ControlShowFile::showFile(string const & file)
|
|
|
|
{
|
|
|
|
filename_ = file;
|
|
|
|
show();
|
|
|
|
}
|
|
|
|
|
|
|
|
string ControlShowFile::getFileContents()
|
|
|
|
{
|
|
|
|
return GetFileContents(filename_);
|
|
|
|
}
|
|
|
|
|
|
|
|
string ControlShowFile::getFileName()
|
|
|
|
{
|
|
|
|
return OnlyFilename(filename_);
|
|
|
|
}
|