src/CutAndPaste.C
src/debug.C
src/exporter.C
-src/ext_l10n.h
src/figure_form.C
src/figureForm.C
src/FontLoader.C
src/frontends/qt2/QSearch.C
src/frontends/qt2/QSpellchecker.C
src/frontends/qt2/QTabularCreate.C
+src/frontends/qt2/QTexinfo.C
src/frontends/qt2/QThesaurus.C
src/frontends/qt2/QToc.C
src/frontends/qt2/QURL.C
2002-01-20 Herbert Voss <voss@perce.de>
+ * ControlInclude.[Ch]: better control of unexistings files
+ when entered without the browser
+
* ControlGraphic.C (Browse): add extension "ps" when browsing for
a filename
#include "ControlInclude.h"
#include "ControlInset.tmpl"
#include "buffer.h"
+#include "Alert.h"
#include "BufferView.h"
#include "Dialogs.h"
#include "LyXView.h"
{
lv_.getLyXFunc()->dispatch(LFUN_CHILDOPEN, file);
}
+
+
+bool const ControlInclude::fileExists(string const & file)
+{
+ string const fileWithAbsPath = MakeAbsPath(file, OnlyPath(params().masterFilename_));
+ if (IsFileReadable(fileWithAbsPath))
+ return true;
+ else
+ Alert::alert(_("File doesn't exists!"));
+ return false;
+}
+
/// load a file
void load(string const & file);
+ /// test if file exist
+ bool const fileExists(string const & file);
+
private:
/// Dispatch the changed parameters to the kernel.
virtual void applyParamsToInset();
+2002-01-20 Herbert Voss <voss@perce.de>
+
+ * FormInclude.[C]: better control of unexistings files
+ when entered without the browser
+
2002-01-20 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
* Toolbar_pimpl.C (update): disable layout combox when LFUN_LAYOUT
{
controller().params().noload = fl_get_button(dialog_->check_typeset);
- controller().params().cparams.
- setContents(fl_get_input(dialog_->input_filename));
+ string const file = fl_get_input(dialog_->input_filename);
+ if (controller().fileExists(file))
+ controller().params().cparams.setContents(file);
+ else
+ controller().params().cparams.setContents("");
if (fl_get_button(dialog_->check_useinput))
controller().params().flag = InsetInclude::INPUT;
} else if (ob == dialog_->button_load) {
string const in_name = fl_get_input(dialog_->input_filename);
- if (!strip(in_name).empty()) {
- ApplyButton();
+ if (!strip(in_name).empty() && controller().fileExists(in_name)) {
+// ApplyButton();
+ OKButton();
controller().load(strip(in_name));
action = ButtonPolicy::SMI_NOOP;
}