+2003-01-12 Edwin Leuven <e.leuven@uva.nl>
+
+ * ui/QPreambleDialog.ui:
+ * QPreamble.[Ch]:
+ * QPreambleDialog.[Ch]:
+ * Dialogs.C:
+ * Dialogs_impl.h:
+ * Makefile.dialogs: Remove preamble dialog
+
2003-01-12 Alfredo Braunstein <abraunst@libero.it>
* QSpellcheckerDialog.C (spellcheck,update_contents): enable/disable
logfile(lv, d),
minipage(lv, d),
paragraph(lv, d),
- preamble(lv, d),
prefs(lv, d),
print(lv, d),
ref(lv, d),
#include "ControlLog.h"
#include "ControlMinipage.h"
#include "ControlParagraph.h"
-#include "ControlPreamble.h"
#include "ControlPrefs.h"
#include "ControlPrint.h"
#include "ControlRef.h"
#include "QMinipageDialog.h"
#include "QParagraph.h"
#include "QParagraphDialog.h"
-#include "QPreamble.h"
-#include "QPreambleDialog.h"
#include "QPrefs.h"
#include "QPrefsDialog.h"
#include "QPrint.h"
typedef GUI<ControlParagraph, QParagraph, OkApplyCancelReadOnlyPolicy, Qt2BC>
ParagraphDialog;
-typedef GUI<ControlPreamble, QPreamble, NoRepeatedApplyReadOnlyPolicy, Qt2BC>
-PreambleDialog;
-
typedef GUI<ControlPrefs, QPrefs, OkApplyCancelPolicy, Qt2BC>
PrefsDialog;
LogFileDialog logfile;
MinipageDialog minipage;
ParagraphDialog paragraph;
- PreambleDialog preamble;
PrefsDialog prefs;
PrintDialog print;
RefDialog ref;
QMath \
QMinipage \
QParagraph \
- QPreamble \
QPrefs \
QPrint \
QRef \
QMinipage.C QMinipageDialog.C \
QParagraph.h QParagraphDialog.h \
QParagraph.C QParagraphDialog.C \
- QPreamble.h QPreambleDialog.h \
- QPreamble.C QPreambleDialog.C \
QPrefs.h QPrefsDialog.h \
QPrefs.C QPrefsDialog.C \
QPrint.h QLPrintDialog.h \
QMathMatrixDialog_moc.C \
QMinipageDialog_moc.C \
QParagraphDialog_moc.C \
- QPreambleDialog_moc.C \
QPrefsDialog_moc.C \
QLPrintDialog_moc.C \
QRefDialog_moc.C \
QMinipageDialogBase.C \
QParagraphDialogBase.h \
QParagraphDialogBase.C \
- QPreambleDialogBase.h \
- QPreambleDialogBase.C \
QPrefsDialogBase.h \
QPrefsDialogBase.C \
QPrintDialogBase.h \
QMathMatrixDialogBase_moc.C \
QMinipageDialogBase_moc.C \
QParagraphDialogBase_moc.C \
- QPreambleDialogBase_moc.C \
QPrefsDialogBase_moc.C \
QPrintDialogBase_moc.C \
QRefDialogBase_moc.C \
+++ /dev/null
-/**
- * \file QPreamble.C
- * This file is part of LyX, the document processor.
- * Licence details can be found in the file COPYING.
- *
- * \author John Levon
- *
- * Full author contact details are available in file CREDITS
- */
-
-#include <config.h>
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-
-#include "qt_helpers.h"
-#include "LyXView.h"
-#include "ControlPreamble.h"
-
-#include "QPreamble.h"
-#include "QPreambleDialog.h"
-#include "Qt2BC.h"
-
-#include <qmultilineedit.h>
-#include <qpushbutton.h>
-
-typedef Qt2CB<ControlPreamble, Qt2DB<QPreambleDialog> > base_class;
-
-
-QPreamble::QPreamble()
- : base_class(qt_("LaTeX Preamble"))
-{
-}
-
-
-void QPreamble::build_dialog()
-{
- dialog_.reset(new QPreambleDialog(this));
-
- bc().setOK(dialog_->okPB);
- bc().setApply(dialog_->applyPB);
- bc().setCancel(dialog_->closePB);
-}
-
-
-void QPreamble::update_contents()
-{
- dialog_->preambleLE->setText(toqstr(controller().params()));
-}
-
-
-void QPreamble::apply()
-{
- controller().params(fromqstr(dialog_->preambleLE->text()));
-}
+++ /dev/null
-// -*- C++ -*-
-/**
- * \file QPreamble.h
- * This file is part of LyX, the document processor.
- * Licence details can be found in the file COPYING.
- *
- * \author John Levon
- *
- * Full author contact details are available in file CREDITS
- */
-
-#ifndef QPREAMBLE_H
-#define QPREAMBLE_H
-
-#ifdef __GNUG__
-#pragma interface
-#endif
-
-#include "Qt2Base.h"
-
-class ControlPreamble;
-class QPreambleDialog;
-
-///
-class QPreamble
- : public Qt2CB<ControlPreamble, Qt2DB<QPreambleDialog> >
-{
-public:
- ///
- friend class QPreambleDialog;
- ///
- QPreamble();
-private:
- /// Apply changes
- virtual void apply();
- /// update
- virtual void update_contents();
- /// build the dialog
- virtual void build_dialog();
-};
-
-#endif // QPREAMBLE_H
+++ /dev/null
-/**
- * \file QPreambleDialog.C
- * This file is part of LyX, the document processor.
- * Licence details can be found in the file COPYING.
- *
- * \author John Levon
- *
- * Full author contact details are available in file CREDITS
- */
-
-#include <config.h>
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-
-#include "Lsstream.h"
-#include "support/lyxlib.h"
-#include "support/forkedcall.h"
-#include "support/filetools.h"
-#include "qt_helpers.h"
-#include "LyXView.h"
-#include "ControlPreamble.h"
-
-#include "QPreamble.h"
-#include "QPreambleDialog.h"
-
-#include <qpushbutton.h>
-#include <qmultilineedit.h>
-#include <qinputdialog.h>
-
-#include <fstream>
-
-using std::getline;
-
-QPreambleDialog::QPreambleDialog(QPreamble * form)
- : QPreambleDialogBase(0, 0, false, 0),
- form_(form)
-{
- connect(okPB, SIGNAL(clicked()),
- form, SLOT(slotOK()));
- connect(applyPB, SIGNAL(clicked()),
- form, SLOT(slotApply()));
- connect(closePB, SIGNAL(clicked()),
- form, SLOT(slotClose()));
-}
-
-
-void QPreambleDialog::closeEvent(QCloseEvent * e)
-{
- form_->slotWMHide();
- e->accept();
-}
-
-
-void QPreambleDialog::change_adaptor()
-{
- form_->changed();
-}
-
-
-void QPreambleDialog::editClicked()
-{
- // find an editor
- string editor = GetEnv("EDITOR");
- if (editor.empty()) {
- static string lastentry;
- editor = fromqstr(QInputDialog::getText(
- qt_("Enter editor program"), qt_("Editor"), QLineEdit::Normal,
- toqstr(lastentry)));
- if (editor.empty())
- return;
- lastentry = editor;
- }
-
- string const text(fromqstr(preambleLE->text()));
- string const filename(lyx::tempName("", "preamble"));
- std::ofstream file(filename.c_str());
-
- // FIXME ?
- if (!file)
- return;
-
- file << text;
-
- file.close();
-
- editor += ' ' + filename;
-
- Forkedcall call;
-
- // FIXME: make async
- if (call.startscript(Forkedcall::Wait, editor)) {
- lyx::unlink(filename);
- return;
- }
-
- std::ifstream in(filename.c_str());
-
- if (!in) {
- lyx::unlink(filename);
- return;
- }
-
- ostringstream newtext;
- newtext << in.rdbuf();
-
- // close the files before we delete the file
- in.close();
-
- lyx::unlink(filename);
- preambleLE->setText(toqstr(newtext.str()));
-}
+++ /dev/null
-// -*- C++ -*-
-/**
- * \file QPreambleDialog.h
- * This file is part of LyX, the document processor.
- * Licence details can be found in the file COPYING.
- *
- * \author John Levon
- *
- * Full author contact details are available in file CREDITS
- */
-
-#ifndef QPreambleDIAPreamble_H
-#define QPreambleDIAPreamble_H
-
-#ifdef __GNUG__
-#pragma interface
-#endif
-
-#include "ui/QPreambleDialogBase.h"
-
-class QPreamble;
-
-class QPreambleDialog : public QPreambleDialogBase {
- Q_OBJECT
-public:
- QPreambleDialog(QPreamble * form);
-protected slots:
- virtual void editClicked();
- virtual void change_adaptor();
-protected:
- virtual void closeEvent(QCloseEvent * e);
-private:
- QPreamble * form_;
-};
-
-#endif // QPreambleDIAPreamble_H
+++ /dev/null
-<!DOCTYPE UI><UI>
-<class>QPreambleDialogBase</class>
-<include location="global">config.h</include>
-<include location="local">qt_helpers.h</include>
-<widget>
- <class>QDialog</class>
- <property stdset="1">
- <name>name</name>
- <cstring>QPreambleDialogBase</cstring>
- </property>
- <property stdset="1">
- <name>geometry</name>
- <rect>
- <x>0</x>
- <y>0</y>
- <width>412</width>
- <height>328</height>
- </rect>
- </property>
- <property stdset="1">
- <name>caption</name>
- <string>LaTeX pre-amble</string>
- </property>
- <property stdset="1">
- <name>sizeGripEnabled</name>
- <bool>true</bool>
- </property>
- <vbox>
- <property stdset="1">
- <name>margin</name>
- <number>11</number>
- </property>
- <property stdset="1">
- <name>spacing</name>
- <number>6</number>
- </property>
- <widget>
- <class>QMultiLineEdit</class>
- <property stdset="1">
- <name>name</name>
- <cstring>preambleLE</cstring>
- </property>
- <property>
- <name>toolTip</name>
- <string>The LaTeX pre-amble</string>
- </property>
- </widget>
- <widget>
- <class>QLayoutWidget</class>
- <property stdset="1">
- <name>name</name>
- <cstring>Layout2</cstring>
- </property>
- <hbox>
- <property stdset="1">
- <name>margin</name>
- <number>0</number>
- </property>
- <property stdset="1">
- <name>spacing</name>
- <number>6</number>
- </property>
- <widget>
- <class>QPushButton</class>
- <property stdset="1">
- <name>name</name>
- <cstring>editPB</cstring>
- </property>
- <property stdset="1">
- <name>text</name>
- <string>&Edit ...</string>
- </property>
- <property stdset="1">
- <name>default</name>
- <bool>true</bool>
- </property>
- <property>
- <name>toolTip</name>
- <string>Edit the pre-amble in an external editor</string>
- </property>
- </widget>
- <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>okPB</cstring>
- </property>
- <property stdset="1">
- <name>text</name>
- <string>&OK</string>
- </property>
- <property stdset="1">
- <name>default</name>
- <bool>true</bool>
- </property>
- <property>
- <name>toolTip</name>
- <string></string>
- </property>
- </widget>
- <widget>
- <class>QPushButton</class>
- <property stdset="1">
- <name>name</name>
- <cstring>applyPB</cstring>
- </property>
- <property stdset="1">
- <name>text</name>
- <string>&Apply</string>
- </property>
- <property stdset="1">
- <name>default</name>
- <bool>true</bool>
- </property>
- <property>
- <name>toolTip</name>
- <string></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>preambleLE</sender>
- <signal>textChanged()</signal>
- <receiver>QPreambleDialogBase</receiver>
- <slot>change_adaptor()</slot>
- </connection>
- <connection>
- <sender>editPB</sender>
- <signal>clicked()</signal>
- <receiver>QPreambleDialogBase</receiver>
- <slot>editClicked()</slot>
- </connection>
- <slot access="public">change_adaptor()</slot>
- <slot access="public">editClicked()</slot>
-</connections>
-<tabstops>
- <tabstop>preambleLE</tabstop>
- <tabstop>editPB</tabstop>
- <tabstop>okPB</tabstop>
- <tabstop>applyPB</tabstop>
- <tabstop>closePB</tabstop>
-</tabstops>
-</UI>