From c53189af58f4a84547be6b5e4725b2f06132a4b2 Mon Sep 17 00:00:00 2001 From: Edwin Leuven Date: Mon, 13 Jan 2003 09:57:15 +0000 Subject: [PATCH] remove preamble dialog from the qt frontend git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5939 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt2/ChangeLog | 9 ++ src/frontends/qt2/Dialogs.C | 1 - src/frontends/qt2/Dialogs_impl.h | 7 - src/frontends/qt2/Makefile.dialogs | 7 - src/frontends/qt2/QPreamble.C | 56 -------- src/frontends/qt2/QPreamble.h | 42 ------ src/frontends/qt2/QPreambleDialog.C | 113 --------------- src/frontends/qt2/QPreambleDialog.h | 36 ----- src/frontends/qt2/ui/QPreambleDialog.ui | 179 ------------------------ 9 files changed, 9 insertions(+), 441 deletions(-) delete mode 100644 src/frontends/qt2/QPreamble.C delete mode 100644 src/frontends/qt2/QPreamble.h delete mode 100644 src/frontends/qt2/QPreambleDialog.C delete mode 100644 src/frontends/qt2/QPreambleDialog.h delete mode 100644 src/frontends/qt2/ui/QPreambleDialog.ui diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index d518d78f4e..80496276ac 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,3 +1,12 @@ +2003-01-12 Edwin Leuven + + * ui/QPreambleDialog.ui: + * QPreamble.[Ch]: + * QPreambleDialog.[Ch]: + * Dialogs.C: + * Dialogs_impl.h: + * Makefile.dialogs: Remove preamble dialog + 2003-01-12 Alfredo Braunstein * QSpellcheckerDialog.C (spellcheck,update_contents): enable/disable diff --git a/src/frontends/qt2/Dialogs.C b/src/frontends/qt2/Dialogs.C index d37054af23..943ba109c4 100644 --- a/src/frontends/qt2/Dialogs.C +++ b/src/frontends/qt2/Dialogs.C @@ -61,7 +61,6 @@ Dialogs::Impl::Impl(LyXView & lv, Dialogs & d) logfile(lv, d), minipage(lv, d), paragraph(lv, d), - preamble(lv, d), prefs(lv, d), print(lv, d), ref(lv, d), diff --git a/src/frontends/qt2/Dialogs_impl.h b/src/frontends/qt2/Dialogs_impl.h index 9356e83e9f..86d96aa34d 100644 --- a/src/frontends/qt2/Dialogs_impl.h +++ b/src/frontends/qt2/Dialogs_impl.h @@ -36,7 +36,6 @@ #include "ControlLog.h" #include "ControlMinipage.h" #include "ControlParagraph.h" -#include "ControlPreamble.h" #include "ControlPrefs.h" #include "ControlPrint.h" #include "ControlRef.h" @@ -89,8 +88,6 @@ #include "QMinipageDialog.h" #include "QParagraph.h" #include "QParagraphDialog.h" -#include "QPreamble.h" -#include "QPreambleDialog.h" #include "QPrefs.h" #include "QPrefsDialog.h" #include "QPrint.h" @@ -182,9 +179,6 @@ MinipageDialog; typedef GUI ParagraphDialog; -typedef GUI -PreambleDialog; - typedef GUI PrefsDialog; @@ -250,7 +244,6 @@ struct Dialogs::Impl { LogFileDialog logfile; MinipageDialog minipage; ParagraphDialog paragraph; - PreambleDialog preamble; PrefsDialog prefs; PrintDialog print; RefDialog ref; diff --git a/src/frontends/qt2/Makefile.dialogs b/src/frontends/qt2/Makefile.dialogs index 0bbc66e5e8..fce8afc912 100644 --- a/src/frontends/qt2/Makefile.dialogs +++ b/src/frontends/qt2/Makefile.dialogs @@ -19,7 +19,6 @@ DIALOGS = \ QMath \ QMinipage \ QParagraph \ - QPreamble \ QPrefs \ QPrint \ QRef \ @@ -73,8 +72,6 @@ DIALOGSOURCES = \ 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 \ @@ -126,7 +123,6 @@ MOCDIALOGS = \ QMathMatrixDialog_moc.C \ QMinipageDialog_moc.C \ QParagraphDialog_moc.C \ - QPreambleDialog_moc.C \ QPrefsDialog_moc.C \ QLPrintDialog_moc.C \ QRefDialog_moc.C \ @@ -184,8 +180,6 @@ UIDIALOGS = \ QMinipageDialogBase.C \ QParagraphDialogBase.h \ QParagraphDialogBase.C \ - QPreambleDialogBase.h \ - QPreambleDialogBase.C \ QPrefsDialogBase.h \ QPrefsDialogBase.C \ QPrintDialogBase.h \ @@ -261,7 +255,6 @@ UIDIALOGS = \ QMathMatrixDialogBase_moc.C \ QMinipageDialogBase_moc.C \ QParagraphDialogBase_moc.C \ - QPreambleDialogBase_moc.C \ QPrefsDialogBase_moc.C \ QPrintDialogBase_moc.C \ QRefDialogBase_moc.C \ diff --git a/src/frontends/qt2/QPreamble.C b/src/frontends/qt2/QPreamble.C deleted file mode 100644 index 7e098d62ba..0000000000 --- a/src/frontends/qt2/QPreamble.C +++ /dev/null @@ -1,56 +0,0 @@ -/** - * \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 - -#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 -#include - -typedef Qt2CB > 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())); -} diff --git a/src/frontends/qt2/QPreamble.h b/src/frontends/qt2/QPreamble.h deleted file mode 100644 index d2132d8b76..0000000000 --- a/src/frontends/qt2/QPreamble.h +++ /dev/null @@ -1,42 +0,0 @@ -// -*- 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 > -{ -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 diff --git a/src/frontends/qt2/QPreambleDialog.C b/src/frontends/qt2/QPreambleDialog.C deleted file mode 100644 index 7d4988c37c..0000000000 --- a/src/frontends/qt2/QPreambleDialog.C +++ /dev/null @@ -1,113 +0,0 @@ -/** - * \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 - -#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 -#include -#include - -#include - -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())); -} diff --git a/src/frontends/qt2/QPreambleDialog.h b/src/frontends/qt2/QPreambleDialog.h deleted file mode 100644 index 8b5292c37d..0000000000 --- a/src/frontends/qt2/QPreambleDialog.h +++ /dev/null @@ -1,36 +0,0 @@ -// -*- 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 diff --git a/src/frontends/qt2/ui/QPreambleDialog.ui b/src/frontends/qt2/ui/QPreambleDialog.ui deleted file mode 100644 index cb83d32324..0000000000 --- a/src/frontends/qt2/ui/QPreambleDialog.ui +++ /dev/null @@ -1,179 +0,0 @@ - -QPreambleDialogBase -config.h -qt_helpers.h - - QDialog - - name - QPreambleDialogBase - - - geometry - - 0 - 0 - 412 - 328 - - - - caption - LaTeX pre-amble - - - sizeGripEnabled - true - - - - margin - 11 - - - spacing - 6 - - - QMultiLineEdit - - name - preambleLE - - - toolTip - The LaTeX pre-amble - - - - QLayoutWidget - - name - Layout2 - - - - margin - 0 - - - spacing - 6 - - - QPushButton - - name - editPB - - - text - &Edit ... - - - default - true - - - toolTip - Edit the pre-amble in an external editor - - - - - name - Spacer3 - - - orientation - Horizontal - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - QPushButton - - name - okPB - - - text - &OK - - - default - true - - - toolTip - - - - - QPushButton - - name - applyPB - - - text - &Apply - - - default - true - - - toolTip - - - - - QPushButton - - name - closePB - - - text - &Close - - - - - - - - - preambleLE - textChanged() - QPreambleDialogBase - change_adaptor() - - - editPB - clicked() - QPreambleDialogBase - editClicked() - - change_adaptor() - editClicked() - - - preambleLE - editPB - okPB - applyPB - closePB - - -- 2.39.2