Hi,

1) first patch to enable Layout->Preamble
2) second patch: to
        a) eliminate a crash on Layout->Preamble->Edit->Cancel (a NULL point
er was assigned to a string)
        b) adds 'xterm -e ' when calling the editor from $EDITOR

Hope it's of some use, Alfredo
Index: Dialogs2.C
===================================================================
RCS file: /cvs/lyx/lyx-devel/src/frontends/qt2/Dialogs2.C,v
retrieving revision 1.16
diff -u -r1.16 Dialogs2.C
--- Dialogs2.C	2002/12/01 22:59:18	1.16
+++ Dialogs2.C	2002/12/09 17:54:11
@@ -172,7 +172,7 @@
 
 void Dialogs::showPreamble()
 {
-	// FIXME
+	pimpl_->preamble.controller().show();
 }
Index: QPreambleDialog.C
===================================================================
RCS file: /cvs/lyx/lyx-devel/src/frontends/qt2/QPreambleDialog.C,v
retrieving revision 1.10
diff -u -r1.10 QPreambleDialog.C
--- QPreambleDialog.C	2002/11/27 10:30:23	1.10
+++ QPreambleDialog.C	2002/12/09 21:03:35
@@ -65,14 +65,18 @@
 	string editor = GetEnv("EDITOR");
 	if (editor.empty()) {
 		static string lastentry;
-		editor = QInputDialog::getText(
-			_("Enter editor program"), _("Editor"), QLineEdit::Normal,
-			lastentry.c_str()).latin1();
+		char const *aux=QInputDialog::getText(
+			_("Enter editor program"), _("Editor"), 
+			QLineEdit::Normal,lastentry.c_str()).latin1();
+		if(!aux) 
+			return;
+		editor=aux;
 		if (editor.empty())
 			return;
 		lastentry = editor;
+	} else {
+		editor = "xterm -e " + editor;
 	}
-
 	string const text(preambleLE->text().latin1());
 	string const filename(lyx::tempName("", "preamble"));
 	std::ofstream file(filename.c_str());

Reply via email to