X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt4%2FGuiLog.h;h=2a9ebb6e7a44d5233b2da13c9bd643bc1f7aa5d9;hb=425d092204118ea6c24c28e85fdf03fcf2bb51a4;hp=430c1e3f3615959177bd80b12f050bb89a2bcd28;hpb=fc36725282df43059aee9a821f098309ccdbd523;p=lyx.git diff --git a/src/frontends/qt4/GuiLog.h b/src/frontends/qt4/GuiLog.h index 430c1e3f36..2a9ebb6e7a 100644 --- a/src/frontends/qt4/GuiLog.h +++ b/src/frontends/qt4/GuiLog.h @@ -5,6 +5,7 @@ * Licence details can be found in the file COPYING. * * \author John Levon + * \author Angus Leeming * * Full author contact details are available in file CREDITS. */ @@ -12,77 +13,79 @@ #ifndef GUILOG_H #define GUILOG_H -#include "GuiDialogView.h" -#include "ControlLog.h" +#include "GuiDialog.h" #include "ui_LogUi.h" -#include -#include +#include "support/FileName.h" + namespace lyx { namespace frontend { -class GuiLog; - -class GuiLogDialog : public QDialog, public Ui::LogUi { - Q_OBJECT -public: - GuiLogDialog(GuiLog * form); -protected Q_SLOTS: - virtual void updateClicked(); -protected: - virtual void closeEvent(QCloseEvent * e); -private: - GuiLog * form_; -}; - - -class ControlLog; class LogHighlighter; -/// -class GuiLog : public GuiView +class GuiLog : public GuiDialog, public Ui::LogUi { + Q_OBJECT + public: - /// - friend class GuiLogDialog; - /// - GuiLog(Dialog &); - /// parent controller - ControlLog & controller() - { return static_cast(this->getController()); } - /// parent controller - ControlLog const & controller() const - { return static_cast(this->getController()); } + GuiLog(GuiView & lv); + +private Q_SLOTS: + void updateContents(); + /// copy log to clipboard + void on_copyPB_clicked(); + /// find content + void find(); + /// jump to next error message + void on_nextErrorPB_clicked(); + /// jump to next warning + void on_nextWarningPB_clicked(); + /// Log type changed + void typeChanged(int); + private: /// Apply changes - virtual void apply() {} - /// update - virtual void update_contents(); - /// build the dialog - virtual void build_dialog(); + void applyView() {} + /// log syntax highlighter LogHighlighter * highlighter; -}; - -/// -class LogHighlighter : public QSyntaxHighlighter -{ -public: - LogHighlighter(QTextDocument * parent); + /** \param data should contain " " + * where is one of "latex", "literate", "lyx2lyx", "vc". + */ + bool initialiseParams(std::string const & data); + /// + void clearParams(); + /// + void dispatchParams() {} + /// + bool isBufferDependent() const { return true; } -protected: - void highlightBlock(QString const & text); + /// 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; + /// go to the next occurence of the RegExp + void goTo(QRegExp const & exp) const; + /// does the document after cursor position contain the RegExp? + bool contains(QRegExp const & exp) const; private: - QTextCharFormat infoFormat; - QTextCharFormat warningFormat; - QTextCharFormat errorFormat; + /// Recognized log file-types + enum LogType { + LatexLog, + LiterateLog, + Lyx2lyxLog, + VCLog + }; + + LogType type_; + support::FileName logfile_; }; } // namespace frontend } // namespace lyx -#endif // QLOG_H +#endif // GUILOG_H