+2001-02-06 John Levon <moz@compsoc.man.ac.uk>
+
+ * log_form.fd: deleted
+++ /dev/null
-Magic: 13000
-
-Internal Form Definition File
- (do not change)
-
-Number of forms: 1
-Unit of measure: FL_COORD_PIXEL
-
-=============== FORM ===============
-Name: LaTeXLog
-Width: 470
-Height: 380
-Number of Objects: 4
-
---------------------
-class: FL_BOX
-type: UP_BOX
-box: 0 0 470 380
-boxtype: FL_UP_BOX
-colors: FL_COL1 FL_COL1
-alignment: FL_ALIGN_CENTER
-style: FL_NORMAL_STYLE
-size: FL_DEFAULT_SIZE
-lcol: FL_BLACK
-label:
-shortcut:
-resize: FL_RESIZE_ALL
-gravity: FL_NoGravity FL_NoGravity
-name:
-callback:
-argument:
-
---------------------
-class: FL_BROWSER
-type: NORMAL_BROWSER
-box: 10 10 450 320
-boxtype: FL_DOWN_BOX
-colors: FL_COL1 FL_YELLOW
-alignment: FL_ALIGN_BOTTOM
-style: FL_NORMAL_STYLE
-size: FL_DEFAULT_SIZE
-lcol: FL_BLACK
-label:
-shortcut:
-resize: FL_RESIZE_ALL
-gravity: FL_NorthWest FL_SouthEast
-name: browser_latexlog
-callback:
-argument:
-
---------------------
-class: FL_BUTTON
-type: RETURN_BUTTON
-box: 270 340 90 30
-boxtype: FL_UP_BOX
-colors: FL_COL1 FL_COL1
-alignment: FL_ALIGN_CENTER
-style: FL_NORMAL_STYLE
-size: FL_NORMAL_SIZE
-lcol: FL_BLACK
-label: Close
-shortcut: ^M
-resize: FL_RESIZE_NONE
-gravity: FL_SouthEast FL_SouthEast
-name:
-callback: LatexLogClose
-argument: 0
-
---------------------
-class: FL_BUTTON
-type: NORMAL_BUTTON
-box: 370 340 90 30
-boxtype: FL_UP_BOX
-colors: FL_COL1 FL_COL1
-alignment: FL_ALIGN_CENTER
-style: FL_NORMAL_STYLE
-size: FL_NORMAL_SIZE
-lcol: FL_BLACK
-label: Update|#Uu
-shortcut:
-resize: FL_RESIZE_NONE
-gravity: FL_SouthEast FL_SouthEast
-name:
-callback: LatexLogUpdate
-argument: 0
-
-==============================
-create_the_forms
src/frontends/kde/urldlg.C
src/frontends/qt2/FormCopyright.C
src/frontends/xforms/FormBase.h
+src/frontends/xforms/form_browser.C
src/frontends/xforms/FormCitation.C
src/frontends/xforms/form_citation.C
src/frontends/xforms/FormCopyright.C
src/frontends/xforms/FormIndex.C
src/frontends/xforms/form_index.C
src/frontends/xforms/FormInset.h
+src/frontends/xforms/FormLog.C
src/frontends/xforms/FormParagraph.C
src/frontends/xforms/form_paragraph.C
src/frontends/xforms/FormPreferences.C
src/frontends/xforms/form_toc.C
src/frontends/xforms/FormUrl.C
src/frontends/xforms/form_url.C
+src/frontends/xforms/FormVCLog.C
src/frontends/xforms/input_validators.C
src/frontends/xforms/Menubar_pimpl.C
src/frontends/xforms/xform_helpers.C
src/kbsequence.C
src/language.C
src/LaTeX.C
-src/LaTeXLog.C
src/layout.C
src/layout_forms.C
src/LColor.C
-src/log_form.C
src/LyXAction.C
src/lyx.C
src/lyx_cb.C
+2001-02-06 John Levon <moz@compsoc.man.ac.uk>
+
+ * Makefile.am: remove LaTeXLog.C, log_form.[Ch]
+
+ * LaTeXLog.C: deleted, useful code moved to Buffer
+
+ * buffer.h:
+ * buffer.C: new function getLatexLogName()
+
+ * lyx_gui_misc.C:
+ * lyx_gui.C:
+ * lyxvc.C:
+ * lyxvc.h:
+ * lyxfunc.C: use frontends for LaTeX and VC logs
+
2001-02-06 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
* LaTeX.h: yet another std:: that Allan forgot.
+++ /dev/null
-#include <config.h>
-
-#include <cstdlib>
-#include FORMS_H_LOCATION
-#include "buffer.h"
-#include "log_form.h"
-#include "lyx_main.h"
-#include "LString.h"
-#include "support/FileInfo.h"
-#include "support/filetools.h"
-#include "support/path.h"
-#include "lyxrc.h"
-#include "BufferView.h"
-#include "gettext.h"
-#include "converter.h"
-
-extern FD_LaTeXLog *fd_latex_log;
-extern BufferView *current_view;
-
-void ShowLatexLog()
-{
- string filename, fname, bname, path;
- bool use_build = false;
- static int ow = -1, oh;
-
- filename = current_view->buffer()->getLatexName();
- if (!filename.empty()) {
- fname = OnlyFilename(ChangeExtension(filename, ".log"));
- bname = OnlyFilename(ChangeExtension(filename,
- formats.Extension("literate") + ".out"));
- path = OnlyPath(filename);
- if (lyxrc.use_tempdir || (IsDirWriteable(path) < 1)) {
- path = current_view->buffer()->tmppath;
- }
- FileInfo f_fi(path + fname), b_fi(path + bname);
- if (b_fi.exist())
- if (!f_fi.exist()
- || f_fi.getModificationTime() < b_fi.getModificationTime())
- use_build = true; // If no Latex log or Build log is newer, show Build log
- Path p(path); // path to LaTeX file
- if (!fl_load_browser(fd_latex_log->browser_latexlog,
- use_build ? bname.c_str() : fname.c_str()))
- fl_add_browser_line(fd_latex_log->browser_latexlog,
- _("No LaTeX log file found"));
- } else {
- fl_add_browser_line(fd_latex_log->browser_latexlog,
- _("No LaTeX log file found"));
- }
- if (fd_latex_log->LaTeXLog->visible) {
- fl_raise_form(fd_latex_log->LaTeXLog);
- } else {
- fl_show_form(fd_latex_log->LaTeXLog,
- FL_PLACE_MOUSE | FL_FREE_SIZE, FL_TRANSIENT,
- use_build ? _("Build Program Log") : _("LaTeX Log"));
- if (ow < 0) {
- ow = fd_latex_log->LaTeXLog->w;
- oh = fd_latex_log->LaTeXLog->h;
- }
- fl_set_form_minsize(fd_latex_log->LaTeXLog, ow, oh);
- }
-}
-
-void LatexLogClose(FL_OBJECT *, long)
-{
- fl_hide_form(fd_latex_log->LaTeXLog);
-}
-
-void LatexLogUpdate(FL_OBJECT *, long)
-{
- ShowLatexLog();
-}
LaTeX.h \
LaTeXFeatures.C \
LaTeXFeatures.h \
- LaTeXLog.C \
Lsstream.h \
LyXAction.C \
LyXAction.h \
layout.h \
layout_forms.C \
layout_forms.h \
- log_form.C \
- log_form.h \
lyx.C \
lyx.h \
lyx_cb.C \
#include "encoding.h"
#include "exporter.h"
#include "Lsstream.h"
+#include "converter.h"
using std::ostream;
using std::ofstream;
".tex");
}
+string const Buffer::getLatexLogName(void) const
+{
+ string filename, fname, bname, path;
+
+ filename = getLatexName(false);
+
+ if (filename.empty())
+ return string();
+
+ fname = OnlyFilename(ChangeExtension(filename, ".log"));
+ bname = OnlyFilename(ChangeExtension(filename,
+ formats.Extension("literate") + ".out"));
+ path = OnlyPath(filename);
+
+ if (lyxrc.use_tempdir || (IsDirWriteable(path) < 1))
+ path = tmppath + "/";
+
+ lyxerr[Debug::FILES] << "LaTeX Log calculated as : " << path + fname << endl;
+
+ // If no Latex log or Build log is newer, show Build log
+ FileInfo f_fi(path + fname), b_fi(path + bname);
+ if (b_fi.exist() &&
+ (!f_fi.exist() || f_fi.getModificationTime() < b_fi.getModificationTime()))
+ return path + bname;
+ else
+ return path + fname;
+}
void Buffer::setReadonly(bool flag)
{
*/
string const getLatexName(bool no_path = true) const;
+ /**
+ * get the name of the LaTeX log
+ */
+ string const getLatexLogName(void) const;
+
/// Change name of buffer. Updates "read-only" flag.
void setFileName(string const & newfile);
}
+/*-------------------------------OkViewPolicy------------------------------*/
+
+
+OkViewPolicy::OkViewPolicy()
+ : state_(INITIAL),
+ outputs_(INVALID + 1, ButtonPolicy::ALL_BUTTONS),
+ state_machine_(INVALID + 1,
+ StateArray(int(SMI_TOTAL), ButtonPolicy::BOGUS))
+{
+}
+
+
+
+void OkViewPolicy::input(SMInput)
+{
+ state_ = VALID;
+}
+
+
/*-------------------------------OkCancelPolicy------------------------------*/
StateMachine state_machine_;
};
-
+/** OK button policy for dialogs that can't mutate the document,
+ and are always valid
+ */
+class OkViewPolicy : public ButtonPolicy {
+public:
+ ///
+ OkViewPolicy();
+ /// Trigger a transition with this input
+ virtual void input(SMInput);
+ /// activation status
+ virtual bool buttonStatus(Button button) const {
+ return button & outputs_[state_];
+ }
+ /// are we in a read-only state ?
+ virtual bool isReadOnly() const {
+ return false;
+ }
+private:
+ /// current state
+ State state_;
+ /// which buttons are active
+ StateOutputs outputs_;
+ ///
+ StateMachine state_machine_;
+};
+
/** Ok and Cancel buttons for dialogs where read-only operation is blocked.
The state machine design for this policy allows changes to occur within
the dialog while a file is read-only -- the okay button is disabled until
+2001-02-06 John Levon <moz@compsoc.man.ac.uk>
+
+ * ButtonPolicies.C:
+ * ButtonPolicies.h: add OkViewPolicy
+
+ * src/frontends/Dialogs.h: add showVCLogFile signal
+
2001-01-24 John Levon <moz@compsoc.man.ac.uk>
* Makefile.am: add qt2 frontend
Signal0<void> showLayoutDocument;
///
Signal0<void> showLayoutParagraph;
- ///
+ /// show the version control log
+ Signal0<void> showVCLogFile;
+ /// show the LaTeX log or build file
Signal0<void> showLogFile;
///
Signal0<void> showPreamble;
+2001-02-06 John Levon <moz@compsoc.man.ac.uk>
+
+ * form_browser.h:
+ * form_browser.C:
+ * forms/form_browser.fd:
+ * forms/makefile:
+ * FormBrowser.C:
+ * FormBrowser.h: readonly browser form
+
+ * FormLog.C:
+ * FormLog.h:
+ * FormVCLog.C:
+ * FormVCLog.h:
+ * Dialogs.C: add Log and VCLog
+
+ * Makefile.am: add Log and VCLog, add updatesrc target
+
2001-01-31 Dekel Tsur <dekelts@tau.ac.il>
* Menubar_pimpl.C (add_toc2): Add shortcut to the TOC menu.
#include "FormError.h"
#include "FormGraphics.h"
#include "FormIndex.h"
+#include "FormLog.h"
#include "FormParagraph.h"
#include "FormPreferences.h"
#include "FormPrint.h"
#include "FormTabularCreate.h"
#include "FormToc.h"
#include "FormUrl.h"
-//#include "debug.h"
+#include "FormVCLog.h"
#ifdef __GNUG__
#pragma implementation
dialogs_.push_back(new FormError(lv, this));
dialogs_.push_back(new FormGraphics(lv, this));
dialogs_.push_back(new FormIndex(lv, this));
+ dialogs_.push_back(new FormLog(lv, this));
dialogs_.push_back(new FormParagraph(lv, this));
dialogs_.push_back(new FormPreferences(lv, this));
dialogs_.push_back(new FormPrint(lv, this));
dialogs_.push_back(new FormTabularCreate(lv, this));
dialogs_.push_back(new FormToc(lv, this));
dialogs_.push_back(new FormUrl(lv, this));
+ dialogs_.push_back(new FormVCLog(lv, this));
showCredits.connect(slot(ShowCredits));
for (vector<DialogBase *>::iterator iter = dialogs_.begin();
iter != dialogs_.end();
++iter) {
- //lyxerr << "delete *iter" << endl;
delete *iter;
}
}
--- /dev/null
+/* FormBrowser.C
+ * (C) 2001 LyX Team
+ * John Levon, moz@compsoc.man.ac.uk
+ */
+
+#include <config.h>
+
+#include FORMS_H_LOCATION
+
+#ifdef __GNUG__
+#pragma implementation
+#endif
+
+#include "gettext.h"
+#include "FormBrowser.h"
+#include "form_browser.h"
+#include "LyXView.h"
+#include "Dialogs.h"
+#include "lyxrc.h"
+#include "buffer.h"
+
+#ifdef SIGC_CXX_NAMESPACES
+using SigC::slot;
+#endif
+
+FormBrowser::FormBrowser(LyXView * lv, Dialogs * d, const string & name)
+ : FormBaseBD(lv, d, name, new OkViewPolicy),
+ dialog_(0)
+{
+}
+
+FormBrowser::~FormBrowser()
+{
+ delete dialog_;
+}
+
+void FormBrowser::build()
+{
+ dialog_ = build_browser();
+
+ // Workaround dumb xforms sizing bug
+ minw_ = form()->w;
+ minh_ = form()->h;
+
+ // Manage the close button
+ bc_.setOK(dialog_->button_close);
+ bc_.refresh();
+}
+
+FL_FORM * FormBrowser::form() const
+{
+ if (dialog_)
+ return dialog_->form;
+ return 0;
+}
+
+void FormBrowser::update()
+{
+}
+
+bool FormBrowser::input(FL_OBJECT *, long)
+{
+ update();
+ return true;
+}
--- /dev/null
+// -*- C++ -*-
+/*
+ * FormBrowser.h
+ *
+ * (C) 2001 LyX Team
+ * John Levon, moz@compsoc.man.ac.uk
+ */
+
+#ifndef FORMBROWSER_H
+#define FORMBROWSER_H
+
+#include "FormBase.h"
+
+#ifdef __GNUG__
+#pragma interface
+#endif
+
+class LyXView;
+class Dialogs;
+struct FD_form_browser;
+
+/**
+ * This class provides an XForms implementation of a read only
+ * text browser.
+ */
+class FormBrowser : public FormBaseBD {
+public:
+ FormBrowser(LyXView *, Dialogs *, const string &);
+ ~FormBrowser();
+
+protected:
+ /// Update the dialog.
+ virtual void update();
+
+ /// Real GUI implementation.
+ FD_form_browser * dialog_;
+
+private:
+ /// Pointer to the actual instantiation of the xform's form
+ virtual FL_FORM * form() const;
+ /// Filter the inputs on callback from xforms
+ virtual bool input(FL_OBJECT *, long);
+ /// Build the dialog
+ virtual void build();
+
+ /// generated build function
+ FD_form_browser * build_browser();
+};
+
+#endif
--- /dev/null
+/* FormLog.C
+ * (C) 2001 LyX Team
+ * John Levon, moz@compsoc.man.ac.uk
+ */
+
+#include <config.h>
+
+#include FORMS_H_LOCATION
+
+#ifdef __GNUG__
+#pragma implementation
+#endif
+
+#include "gettext.h"
+#include "FormLog.h"
+#include "form_browser.h"
+#include "LyXView.h"
+#include "Dialogs.h"
+#include "lyxrc.h"
+#include "buffer.h"
+
+#ifdef SIGC_CXX_NAMESPACES
+using SigC::slot;
+#endif
+
+FormLog::FormLog(LyXView * lv, Dialogs * d)
+ : FormBrowser(lv, d, _("LaTeX Log"))
+{
+ // let the dialog be shown
+ // This is a permanent connection so we won't bother
+ // storing a copy because we won't be disconnecting.
+ d->showLogFile.connect(slot(this, &FormLog::show));
+}
+
+FormLog::~FormLog()
+{
+}
+
+void FormLog::update()
+{
+ if (!dialog_ || !lv_->view()->available())
+ return;
+
+ string const logfile = lv_->view()->buffer()->getLatexLogName();
+
+ fl_clear_browser(dialog_->browser);
+
+ if (!fl_load_browser(dialog_->browser, logfile.c_str()))
+ fl_add_browser_line(dialog_->browser, _("No LaTeX log file found"));
+}
--- /dev/null
+// -*- C++ -*-
+/*
+ * FormLog.h
+ *
+ * (C) 2001 LyX Team
+ * John Levon, moz@compsoc.man.ac.uk
+ */
+
+#ifndef FORMLOG_H
+#define FORMLOG_H
+
+#include "FormBase.h"
+#include "FormBrowser.h"
+
+#ifdef __GNUG__
+#pragma interface
+#endif
+
+class LyXView;
+class Dialogs;
+
+/**
+ * This class provides an XForms implementation of the LaTeX log dialog
+ * for viewing the last LaTeX log file.
+ */
+class FormLog : public FormBrowser {
+public:
+ FormLog(LyXView *, Dialogs *);
+ ~FormLog();
+
+private:
+ /// Update the dialog.
+ virtual void update();
+};
+
+#endif
--- /dev/null
+/* FormVCLog.C
+ * (C) 2001 LyX Team
+ * John Levon, moz@compsoc.man.ac.uk
+ */
+
+#include <config.h>
+
+#include FORMS_H_LOCATION
+
+#ifdef __GNUG__
+#pragma implementation
+#endif
+
+#include "gettext.h"
+#include "FormVCLog.h"
+#include "form_browser.h"
+#include "LyXView.h"
+#include "Dialogs.h"
+#include "lyxrc.h"
+#include "buffer.h"
+
+#ifdef SIGC_CXX_NAMESPACES
+using SigC::slot;
+#endif
+
+FormVCLog::FormVCLog(LyXView * lv, Dialogs * d)
+ : FormBrowser(lv, d, _("Version Control Log"))
+{
+ // let the dialog be shown
+ // This is a permanent connection so we won't bother
+ // storing a copy because we won't be disconnecting.
+ d->showVCLogFile.connect(slot(this, &FormVCLog::show));
+}
+
+FormVCLog::~FormVCLog()
+{
+}
+
+void FormVCLog::update()
+{
+ if (!dialog_ || !lv_->view()->available())
+ return;
+
+ const string logfile = lv_->view()->buffer()->lyxvc.getLogFile();
+
+ fl_clear_browser(dialog_->browser);
+
+ if (logfile=="" || !fl_load_browser(dialog_->browser, logfile.c_str()))
+ fl_add_browser_line(dialog_->browser, _("No version control log file available"));
+
+ lyx::unlink(logfile);
+}
--- /dev/null
+// -*- C++ -*-
+/*
+ * FormVCLog.h
+ *
+ * (C) 2001 LyX Team
+ * John Levon, moz@compsoc.man.ac.uk
+ */
+
+#ifndef FORMVCLOG_H
+#define FORMVCLOG_H
+
+#include "FormBase.h"
+#include "FormBrowser.h"
+
+#ifdef __GNUG__
+#pragma interface
+#endif
+
+class LyXView;
+class Dialogs;
+
+/**
+ * This class provides an XForms implementation of the Version Control
+ * log viewer
+ */
+class FormVCLog : public FormBrowser {
+public:
+ FormVCLog(LyXView *, Dialogs *);
+ ~FormVCLog();
+
+private:
+ /// Update the dialog.
+ virtual void update();
+};
+
+#endif
GUIRunTime.C \
FormBase.C \
FormBase.h \
+ FormBrowser.C \
+ FormBrowser.h \
+ form_browser.C \
+ form_browser.h \
FormCitation.C \
FormCitation.h \
form_citation.C \
form_index.h \
FormInset.C \
FormInset.h \
+ FormLog.C \
+ FormLog.h \
FormParagraph.C \
FormParagraph.h \
form_paragraph.C \
FormUrl.h \
form_url.C \
form_url.h \
+ FormVCLog.C \
+ FormVCLog.h \
input_validators.h \
input_validators.C \
Menubar_pimpl.C \
# GUI_runtime.C \
# GUI_applymenu.C
+# for convenience only
+updatesrc:
+ $(MAKE) -C forms updatesrc
+
# just copied from old lyx repository
dist-hook:
for subdir in $(LYXDATADIRS) ; do \
--- /dev/null
+// File modified by fdfix.sh for use by lyx (with xforms >= 0.88) and gettext
+#include <config.h>
+#include "lyx_gui_misc.h"
+#include "gettext.h"
+
+/* Form definition file generated with fdesign. */
+
+#include FORMS_H_LOCATION
+#include <stdlib.h>
+#include "form_browser.h"
+#include "FormBrowser.h"
+
+FD_form_browser::~FD_form_browser()
+{
+ if ( form->visible ) fl_hide_form( form );
+ fl_free_form( form );
+}
+
+
+FD_form_browser * FormBrowser::build_browser()
+{
+ FL_OBJECT *obj;
+ FD_form_browser *fdui = new FD_form_browser;
+
+ fdui->form = fl_bgn_form(FL_NO_BOX, 470, 380);
+ fdui->form->u_vdata = this;
+ obj = fl_add_box(FL_UP_BOX, 0, 0, 470, 380, "");
+ fdui->browser = obj = fl_add_browser(FL_NORMAL_BROWSER, 10, 10, 450, 320, "");
+ fl_set_object_gravity(obj, FL_NorthWest, FL_SouthEast);
+ fdui->button_close = obj = fl_add_button(FL_RETURN_BUTTON, 370, 340, 90, 30, _("Close"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
+ fl_set_object_callback(obj, C_FormBaseOKCB, 0);
+ {
+ char const * const dummy = N_("Update|#Uu");
+ fdui->button_update = obj = fl_add_button(FL_NORMAL_BUTTON, 270, 340, 90, 30, idex(_(dummy)));
+ fl_set_button_shortcut(obj, scex(_(dummy)), 1);
+ }
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
+ fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fl_end_form();
+
+ fdui->form->fdui = fdui;
+
+ return fdui;
+}
+/*---------------------------------------*/
+
--- /dev/null
+// File modified by fdfix.sh for use by lyx (with xforms >= 0.88) and gettext
+/** Header file generated with fdesign **/
+
+#ifndef FD_form_browser_h_
+#define FD_form_browser_h_
+
+/** Callbacks, globals and object handlers **/
+extern "C" void C_FormBaseOKCB(FL_OBJECT *, long);
+extern "C" void C_FormBaseInputCB(FL_OBJECT *, long);
+
+
+/**** Forms and Objects ****/
+struct FD_form_browser {
+ ~FD_form_browser();
+
+ FL_FORM *form;
+ FL_OBJECT *browser;
+ FL_OBJECT *button_close;
+ FL_OBJECT *button_update;
+};
+
+#endif /* FD_form_browser_h_ */
--- /dev/null
+Magic: 13000
+
+Internal Form Definition File
+ (do not change)
+
+Number of forms: 1
+Unit of measure: FL_COORD_PIXEL
+
+=============== FORM ===============
+Name: form_browser
+Width: 470
+Height: 380
+Number of Objects: 4
+
+--------------------
+class: FL_BOX
+type: UP_BOX
+box: 0 0 470 380
+boxtype: FL_UP_BOX
+colors: FL_COL1 FL_COL1
+alignment: FL_ALIGN_CENTER
+style: FL_NORMAL_STYLE
+size: FL_DEFAULT_SIZE
+lcol: FL_BLACK
+label:
+shortcut:
+resize: FL_RESIZE_ALL
+gravity: FL_NoGravity FL_NoGravity
+name:
+callback:
+argument:
+
+--------------------
+class: FL_BROWSER
+type: NORMAL_BROWSER
+box: 10 10 450 320
+boxtype: FL_DOWN_BOX
+colors: FL_COL1 FL_YELLOW
+alignment: FL_ALIGN_BOTTOM
+style: FL_NORMAL_STYLE
+size: FL_DEFAULT_SIZE
+lcol: FL_BLACK
+label:
+shortcut:
+resize: FL_RESIZE_ALL
+gravity: FL_NorthWest FL_SouthEast
+name: browser
+callback:
+argument:
+
+--------------------
+class: FL_BUTTON
+type: RETURN_BUTTON
+box: 370 340 90 30
+boxtype: FL_UP_BOX
+colors: FL_COL1 FL_COL1
+alignment: FL_ALIGN_CENTER
+style: FL_NORMAL_STYLE
+size: FL_NORMAL_SIZE
+lcol: FL_BLACK
+label: Close
+shortcut: ^M
+resize: FL_RESIZE_NONE
+gravity: FL_SouthEast FL_SouthEast
+name: button_close
+callback: C_FormBaseOKCB
+argument: 0
+
+--------------------
+class: FL_BUTTON
+type: NORMAL_BUTTON
+box: 270 340 90 30
+boxtype: FL_UP_BOX
+colors: FL_COL1 FL_COL1
+alignment: FL_ALIGN_CENTER
+style: FL_NORMAL_STYLE
+size: FL_NORMAL_SIZE
+lcol: FL_BLACK
+label: Update|#Uu
+shortcut:
+resize: FL_RESIZE_NONE
+gravity: FL_SouthEast FL_SouthEast
+name: button_update
+callback: C_FormBaseInputCB
+argument: 0
+
+==============================
+create_the_forms
form_error.fd \
form_graphics.fd \
form_index.fd \
+ form_browser.fd \
form_paragraph.fd \
form_preferences.fd \
form_print.fd \
+++ /dev/null
-// File modified by fdfix.sh for use by lyx (with xforms > 0.88) and gettext
-#include <config.h>
-#include "lyx_gui_misc.h"
-#include "gettext.h"
-
-/* Form definition file generated with fdesign. */
-
-#include FORMS_H_LOCATION
-#include <cstdlib>
-#include "log_form.h"
-
-FD_LaTeXLog *create_form_LaTeXLog(void)
-{
- FL_OBJECT *obj;
- FD_LaTeXLog *fdui = (FD_LaTeXLog *) fl_calloc(1, sizeof(FD_LaTeXLog));
-
- fdui->LaTeXLog = fl_bgn_form(FL_NO_BOX, 470, 380);
- obj = fl_add_box(FL_UP_BOX, 0, 0, 470, 380, "");
- fdui->browser_latexlog = obj = fl_add_browser(FL_NORMAL_BROWSER, 10, 10, 450, 320, "");
- fl_set_object_gravity(obj, FL_NorthWest, FL_SouthEast);
- obj = fl_add_button(FL_RETURN_BUTTON, 270, 340, 90, 30, _("Close"));
- fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
- fl_set_object_callback(obj, LatexLogClose, 0);
- obj = fl_add_button(FL_NORMAL_BUTTON, 370, 340, 90, 30, idex(_("Update|#Uu")));fl_set_button_shortcut(obj, scex(_("Update|#Uu")), 1);
- fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
- fl_set_object_callback(obj, LatexLogUpdate, 0);
- fl_end_form();
-
- fdui->LaTeXLog->fdui = fdui;
-
- return fdui;
-}
-/*---------------------------------------*/
-
+++ /dev/null
-/** Header file generated with fdesign **/
-
-#ifndef FD_LaTeXLog_h_
-#define FD_LaTeXLog_h_
-
-/** Callbacks, globals and object handlers **/
-extern "C" void LatexLogClose(FL_OBJECT *, long);
-extern "C" void LatexLogUpdate(FL_OBJECT *, long);
-
-
-/**** Forms and Objects ****/
-typedef struct {
- FL_FORM *LaTeXLog;
- void *vdata;
- char *cdata;
- long ldata;
- FL_OBJECT *browser_latexlog;
-} FD_LaTeXLog;
-
-extern FD_LaTeXLog * create_form_LaTeXLog(void);
-
-#endif /* FD_LaTeXLog_h_ */
#include "print_form.h"
#include "tex-strings.h"
#include "lyx_main.h"
-#include "log_form.h"
#include "debug.h"
#include "version.h"
#include "LyXView.h"
FD_form_preamble * fd_form_preamble;
FD_form_sendto * fd_form_sendto;
FD_form_figure * fd_form_figure;
-FD_LaTeXLog * fd_latex_log; // from log_form.h
Combox * combo_language;
Combox * combo_language2;
CancelCloseBoxCB, 0);
fl_set_button(fd_form_figure->radio_postscript, 1);
- // the latex log form
- fd_latex_log = create_form_LaTeXLog();
- fl_set_form_atclose(fd_latex_log->LaTeXLog,
- CancelCloseBoxCB, 0);
-
// This is probably as good a time as any to map the xform colours,
// should a mapping exist.
{
#include "form1.h"
#include "gettext.h"
#include "include_form.h"
-#include "log_form.h"
#include "layout_forms.h"
#include "lyx.h"
#include "lyx_cb.h"
extern FD_form_sendto * fd_form_sendto;
extern FD_form_spell_check * fd_form_spell_check;
extern FD_form_spell_options * fd_form_spell_options;
-extern FD_LaTeXLog * fd_latex_log;
extern FD_panel * fd_panel;
extern FD_delim * fd_delim;
extern FD_deco * fd_deco;
fd_form_spell_options->form_spell_options->visible) {
fl_redraw_form(fd_form_spell_options->form_spell_options);
}
- if (fd_latex_log->LaTeXLog->visible) {
- fl_redraw_form(fd_latex_log->LaTeXLog);
- }
if (fd_matrix && fd_matrix->matrix->visible) {
fl_redraw_form(fd_matrix->matrix);
}
if (fd_form_sendto->form_sendto->visible) {
fl_hide_form(fd_form_sendto->form_sendto);
}
- if (fd_latex_log->LaTeXLog->visible) {
- fl_hide_form(fd_latex_log->LaTeXLog);
- }
if (fd_form_spell_check) {
if (fd_form_spell_check->form_spell_check->visible) {
fl_trigger_object(fd_form_spell_check->done);
if (fd_form_preamble->form_preamble->visible) {
UpdateLayoutPreamble(current_view);
}
- if (fd_latex_log->LaTeXLog->visible) {
- LatexLogUpdate(0,0);
- }
if (current_view->buffer() && current_view->buffer()->isReadonly()) {
// a little crude perhaps but it works. ARRae
if (fd_form_character->form_character->visible) {
case LFUN_VC_HISTORY:
{
- owner->buffer()->lyxvc.showLog();
+ owner->getDialogs()->showVCLogFile();
break;
}
break;
case LFUN_LATEX_LOG:
- ShowLatexLog();
+ owner->getDialogs()->showLogFile();
break;
case LFUN_LAYOUTNO:
LyXVC::LyXVC()
{
vcs = 0;
- browser = 0;
owner_ = 0;
}
LyXVC::~LyXVC()
{
- if (browser) {
- if (browser->LaTeXLog->visible)
- fl_hide_form(browser->LaTeXLog);
- fl_free_form(browser->LaTeXLog);
- }
delete vcs;
}
}
-// This is a hack anyway so I'll put it here in the mean time.
-void LyXVC::logClose(FL_OBJECT * obj, long)
+const string LyXVC::getLogFile() const
{
- LyXVC * This = static_cast<LyXVC*>(obj->form->u_vdata);
- fl_hide_form(This->browser->LaTeXLog);
-}
-
-
-// and, hack over hack, here is a C wrapper :)
-extern "C" void C_LyXVC_logClose(FL_OBJECT * ob, long data)
-{
- LyXVC::logClose(ob, data);
-}
-
-
-void LyXVC::logUpdate(FL_OBJECT * obj, long)
-{
- LyXVC * This = static_cast<LyXVC*>(obj->form->u_vdata);
- This->showLog();
-}
-
-extern "C" void C_LyXVC_logUpdate(FL_OBJECT *ob, long data)
-{
- LyXVC::logUpdate(ob, data);
-}
+ if (!vcs)
+ return string();
-
-void LyXVC::viewLog(string const & fil)
-{
- static int ow = -1, oh;
-
- if (!browser) {
- FL_OBJECT * obj;
- browser = (FD_LaTeXLog *) fl_calloc(1, sizeof(*browser));
-
- browser->LaTeXLog = fl_bgn_form(FL_NO_BOX, 470, 380);
- browser->LaTeXLog->u_vdata = this;
- obj = fl_add_box(FL_UP_BOX, 0, 0, 470, 380, "");
- browser->browser_latexlog = fl_add_browser(FL_NORMAL_BROWSER,
- 10, 10,
- 450, 320, "");
- obj = fl_add_button(FL_RETURN_BUTTON, 270, 340, 90, 30,
- _("Close"));
- fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_LyXVC_logClose, 0);
- obj = fl_add_button(FL_NORMAL_BUTTON, 370, 340, 90, 30,
- idex(_("Update|#Uu")));
- fl_set_button_shortcut(obj, scex(_("Update|#Uu")), 1);
- fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_LyXVC_logUpdate, 0);
- fl_end_form();
- fl_set_form_atclose(browser->LaTeXLog, CancelCloseBoxCB, 0);
- }
-
- if (!fl_load_browser(browser->browser_latexlog, fil.c_str()))
- fl_add_browser_line(browser->browser_latexlog,
- _("No VC History!"));
-
- if (browser->LaTeXLog->visible) {
- fl_raise_form(browser->LaTeXLog);
- } else {
- fl_show_form(browser->LaTeXLog,
- FL_PLACE_MOUSE | FL_FREE_SIZE, FL_TRANSIENT,
- _("VC History"));
- if (ow < 0) {
- ow = browser->LaTeXLog->w;
- oh = browser->LaTeXLog->h;
- }
- fl_set_form_minsize(browser->LaTeXLog, ow, oh);
- }
-}
-
-
-void LyXVC::showLog()
-{
string tmpf = lyx::tempName(string(), "lyxvclog");
+ lyxerr[Debug::LYXVC] << "Generating logfile " << tmpf << endl;
vcs->getLog(tmpf);
- viewLog(tmpf);
- lyx::unlink(tmpf);
+ return tmpf;
}
#endif
#include "LString.h"
-#include "log_form.h"
class VCS;
class Buffer;
/// Undo last check-in.
void undoLast();
- ///
- void viewLog(string const &);
-
- ///
- void showLog();
+ /// generate a log file and return the filename
+ const string getLogFile() const;
///
void toggleReadOnly();
/// Returns the userid of the person who has locked the doc.
string const & locker() const;
- ///
- static void logClose(FL_OBJECT *, long);
- ///
- static void logUpdate(FL_OBJECT *, long);
private:
///
Buffer * owner_;
///
VCS * vcs;
-
- ///
- FD_LaTeXLog * browser; // FD_LaTeXLog is just a browser with a
- // close button. Unfortunately we can not use the standard callbacks.
};
#endif