+2001-08-29 John Levon <moz@compsoc.man.ac.uk>
+
+ * QLog.[Ch]:
+ * QLogDialog.[Ch]:
+ * ui/QLogDialog.ui:
+ * QVCLog.[Ch]:
+ * QVCLogDialog.[Ch]:
+ * ui/QVCLogDialog.ui:
+ * Dialogs.C:
+ * Makefile.am:
+ * Makefile.dialogs: add log and vclog dialogs
+
2001-08-28 John Levon <moz@compsoc.man.ac.uk>
* Dialogs.C:
#include "QGraphicsDialog.h"
#include "QIncludeDialog.h"
#include "QIndexDialog.h"
+#include "QLogDialog.h"
#include "QRefDialog.h"
#include "QTabularCreateDialog.h"
#include "QThesaurusDialog.h"
#include "QURLDialog.h"
+#include "QVCLogDialog.h"
#include "QAbout.h"
#include "QBibitem.h"
#include "QGraphics.h"
#include "QInclude.h"
#include "QIndex.h"
+#include "QLog.h"
#include "QParagraph.h"
#include "QPrint.h"
#include "QRef.h"
#include "QTabularCreate.h"
#include "QThesaurus.h"
#include "QURL.h"
+#include "QVCLog.h"
#include "QtLyXView.h"
#include "Dialogs.h"
#include "controllers/ControlGraphics.h"
#include "controllers/ControlInclude.h"
#include "controllers/ControlIndex.h"
+#include "controllers/ControlLog.h"
#include "controllers/ControlRef.h"
#include "controllers/ControlSplash.h"
#include "controllers/ControlTabularCreate.h"
#include "controllers/ControlThesaurus.h"
#include "controllers/ControlUrl.h"
+#include "controllers/ControlVCLog.h"
#if 0
#include "controllers/ControlButtons.h"
#include "controllers/ControlCitation.h"
#include "controllers/ControlFloat.h"
#include "controllers/ControlLabel.h"
-#include "controllers/ControlLog.h"
#include "controllers/ControlMinipage.h"
#include "controllers/ControlPreamble.h"
#include "controllers/ControlPrint.h"
#include "controllers/ControlSearch.h"
#include "controllers/ControlSpellchecker.h"
#include "controllers/ControlToc.h"
-#include "controllers/ControlVCLog.h"
#endif
#include "GUI.h"
add(new GUIGraphics<QGraphics, Qt2BC>(*lv, *this));
add(new GUIInclude<QInclude, Qt2BC>(*lv, *this));
add(new GUIIndex<QIndex, Qt2BC>(*lv, *this));
+ add(new GUILog<QLog, Qt2BC>(*lv, *this));
add(new GUIRef<QRef, Qt2BC>(*lv, *this));
add(new GUITabularCreate<QTabularCreate, Qt2BC>(*lv, *this));
add(new GUIThesaurus<QThesaurus, Qt2BC>(*lv, *this));
add(new GUIUrl<QURL, Qt2BC>(*lv, *this));
+ add(new GUIVCLog<QVCLog, Qt2BC>(*lv, *this));
// reduce the number of connections needed in
// dialogs by a simple connection here.
../xforms/FormDocument.lo \
../xforms/FormIndex.lo \
../xforms/FormInset.lo \
- ../xforms/FormLog.lo \
../xforms/FormMinipage.lo \
../xforms/FormPreamble.lo \
../xforms/FormPreferences.lo \
../xforms/FormTabular.lo \
../xforms/FormToc.lo \
../xforms/FormUrl.lo \
- ../xforms/FormVCLog.lo \
../xforms/MathsSymbols.lo \
../xforms/Menubar_pimpl.lo \
../xforms/RadioButtonGroup.lo \
QGraphics \
QInclude \
QIndex \
+ QLog \
QParagraph \
QPrint \
QRef \
QTabularCreate \
QThesaurus \
QToc \
- QURL
+ QURL \
+ QVCLog
DIALOGSOURCES = \
QAbout.h QAboutDialog.h \
QInclude.C QIncludeDialog.C \
QIndex.h QIndexDialog.h \
QIndex.C QIndexDialog.C \
+ QLog.h QLogDialog.h \
+ QLog.C QLogDialog.C \
QParagraph.h QParagraphDialog.h \
QParagraph.C QParagraphDialog.C \
QPrint.h QPrintDialog.h \
QToc.h QTocDialog.h \
QToc.C QTocDialog.C \
QURL.h QURLDialog.h \
- QURL.C QURLDialog.C
+ QURL.C QURLDialog.C \
+ QVCLog.h QVCLogDialog.h \
+ QVCLog.C QVCLogDialog.C
MOCDIALOGS = \
QAboutDialog_moc.C \
QGraphicsDialog_moc.C \
QIncludeDialog_moc.C \
QIndexDialog_moc.C \
+ QLogDialog_moc.C \
QParagraphDialog_moc.C \
QPrintDialog_moc.C \
QRefDialog_moc.C \
QTabularCreateDialog_moc.C \
QThesaurusDialog_moc.C \
QTocDialog_moc.C \
- QURLDialog_moc.C
+ QURLDialog_moc.C \
+ QVCLogDialog_moc.C
UIDIALOGS = \
QAboutDialogBase.h \
QIncludeDialogBase.C \
QIndexDialogBase.h \
QIndexDialogBase.C \
+ QLogDialogBase.h \
+ QLogDialogBase.C \
QParagraphDialogBase.h \
QParagraphDialogBase.C \
QPrintDialogBase.h \
QTocDialogBase.h \
QTocDialogBase.C \
QURLDialogBase.h \
- QURLDialogBase.C
+ QURLDialogBase.C \
+ QVCLogDialogBase.h \
+ QVCLogDialogBase.C
UIMOCDIALOGS = \
QAboutDialogBase_moc.C \
QGraphicsDialogBase_moc.C \
QIncludeDialogBase_moc.C \
QIndexDialogBase_moc.C \
+ QLogDialogBase_moc.C \
QParagraphDialogBase_moc.C \
QPrintDialogBase_moc.C \
QRefDialogBase_moc.C \
QTabularCreateDialogBase_moc.C \
QThesaurusDialogBase_moc.C \
QTocDialogBase_moc.C \
- QURLDialogBase_moc.C
+ QURLDialogBase_moc.C \
+ QVCLogDialogBase_moc.C
--- /dev/null
+/**
+ * \file QLog.C
+ * Copyright 2001 the LyX Team
+ * Read the file COPYING
+ *
+ * \author John Levon <moz@compsoc.man.ac.uk>
+ */
+
+#include <config.h>
+#include <fstream>
+
+#ifdef __GNUG__
+#pragma implementation
+#endif
+
+#include <qtextview.h>
+#include <qpushbutton.h>
+
+#include "QLogDialog.h"
+#include "QLog.h"
+#include "Qt2BC.h"
+#include "gettext.h"
+
+#include "QtLyXView.h"
+#include "ControlLog.h"
+
+typedef Qt2CB<ControlLog, Qt2DB<QLogDialog> > base_class;
+
+QLog::QLog(ControlLog & c)
+ : base_class(c, _("Log"))
+{
+}
+
+
+void QLog::build_dialog()
+{
+ dialog_.reset(new QLogDialog(this));
+
+ bc().setCancel(dialog_->closePB);
+}
+
+
+void QLog::update_contents()
+{
+ std::pair<Buffer::LogType, string> const logfile = controller().logfile();
+
+ if (logfile.first == Buffer::buildlog)
+ dialog_->setCaption(_("Build log"));
+ else
+ dialog_->setCaption(_("LaTeX log"));
+
+ dialog_->logTV->setText("");
+
+ ifstream ifstr(logfile.second.c_str());
+ if (!ifstr) {
+ if (logfile.first == Buffer::buildlog)
+ dialog_->logTV->setText(_("No build log file found"));
+ else
+ dialog_->logTV->setText(_("No LaTeX log file found"));
+ return;
+ }
+
+ string text;
+ string line;
+
+ while (getline(ifstr, line))
+ text += line + "\n";
+
+ dialog_->logTV->setText(text.c_str());
+}
--- /dev/null
+// -*- C++ -*-
+/**
+ * \file QLog.h
+ * Copyright 2001 the LyX Team
+ * Read the file COPYING
+ *
+ * \author John Levon <moz@compsoc.man.ac.uk>
+ */
+
+#ifndef QLOG_H
+#define QLOG_H
+
+#ifdef __GNUG__
+#pragma interface
+#endif
+
+#include "Qt2Base.h"
+
+class ControlLog;
+class QLogDialog;
+
+///
+class QLog
+ : public Qt2CB<ControlLog, Qt2DB<QLogDialog> >
+{
+public:
+ ///
+ friend class QLogDialog;
+ ///
+ QLog(ControlLog &);
+
+private:
+ /// Apply changes
+ virtual void apply() {};
+ /// update
+ virtual void update_contents();
+ /// build the dialog
+ virtual void build_dialog();
+};
+
+#endif // QLOG_H
--- /dev/null
+/**
+ * \file QLogDialog.C
+ * Copyright 2001 the LyX Team
+ * Read the file COPYING
+ *
+ * \author John Levon <moz@compsoc.man.ac.uk>
+ */
+
+#include <config.h>
+#include <vector>
+
+#include <qpushbutton.h>
+#include <qtextview.h>
+#include "QLogDialog.h"
+#include "Dialogs.h"
+#include "QLog.h"
+
+#include "QtLyXView.h"
+#include "ControlLog.h"
+
+QLogDialog::QLogDialog(QLog * form)
+ : QLogDialogBase(0, 0, false, 0),
+ form_(form)
+{
+ connect(closePB, SIGNAL(clicked()),
+ form, SLOT(slotClose()));
+}
+
+
+void QLogDialog::closeEvent(QCloseEvent * e)
+{
+ form_->slotWMHide();
+ e->accept();
+}
+
+
+void QLogDialog::updateClicked()
+{
+ form_->update_contents();
+}
--- /dev/null
+/**
+ * \file QLogDialog.h
+ * Copyright 2001 the LyX Team
+ * Read the file COPYING
+ *
+ * \author John Levon <moz@compsoc.man.ac.uk>
+ */
+
+#ifndef QLOGDIALOG_H
+#define QLOGDIALOG_H
+
+#include <config.h>
+
+#include "ui/QLogDialogBase.h"
+
+class QLog;
+
+class QLogDialog : public QLogDialogBase
+{ Q_OBJECT
+
+public:
+ QLogDialog(QLog * form);
+
+protected slots:
+ virtual void updateClicked();
+
+protected:
+ virtual void closeEvent(QCloseEvent * e);
+
+private:
+ QLog * form_;
+};
+
+#endif // QLOGDIALOG_H
--- /dev/null
+/**
+ * \file QVCLog.C
+ * Copyright 2001 the LyX Team
+ * Read the file COPYING
+ *
+ * \author John Levon <moz@compsoc.man.ac.uk>
+ */
+
+#include <config.h>
+#include "Lsstream.h"
+
+#ifdef __GNUG__
+#pragma implementation
+#endif
+
+#include <qtextview.h>
+#include <qpushbutton.h>
+
+#include "QVCLogDialog.h"
+#include "QVCLog.h"
+#include "Qt2BC.h"
+#include "gettext.h"
+
+#include "QtLyXView.h"
+#include "ControlVCLog.h"
+
+typedef Qt2CB<ControlVCLog, Qt2DB<QVCLogDialog> > base_class;
+
+QVCLog::QVCLog(ControlVCLog & c)
+ : base_class(c, _("VCLog"))
+{
+}
+
+
+void QVCLog::build_dialog()
+{
+ dialog_.reset(new QVCLogDialog(this));
+
+ bc().setCancel(dialog_->closePB);
+}
+
+
+void QVCLog::update_contents()
+{
+ dialog_->setCaption(string(_("Version control log for ") + controller().getBufferFileName()).c_str());
+
+ dialog_->vclogTV->setText("");
+
+ stringstream ss;
+
+ dialog_->vclogTV->setText(controller().getVCLogFile(ss).str().c_str());
+}
--- /dev/null
+// -*- C++ -*-
+/**
+ * \file QVCLog.h
+ * Copyright 2001 the LyX Team
+ * Read the file COPYING
+ *
+ * \author John Levon <moz@compsoc.man.ac.uk>
+ */
+
+#ifndef QVCLOG_H
+#define QVCLOG_H
+
+#ifdef __GNUG__
+#pragma interface
+#endif
+
+#include "Qt2Base.h"
+
+class ControlVCLog;
+class QVCLogDialog;
+
+///
+class QVCLog
+ : public Qt2CB<ControlVCLog, Qt2DB<QVCLogDialog> >
+{
+public:
+ ///
+ friend class QVCLogDialog;
+ ///
+ QVCLog(ControlVCLog &);
+
+private:
+ /// Apply changes
+ virtual void apply() {};
+ /// update
+ virtual void update_contents();
+ /// build the dialog
+ virtual void build_dialog();
+};
+
+#endif // QVCLOG_H
--- /dev/null
+/**
+ * \file QVCLogDialog.C
+ * Copyright 2001 the LyX Team
+ * Read the file COPYING
+ *
+ * \author John Levon <moz@compsoc.man.ac.uk>
+ */
+
+#include <config.h>
+#include <vector>
+
+#include <qpushbutton.h>
+#include <qtextview.h>
+#include "QVCLogDialog.h"
+#include "Dialogs.h"
+#include "QVCLog.h"
+
+#include "QtLyXView.h"
+#include "ControlVCLog.h"
+
+QVCLogDialog::QVCLogDialog(QVCLog * form)
+ : QVCLogDialogBase(0, 0, false, 0),
+ form_(form)
+{
+ connect(closePB, SIGNAL(clicked()),
+ form, SLOT(slotClose()));
+}
+
+
+void QVCLogDialog::closeEvent(QCloseEvent * e)
+{
+ form_->slotWMHide();
+ e->accept();
+}
+
+
+void QVCLogDialog::updateClicked()
+{
+ form_->update_contents();
+}
--- /dev/null
+/**
+ * \file QVCLogDialog.h
+ * Copyright 2001 the LyX Team
+ * Read the file COPYING
+ *
+ * \author John Levon <moz@compsoc.man.ac.uk>
+ */
+
+#ifndef QVCLOGDIALOG_H
+#define QVCLOGDIALOG_H
+
+#include <config.h>
+
+#include "ui/QVCLogDialogBase.h"
+
+class QVCLog;
+
+class QVCLogDialog : public QVCLogDialogBase
+{ Q_OBJECT
+
+public:
+ QVCLogDialog(QVCLog * form);
+
+protected slots:
+ virtual void updateClicked();
+
+protected:
+ virtual void closeEvent(QCloseEvent * e);
+
+private:
+ QVCLog * form_;
+};
+
+#endif // QVCLOGDIALOG_H
--- /dev/null
+<!DOCTYPE UI><UI>
+<class>QLogDialogBase</class>
+<include location="global">config.h</include>
+<include location="local">gettext.h</include>
+<widget>
+ <class>QDialog</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>QLogDialogBase</cstring>
+ </property>
+ <property stdset="1">
+ <name>geometry</name>
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>424</width>
+ <height>328</height>
+ </rect>
+ </property>
+ <property stdset="1">
+ <name>caption</name>
+ <string>Log</string>
+ </property>
+ <vbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>11</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <widget>
+ <class>QTextView</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>logTV</cstring>
+ </property>
+ </widget>
+ <widget>
+ <class>QLayoutWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Layout27</cstring>
+ </property>
+ <hbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <spacer>
+ <property>
+ <name>name</name>
+ <cstring>Spacer3</cstring>
+ </property>
+ <property stdset="1">
+ <name>orientation</name>
+ <enum>Horizontal</enum>
+ </property>
+ <property stdset="1">
+ <name>sizeType</name>
+ <enum>Expanding</enum>
+ </property>
+ <property>
+ <name>sizeHint</name>
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget>
+ <class>QPushButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>updatePB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>&Update</string>
+ </property>
+ <property stdset="1">
+ <name>default</name>
+ <bool>true</bool>
+ </property>
+ <property>
+ <name>toolTip</name>
+ <string>Update the display</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QPushButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>closePB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>&Close</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>updatePB</sender>
+ <signal>clicked()</signal>
+ <receiver>QLogDialogBase</receiver>
+ <slot>updateClicked()</slot>
+ </connection>
+ <slot access="public">updateClicked()</slot>
+</connections>
+<tabstops>
+ <tabstop>logTV</tabstop>
+ <tabstop>updatePB</tabstop>
+ <tabstop>closePB</tabstop>
+</tabstops>
+</UI>
--- /dev/null
+<!DOCTYPE UI><UI>
+<class>QVCLogDialogBase</class>
+<include location="global">config.h</include>
+<include location="local">gettext.h</include>
+<widget>
+ <class>QDialog</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>QVCLogDialogBase</cstring>
+ </property>
+ <property stdset="1">
+ <name>geometry</name>
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>420</width>
+ <height>328</height>
+ </rect>
+ </property>
+ <property stdset="1">
+ <name>caption</name>
+ <string>Version control log</string>
+ </property>
+ <vbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>11</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <widget>
+ <class>QTextView</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>vclogTV</cstring>
+ </property>
+ </widget>
+ <widget>
+ <class>QLayoutWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Layout27</cstring>
+ </property>
+ <hbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <spacer>
+ <property>
+ <name>name</name>
+ <cstring>Spacer3</cstring>
+ </property>
+ <property stdset="1">
+ <name>orientation</name>
+ <enum>Horizontal</enum>
+ </property>
+ <property stdset="1">
+ <name>sizeType</name>
+ <enum>Expanding</enum>
+ </property>
+ <property>
+ <name>sizeHint</name>
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget>
+ <class>QPushButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>updatePB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>&Update</string>
+ </property>
+ <property stdset="1">
+ <name>default</name>
+ <bool>true</bool>
+ </property>
+ <property>
+ <name>toolTip</name>
+ <string>Update the display</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QPushButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>closePB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>&Close</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>updatePB</sender>
+ <signal>clicked()</signal>
+ <receiver>QVCLogDialogBase</receiver>
+ <slot>updateClicked()</slot>
+ </connection>
+ <slot access="public">updateClicked()</slot>
+</connections>
+<tabstops>
+ <tabstop>vclogTV</tabstop>
+ <tabstop>updatePB</tabstop>
+ <tabstop>closePB</tabstop>
+</tabstops>
+</UI>