further implementation of inverse search

svn path=/trunk/kdegraphics/kdvi/; revision=113404
remotes/origin/kdvi-3.0
Stefan Kebekus 25 years ago
parent 658e07be1c
commit c9c6982ca1
  1. 17
      dviwin.cpp
  2. 10
      kdvi_multipage.cpp
  3. 22
      optiondialog.cpp

@ -288,9 +288,9 @@ void dviWindow::exportPDF(void)
qApp->connect(proc, SIGNAL(receivedStdout(KProcess *, char *, int)), this, SLOT(dvips_output_receiver(KProcess *, char *, int)));
qApp->connect(proc, SIGNAL(processExited(KProcess *)), this, SLOT(dvips_terminated(KProcess *)));
export_errorString = i18n("The external program 'dvipdf', which was used to export the file, reported an error. "
export_errorString = i18n("<qt>The external program 'dvipdf', which was used to export the file, reported an error. "
"You might wish to look at the <strong>document info dialog</strong> which you will "
"find in the File-Menu for a precise error report.") ;
"find in the File-Menu for a precise error report.</qt>") ;
if (info)
@ -952,7 +952,8 @@ void dviWindow::mousePressEvent ( QMouseEvent * e )
QString cp = sourceHyperLinkList[i].linkText;
int max = cp.length();
for(int i=0; i<max; i++)
int i;
for(i=0; i<max; i++)
if (cp[i].isDigit() == false)
break;
@ -1014,12 +1015,14 @@ void dviWindow::mousePressEvent ( QMouseEvent * e )
qApp->connect(proc, SIGNAL(receivedStdout(KProcess *, char *, int)), this, SLOT(dvips_output_receiver(KProcess *, char *, int)));
qApp->connect(proc, SIGNAL(processExited(KProcess *)), this, SLOT(editorCommand_terminated(KProcess *)));
// Merge the editor-specific editor message here.
export_errorString = i18n("The external program, which was used to call the editor for inverse search, reported an error. "
"You might wish to look at the <strong>document info dialog</strong> which you will "
"find in the File-Menu for a precise error report.") ;
export_errorString = i18n("<qt>The external program<br/><br/><nobr><tt>%1</strong></tt><br/></br>which was used to call the editor "
"for inverse search, reported an error. You might wish to look at the <strong>document info "
"dialog</strong> which you will find in the File-Menu for a precise error report. The "
"manual of KDVI contains a detailed explanation how to set up your editor for use with KDVI, "
"and a list of common problems.</qt>").arg(command);
if (info)
info->clear(i18n("Starting the editor... <i>%1</i>").arg(command));
info->clear(i18n("Starting the editor..."));
proc->clearArguments();
*proc << command;

@ -18,7 +18,6 @@
#include <qimage.h>
#include <qpixmap.h>
// #include "../kviewshell/centeringScrollView.h"
#include "fontpool.h"
#include "kviewpart.h"
#include "optiondialog.h"
@ -223,13 +222,10 @@ void KDVIMultiPage::doExportPDF(void)
void KDVIMultiPage::doSettings()
{
if (options) {
options->show();
return;
if (!options) {
options = new OptionDialog(window);
connect(options, SIGNAL(preferencesChanged()), this, SLOT(preferencesChanged()));
}
options = new OptionDialog(window);
connect(options, SIGNAL(preferencesChanged()), this, SLOT(preferencesChanged()));
options->show();
}

@ -84,12 +84,20 @@ OptionDialog::OptionDialog( QWidget *parent, const char *name, bool modal )
mRender.showHyperLinksCheck->setChecked(config->readNumEntry("ShowHyperLinks", 1));
for(unsigned int i=0; i<EditorNames.count(); i++)
mRender.editorChoice->insertItem(EditorNames[i]);
mRender.editorCallingCommand->setText(EditorCommands[0]);
// Missing: Read Entry from config file.
int item = 1;
slotComboBox(item);
// mFont.metafontMode->setCurrentItem( config->readNumEntry( "MetafontMode" , DefaultMFMode ));
}
// Set the proper editor on the "Rendering-Page", try to recognize
// the editor command from the config-file. If the editor command is
// not recognized, switch to "User defined editor". That way, kdvi
// stays compatible even if the EditorCommands[] change between
// different versions of kdvi.
QString currentEditorCommand = config->readEntry( "EditorCommand", "" );
int i;
for(i = EditorCommands.count()-1; i>0; i--)
if (EditorCommands[i] == currentEditorCommand)
break;
if (i == 0)
usersEditorCommand = currentEditorCommand;
slotComboBox(i);
}
void OptionDialog::show()
@ -214,6 +222,7 @@ void OptionDialog::makeRenderingPage()
label = new QLabel( i18n("Editor description:"), page );
glay->addWidget( label, 3, 0 );
// Find the longest description string available, to make sure that
// the page is always large enough. Of course, we are making a
// mistake here, since we use variable-width fonts. Let's hope that
@ -230,6 +239,7 @@ void OptionDialog::makeRenderingPage()
}
kdError() << longest << endl;
mRender.editorDescription = new QLabel( longest, page );
// Do something about minimum size here!
QToolTip::add( mRender.editorDescription, i18n("Explains about the editor's capabilities in conjunction with inverse search.") );
QWhatsThis::add( mRender.editorDescription, i18n("Not all editors are well-suited for inverse search. For instance, many editors have no command like 'If the file is not yet loaded, load it. Otherwise, bring the window with the file to the front'. If you are using an editor like this, clicking into the DVI file will always open a new editor, even if the TeX-file is already open. Likewise, many editors have no command line argument that would allow KDVI to specify the exact line which you wish to edit.\nIf you feel that KDVI's support for a certain editor is not well-done, please write to kebekus@kde.org.") );
glay->addWidget( mRender.editorDescription, 3, 1 );

Loading…
Cancel
Save