2006-03-05 17:24:44 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
2007-08-31 05:53:55 +00:00
|
|
|
* \file GuiLog.h
|
2006-03-05 17:24:44 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
|
|
|
* \author John Levon
|
2007-10-06 11:45:53 +00:00
|
|
|
* \author Angus Leeming
|
2006-03-05 17:24:44 +00:00
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
#ifndef GUILOG_H
|
|
|
|
#define GUILOG_H
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
#include "GuiDialog.h"
|
2007-08-11 15:48:15 +00:00
|
|
|
#include "ui_LogUi.h"
|
2007-04-24 19:37:34 +00:00
|
|
|
|
2007-10-06 11:45:53 +00:00
|
|
|
#include "support/FileName.h"
|
|
|
|
|
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
namespace lyx {
|
|
|
|
namespace frontend {
|
|
|
|
|
2007-04-24 19:37:34 +00:00
|
|
|
class LogHighlighter;
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2007-10-09 19:34:27 +00:00
|
|
|
class GuiLog : public GuiDialog, public Ui::LogUi
|
2006-03-05 17:24:44 +00:00
|
|
|
{
|
2007-09-05 20:33:29 +00:00
|
|
|
Q_OBJECT
|
2007-10-06 11:45:53 +00:00
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
public:
|
2007-11-23 09:44:02 +00:00
|
|
|
GuiLog(GuiView & lv);
|
2007-10-06 11:45:53 +00:00
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
private Q_SLOTS:
|
2020-10-01 10:42:11 +03:00
|
|
|
void updateContents() override;
|
2009-06-18 09:35:51 +00:00
|
|
|
/// find content
|
|
|
|
void find();
|
|
|
|
/// jump to next error message
|
|
|
|
void on_nextErrorPB_clicked();
|
|
|
|
/// jump to next warning
|
|
|
|
void on_nextWarningPB_clicked();
|
2015-11-02 18:19:40 +00:00
|
|
|
/// open containing directory
|
|
|
|
void on_openDirPB_clicked();
|
2009-11-29 17:15:22 +00:00
|
|
|
/// Log type changed
|
|
|
|
void typeChanged(int);
|
2007-10-06 11:45:53 +00:00
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
private:
|
|
|
|
/// Apply changes
|
2020-10-01 10:42:11 +03:00
|
|
|
void applyView() override {}
|
2007-09-05 20:33:29 +00:00
|
|
|
|
2007-03-26 04:25:49 +00:00
|
|
|
/// log syntax highlighter
|
2007-04-24 19:37:34 +00:00
|
|
|
LogHighlighter * highlighter;
|
2007-10-06 11:45:53 +00:00
|
|
|
|
|
|
|
/** \param data should contain "<logtype> <logfile>"
|
|
|
|
* where <logtype> is one of "latex", "literate", "lyx2lyx", "vc".
|
|
|
|
*/
|
2020-10-01 10:42:11 +03:00
|
|
|
bool initialiseParams(std::string const & data) override;
|
2007-10-06 11:45:53 +00:00
|
|
|
///
|
2020-10-01 10:42:11 +03:00
|
|
|
void clearParams() override;
|
2007-10-06 11:45:53 +00:00
|
|
|
///
|
2020-10-01 10:42:11 +03:00
|
|
|
void dispatchParams() override {}
|
2007-10-06 11:45:53 +00:00
|
|
|
///
|
2020-10-01 10:42:11 +03:00
|
|
|
bool isBufferDependent() const override { return true; }
|
2007-10-06 11:45:53 +00:00
|
|
|
|
|
|
|
/// The title displayed by the dialog reflects the \c LogType
|
|
|
|
docstring title() const;
|
|
|
|
/// put the log file into the ostream
|
|
|
|
void getContents(std::ostream & ss) const;
|
Allow compiling with Qt6
This commit allows compiling LyX with Qt6 when using autotools.
For a successful compilation the following 2 conditions must be met.
1) The Qt6 qmake has to come first in PATH, so that the command
"qmake -v | grep -o 'Qt version .'" returns "Qt version 6".
2) The --enable-qt6 switch has to be passed to the configure command.
If --enable-qt6 is used but Qt6 is not found, Qt5 is tried as a fallback.
If also Qt5 is not found, configuring for Qt4 is attempted.
If --enable-qt6 is not used, then things go as usual. This means that Qt5
is tried first and then Qt4, unless --disable-qt5 is used, in which case
Qt4 is directly attempted. This means that existing scripts should
continue working unmodified.
LyX should compile with Qt6 on windows and linux, and possibly also on
mac, but I could not test that. However, it is not guaranteed that it
works as it should. In particular I am not sure that I got right the
conversion from QRegExp to QRegularExpression. For sure, the syntax
highlighting seems to not work right. Someone in the know should take
a look at that. I am able to load documents and compile them but some
thourough testing is needed. However, when compiling for Qt5 or Qt4,
I tried to make sure that the functionality is preserved.
2021-03-15 17:09:09 +01:00
|
|
|
#if QT_VERSION < 0x060000
|
Run codespell on src/frontends
Command was:
codespell -w -i 3 -S Makefile.in -L mathed,afe,tthe,ue,fro,uint,larg,alph,te,thes,alle,Claus,pres,pass-thru src/frontends/
2020-06-26 00:04:31 +02:00
|
|
|
/// go to the next occurrence of the RegExp
|
2009-06-18 09:35:51 +00:00
|
|
|
void goTo(QRegExp const & exp) const;
|
|
|
|
/// does the document after cursor position contain the RegExp?
|
|
|
|
bool contains(QRegExp const & exp) const;
|
Allow compiling with Qt6
This commit allows compiling LyX with Qt6 when using autotools.
For a successful compilation the following 2 conditions must be met.
1) The Qt6 qmake has to come first in PATH, so that the command
"qmake -v | grep -o 'Qt version .'" returns "Qt version 6".
2) The --enable-qt6 switch has to be passed to the configure command.
If --enable-qt6 is used but Qt6 is not found, Qt5 is tried as a fallback.
If also Qt5 is not found, configuring for Qt4 is attempted.
If --enable-qt6 is not used, then things go as usual. This means that Qt5
is tried first and then Qt4, unless --disable-qt5 is used, in which case
Qt4 is directly attempted. This means that existing scripts should
continue working unmodified.
LyX should compile with Qt6 on windows and linux, and possibly also on
mac, but I could not test that. However, it is not guaranteed that it
works as it should. In particular I am not sure that I got right the
conversion from QRegExp to QRegularExpression. For sure, the syntax
highlighting seems to not work right. Someone in the know should take
a look at that. I am able to load documents and compile them but some
thourough testing is needed. However, when compiling for Qt5 or Qt4,
I tried to make sure that the functionality is preserved.
2021-03-15 17:09:09 +01:00
|
|
|
#else
|
|
|
|
/// go to the next occurrence of the RegExp
|
|
|
|
void goTo(QRegularExpression const & exp) const;
|
|
|
|
/// does the document after cursor position contain the RegExp?
|
|
|
|
bool contains(QRegularExpression const & exp) const;
|
|
|
|
#endif
|
2007-10-06 11:45:53 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
/// Recognized log file-types
|
|
|
|
enum LogType {
|
|
|
|
LatexLog,
|
|
|
|
LiterateLog,
|
|
|
|
Lyx2lyxLog,
|
|
|
|
VCLog
|
|
|
|
};
|
|
|
|
|
|
|
|
LogType type_;
|
|
|
|
support::FileName logfile_;
|
2007-03-26 04:25:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|
|
|
|
|
2007-10-06 11:45:53 +00:00
|
|
|
#endif // GUILOG_H
|