w2l toolbar configuration: Enable the use of default applications for viewers
git-svn-id: svn://svn.code.sf.net/p/writer2latex/code/trunk@246 f0f2a975-2e09-46c8-9428-3b39399b9f3c
This commit is contained in:
parent
2953e5845c
commit
88f9974a51
9 changed files with 380 additions and 241 deletions
|
@ -2,6 +2,11 @@ Changelog for Writer2LaTeX version 1.4 -> 1.6
|
|||
|
||||
---------- version 1.5.3 ----------
|
||||
|
||||
[w2l] In the Application dialog in the toolbar configuration it is now possible to select the systems's default
|
||||
application for the viewers. This is now the default, and in most cases this will imply that the toolbar works
|
||||
without configuration. The automatic configuration has been changed to use the default application if it fails
|
||||
to find the dedicated applications.
|
||||
|
||||
[w2l] The Application dialog in the toolbar configuration can now be used to select the behavior after export
|
||||
(do nothing, compile or (default) export, compile and preview)
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
*
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Version 1.6 (2015-05-14)
|
||||
* Version 1.6 (2015-05-19)
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -48,7 +48,7 @@ import org.openoffice.da.comp.w2lcommon.helper.DialogAccess;
|
|||
import org.openoffice.da.comp.w2lcommon.helper.FilePicker;
|
||||
import org.openoffice.da.comp.w2lcommon.helper.StreamGobbler;
|
||||
|
||||
/** This class provides a uno component which implements the configuration
|
||||
/** This class provides a UNO component which implements the configuration
|
||||
* of applications for the Writer2LaTeX toolbar
|
||||
*/
|
||||
public final class ApplicationsDialog
|
||||
|
@ -75,8 +75,9 @@ public final class ApplicationsDialog
|
|||
filePicker = new FilePicker(xContext);
|
||||
}
|
||||
|
||||
// Implement XContainerWindowEventHandler
|
||||
public boolean callHandlerMethod(XWindow xWindow, Object event, String sMethod)
|
||||
// **** Implement XContainerWindowEventHandler
|
||||
|
||||
@Override public boolean callHandlerMethod(XWindow xWindow, Object event, String sMethod)
|
||||
throws com.sun.star.lang.WrappedTargetException {
|
||||
XDialog xDialog = (XDialog)UnoRuntime.queryInterface(XDialog.class, xWindow);
|
||||
DialogAccess dlg = new DialogAccess(xDialog);
|
||||
|
@ -86,11 +87,14 @@ public final class ApplicationsDialog
|
|||
return handleExternalEvent(dlg, event);
|
||||
}
|
||||
else if (sMethod.equals("AfterExportChange")) {
|
||||
return changeBehavior(dlg);
|
||||
return changeProcessingLevel(dlg);
|
||||
}
|
||||
else if (sMethod.equals("ApplicationChange")) {
|
||||
return changeApplication(dlg);
|
||||
}
|
||||
else if (sMethod.equals("UseDefaultChange")) {
|
||||
return useDefaultChange(dlg) && updateApplication(dlg);
|
||||
}
|
||||
else if (sMethod.equals("BrowseClick")) {
|
||||
return browseForExecutable(dlg);
|
||||
}
|
||||
|
@ -113,26 +117,27 @@ public final class ApplicationsDialog
|
|||
return false;
|
||||
}
|
||||
|
||||
public String[] getSupportedMethodNames() {
|
||||
@Override public String[] getSupportedMethodNames() {
|
||||
String[] sNames = { "external_event", "AfterExportChange", "ApplicationChange", "BrowseClick", "ExecutableUnfocus", "OptionsUnfocus", "AutomaticClick" };
|
||||
return sNames;
|
||||
}
|
||||
|
||||
// Implement the interface XServiceInfo
|
||||
public boolean supportsService(String sServiceName) {
|
||||
// **** Implement the interface XServiceInfo
|
||||
|
||||
@Override public boolean supportsService(String sServiceName) {
|
||||
return sServiceName.equals(__serviceName);
|
||||
}
|
||||
|
||||
public String getImplementationName() {
|
||||
@Override public String getImplementationName() {
|
||||
return __implementationName;
|
||||
}
|
||||
|
||||
public String[] getSupportedServiceNames() {
|
||||
@Override public String[] getSupportedServiceNames() {
|
||||
String[] sSupportedServiceNames = { __serviceName };
|
||||
return sSupportedServiceNames;
|
||||
}
|
||||
|
||||
// Private stuff
|
||||
// **** Event handlers
|
||||
|
||||
private boolean handleExternalEvent(DialogAccess dlg, Object aEventObject)
|
||||
throws com.sun.star.uno.Exception {
|
||||
|
@ -143,7 +148,7 @@ public final class ApplicationsDialog
|
|||
return true;
|
||||
} else if (sMethod.equals("back") || sMethod.equals("initialize")) {
|
||||
externalApps.load();
|
||||
updateBehavior(dlg);
|
||||
updateProcessingLevel(dlg);
|
||||
return changeApplication(dlg);
|
||||
}
|
||||
}
|
||||
|
@ -154,12 +159,12 @@ public final class ApplicationsDialog
|
|||
return false;
|
||||
}
|
||||
|
||||
private boolean changeBehavior(DialogAccess dlg) {
|
||||
private boolean changeProcessingLevel(DialogAccess dlg) {
|
||||
externalApps.setProcessingLevel(dlg.getListBoxSelectedItem("AfterExport"));
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean updateBehavior(DialogAccess dlg) {
|
||||
private boolean updateProcessingLevel(DialogAccess dlg) {
|
||||
dlg.setListBoxSelectedItem("AfterExport", externalApps.getProcessingLevel());
|
||||
return true;
|
||||
}
|
||||
|
@ -170,9 +175,22 @@ public final class ApplicationsDialog
|
|||
String[] s = externalApps.getApplication(sAppName);
|
||||
dlg.setComboBoxText("Executable", s[0]);
|
||||
dlg.setComboBoxText("Options", s[1]);
|
||||
dlg.setCheckBoxStateAsBoolean("UseDefault", externalApps.getUseDefaultApplication(sAppName));
|
||||
dlg.setControlEnabled("UseDefault", externalApps.isViewer(sAppName));
|
||||
useDefaultChange(dlg);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean useDefaultChange(DialogAccess dlg) {
|
||||
boolean bCustomApp = !dlg.getCheckBoxStateAsBoolean("UseDefault");
|
||||
dlg.setControlEnabled("ExecutableLabel", bCustomApp);
|
||||
dlg.setControlEnabled("Executable", bCustomApp);
|
||||
dlg.setControlEnabled("OptionsLabel", bCustomApp);
|
||||
dlg.setControlEnabled("Options", bCustomApp);
|
||||
dlg.setControlEnabled("BrowseButton", bCustomApp);
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean browseForExecutable(DialogAccess dlg) {
|
||||
String sPath = filePicker.getPath();
|
||||
|
@ -193,10 +211,205 @@ public final class ApplicationsDialog
|
|||
String sAppName = getSelectedAppName(dlg);
|
||||
if (sAppName!=null) {
|
||||
externalApps.setApplication(sAppName, dlg.getComboBoxText("Executable"), dlg.getComboBoxText("Options"));
|
||||
externalApps.setUseDefaultApplication(sAppName, dlg.getCheckBoxStateAsBoolean("UseDefault"));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean autoConfigure(DialogAccess dlg) {
|
||||
String sOsName = System.getProperty("os.name");
|
||||
String sOsVersion = System.getProperty("os.version");
|
||||
String sOsArch = System.getProperty("os.arch");
|
||||
StringBuilder info = new StringBuilder();
|
||||
info.append("Results of configuration:\n\n");
|
||||
info.append("Your system identifies itself as "+sOsName+" version "+sOsVersion+ " (" + sOsArch +")\n\n");
|
||||
if (sOsName.startsWith("Windows")) {
|
||||
autoConfigureWindows(dlg, info);
|
||||
}
|
||||
else {
|
||||
autoConfigureUnix(dlg, info);
|
||||
}
|
||||
displayAutoConfigInfo(info.toString());
|
||||
changeApplication(dlg);
|
||||
return true;
|
||||
}
|
||||
|
||||
private void displayAutoConfigInfo(String sText) {
|
||||
XDialog xDialog = getDialog("W2LDialogs2.AutoConfigInfo");
|
||||
if (xDialog!=null) {
|
||||
DialogAccess info = new DialogAccess(xDialog);
|
||||
info.setTextFieldText("Info", sText);
|
||||
xDialog.execute();
|
||||
xDialog.endExecute();
|
||||
}
|
||||
}
|
||||
|
||||
private XDialog getDialog(String sDialogName) {
|
||||
XMultiComponentFactory xMCF = xContext.getServiceManager();
|
||||
try {
|
||||
Object provider = xMCF.createInstanceWithContext(
|
||||
"com.sun.star.awt.DialogProvider2", xContext);
|
||||
XDialogProvider2 xDialogProvider = (XDialogProvider2)
|
||||
UnoRuntime.queryInterface(XDialogProvider2.class, provider);
|
||||
String sDialogUrl = "vnd.sun.star.script:"+sDialogName+"?location=application";
|
||||
return xDialogProvider.createDialogWithHandler(sDialogUrl, this);
|
||||
}
|
||||
catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private String getSelectedAppName(DialogAccess dlg) {
|
||||
short nItem = dlg.getListBoxSelectedItem("Application");
|
||||
//String sAppName = null;
|
||||
switch (nItem) {
|
||||
case 0: return ExternalApps.LATEX;
|
||||
case 1: return ExternalApps.PDFLATEX;
|
||||
case 2: return ExternalApps.XELATEX;
|
||||
case 3: return ExternalApps.DVIPS;
|
||||
case 4: return ExternalApps.BIBTEX;
|
||||
case 5: return ExternalApps.MAKEINDEX;
|
||||
//case 6: return ExternalApps.MK4HT;
|
||||
case 6: return ExternalApps.DVIVIEWER;
|
||||
case 7: return ExternalApps.PDFVIEWER;
|
||||
case 8: return ExternalApps.POSTSCRIPTVIEWER;
|
||||
}
|
||||
return "???";
|
||||
}
|
||||
|
||||
// **** Automatic configuration of applications for Windows systems (assuming MikTeX)
|
||||
|
||||
private void autoConfigureWindows(DialogAccess dlg, StringBuilder info) {
|
||||
String sMikTeXPath = getMikTeXPath();
|
||||
|
||||
// Configure TeX and friends + yap (DVi viewer) + TeXworks (PDF viewer)
|
||||
boolean bFoundTexworks = false;
|
||||
if (sMikTeXPath!=null) {
|
||||
info.append("Found MikTeX\n");
|
||||
configureMikTeX(sMikTeXPath, ExternalApps.LATEX, "latex", "--interaction=batchmode %s", info, true);
|
||||
configureMikTeX(sMikTeXPath, ExternalApps.PDFLATEX, "pdflatex", "--interaction=batchmode %s", info, true);
|
||||
configureMikTeX(sMikTeXPath, ExternalApps.XELATEX, "xelatex", "--interaction=batchmode %s", info, true);
|
||||
configureMikTeX(sMikTeXPath, ExternalApps.DVIPS, "dvips", "%s", info, true);
|
||||
configureMikTeX(sMikTeXPath, ExternalApps.BIBTEX, "bibtex", "%s", info, true);
|
||||
configureMikTeX(sMikTeXPath, ExternalApps.MAKEINDEX, "makeindex", "%s", info, true);
|
||||
//configureMikTeX(sMikTeXPath, ExternalApps.MK4HT, "mk4ht", "%c %s", info, true);
|
||||
configureMikTeX(sMikTeXPath, ExternalApps.DVIVIEWER, "yap", "--single-instance %s", info, true);
|
||||
externalApps.setUseDefaultApplication(ExternalApps.DVIVIEWER, false);
|
||||
// MikTeX 2.8 provides texworks for pdf viewing
|
||||
bFoundTexworks = configureMikTeX(sMikTeXPath, ExternalApps.PDFVIEWER, "texworks", "%s", info, true);
|
||||
}
|
||||
else {
|
||||
info.append("Failed to find MikTeX\n");
|
||||
info.append("Writer2LaTeX has been configured to work if MikTeX is added to your path\n");
|
||||
externalApps.setApplication(ExternalApps.LATEX, "latex", "--interaction=batchmode %s");
|
||||
externalApps.setApplication(ExternalApps.PDFLATEX, "pdflatex", "--interaction=batchmode %s");
|
||||
externalApps.setApplication(ExternalApps.XELATEX, "xelatex", "--interaction=batchmode %s");
|
||||
externalApps.setApplication(ExternalApps.DVIPS, "dvips", "%s");
|
||||
externalApps.setApplication(ExternalApps.BIBTEX, "bibtex", "%s");
|
||||
externalApps.setApplication(ExternalApps.MAKEINDEX, "makeindex", "%s");
|
||||
//externalApps.setApplication(ExternalApps.MK4HT, "mk4ht", "%c %s");
|
||||
externalApps.setUseDefaultApplication(ExternalApps.DVIVIEWER, true);
|
||||
}
|
||||
externalApps.setUseDefaultApplication(ExternalApps.PDFVIEWER, !bFoundTexworks);
|
||||
info.append("\n");
|
||||
|
||||
// Configure gsview (PostScript viewer and fall back viewer for PDF)
|
||||
String sGsview = getGsviewPath();
|
||||
if (sGsview!=null) {
|
||||
info.append("Found gsview - OK\n");
|
||||
externalApps.setApplication(ExternalApps.POSTSCRIPTVIEWER, sGsview, "-e \"%s\"");
|
||||
if (!bFoundTexworks) {
|
||||
externalApps.setApplication(ExternalApps.PDFVIEWER, sGsview, "-e \"%s\"");
|
||||
externalApps.setUseDefaultApplication(ExternalApps.PDFVIEWER, false);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (!bFoundTexworks) {
|
||||
info.append("Using default application for PDF\n");
|
||||
}
|
||||
info.append("Using default application for PostScript\n");
|
||||
}
|
||||
externalApps.setUseDefaultApplication(ExternalApps.POSTSCRIPTVIEWER, sGsview!=null);
|
||||
}
|
||||
|
||||
// Windows: Get the path to the MikTeX bin directory
|
||||
private String getMikTeXPath() {
|
||||
String[] sPaths = System.getenv("PATH").split(";");
|
||||
for (String s : sPaths) {
|
||||
if (s.toLowerCase().indexOf("miktex")>-1 && containsExecutable(s,"latex.exe")) {
|
||||
return s;
|
||||
}
|
||||
}
|
||||
for (String s : sPaths) {
|
||||
if (containsExecutable(s,"latex.exe")) {
|
||||
return s;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
// Windows: Get the path to the gsview executable
|
||||
private String getGsviewPath() {
|
||||
String sProgramFiles = System.getenv("ProgramFiles");
|
||||
if (sProgramFiles!=null) {
|
||||
if (containsExecutable(sProgramFiles+"\\ghostgum\\gsview","gsview32.exe")) {
|
||||
return sProgramFiles+"\\ghostgum\\gsview\\gsview32.exe";
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
// Windows: Test that the given path contains a given executable
|
||||
private boolean containsExecutable(String sPath,String sExecutable) {
|
||||
File dir = new File(sPath);
|
||||
if (dir.exists() && dir.canRead()) {
|
||||
File exe = new File(dir,sExecutable);
|
||||
return exe.exists();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Windows: Configure a certain MikTeX application
|
||||
private boolean configureMikTeX(String sPath, String sName, String sAppName, String sArguments, StringBuilder info, boolean bRequired) {
|
||||
File app = new File(new File(sPath),sAppName+".exe");
|
||||
if (app.exists()) {
|
||||
externalApps.setApplication(sName, sAppName, sArguments);
|
||||
info.append(" Found "+sName+": "+sAppName+" - OK\n");
|
||||
return true;
|
||||
}
|
||||
else if (bRequired) {
|
||||
externalApps.setApplication(sName, "???", "???");
|
||||
info.append(" Failed to find "+sName+"\n");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// **** Automatic configuration of applications for other systems (assuming unix-like systems)
|
||||
|
||||
private void autoConfigureUnix(DialogAccess dlg, StringBuilder info) {
|
||||
// Assume that the "which" command is supported
|
||||
configureApp(ExternalApps.LATEX, "latex", "--interaction=batchmode %s",info);
|
||||
configureApp(ExternalApps.PDFLATEX, "pdflatex", "--interaction=batchmode %s",info);
|
||||
configureApp(ExternalApps.XELATEX, "xelatex", "--interaction=batchmode %s",info);
|
||||
configureApp(ExternalApps.DVIPS, "dvips", "%s",info);
|
||||
configureApp(ExternalApps.BIBTEX, "bibtex", "%s",info);
|
||||
configureApp(ExternalApps.MAKEINDEX, "makeindex", "%s",info);
|
||||
//configureApp(ExternalApps.MK4HT, "mk4ht", "%c %s",info);
|
||||
// We have several possible viewers
|
||||
String[] sDviViewers = {"evince", "okular", "xdvi"};
|
||||
configureViewer(ExternalApps.DVIVIEWER, sDviViewers, "%s",info);
|
||||
String[] sPdfViewers = {"evince", "okular", "xpdf"};
|
||||
configureViewer(ExternalApps.PDFVIEWER, sPdfViewers, "%s",info);
|
||||
String[] sPsViewers = {"evince", "okular", "ghostview"};
|
||||
configureViewer(ExternalApps.POSTSCRIPTVIEWER, sPsViewers, "%s",info);
|
||||
|
||||
// Maybe add some info for Debian/Ubuntu users, e.g.
|
||||
// sudo apt-get install texlive
|
||||
// sudo apt-get install texlive-xetex
|
||||
// sudo apt-get install texlive-latex-extra
|
||||
// sudo apt-get install tex4ht
|
||||
}
|
||||
|
||||
// Unix: Test to determine whether a certain application is available in the OS
|
||||
// Requires "which", hence Unix only
|
||||
private boolean hasApp(String sAppName) {
|
||||
|
@ -230,218 +443,39 @@ public final class ApplicationsDialog
|
|||
}
|
||||
}
|
||||
|
||||
// Unix: Configure a certain application testing the availability
|
||||
private boolean configureApp(String sName, String sAppName, String sArguments) {
|
||||
if (hasApp(sAppName)) {
|
||||
externalApps.setApplication(sName, sAppName, sArguments);
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
externalApps.setApplication(sName, "???", "???");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Unix: Configure a certain application, reporting the availability
|
||||
// Unix: Configure a certain application, testing and reporting the availability
|
||||
private boolean configureApp(String sName, String sAppName, String sArguments, StringBuilder info) {
|
||||
if (hasApp(sAppName)) {
|
||||
externalApps.setApplication(sName, sAppName, sArguments);
|
||||
info.append("Found "+sAppName+" - OK\n");
|
||||
externalApps.setUseDefaultApplication(sName, false);
|
||||
if (info!=null) {
|
||||
info.append("Found "+sAppName+" - OK\n");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
externalApps.setApplication(sName, "???", "???");
|
||||
info.append("Failed to find "+sAppName+"\n");
|
||||
externalApps.setUseDefaultApplication(sName, false);
|
||||
if (info!=null) {
|
||||
info.append("Failed to find "+sAppName+"\n");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Unix: Configure a certain application testing the availability
|
||||
// Unix: Configure a certain application, testing and reporting the availability
|
||||
// This variant uses an array of potential apps
|
||||
private boolean configureApp(String sName, String[] sAppNames, String sArguments, StringBuilder info) {
|
||||
private boolean configureViewer(String sName, String[] sAppNames, String sArguments, StringBuilder info) {
|
||||
for (String sAppName : sAppNames) {
|
||||
if (configureApp(sName, sAppName, sArguments)) {
|
||||
if (configureApp(sName, sAppName, sArguments, null)) {
|
||||
info.append("Found "+sName+": "+sAppName+" - OK\n");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
info.append("Failed to find "+sName+"\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
// Windows: Test that the given path contains a given executable
|
||||
private boolean containsExecutable(String sPath,String sExecutable) {
|
||||
File dir = new File(sPath);
|
||||
if (dir.exists() && dir.canRead()) {
|
||||
File exe = new File(dir,sExecutable);
|
||||
return exe.exists();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Windows: Configure a certain MikTeX application
|
||||
private boolean configureMikTeX(String sPath, String sName, String sAppName, String sArguments, StringBuilder info, boolean bRequired) {
|
||||
File app = new File(new File(sPath),sAppName+".exe");
|
||||
if (app.exists()) {
|
||||
externalApps.setApplication(sName, sAppName, sArguments);
|
||||
info.append(" Found "+sName+": "+sAppName+" - OK\n");
|
||||
return true;
|
||||
}
|
||||
else if (bRequired) {
|
||||
externalApps.setApplication(sName, "???", "???");
|
||||
info.append(" Failed to find "+sName+"\n");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Configure the applications automatically (OS dependent)
|
||||
private boolean autoConfigure(DialogAccess dlg) {
|
||||
String sOsName = System.getProperty("os.name");
|
||||
String sOsVersion = System.getProperty("os.version");
|
||||
String sOsArch = System.getProperty("os.arch");
|
||||
StringBuilder info = new StringBuilder();
|
||||
info.append("Results of configuration:\n\n");
|
||||
info.append("Your system identifies itself as "+sOsName+" version "+sOsVersion+ " (" + sOsArch +")\n\n");
|
||||
if (sOsName.startsWith("Windows")) {
|
||||
// Assume MikTeX
|
||||
String sMikTeXPath = null;
|
||||
String[] sPaths = System.getenv("PATH").split(";");
|
||||
for (String s : sPaths) {
|
||||
if (s.toLowerCase().indexOf("miktex")>-1 && containsExecutable(s,"latex.exe")) {
|
||||
sMikTeXPath = s;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (sMikTeXPath==null) {
|
||||
for (String s : sPaths) {
|
||||
if (containsExecutable(s,"latex.exe")) {
|
||||
sMikTeXPath = s;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
boolean bFoundTexworks = false;
|
||||
if (sMikTeXPath!=null) {
|
||||
info.append("Found MikTeX\n");
|
||||
configureMikTeX(sMikTeXPath, ExternalApps.LATEX, "latex", "--interaction=batchmode %s", info, true);
|
||||
configureMikTeX(sMikTeXPath, ExternalApps.PDFLATEX, "pdflatex", "--interaction=batchmode %s", info, true);
|
||||
configureMikTeX(sMikTeXPath, ExternalApps.XELATEX, "xelatex", "--interaction=batchmode %s", info, true);
|
||||
configureMikTeX(sMikTeXPath, ExternalApps.DVIPS, "dvips", "%s", info, true);
|
||||
configureMikTeX(sMikTeXPath, ExternalApps.BIBTEX, "bibtex", "%s", info, true);
|
||||
configureMikTeX(sMikTeXPath, ExternalApps.MAKEINDEX, "makeindex", "%s", info, true);
|
||||
//configureMikTeX(sMikTeXPath, ExternalApps.MK4HT, "mk4ht", "%c %s", info, true);
|
||||
configureMikTeX(sMikTeXPath, ExternalApps.DVIVIEWER, "yap", "--single-instance %s", info, true);
|
||||
// MikTeX 2.8 provides texworks for pdf viewing
|
||||
bFoundTexworks = configureMikTeX(sMikTeXPath, ExternalApps.PDFVIEWER, "texworks", "%s", info, true);
|
||||
}
|
||||
else {
|
||||
info.append("Failed to find MikTeX\n");
|
||||
info.append("Writer2LaTeX has been configured to work if MikTeX is added to your path\n");
|
||||
externalApps.setApplication(ExternalApps.LATEX, "latex", "--interaction=batchmode %s");
|
||||
externalApps.setApplication(ExternalApps.PDFLATEX, "pdflatex", "--interaction=batchmode %s");
|
||||
externalApps.setApplication(ExternalApps.XELATEX, "xelatex", "--interaction=batchmode %s");
|
||||
externalApps.setApplication(ExternalApps.DVIPS, "dvips", "%s");
|
||||
externalApps.setApplication(ExternalApps.BIBTEX, "bibtex", "%s");
|
||||
externalApps.setApplication(ExternalApps.MAKEINDEX, "makeindex", "%s");
|
||||
//externalApps.setApplication(ExternalApps.MK4HT, "mk4ht", "%c %s");
|
||||
externalApps.setApplication(ExternalApps.DVIVIEWER, "yap", "--single-instance %s");
|
||||
}
|
||||
info.append("\n");
|
||||
|
||||
// Assume gsview for pdf and ps
|
||||
String sGsview = null;
|
||||
String sProgramFiles = System.getenv("ProgramFiles");
|
||||
if (sProgramFiles!=null) {
|
||||
if (containsExecutable(sProgramFiles+"\\ghostgum\\gsview","gsview32.exe")) {
|
||||
sGsview = sProgramFiles+"\\ghostgum\\gsview\\gsview32.exe";
|
||||
}
|
||||
}
|
||||
|
||||
if (sGsview!=null) {
|
||||
info.append("Found gsview - OK\n");
|
||||
}
|
||||
else {
|
||||
info.append("Failed to find gsview\n");
|
||||
sGsview = "gsview32.exe"; // at least this helps a bit..
|
||||
}
|
||||
if (!bFoundTexworks) {
|
||||
externalApps.setApplication(ExternalApps.PDFVIEWER, sGsview, "-e \"%s\"");
|
||||
}
|
||||
externalApps.setApplication(ExternalApps.POSTSCRIPTVIEWER, sGsview, "-e \"%s\"");
|
||||
|
||||
}
|
||||
else { // Assume a Unix-like system supporting the "which" command
|
||||
configureApp(ExternalApps.LATEX, "latex", "--interaction=batchmode %s",info);
|
||||
configureApp(ExternalApps.PDFLATEX, "pdflatex", "--interaction=batchmode %s",info);
|
||||
configureApp(ExternalApps.XELATEX, "xelatex", "--interaction=batchmode %s",info);
|
||||
configureApp(ExternalApps.DVIPS, "dvips", "%s",info);
|
||||
configureApp(ExternalApps.BIBTEX, "bibtex", "%s",info);
|
||||
configureApp(ExternalApps.MAKEINDEX, "makeindex", "%s",info);
|
||||
//configureApp(ExternalApps.MK4HT, "mk4ht", "%c %s",info);
|
||||
// We have several possible viewers
|
||||
String[] sDviViewers = {"evince", "okular", "xdvi"};
|
||||
configureApp(ExternalApps.DVIVIEWER, sDviViewers, "%s",info);
|
||||
String[] sPdfViewers = {"evince", "okular", "xpdf"};
|
||||
configureApp(ExternalApps.PDFVIEWER, sPdfViewers, "%s",info);
|
||||
String[] sPsViewers = {"evince", "okular", "ghostview"};
|
||||
configureApp(ExternalApps.POSTSCRIPTVIEWER, sPsViewers, "%s",info);
|
||||
|
||||
}
|
||||
// Maybe add some info for Ubuntu users
|
||||
// sudo apt-get install texlive
|
||||
// sudo apt-get install texlive-xetex
|
||||
// sudo apt-get install texlive-latex-extra
|
||||
// sudo apt-get install tex4ht
|
||||
displayAutoConfigInfo(info.toString());
|
||||
changeApplication(dlg);
|
||||
return true;
|
||||
}
|
||||
|
||||
private String getSelectedAppName(DialogAccess dlg) {
|
||||
short nItem = dlg.getListBoxSelectedItem("Application");
|
||||
//String sAppName = null;
|
||||
switch (nItem) {
|
||||
case 0: return ExternalApps.LATEX;
|
||||
case 1: return ExternalApps.PDFLATEX;
|
||||
case 2: return ExternalApps.XELATEX;
|
||||
case 3: return ExternalApps.DVIPS;
|
||||
case 4: return ExternalApps.BIBTEX;
|
||||
case 5: return ExternalApps.MAKEINDEX;
|
||||
//case 6: return ExternalApps.MK4HT;
|
||||
case 6: return ExternalApps.DVIVIEWER;
|
||||
case 7: return ExternalApps.PDFVIEWER;
|
||||
case 8: return ExternalApps.POSTSCRIPTVIEWER;
|
||||
}
|
||||
return "???";
|
||||
}
|
||||
|
||||
private XDialog getDialog(String sDialogName) {
|
||||
XMultiComponentFactory xMCF = xContext.getServiceManager();
|
||||
try {
|
||||
Object provider = xMCF.createInstanceWithContext(
|
||||
"com.sun.star.awt.DialogProvider2", xContext);
|
||||
XDialogProvider2 xDialogProvider = (XDialogProvider2)
|
||||
UnoRuntime.queryInterface(XDialogProvider2.class, provider);
|
||||
String sDialogUrl = "vnd.sun.star.script:"+sDialogName+"?location=application";
|
||||
return xDialogProvider.createDialogWithHandler(sDialogUrl, this);
|
||||
}
|
||||
catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private void displayAutoConfigInfo(String sText) {
|
||||
XDialog xDialog = getDialog("W2LDialogs2.AutoConfigInfo");
|
||||
if (xDialog!=null) {
|
||||
DialogAccess info = new DialogAccess(xDialog);
|
||||
info.setTextFieldText("Info", sText);
|
||||
xDialog.execute();
|
||||
xDialog.endExecute();
|
||||
}
|
||||
externalApps.setUseDefaultApplication(sName, true);
|
||||
info.append("Using default application as "+sName+"\n");
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -20,18 +20,21 @@
|
|||
*
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Version 1.6 (2015-05-14)
|
||||
* Version 1.6 (2015-05-19)
|
||||
*
|
||||
*/
|
||||
|
||||
package org.openoffice.da.comp.writer2latex;
|
||||
|
||||
import java.awt.Desktop;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.lang.Process;
|
||||
import java.lang.ProcessBuilder;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.Vector;
|
||||
|
||||
import org.openoffice.da.comp.w2lcommon.helper.RegistryHelper;
|
||||
|
@ -72,14 +75,17 @@ public class ExternalApps {
|
|||
|
||||
private short nLevel = (short)2;
|
||||
|
||||
private HashMap<String,String[]> apps;
|
||||
private Map<String,String[]> apps;
|
||||
private Set<String> defaultApps;
|
||||
|
||||
/** Construct a new ExternalApps object, with empty definitions */
|
||||
/** Construct a new ExternalApps object with empty content */
|
||||
public ExternalApps(XComponentContext xContext) {
|
||||
this.xContext = xContext;
|
||||
apps = new HashMap<String,String[]>();
|
||||
defaultApps = new HashSet<String>();
|
||||
for (int i=0; i<sApps.length; i++) {
|
||||
setApplication(sApps[i], "?", "?");
|
||||
setApplication(sApps[i], "", "");
|
||||
setUseDefaultApplication(sApps[i],true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -98,6 +104,10 @@ public class ExternalApps {
|
|||
public short getProcessingLevel() {
|
||||
return nLevel;
|
||||
}
|
||||
|
||||
public boolean isViewer(String sAppName) {
|
||||
return sAppName!=null && sAppName.endsWith("Viewer");
|
||||
}
|
||||
|
||||
/** Define an external application
|
||||
* @param sAppName the name of the application to define
|
||||
|
@ -109,28 +119,71 @@ public class ExternalApps {
|
|||
String[] sValue = { sExecutable, sOptions };
|
||||
apps.put(sAppName, sValue);
|
||||
}
|
||||
|
||||
|
||||
/** Get the definition for an external application
|
||||
* @param sAppName the name of the application to get
|
||||
* @return a String array containing the system dependent path to the
|
||||
* executable file as entry 0, and the parameters as entry 1
|
||||
* executable file as entry 0 and the parameters as entry 1
|
||||
* returns null if the application is unknown
|
||||
*/
|
||||
public String[] getApplication(String sAppName) {
|
||||
return apps.get(sAppName);
|
||||
}
|
||||
|
||||
/** Define to use the system's default for an external application. This is only possible if the application is a viewer,
|
||||
* otherwise setting the value to true will be ignored
|
||||
* @param sAppName the name of the application
|
||||
* @param sUseDefault flag defining whether or not to use the default
|
||||
*/
|
||||
public void setUseDefaultApplication(String sAppName, boolean bUseDefault) {
|
||||
if (bUseDefault && isViewer(sAppName)) {
|
||||
defaultApps.add(sAppName);
|
||||
}
|
||||
else if (defaultApps.contains(sAppName)) {
|
||||
defaultApps.remove(sAppName);
|
||||
}
|
||||
}
|
||||
|
||||
/** Get the setting to use the system's default application
|
||||
*
|
||||
* @param sAppName the name of the application
|
||||
* @return true if the system's default should be used, false if not or if the application is unknown
|
||||
*/
|
||||
public boolean getUseDefaultApplication(String sAppName) {
|
||||
return defaultApps.contains(sAppName);
|
||||
}
|
||||
|
||||
/** Execute an external application
|
||||
* @param sAppName the name of the application to execute
|
||||
* @param sAppName the name of the application to execute (ignored for default apps)
|
||||
* @param sFileName the file name to use
|
||||
* @param workDir the working directory to use
|
||||
* @param env map of environment variables to set (or null if no variables needs to be set)
|
||||
* @param bWaitFor true if the method should wait for the execution to finish
|
||||
* @param env map of environment variables to set (or null if no variables needs to be set, ignored for default apps)
|
||||
* @param bWaitFor true if the method should wait for the execution to finish (ignored for default apps)
|
||||
* @return error code
|
||||
*/
|
||||
public int execute(String sAppName, String sFileName, File workDir, Map<String,String> env, boolean bWaitFor) {
|
||||
return execute(sAppName, "", sFileName, workDir, env, bWaitFor);
|
||||
if (defaultApps.contains(sAppName)) {
|
||||
return openWithDefaultApplication(new File(sFileName)) ? 0 : 1;
|
||||
}
|
||||
else {
|
||||
return execute(sAppName, "", sFileName, workDir, env, bWaitFor);
|
||||
}
|
||||
}
|
||||
|
||||
// Open the file in the default application on this system (if any)
|
||||
private boolean openWithDefaultApplication(File file) {
|
||||
if (Desktop.isDesktopSupported()) {
|
||||
Desktop desktop = Desktop.getDesktop();
|
||||
try {
|
||||
desktop.open(file);
|
||||
return true;
|
||||
} catch (IOException e) {
|
||||
System.err.println(e.getMessage());
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/** Execute an external application
|
||||
* @param sAppName the name of the application to execute
|
||||
|
@ -204,12 +257,14 @@ public class ExternalApps {
|
|||
XMultiHierarchicalPropertySet xProps = (XMultiHierarchicalPropertySet)
|
||||
UnoRuntime.queryInterface(XMultiHierarchicalPropertySet.class, view);
|
||||
for (int i=0; i<sApps.length; i++) {
|
||||
String[] sNames = new String[2];
|
||||
String[] sNames = new String[3];
|
||||
sNames[0] = sApps[i]+"/Executable";
|
||||
sNames[1] = sApps[i]+"/Options";
|
||||
sNames[2] = sApps[i]+"/UseDefault";
|
||||
try {
|
||||
Object[] values = xProps.getHierarchicalPropertyValues(sNames);
|
||||
setApplication(sApps[i], (String) values[0], (String) values[1]);
|
||||
setUseDefaultApplication(sApps[i], ((Boolean) values[2]).booleanValue());
|
||||
}
|
||||
catch (com.sun.star.uno.Exception e) {
|
||||
// Ignore...
|
||||
|
@ -238,12 +293,15 @@ public class ExternalApps {
|
|||
XMultiHierarchicalPropertySet xProps = (XMultiHierarchicalPropertySet)
|
||||
UnoRuntime.queryInterface(XMultiHierarchicalPropertySet.class, view);
|
||||
for (int i=0; i<sApps.length; i++) {
|
||||
String[] sNames = new String[2];
|
||||
String[] sNames = new String[3];
|
||||
sNames[0] = sApps[i]+"/Executable";
|
||||
sNames[1] = sApps[i]+"/Options";
|
||||
String[] sValues = getApplication(sApps[i]);
|
||||
sNames[2] = sApps[i]+"/UseDefault";
|
||||
String[] sApp = getApplication(sApps[i]);
|
||||
boolean bUseDefault = getUseDefaultApplication(sApps[i]);
|
||||
Object[] values = { sApp[0], sApp[1], new Boolean(bUseDefault) };
|
||||
try {
|
||||
xProps.setHierarchicalPropertyValues(sNames, sValues);
|
||||
xProps.setHierarchicalPropertyValues(sNames, values);
|
||||
}
|
||||
catch (com.sun.star.uno.Exception e) {
|
||||
// Ignore...
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
*
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Version 1.6 (2015-05-12)
|
||||
* Version 1.6 (2015-05-19)
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -33,7 +33,7 @@ public class ConverterFactory {
|
|||
|
||||
// Version information
|
||||
private static final String VERSION = "1.5.3";
|
||||
private static final String DATE = "2015-05-15";
|
||||
private static final String DATE = "2015-05-19";
|
||||
|
||||
/** Return the Writer2LaTeX version in the form
|
||||
* (major version).(minor version).(patch level)<br/>
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<templates>
|
||||
<group oor:name="Application">
|
||||
<prop oor:name="UseDefault" oor:type="xs:boolean" />
|
||||
<prop oor:name="Executable" oor:type="xs:string" />
|
||||
<prop oor:name="Options" oor:type="xs:string" />
|
||||
</group>
|
||||
|
|
|
@ -9,6 +9,9 @@
|
|||
<value>2</value><!-- compile and preview -->
|
||||
</prop>
|
||||
<node oor:name="LaTeX" oor:type="xs:string">
|
||||
<prop oor:name="UseDefault">
|
||||
<value>false</value>
|
||||
</prop>
|
||||
<prop oor:name="Executable">
|
||||
<value>latex</value>
|
||||
</prop>
|
||||
|
@ -17,6 +20,9 @@
|
|||
</prop>
|
||||
</node>
|
||||
<node oor:name="PdfLaTeX" oor:type="xs:string">
|
||||
<prop oor:name="UseDefault">
|
||||
<value>false</value>
|
||||
</prop>
|
||||
<prop oor:name="Executable">
|
||||
<value>pdflatex</value>
|
||||
</prop>
|
||||
|
@ -25,6 +31,9 @@
|
|||
</prop>
|
||||
</node>
|
||||
<node oor:name="XeLaTeX" oor:type="xs:string">
|
||||
<prop oor:name="UseDefault">
|
||||
<value>false</value>
|
||||
</prop>
|
||||
<prop oor:name="Executable">
|
||||
<value>xelatex</value>
|
||||
</prop>
|
||||
|
@ -33,6 +42,9 @@
|
|||
</prop>
|
||||
</node>
|
||||
<node oor:name="BibTeX" oor:type="xs:string">
|
||||
<prop oor:name="UseDefault">
|
||||
<value>false</value>
|
||||
</prop>
|
||||
<prop oor:name="Executable">
|
||||
<value>bibtex</value>
|
||||
</prop>
|
||||
|
@ -41,6 +53,9 @@
|
|||
</prop>
|
||||
</node>
|
||||
<node oor:name="Makeindex" oor:type="xs:string">
|
||||
<prop oor:name="UseDefault">
|
||||
<value>false</value>
|
||||
</prop>
|
||||
<prop oor:name="Executable">
|
||||
<value>makeindex</value>
|
||||
</prop>
|
||||
|
@ -49,6 +64,9 @@
|
|||
</prop>
|
||||
</node>
|
||||
<node oor:name="Mk4ht" oor:type="xs:string">
|
||||
<prop oor:name="UseDefault">
|
||||
<value>false</value>
|
||||
</prop>
|
||||
<prop oor:name="Executable">
|
||||
<value>mk4ht</value>
|
||||
</prop>
|
||||
|
@ -57,6 +75,9 @@
|
|||
</prop>
|
||||
</node>
|
||||
<node oor:name="Dvips" oor:type="xs:string">
|
||||
<prop oor:name="UseDefault">
|
||||
<value>true</value>
|
||||
</prop>
|
||||
<prop oor:name="Executable">
|
||||
<value>dvips</value>
|
||||
</prop>
|
||||
|
@ -65,6 +86,9 @@
|
|||
</prop>
|
||||
</node>
|
||||
<node oor:name="DVIViewer" oor:type="xs:string">
|
||||
<prop oor:name="UseDefault">
|
||||
<value>true</value>
|
||||
</prop>
|
||||
<prop oor:name="Executable">
|
||||
<value>evince</value>
|
||||
</prop>
|
||||
|
@ -73,6 +97,9 @@
|
|||
</prop>
|
||||
</node>
|
||||
<node oor:name="PostscriptViewer" oor:type="xs:string">
|
||||
<prop oor:name="UseDefault">
|
||||
<value>true</value>
|
||||
</prop>
|
||||
<prop oor:name="Executable">
|
||||
<value>evince</value>
|
||||
</prop>
|
||||
|
@ -81,6 +108,9 @@
|
|||
</prop>
|
||||
</node>
|
||||
<node oor:name="PdfViewer" oor:type="xs:string">
|
||||
<prop oor:name="UseDefault">
|
||||
<value>true</value>
|
||||
</prop>
|
||||
<prop oor:name="Executable">
|
||||
<value>evince</value>
|
||||
</prop>
|
||||
|
|
|
@ -28,18 +28,23 @@
|
|||
</dlg:menupopup>
|
||||
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.UNO:ApplicationChange" script:language="UNO"/>
|
||||
</dlg:menulist>
|
||||
<dlg:text dlg:id="ExecutableLabel" dlg:tab-index="5" dlg:left="12" dlg:top="46" dlg:width="55" dlg:height="12" dlg:value="Executable"/>
|
||||
<dlg:textfield dlg:id="Executable" dlg:tab-index="6" dlg:left="72" dlg:top="44" dlg:width="120" dlg:height="12" dlg:help-url="org.openoffice.da.writer2latex.oxt:ConfigurationExecutable">
|
||||
|
||||
<dlg:checkbox dlg:id="UseDefault" dlg:tab-index="5" dlg:left="12" dlg:top="46" dlg:width="240" dlg:height="12" dlg:help-url="org.openoffice.da.writer2latex.oxt:UseDefault" dlg:value="Use the system's default application" dlg:checked="false">
|
||||
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.UNO:UseDefaultChange" script:language="UNO"/>
|
||||
</dlg:checkbox>
|
||||
|
||||
<dlg:text dlg:id="ExecutableLabel" dlg:tab-index="6" dlg:left="12" dlg:top="60" dlg:width="55" dlg:height="12" dlg:value="Executable"/>
|
||||
<dlg:textfield dlg:id="Executable" dlg:tab-index="7" dlg:left="72" dlg:top="58" dlg:width="120" dlg:height="12" dlg:help-url="org.openoffice.da.writer2latex.oxt:ConfigurationExecutable">
|
||||
<script:event script:event-name="on-blur" script:macro-name="vnd.sun.star.UNO:ExecutableUnfocus" script:language="UNO"/>
|
||||
</dlg:textfield>
|
||||
<dlg:button dlg:id="BrowseButton" dlg:tab-index="7" dlg:left="200" dlg:top="44" dlg:width="55" dlg:height="14" dlg:value="Browse...">
|
||||
<dlg:button dlg:id="BrowseButton" dlg:tab-index="8" dlg:left="200" dlg:top="58" dlg:width="55" dlg:height="14" dlg:value="Browse...">
|
||||
<script:event script:event-name="on-mouseup" script:macro-name="vnd.sun.star.UNO:BrowseClick" script:language="UNO"/>
|
||||
</dlg:button>
|
||||
<dlg:text dlg:id="OptionsLabel" dlg:tab-index="8" dlg:left="12" dlg:top="60" dlg:width="55" dlg:height="12" dlg:value="Options"/>
|
||||
<dlg:textfield dlg:id="Options" dlg:tab-index="9" dlg:left="72" dlg:top="58" dlg:width="120" dlg:height="12" dlg:help-url="org.openoffice.da.writer2latex.oxt:ConfigurationOptions">
|
||||
<dlg:text dlg:id="OptionsLabel" dlg:tab-index="9" dlg:left="12" dlg:top="74" dlg:width="55" dlg:height="12" dlg:value="Options"/>
|
||||
<dlg:textfield dlg:id="Options" dlg:tab-index="10" dlg:left="72" dlg:top="72" dlg:width="120" dlg:height="12" dlg:help-url="org.openoffice.da.writer2latex.oxt:ConfigurationOptions">
|
||||
<script:event script:event-name="on-blur" script:macro-name="vnd.sun.star.UNO:OptionsUnfocus" script:language="UNO"/>
|
||||
</dlg:textfield>
|
||||
<dlg:button dlg:id="AutoButton" dlg:tab-index="10" dlg:left="72" dlg:top="78" dlg:width="120" dlg:height="14" dlg:value="Automatic configuration" dlg:help-url="org.openoffice.da.writer2latex.oxt:ConfigurationAutoButton">
|
||||
<dlg:button dlg:id="AutoButton" dlg:tab-index="11" dlg:left="72" dlg:top="92" dlg:width="120" dlg:height="14" dlg:value="Automatic configuration" dlg:help-url="org.openoffice.da.writer2latex.oxt:ConfigurationAutoButton">
|
||||
<script:event script:event-name="on-mouseup" script:macro-name="vnd.sun.star.UNO:AutomaticClick" script:language="UNO"/>
|
||||
</dlg:button>
|
||||
</dlg:bulletinboard>
|
||||
|
|
|
@ -4,11 +4,11 @@
|
|||
<dlg:bulletinboard>
|
||||
<dlg:text dlg:id="BibliographyLabel" dlg:tab-index="0" dlg:left="6" dlg:top="4" dlg:width="244" dlg:height="12" dlg:value="Citations and BibTeX files"/>
|
||||
|
||||
<dlg:checkbox dlg:id="UseExternalBibTeXFiles" dlg:tab-index="1" dlg:left="10" dlg:top="18" dlg:width="240" dlg:height="12" dlg:help-url="org.openoffice.da.writer2latex.oxt:BibliographyUseExternalBibTeXFiles" dlg:value="Use BibTeX as bibliography database" dlg:checked="false">
|
||||
<dlg:checkbox dlg:id="UseExternalBibTeXFiles" dlg:tab-index="1" dlg:left="12" dlg:top="18" dlg:width="240" dlg:height="12" dlg:help-url="org.openoffice.da.writer2latex.oxt:BibliographyUseExternalBibTeXFiles" dlg:value="Use BibTeX as bibliography database" dlg:checked="false">
|
||||
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.UNO:UseExternalBibTeXFilesChange" script:language="UNO"/>
|
||||
</dlg:checkbox>
|
||||
|
||||
<dlg:text dlg:id="BibTeXLocationLabel" dlg:tab-index="2" dlg:left="10" dlg:top="32" dlg:width="55" dlg:height="12" dlg:value="BibTeX location"/>
|
||||
<dlg:text dlg:id="BibTeXLocationLabel" dlg:tab-index="2" dlg:left="12" dlg:top="32" dlg:width="55" dlg:height="12" dlg:value="BibTeX location"/>
|
||||
<dlg:menulist dlg:id="BibTeXLocation" dlg:tab-index="3" dlg:left="70" dlg:top="30" dlg:width="180" dlg:height="12" dlg:help-url="org.openoffice.da.writer2latex.oxt:BibliographyBibTeXLocation" dlg:spin="true" dlg:linecount="3">
|
||||
<dlg:menupopup>
|
||||
<dlg:menuitem dlg:value="In central folder"/>
|
||||
|
@ -18,29 +18,29 @@
|
|||
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.UNO:BibTeXLocationChange" script:language="UNO"/>
|
||||
</dlg:menulist>
|
||||
|
||||
<dlg:text dlg:id="BibTeXDirLabel" dlg:tab-index="4" dlg:left="10" dlg:top="46" dlg:width="55" dlg:height="12" dlg:value="BibTeX folder"/>
|
||||
<dlg:text dlg:id="BibTeXDirLabel" dlg:tab-index="4" dlg:left="12" dlg:top="46" dlg:width="55" dlg:height="12" dlg:value="BibTeX folder"/>
|
||||
<dlg:textfield dlg:id="BibTeXDir" dlg:tab-index="5" dlg:left="70" dlg:top="44" dlg:width="130" dlg:height="12" dlg:help-url="org.openoffice.da.writer2latex.oxt:BibliographyBibTeXDir"/>
|
||||
<dlg:button dlg:id="BibTeXDirButton" dlg:tab-index="6" dlg:left="210" dlg:top="44" dlg:width="40" dlg:height="12" dlg:help-url="org.openoffice.da.writer2latex.oxt:BibliographyBibTeXDirButton" dlg:value="Browse...">
|
||||
<script:event script:event-name="on-mouseup" script:macro-name="vnd.sun.star.UNO:BibTeXDirClick" script:language="UNO"/>
|
||||
</dlg:button>
|
||||
|
||||
<dlg:checkbox dlg:id="ConvertZoteroCitations" dlg:tab-index="7" dlg:left="10" dlg:top="60" dlg:width="240" dlg:height="12" dlg:help-url="org.openoffice.da.writer2latex.oxt:BibliographyConvertZoteroCitations" dlg:value="Convert Zotero citations" dlg:checked="false">
|
||||
<dlg:checkbox dlg:id="ConvertZoteroCitations" dlg:tab-index="7" dlg:left="12" dlg:top="60" dlg:width="240" dlg:height="12" dlg:help-url="org.openoffice.da.writer2latex.oxt:BibliographyConvertZoteroCitations" dlg:value="Convert Zotero citations" dlg:checked="false">
|
||||
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.UNO:ConvertZoteroCitationsChange" script:language="UNO"/>
|
||||
</dlg:checkbox>
|
||||
|
||||
<dlg:checkbox dlg:id="ConvertJabRefCitations" dlg:tab-index="8" dlg:left="10" dlg:top="74" dlg:width="240" dlg:height="12" dlg:help-url="org.openoffice.da.writer2latex.oxt:BibliographyConvertJabRefCitations" dlg:value="Convert JabRef citations" dlg:checked="false">
|
||||
<dlg:checkbox dlg:id="ConvertJabRefCitations" dlg:tab-index="8" dlg:left="12" dlg:top="74" dlg:width="240" dlg:height="12" dlg:help-url="org.openoffice.da.writer2latex.oxt:BibliographyConvertJabRefCitations" dlg:value="Convert JabRef citations" dlg:checked="false">
|
||||
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.UNO:ConvertJabRefCitationsChange" script:language="UNO"/>
|
||||
</dlg:checkbox>
|
||||
|
||||
<dlg:checkbox dlg:id="IncludeOriginalCitations" dlg:tab-index="9" dlg:left="10" dlg:top="88" dlg:width="240" dlg:height="12" dlg:help-url="org.openoffice.da.writer2latex.oxt:BibliographyIncludeOriginalCitations" dlg:value="Include original citations as comments" dlg:checked="false"/>
|
||||
<dlg:checkbox dlg:id="IncludeOriginalCitations" dlg:tab-index="9" dlg:left="12" dlg:top="88" dlg:width="240" dlg:height="12" dlg:help-url="org.openoffice.da.writer2latex.oxt:BibliographyIncludeOriginalCitations" dlg:value="Include original citations as comments" dlg:checked="false"/>
|
||||
|
||||
<dlg:text dlg:id="NatbibLabel" dlg:tab-index="10" dlg:left="6" dlg:top="102" dlg:width="244" dlg:height="11" dlg:value="Natbib"/>
|
||||
|
||||
<dlg:checkbox dlg:id="UseNatbib" dlg:tab-index="11" dlg:left="10" dlg:top="116" dlg:width="240" dlg:height="12" dlg:help-url="org.openoffice.da.writer2latex.oxt:BibliographyUseNatbib" dlg:value="Use natbib.sty" dlg:checked="false">
|
||||
<dlg:checkbox dlg:id="UseNatbib" dlg:tab-index="11" dlg:left="12" dlg:top="116" dlg:width="240" dlg:height="12" dlg:help-url="org.openoffice.da.writer2latex.oxt:BibliographyUseNatbib" dlg:value="Use natbib.sty" dlg:checked="false">
|
||||
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.UNO:UseNatbibChange" script:language="UNO"/>
|
||||
</dlg:checkbox>
|
||||
|
||||
<dlg:text dlg:id="NatbibOptionsLabel" dlg:tab-index="12" dlg:left="19" dlg:top="130" dlg:width="45" dlg:height="12" dlg:value="Options"/>
|
||||
<dlg:text dlg:id="NatbibOptionsLabel" dlg:tab-index="12" dlg:left="22" dlg:top="130" dlg:width="45" dlg:height="12" dlg:value="Options"/>
|
||||
|
||||
<dlg:textfield dlg:id="NatbibOptions" dlg:tab-index="13" dlg:left="70" dlg:top="128" dlg:width="180" dlg:height="12" dlg:help-url="org.openoffice.da.writer2latex.oxt:BibliographyNatbibOptions"/>
|
||||
</dlg:bulletinboard>
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
<body>
|
||||
<bookmark xml-lang="en-US" branch="hid/org.openoffice.da.writer2latex.oxt:ConfigurationDialog" id="bm_configurationdialog"/>
|
||||
<paragraph role="heading" level="1" xml-lang="en-US">Configuration of applications</paragraph>
|
||||
<paragraph role="paragraph" xml-lang="en-US">Before you can use Writer2LaTeX you must configure it to use your LaTeX
|
||||
distribution as well as viewers for the different output formats.</paragraph>
|
||||
<paragraph role="paragraph" xml-lang="en-US">On this page you can configure the interaction between Writer2LaTeX
|
||||
and your LaTeX distribution as well as viewers for the different output formats.</paragraph>
|
||||
<section id="howtoget" xml-lang="en-US">
|
||||
Select <emph>Tools - Options - Writer2LaTeX toolbar - Applications</emph>
|
||||
</section>
|
||||
|
@ -88,7 +88,7 @@
|
|||
<paragraph role="heading" level="2" xml-lang="en-US">Automatic Configuration</paragraph>
|
||||
<paragraph role="paragraph" xml-lang="en-US">If you click this button, Writer2LaTeX will try to locate the external programs
|
||||
and configure them. You will be presented with a short report of the results. Any applications that Writer2LaTeX cannot find for
|
||||
you must be configured manually.</paragraph>
|
||||
you should be configured manually.</paragraph>
|
||||
<paragraph role="paragraph" xml-lang="en-US"><ahelp hid="org.openoffice.da.writer2latex.oxt:ConfigurationAutoButton" visibility="hidden">Click here to let Writer2LaTeX configure your external applications automatically</ahelp></paragraph>
|
||||
|
||||
<bookmark xml-lang="en-US" branch="hid/org.openoffice.da.writer2latex.oxt:ConfigurationApplication" id="bm_configurationapplication"/>
|
||||
|
@ -123,6 +123,12 @@
|
|||
</list>
|
||||
<paragraph role="paragraph" xml-lang="en-US"><ahelp hid="org.openoffice.da.writer2latex.oxt:ConfigurationApplication" visibility="hidden">Select the external application you wish to configure here</ahelp></paragraph>
|
||||
|
||||
<bookmark xml-lang="en-US" branch="hid/org.openoffice.da.writer2latex.oxt:UseDefault" id="bm_configurationusedefault"/>
|
||||
<paragraph role="heading" level="2" xml-lang="en-US">Use the system's default application</paragraph>
|
||||
<paragraph role="paragraph" xml-lang="en-US">Select this if you wish to use the default application to view files
|
||||
of the selected type.</paragraph>
|
||||
<paragraph role="paragraph" xml-lang="en-US"><ahelp hid="org.openoffice.da.writer2latex.oxt:UseDefault" visibility="hidden">Select this to use the default application to view files of the selected type</ahelp></paragraph>
|
||||
|
||||
<bookmark xml-lang="en-US" branch="hid/org.openoffice.da.writer2latex.oxt:ConfigurationExecutable" id="bm_configurationexecutable"/>
|
||||
<paragraph role="heading" level="2" xml-lang="en-US">Executable</paragraph>
|
||||
<paragraph role="paragraph" xml-lang="en-US">Type the full path to the executable or click <emph>Browse</emph> to find
|
||||
|
|
Loading…
Add table
Reference in a new issue