initpath = trypath;
}
- FileDialog fileDlg(bv_->owner(),
- _("Select LyX document to insert"),
+ FileDialog fileDlg(_("Select LyX document to insert"),
LFUN_FILE_INSERT,
make_pair(string(_("Documents|#o#O")),
string(lyxrc.document_path)),
+2003-02-21 Angus Leeming <leeming@lyx.org>
+
+ * BufferView_pimpl.C (MenuInsertLyXFile):
+ * lyx_cb.C (WriteAs, getContentsOfAsciiFile):
+ * lyxfunc.C (menuNew, open, doImport):
+ no longer pass a LyXView & to fileDlg.
+
2003-02-21 Angus Leeming <leeming@lyx.org>
* BufferView_pimpl.C: replace insetbib.h with insetbibtex.h.
* Dialogs.h: remove forward declarations of InsetBibKey, InsetBibtex.
+ * FileDialog.h: don't pass LyXView to the c-tor.
+ Don't store a LyXView &.
+
2003-02-14 John Levon <levon@movementarian.org>
* LyXView.h: prohibit/allowInput() -> busy(bool)
#include "LString.h"
-class LyXView;
-
/**
* \class FileDialog
* \brief GUI-I definition of file dialog interface
typedef std::pair<FileDialog::ResultType, string> Result;
/**
- * Constructs a file dialog attached to LyXView \param lv, with
- * title \param title. If \param a is \const LFUN_SELECT_FILE_SYNC
- * then a value will be returned immediately upon performing a open(),
+ * Constructs a file dialog with title \param title.
+ * If \param a is \const LFUN_SELECT_FILE_SYNC then a value
+ * will be returned immediately upon performing a open(),
* otherwise a callback Dispatch() will be invoked with the filename as
* argument, of action \param a.
*
* additional directories in the navigation (an empty
* directory is interpreted as getcwd())
*/
- FileDialog(LyXView * lv, string const & title,
+ FileDialog(string const & title,
kb_action a = LFUN_SELECT_FILE_SYNC,
Button b1 = Button(string(), string()),
Button b2 = Button(string(), string()));
Private * private_;
private:
- /// our LyXView
- LyXView * lv_;
-
/// the dialog title
string title_;
+2003-02-21 Angus Leeming <leeming@lyx.org>
+
+ * ControlBibtex.C (Browse):
+ * ControlExternal.C (Browse):
+ * ControlGraphics.C (Browse):
+ * ControlInclude.C (Browse):
+ * ControlPrefs.C (browsebind, browseUI, browsekbmap, browsedict,
+ browse, browsedir):
+ * ControlPrint.C (Browse):
+ don't pass a LyXView & to browseFile et al.
+ * helper_funcs.[Ch] (browseFile, browseRelFile, browseDir):
+ don't pass a LyXView & to fileDlg.
+
2003-02-17 John Levon <levon@movementarian.org>
* ControlDialog.tmpl: build dialog before calling setParams
{
pair<string, string> dir1(_("Documents|#o#O"),
string(lyxrc.document_path));
- return browseRelFile(&lv_, in_name, buffer()->filePath(),
+ return browseRelFile(in_name, buffer()->filePath(),
title, pattern, false, dir1);
}
std::pair<string, string> dir1(N_("Documents|#o#O"),
string(lyxrc.document_path));
- return browseRelFile(&lv_, input, bufpath, title, pattern, false, dir1);
+ return browseRelFile(input, bufpath, title, pattern, false, dir1);
}
pair<string, string> dir1(_("Clipart|#C#c"), clipdir);
pair<string, string> dir2(_("Documents|#o#O"), string(lyxrc.document_path));
// Show the file browser dialog
- return browseRelFile(&lv_, in_name, buffer()->filePath(),
+ return browseRelFile(in_name, buffer()->filePath(),
title, "*.*", false, dir1, dir2);
}
string const docpath = OnlyPath(params().masterFilename_);
- return browseRelFile(&lv_, in_name, docpath, title, pattern, false, dir1);
+ return browseRelFile(in_name, docpath, title, pattern, false, dir1);
}
name = _("User Bind|#U#u");
pair<string,string> dir2(name, dir);
- return browseFile(&lv_, file, _("Choose bind file"), "*.bind", false, dir1, dir2);
+ return browseFile(file, _("Choose bind file"), "*.bind", false, dir1, dir2);
}
name = _("User UI|#U#u");
pair<string,string> dir2(name, dir);
- return browseFile(&lv_, file, _("Choose UI file"), "*.ui", false, dir1, dir2);
+ return browseFile(file, _("Choose UI file"), "*.ui", false, dir1, dir2);
}
string const name = _("Key maps|#K#k");
pair<string, string> dir1(name, dir);
- return browseFile(&lv_, file, _("Choose keyboard map"), "*.kmap", false, dir1);
+ return browseFile(file, _("Choose keyboard map"), "*.kmap", false, dir1);
}
string const ControlPrefs::browsedict(string const & file)
{
- return browseFile(&lv_, file, _("Choose personal dictionary"), "*.ispell");
+ return browseFile(file, _("Choose personal dictionary"), "*.ispell");
}
string const ControlPrefs::browse(string const & file, string const & title)
{
- return browseFile(&lv_, file, title, "*", true);
+ return browseFile(file, title, "*", true);
}
string const ControlPrefs::browsedir(string const & path, string const & title)
{
- return browseDir(&lv_, path, title);
+ return browseDir(path, title);
}
string const pattern = "*.ps";
// Show the file browser dialog
- return browseRelFile(&lv_, in_name, buffer()->filePath(),
+ return browseRelFile(in_name, buffer()->filePath(),
title, pattern, true);
}
using std::make_pair;
-string const browseFile(LyXView * lv, string const & filename,
+string const browseFile(string const & filename,
string const & title,
string const & pattern,
bool save,
if (!filename.empty())
lastPath = OnlyPath(filename);
- FileDialog fileDlg(lv, title, LFUN_SELECT_FILE_SYNC, dir1, dir2);
+ FileDialog fileDlg(title, LFUN_SELECT_FILE_SYNC, dir1, dir2);
FileDialog::Result result;
}
-string const browseRelFile(LyXView * lv, string const & filename,
+string const browseRelFile(string const & filename,
string const & refpath,
string const & title,
string const & pattern,
{
string const fname = MakeAbsPath(filename, refpath);
- string const outname = browseFile(lv, fname, title, pattern, save,
+ string const outname = browseFile(fname, title, pattern, save,
dir1, dir2);
string const reloutname = MakeRelPath(outname, refpath);
if (prefixIs(reloutname, "../"))
}
-string const browseDir(LyXView * lv, string const & pathname,
+string const browseDir(string const & pathname,
string const & title,
pair<string,string> const & dir1,
pair<string,string> const & dir2)
if (!pathname.empty())
lastPath = OnlyPath(pathname);
- FileDialog fileDlg(lv, title, LFUN_SELECT_FILE_SYNC, dir1, dir2);
+ FileDialog fileDlg(title, LFUN_SELECT_FILE_SYNC, dir1, dir2);
FileDialog::Result result;
#include <utility> // pair
#include <vector> // pair
-class LyXView;
-
/** Launch a file dialog and return the chosen file.
filename: a suggested filename.
title: the title of the dialog.
dir1 = (name, dir), dir2 = (name, dir): extra buttons on the dialog.
*/
string const
-browseFile(LyXView * lv, string const & filename,
+browseFile(string const & filename,
string const & title,
string const & pattern,
bool save = false,
intended to be useful for insets which encapsulate files/
*/
string const
-browseRelFile(LyXView * lv, string const & filename,
+browseRelFile(string const & filename,
string const & refpath,
string const & title,
string const & pattern,
dir1 = (name, dir), dir2 = (name, dir): extra buttons on the dialog.
*/
string const
-browseDir(LyXView * lv, string const & pathname,
+browseDir(string const & pathname,
string const & title,
std::pair<string,string> const & dir1 =
std::make_pair(string(), string()),
+2003-02-21 Angus Leeming <leeming@lyx.org>
+
+ * FileDialog.C (FileDialog): no need for LyXView *.
+
2003-02-14 John Levon <levon@movementarian.org>
* FileDialog.C: remove spurious allow/prohibitInput()
// FileDialog
-FileDialog::FileDialog(LyXView * lv, string const & title, kb_action a,
+FileDialog::FileDialog(string const & title, kb_action a,
Button /*b1*/, Button /*b2*/)
: private_(new Private(title))
- , lv_(lv), title_(title), success_(a)
+ , title_(title), success_(a)
{
private_->set_modal(LFUN_SELECT_FILE_SYNC == a);
}
+2003-02-21 Angus Leeming <leeming@lyx.org>
+
+ * FileDialog.C (FileDialog): no need for LyXView *.
+
2003-02-17 John Levon <levon@movementarian.org>
* QSpellchecker.h:
};
-FileDialog::FileDialog(LyXView * lv, string const & t,
+FileDialog::FileDialog(string const & t,
kb_action s, Button b1, Button b2)
- : private_(new FileDialog::Private), lv_(lv), title_(t), success_(s)
+ : private_(new FileDialog::Private), title_(t), success_(s)
{
private_->b1 = b1;
private_->b2 = b2;
result.second = string(dlg.selectedFile().data());
dlg.hide();
return result;
-}
\ No newline at end of file
+}
+2003-02-21 Angus Leeming <leeming@lyx.org>
+
+ * FileFialog.C (c-tor): no longer receives a LyXView &, nor passes
+ it to the Provate c-tor.
+ * FormFiledialog.[Ch] (c-tor): no longer receives a LyXView &.
+ Dialogs::redrawGUI is a static member, so can reference it without
+ a specific instance.
+
2003-02-17 John Levon <levon@movementarian.org>
* FormSpellchecker.h:
using std::pair;
using std::endl;
-FileDialog::FileDialog(LyXView *lv, string const &t, kb_action s, Button b1, Button b2)
- : private_(0), lv_(lv), title_(t), success_(s)
+FileDialog::FileDialog(string const &t, kb_action s, Button b1, Button b2)
+ : private_(0), title_(t), success_(s)
{
- private_ = new FileDialog::Private(lv->getDialogs());
+ private_ = new FileDialog::Private();
private_->SetButton(0, b1.first, b1.second);
private_->SetButton(1, b2.first, b2.second);
}
-FileDialog::Private::Private(Dialogs & dia)
+FileDialog::Private::Private()
{
directory_ = MakeAbsPath(string("."));
mask_ = '*';
fl_hide_object(file_dlg_form_->User1);
fl_hide_object(file_dlg_form_->User2);
- r_ = dia.redrawGUI().connect(boost::bind(&FileDialog::Private::redraw, this));
+ r_ = Dialogs::redrawGUI().connect(boost::bind(&FileDialog::Private::redraw, this));
}
class FileDialog::Private : public boost::signals::trackable {
public:
///
- Private(Dialogs &);
+ Private();
///
~Private();
if (filename.empty()) {
- FileDialog fileDlg(bv->owner(),
- _("Choose a filename to save document as"),
+ FileDialog fileDlg(_("Choose a filename to save document as"),
LFUN_WRITEAS,
make_pair(string(_("Documents|#o#O")),
string(lyxrc.document_path)),
string fname = f;
if (fname.empty()) {
- FileDialog fileDlg(bv->owner(), _("Select file to insert"),
+ FileDialog fileDlg(_("Select file to insert"),
(asParagraph) ? LFUN_FILE_INSERT_ASCII_PARA : LFUN_FILE_INSERT_ASCII);
FileDialog::Result result = fileDlg.open(bv->owner()->buffer()->filePath());
// The template stuff
string templname;
if (fromTemplate) {
- FileDialog fileDlg(owner, _("Select template file"),
+ FileDialog fileDlg(_("Select template file"),
LFUN_SELECT_FILE_SYNC,
make_pair(string(_("Documents|#o#O")),
string(lyxrc.document_path)),
string filename;
if (fname.empty()) {
- FileDialog fileDlg(owner, _("Select document to open"),
+ FileDialog fileDlg(_("Select document to open"),
LFUN_FILE_OPEN,
make_pair(string(_("Documents|#o#O")),
string(lyxrc.document_path)),
+ _(" file to import");;
#endif
- FileDialog fileDlg(owner, text,
+ FileDialog fileDlg(text,
LFUN_IMPORT,
make_pair(string(_("Documents|#o#O")),
string(lyxrc.document_path)),