> > Did you test it? If so, I need another OK to proceed.
> >
> It seems to work here, yes.
JMarc,
Can I apply the attached patch to the branch? If you do not like the
name change (Load->Edit) because of translation, documentation etc, I
can fix the crash in branch, and apply the full patch to trunk.
Cheers,
Bo
Index: src/frontends/qt4/QInclude.cpp
===================================================================
--- src/frontends/qt4/QInclude.cpp (revision 19344)
+++ src/frontends/qt4/QInclude.cpp (working copy)
@@ -56,7 +56,7 @@
connect(visiblespaceCB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
connect(filenameED, SIGNAL(textChanged(const QString &)),
this, SLOT(change_adaptor()));
- connect(loadPB, SIGNAL(clicked()), this, SLOT(loadClicked()));
+ connect(editPB, SIGNAL(clicked()), this, SLOT(editClicked()));
connect(browsePB, SIGNAL(clicked()), this, SLOT(browseClicked()));
connect(typeCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
connect(typeCO, SIGNAL(activated(int)), this, SLOT(typeChanged(int)));
@@ -168,9 +168,9 @@
}
-void QIncludeDialog::loadClicked()
+void QIncludeDialog::editClicked()
{
- form_->load();
+ form_->edit();
}
@@ -336,12 +336,12 @@
}
-void QInclude::load()
+void QInclude::edit()
{
if (isValid()) {
string const file = fromqstr(dialog_->filenameED->text());
slotOK();
- controller().load(file);
+ controller().edit(file);
}
}
Index: src/frontends/qt4/ui/IncludeUi.ui
===================================================================
--- src/frontends/qt4/ui/IncludeUi.ui (revision 19344)
+++ src/frontends/qt4/ui/IncludeUi.ui (working copy)
@@ -331,12 +331,12 @@
</widget>
</item>
<item row="1" column="4" >
- <widget class="QPushButton" name="loadPB" >
+ <widget class="QPushButton" name="editPB" >
<property name="toolTip" >
- <string>Load the file</string>
+ <string>Edit the file</string>
</property>
<property name="text" >
- <string>&Load</string>
+ <string>&Edit</string>
</property>
</widget>
</item>
@@ -346,7 +346,7 @@
<tabstop>filenameED</tabstop>
<tabstop>browsePB</tabstop>
<tabstop>typeCO</tabstop>
- <tabstop>loadPB</tabstop>
+ <tabstop>editPB</tabstop>
<tabstop>visiblespaceCB</tabstop>
<tabstop>previewCB</tabstop>
<tabstop>captionLE</tabstop>
Index: src/frontends/qt4/QInclude.h
===================================================================
--- src/frontends/qt4/QInclude.h (revision 19344)
+++ src/frontends/qt4/QInclude.h (working copy)
@@ -35,7 +35,7 @@
docstring validate_listings_params();
protected Q_SLOTS:
virtual void change_adaptor();
- virtual void loadClicked();
+ virtual void editClicked();
virtual void browseClicked();
virtual void typeChanged(int v);
/// AFAIK, QValidator only works for QLineEdit so
@@ -70,8 +70,9 @@
/// build the dialog
virtual void build_dialog();
- /// load the file
- void load();
+ /// edit the child document, .lyx file will be opened in lyx
+ /// other formats will be edited by external applications.
+ void edit();
/// browse for a file
void browse();
Index: src/frontends/controllers/ControlInclude.cpp
===================================================================
--- src/frontends/controllers/ControlInclude.cpp (revision 19344)
+++ src/frontends/controllers/ControlInclude.cpp (working copy)
@@ -100,14 +100,14 @@
}
-void ControlInclude::load(string const & file)
+void ControlInclude::edit(string const & file)
{
string const ext = support::getExtension(file);
if (ext == "lyx")
kernel().dispatch(FuncRequest(LFUN_BUFFER_CHILD_OPEN, file));
else
// tex file or other text file in verbatim mode
- formats.edit(kernel().buffer(), FileName(file), "text");
+ formats.edit(kernel().buffer(), FileName(makeAbsPath(file, onlyPath(kernel().buffer().fileName()))), "text");
}
Index: src/frontends/controllers/ControlInclude.h
===================================================================
--- src/frontends/controllers/ControlInclude.h (revision 19344)
+++ src/frontends/controllers/ControlInclude.h (working copy)
@@ -58,8 +58,9 @@
/// Browse for a file
docstring const browse(docstring const &, Type) const;
- /// load a file
- void load(std::string const & file);
+ /// edit the child document, .lyx file will be opened in lyx
+ /// other formats will be edited by external applications.
+ void edit(std::string const & file);
/// test if file exist
bool fileExists(std::string const & file);
Index: status.15x
===================================================================
--- status.15x (revision 19344)
+++ status.15x (working copy)
@@ -38,7 +38,10 @@
* USER INTERFACE:
+- Fix loading non-lyx child documents with relative path names, change
+ 'Load' to 'Edit' in the child document dialog. (Bug 4107 and 4111)
+
* DOCUMENTATION