From 03add3957a3807cdd9f7608aa9277c0177988a9e Mon Sep 17 00:00:00 2001 From: John Levon Date: Sun, 19 Aug 2001 13:25:15 +0000 Subject: [PATCH] The big renaming. Yowser. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2552 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt2/.cvsignore | 4 - src/frontends/qt2/ChangeLog | 4 + src/frontends/qt2/Dialogs.C | 123 ++-- src/frontends/qt2/FileDialog_private.C | 2 +- src/frontends/qt2/FormCitationDialogImpl.C | 305 --------- src/frontends/qt2/FormCitationDialogImpl.h | 39 -- src/frontends/qt2/FormCopyright.C | 52 -- src/frontends/qt2/FormCopyright.h | 48 -- src/frontends/qt2/FormCopyrightDialogImpl.C | 22 - src/frontends/qt2/FormCopyrightDialogImpl.h | 15 - src/frontends/qt2/FormCredits.C | 58 -- src/frontends/qt2/FormCredits.h | 41 -- src/frontends/qt2/FormCreditsDialog.ui | 167 ----- src/frontends/qt2/FormCreditsDialogImpl.C | 27 - src/frontends/qt2/FormCreditsDialogImpl.h | 18 - src/frontends/qt2/FormDocumentDialogImpl.C | 502 -------------- src/frontends/qt2/FormDocumentDialogImpl.h | 76 --- src/frontends/qt2/FormIndex.C | 132 ---- src/frontends/qt2/FormIndex.h | 83 --- src/frontends/qt2/FormIndexDialog.C | 46 -- src/frontends/qt2/FormIndexDialog.h | 26 - src/frontends/qt2/FormRefDialog.C | 83 --- src/frontends/qt2/FormRefDialog.h | 31 - src/frontends/qt2/FormSplashImpl.C | 52 -- src/frontends/qt2/FormSplashImpl.h | 27 - src/frontends/qt2/FormTabularCreate.C | 70 -- src/frontends/qt2/FormTabularCreate.h | 63 -- src/frontends/qt2/FormToc.h | 90 --- src/frontends/qt2/FormTocDialog.C | 87 --- src/frontends/qt2/FormTocDialog.h | 29 - src/frontends/qt2/FormUrl.h | 83 --- src/frontends/qt2/FormUrlDialog.C | 48 -- src/frontends/qt2/FormUrlDialog.h | 26 - src/frontends/qt2/GUIRunTime.C | 79 ++- src/frontends/qt2/Makefile.am | 155 +---- src/frontends/qt2/Makefile.dialogs | 99 +++ src/frontends/qt2/QAbout.C | 44 ++ src/frontends/qt2/QAbout.h | 36 + src/frontends/qt2/QAboutDialog.C | 19 + src/frontends/qt2/QAboutDialog.h | 21 + .../qt2/{FormCharacter.C => QCharacter.C} | 44 +- .../qt2/{FormCharacter.h => QCharacter.h} | 18 +- .../qt2/{chardlgimpl.C => QCharacterDialog.C} | 57 +- src/frontends/qt2/QCharacterDialog.h | 71 ++ .../qt2/{FormCitation.C => QCitation.C} | 63 +- .../qt2/{FormCitation.h => QCitation.h} | 34 +- src/frontends/qt2/QCitationDialog.C | 277 ++++++++ src/frontends/qt2/QCitationDialog.h | 47 ++ .../qt2/{FormDocument.C => QDocument.C} | 109 +-- .../qt2/{FormDocument.h => QDocument.h} | 44 +- src/frontends/qt2/QDocumentDialog.C | 454 +++++++++++++ src/frontends/qt2/QDocumentDialog.h | 86 +++ src/frontends/qt2/QIndex.C | 130 ++++ src/frontends/qt2/QIndex.h | 71 ++ src/frontends/qt2/QIndexDialog.C | 44 ++ src/frontends/qt2/QIndexDialog.h | 36 + .../qt2/{FormParagraph.C => QParagraph.C} | 33 +- .../qt2/{FormParagraph.h => QParagraph.h} | 23 +- ...{paragraphdlgimpl.C => QParagraphDialog.C} | 135 ++-- ...{paragraphdlgimpl.h => QParagraphDialog.h} | 28 +- src/frontends/qt2/{FormPrint.C => QPrint.C} | 37 +- src/frontends/qt2/{FormPrint.h => QPrint.h} | 23 +- .../qt2/{printdlgimpl.C => QPrintDialog.C} | 87 +-- .../qt2/{printdlgimpl.h => QPrintDialog.h} | 23 +- src/frontends/qt2/{FormRef.C => QRef.C} | 93 +-- src/frontends/qt2/{FormRef.h => QRef.h} | 50 +- src/frontends/qt2/QRefDialog.C | 75 +++ src/frontends/qt2/QRefDialog.h | 41 ++ src/frontends/qt2/{FormSearch.C => QSearch.C} | 48 +- src/frontends/qt2/{FormSearch.h => QSearch.h} | 20 +- .../qt2/{searchdlgimpl.C => QSearchDialog.C} | 20 +- src/frontends/qt2/QSearchDialog.h | 54 ++ src/frontends/qt2/{FormSplash.C => QSplash.C} | 20 +- src/frontends/qt2/{FormSplash.h => QSplash.h} | 20 +- src/frontends/qt2/QSplashDialog.C | 51 ++ src/frontends/qt2/QSplashDialog.h | 25 + src/frontends/qt2/QTabularCreate.C | 73 +++ src/frontends/qt2/QTabularCreate.h | 52 ++ src/frontends/qt2/QTabularCreateDialog.C | 69 ++ src/frontends/qt2/QTabularCreateDialog.h | 33 + src/frontends/qt2/{FormToc.C => QToc.C} | 90 +-- src/frontends/qt2/QToc.h | 78 +++ src/frontends/qt2/QTocDialog.C | 79 +++ src/frontends/qt2/QTocDialog.h | 37 ++ src/frontends/qt2/{FormUrl.C => QURL.C} | 67 +- src/frontends/qt2/QURL.h | 71 ++ src/frontends/qt2/QURLDialog.C | 46 ++ src/frontends/qt2/QURLDialog.h | 34 + src/frontends/qt2/Qt2Base.C | 2 +- src/frontends/qt2/QtLyXView.h | 4 +- src/frontends/qt2/README | 59 ++ src/frontends/qt2/chardlg.C | 255 -------- src/frontends/qt2/chardlg.h | 66 -- src/frontends/qt2/chardlgimpl.h | 70 -- src/frontends/qt2/dialogs-qt2.txt | 33 - src/frontends/qt2/emptytable.C | 8 +- src/frontends/qt2/moc/.cvsignore | 8 + src/frontends/qt2/moc/Makefile.am | 26 + src/frontends/qt2/paragraphdlg.C | 618 ------------------ src/frontends/qt2/paragraphdlg.h | 117 ---- src/frontends/qt2/printdlg.C | 223 ------- src/frontends/qt2/printdlg.h | 71 -- src/frontends/qt2/qt2BC.h | 13 +- src/frontends/qt2/searchdlg.C | 149 ----- src/frontends/qt2/searchdlg.h | 52 -- src/frontends/qt2/searchdlgimpl.h | 51 -- src/frontends/qt2/tabularcreatedlg.C | 108 --- src/frontends/qt2/tabularcreatedlg.h | 48 -- src/frontends/qt2/tabularcreatedlgimpl.C | 65 -- src/frontends/qt2/tabularcreatedlgimpl.h | 34 - src/frontends/qt2/ui/.cvsignore | 10 + src/frontends/qt2/ui/Makefile.am | 25 + .../QAboutDialog.ui} | 26 +- .../{chardlg.ui => ui/QCharacterDialog.ui} | 22 +- .../QCitationDialog.ui} | 72 +- .../QDocumentDialog.ui} | 591 ++++++----------- .../QIndexDialog.ui} | 10 +- .../QParagraphDialog.ui} | 26 +- .../qt2/{printdlg.ui => ui/QPrintDialog.ui} | 14 +- .../QRefDialog.ui} | 20 +- .../qt2/{searchdlg.ui => ui/QSearchDialog.ui} | 14 +- .../QTabularCreateDialog.ui} | 10 +- .../QTocDialog.ui} | 23 +- .../QURLDialog.ui} | 10 +- src/frontends/qt2/ui/moc/.cvsignore | 10 + src/frontends/qt2/ui/moc/Makefile.am | 23 + 126 files changed, 3469 insertions(+), 5669 deletions(-) delete mode 100644 src/frontends/qt2/FormCitationDialogImpl.C delete mode 100644 src/frontends/qt2/FormCitationDialogImpl.h delete mode 100644 src/frontends/qt2/FormCopyright.C delete mode 100644 src/frontends/qt2/FormCopyright.h delete mode 100644 src/frontends/qt2/FormCopyrightDialogImpl.C delete mode 100644 src/frontends/qt2/FormCopyrightDialogImpl.h delete mode 100644 src/frontends/qt2/FormCredits.C delete mode 100644 src/frontends/qt2/FormCredits.h delete mode 100644 src/frontends/qt2/FormCreditsDialog.ui delete mode 100644 src/frontends/qt2/FormCreditsDialogImpl.C delete mode 100644 src/frontends/qt2/FormCreditsDialogImpl.h delete mode 100644 src/frontends/qt2/FormDocumentDialogImpl.C delete mode 100644 src/frontends/qt2/FormDocumentDialogImpl.h delete mode 100644 src/frontends/qt2/FormIndex.C delete mode 100644 src/frontends/qt2/FormIndex.h delete mode 100644 src/frontends/qt2/FormIndexDialog.C delete mode 100644 src/frontends/qt2/FormIndexDialog.h delete mode 100644 src/frontends/qt2/FormRefDialog.C delete mode 100644 src/frontends/qt2/FormRefDialog.h delete mode 100644 src/frontends/qt2/FormSplashImpl.C delete mode 100644 src/frontends/qt2/FormSplashImpl.h delete mode 100644 src/frontends/qt2/FormTabularCreate.C delete mode 100644 src/frontends/qt2/FormTabularCreate.h delete mode 100644 src/frontends/qt2/FormToc.h delete mode 100644 src/frontends/qt2/FormTocDialog.C delete mode 100644 src/frontends/qt2/FormTocDialog.h delete mode 100644 src/frontends/qt2/FormUrl.h delete mode 100644 src/frontends/qt2/FormUrlDialog.C delete mode 100644 src/frontends/qt2/FormUrlDialog.h create mode 100644 src/frontends/qt2/Makefile.dialogs create mode 100644 src/frontends/qt2/QAbout.C create mode 100644 src/frontends/qt2/QAbout.h create mode 100644 src/frontends/qt2/QAboutDialog.C create mode 100644 src/frontends/qt2/QAboutDialog.h rename src/frontends/qt2/{FormCharacter.C => QCharacter.C} (55%) rename src/frontends/qt2/{FormCharacter.h => QCharacter.h} (76%) rename src/frontends/qt2/{chardlgimpl.C => QCharacterDialog.C} (75%) create mode 100644 src/frontends/qt2/QCharacterDialog.h rename src/frontends/qt2/{FormCitation.C => QCitation.C} (64%) rename src/frontends/qt2/{FormCitation.h => QCitation.h} (51%) create mode 100644 src/frontends/qt2/QCitationDialog.C create mode 100644 src/frontends/qt2/QCitationDialog.h rename src/frontends/qt2/{FormDocument.C => QDocument.C} (93%) rename src/frontends/qt2/{FormDocument.h => QDocument.h} (77%) create mode 100644 src/frontends/qt2/QDocumentDialog.C create mode 100644 src/frontends/qt2/QDocumentDialog.h create mode 100644 src/frontends/qt2/QIndex.C create mode 100644 src/frontends/qt2/QIndex.h create mode 100644 src/frontends/qt2/QIndexDialog.C create mode 100644 src/frontends/qt2/QIndexDialog.h rename src/frontends/qt2/{FormParagraph.C => QParagraph.C} (87%) rename src/frontends/qt2/{FormParagraph.h => QParagraph.h} (71%) rename src/frontends/qt2/{paragraphdlgimpl.C => QParagraphDialog.C} (77%) rename src/frontends/qt2/{paragraphdlgimpl.h => QParagraphDialog.h} (83%) rename src/frontends/qt2/{FormPrint.C => QPrint.C} (77%) rename src/frontends/qt2/{FormPrint.h => QPrint.h} (73%) rename src/frontends/qt2/{printdlgimpl.C => QPrintDialog.C} (50%) rename src/frontends/qt2/{printdlgimpl.h => QPrintDialog.h} (72%) rename src/frontends/qt2/{FormRef.C => QRef.C} (70%) rename src/frontends/qt2/{FormRef.h => QRef.h} (59%) create mode 100644 src/frontends/qt2/QRefDialog.C create mode 100644 src/frontends/qt2/QRefDialog.h rename src/frontends/qt2/{FormSearch.C => QSearch.C} (58%) rename src/frontends/qt2/{FormSearch.h => QSearch.h} (82%) rename src/frontends/qt2/{searchdlgimpl.C => QSearchDialog.C} (65%) create mode 100644 src/frontends/qt2/QSearchDialog.h rename src/frontends/qt2/{FormSplash.C => QSplash.C} (57%) rename src/frontends/qt2/{FormSplash.h => QSplash.h} (59%) create mode 100644 src/frontends/qt2/QSplashDialog.C create mode 100644 src/frontends/qt2/QSplashDialog.h create mode 100644 src/frontends/qt2/QTabularCreate.C create mode 100644 src/frontends/qt2/QTabularCreate.h create mode 100644 src/frontends/qt2/QTabularCreateDialog.C create mode 100644 src/frontends/qt2/QTabularCreateDialog.h rename src/frontends/qt2/{FormToc.C => QToc.C} (74%) create mode 100644 src/frontends/qt2/QToc.h create mode 100644 src/frontends/qt2/QTocDialog.C create mode 100644 src/frontends/qt2/QTocDialog.h rename src/frontends/qt2/{FormUrl.C => QURL.C} (59%) create mode 100644 src/frontends/qt2/QURL.h create mode 100644 src/frontends/qt2/QURLDialog.C create mode 100644 src/frontends/qt2/QURLDialog.h create mode 100644 src/frontends/qt2/README delete mode 100644 src/frontends/qt2/chardlg.C delete mode 100644 src/frontends/qt2/chardlg.h delete mode 100644 src/frontends/qt2/chardlgimpl.h delete mode 100644 src/frontends/qt2/dialogs-qt2.txt create mode 100644 src/frontends/qt2/moc/.cvsignore create mode 100644 src/frontends/qt2/moc/Makefile.am delete mode 100644 src/frontends/qt2/paragraphdlg.C delete mode 100644 src/frontends/qt2/paragraphdlg.h delete mode 100644 src/frontends/qt2/printdlg.C delete mode 100644 src/frontends/qt2/printdlg.h delete mode 100644 src/frontends/qt2/searchdlg.C delete mode 100644 src/frontends/qt2/searchdlg.h delete mode 100644 src/frontends/qt2/searchdlgimpl.h delete mode 100644 src/frontends/qt2/tabularcreatedlg.C delete mode 100644 src/frontends/qt2/tabularcreatedlg.h delete mode 100644 src/frontends/qt2/tabularcreatedlgimpl.C delete mode 100644 src/frontends/qt2/tabularcreatedlgimpl.h create mode 100644 src/frontends/qt2/ui/.cvsignore create mode 100644 src/frontends/qt2/ui/Makefile.am rename src/frontends/qt2/{FormCopyrightDialog.ui => ui/QAboutDialog.ui} (92%) rename src/frontends/qt2/{chardlg.ui => ui/QCharacterDialog.ui} (98%) rename src/frontends/qt2/{FormCitationDialog.ui => ui/QCitationDialog.ui} (79%) rename src/frontends/qt2/{FormDocumentDialog.ui => ui/QDocumentDialog.ui} (94%) rename src/frontends/qt2/{FormIndexDialogBase.ui => ui/QIndexDialog.ui} (96%) rename src/frontends/qt2/{paragraphdlg.ui => ui/QParagraphDialog.ui} (99%) rename src/frontends/qt2/{printdlg.ui => ui/QPrintDialog.ui} (98%) rename src/frontends/qt2/{FormRefDialogBase.ui => ui/QRefDialog.ui} (97%) rename src/frontends/qt2/{searchdlg.ui => ui/QSearchDialog.ui} (96%) rename src/frontends/qt2/{tabularcreatedlg.ui => ui/QTabularCreateDialog.ui} (97%) rename src/frontends/qt2/{FormTocDialogBase.ui => ui/QTocDialog.ui} (92%) rename src/frontends/qt2/{FormUrlDialogBase.ui => ui/QURLDialog.ui} (97%) create mode 100644 src/frontends/qt2/ui/moc/.cvsignore create mode 100644 src/frontends/qt2/ui/moc/Makefile.am diff --git a/src/frontends/qt2/.cvsignore b/src/frontends/qt2/.cvsignore index 638ccd4ddc..820ab9c110 100644 --- a/src/frontends/qt2/.cvsignore +++ b/src/frontends/qt2/.cvsignore @@ -6,7 +6,3 @@ Makefile libqt2.la moc_*.C *_moc.C -FormCitationDialog.h -FormCitationDialog.C -FormCopyrightDialog.C -FormCopyrightDialog.h diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index 107618474f..7ccb03f9d0 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,3 +1,7 @@ +2001-08-19 John Levon + + * all files: enormous naming re-jig and tidy + 2001-07-13 Angus Leeming Consistent use of Lsstream.h: diff --git a/src/frontends/qt2/Dialogs.C b/src/frontends/qt2/Dialogs.C index 8f5b5eb25c..27178b705d 100644 --- a/src/frontends/qt2/Dialogs.C +++ b/src/frontends/qt2/Dialogs.C @@ -1,12 +1,8 @@ -/* This file is part of - * ====================================================== +/** + * \file Dialogs.C + * Copyright 2001 the LyX Team + * Read the file COPYING * - * LyX, The Document Processor - * - * Copyright 1995 Matthias Ettrich - * Copyright 1995-2000 The LyX Team. - * - * ====================================================== */ #include @@ -15,81 +11,80 @@ #pragma implementation #endif +// the dialog definitions +#include "QCitationDialog.h" +#include "QAboutDialog.h" + +// the controller interface +#include "QAbout.h" +#include "QCharacter.h" +#include "QCitation.h" +#include "QParagraph.h" +#include "QPrint.h" +#include "QSearch.h" +#include "QSplash.h" +#include "QTabularCreate.h" + +#include "QtLyXView.h" #include "Dialogs.h" +#include "BufferView.h" +#include "buffer.h" +#include "qt2BC.h" -#include "FormCitationDialogImpl.h" -#include "FormCopyrightDialogImpl.h" -#include "FormCreditsDialogImpl.h" -#undef emit - +// xforms implementations #include "../xforms/FormError.h" #include "../xforms/FormGraphics.h" #include "../xforms/FormPreferences.h" #include "../xforms/FormTabular.h" -#include "FormCharacter.h" -#include "FormCitation.h" -#include "FormCopyright.h" -#include "FormCredits.h" -//#include "FormDocument.h" -//#include "FormIndex.h" -#include "FormParagraph.h" -#include "FormPrint.h" -//#include "FormRef.h" -#include "FormSearch.h" -#include "FormSplash.h" -#include "FormTabularCreate.h" -//#include "FormToc.h" -//#include "FormUrl.h" - -#include "BufferView.h" -#include "buffer.h" - +// the controllers #include "controllers/ControlCitation.h" +#include "controllers/ControlAboutlyx.h" +#include "controllers/ControlSplash.h" +#if 0 #include "controllers/ControlCopyright.h" #include "controllers/ControlCredits.h" +#include "controllers/ControlBibitem.h" +#include "controllers/ControlBibtex.h" +#include "controllers/ControlButtons.h" +#include "controllers/ControlCharacter.h" +#include "controllers/ControlCitation.h" +#include "controllers/ControlCommand.h" +#include "controllers/ControlERT.h" +#include "controllers/ControlError.h" +#include "controllers/ControlExternal.h" +#include "controllers/ControlFloat.h" +#include "controllers/ControlGraphics.h" +#include "controllers/ControlInclude.h" +#include "controllers/ControlIndex.h" +#include "controllers/ControlLabel.h" +#include "controllers/ControlLog.h" +#include "controllers/ControlMinipage.h" +#include "controllers/ControlPreamble.h" +#include "controllers/ControlPrint.h" +#include "controllers/ControlRef.h" +#include "controllers/ControlSearch.h" +#include "controllers/ControlSpellchecker.h" +#include "controllers/ControlTabularCreate.h" +#include "controllers/ControlThesaurus.h" +#include "controllers/ControlToc.h" +#include "controllers/ControlUrl.h" +#include "controllers/ControlVCLog.h" +#endif #include "GUI.h" - -#include "qt2BC.h" - -// Signal enabling all visible dialogs to be redrawn if so desired. -// E.g., when the GUI colours have been remapped. + +// this makes no real sense for Qt2 SigC::Signal0 Dialogs::redrawGUI; Dialogs::Dialogs(LyXView * lv) { - splash_.reset( new FormSplash(lv, this) ); + splash_.reset(new QSplash(lv, this)); // dialogs that have been converted to new scheme - add( new GUICitation( *lv, *this ) ); - add( new GUICopyright( *lv, *this ) ); - add( new GUICredits( *lv, *this ) ); - - // ------------------------------------------ - - // dialogs that are still old-style - add( new FormCharacter(lv, this)); - - // add(new FormDocument(lv, this)); - - - // REMOVED THIS UNTIL CHANGED TO NEW SCHEME -- Kalle, 2001-03-23 - // add(new FormError(lv, this)); - - // REMOVED THIS UNTIL CHANGED TO NEW SCHEME -- Kalle, 2001-03-28 - // add(new FormGraphics(lv, this)); - // add(new FormIndex(lv, this)); - add(new FormParagraph(lv, this)); - add(new FormPreferences(lv, this)); - add(new FormPrint(lv, this)); - // add(new FormRef(lv, this)); - add(new FormSearch(lv, this)); - add(new FormTabular(lv, this)); - add(new FormTabularCreate(lv, this)); - // add(new FormToc(lv, this)); - // add(new FormUrl(lv, this)); + add(new GUICitation(*lv, *this)); + add(new GUIAboutlyx(*lv, *this)); // reduce the number of connections needed in // dialogs by a simple connection here. diff --git a/src/frontends/qt2/FileDialog_private.C b/src/frontends/qt2/FileDialog_private.C index 3d7e4f6f14..f10cf04195 100644 --- a/src/frontends/qt2/FileDialog_private.C +++ b/src/frontends/qt2/FileDialog_private.C @@ -34,7 +34,7 @@ void LyXFileDialog::done(int what) QDialog::done(what); return; } else if (what == QDialog::Accepted) - lv_->getLyXFunc()->Dispatch(action_, selectedFile().data()); + lv_->getLyXFunc()->dispatch(action_, selectedFile().data()); delete this; } diff --git a/src/frontends/qt2/FormCitationDialogImpl.C b/src/frontends/qt2/FormCitationDialogImpl.C deleted file mode 100644 index 891f7ba843..0000000000 --- a/src/frontends/qt2/FormCitationDialogImpl.C +++ /dev/null @@ -1,305 +0,0 @@ -/** - * $Id: FormCitationDialogImpl.C,v 1.9 2001/06/17 13:22:55 leeming Exp $ - */ - -#include - -#include "FormCitationDialogImpl.h" -#include "Dialogs.h" -#include "FormCitation.h" -#include "qt2BC.h" -#include "controllers/biblio.h" -#include "controllers/ControlCitation.h" - -#include -#include -#include -#include -#include -#undef emit - -#include -#include "LyXView.h" -#include "buffer.h" - -using std::vector; -using std::find; -using std::max; - -/* - * Constructs a FormCitationDialogImpl which is a child of 'parent', with the - * name 'name' and widget flags set to 'f' - * - * The dialog will by default be modeless, unless you set 'modal' to - * TRUE to construct a modal dialog. - */ -FormCitationDialogImpl::FormCitationDialogImpl( FormCitation* form, QWidget* parent, const char* name, bool modal, WFlags fl ) - : FormCitationDialog( parent, name, modal, fl ), - form_( form ) -{ - connect( okPB, SIGNAL( clicked() ), - form, SLOT( slotOK() ) ); - connect( cancelPB, SIGNAL( clicked() ), - form, SLOT( slotCancel() ) ); - connect( restorePB, SIGNAL( clicked() ), - form, SLOT( slotRestore() ) ); - connect( applyPB, SIGNAL( clicked() ), - form, SLOT( slotApply() ) ); -} - -/* - * Destroys the object and frees any allocated resources - */ -FormCitationDialogImpl::~FormCitationDialogImpl() -{ - // no need to delete child widgets, Qt does it all for us -} - - -// These slots correspond to the XForms input() method. -void FormCitationDialogImpl::slotBibSelected( int sel ) -{ - biblio::InfoMap const & theMap = form_->controller().bibkeysInfo(); - - citeLB->clearSelection(); - - if (sel < 0 || sel >= (int)form_->bibkeys.size()) { - // form_->bc().input( ButtonPolicy::SMI_NOOP ); - return; - } - - // Put into browser_info the additional info associated with - // the selected browser_bib key - infoML->clear(); - - infoML->setText( biblio::getInfo( theMap, - form_->bibkeys[sel] ).c_str() ); - - // Highlight the selected browser_bib key in browser_cite if - // present - vector::const_iterator cit = - std::find(form_->citekeys.begin(), form_->citekeys.end(), - form_->bibkeys[sel]); - - if (cit != form_->citekeys.end()) { - int const n = int(cit - form_->citekeys.begin()); - citeLB->setSelected( n, true ); - citeLB->setTopItem( n ); - } - - if (!form_->controller().isReadonly()) { - if (cit != form_->citekeys.end()) { - form_->setBibButtons(FormCitation::OFF); - form_->setCiteButtons(FormCitation::ON); - } else { - form_->setBibButtons(FormCitation::ON); - form_->setCiteButtons(FormCitation::OFF); - } - } - - // form_->bc().input( ButtonPolicy::SMI_VALID ); -} - - -void FormCitationDialogImpl::slotCiteSelected( int sel ) -{ - biblio::InfoMap const & theMap = form_->controller().bibkeysInfo(); - - if (sel < 0 || sel >= (int)form_->citekeys.size()) { - // form_->bc().input( ButtonPolicy::SMI_NOOP ); - return; - } - - if (!form_->controller().isReadonly()) { - form_->setBibButtons(FormCitation::OFF); - form_->setCiteButtons(FormCitation::ON); - } - - // Highlight the selected browser_cite key in browser_bib - vector::const_iterator cit = - std::find(form_->bibkeys.begin(), form_->bibkeys.end(), form_->citekeys[sel]); - - if (cit != form_->bibkeys.end()) { - int const n = int(cit - form_->bibkeys.begin()); - bibLB->setSelected( n, true ); - bibLB->setTopItem( n ); - - // Put into browser_info the additional info associated - // with the selected browser_cite key - infoML->clear(); - infoML->setText( biblio::getInfo( theMap, form_->bibkeys[sel] ).c_str() ); - } - - // form_->bc().input( ButtonPolicy::SMI_VALID ); -} - - -void FormCitationDialogImpl::slotAddClicked() -{ - int const sel = bibLB->currentItem(); - if (sel < 0 || sel >= (int)form_->bibkeys.size()) { - // form_->bc().input( ButtonPolicy::SMI_NOOP ); - return; - } - - // Add the selected browser_bib key to browser_cite - citeLB->insertItem( form_->bibkeys[sel].c_str() ); - form_->citekeys.push_back( form_->bibkeys[sel] ); - - int const n = int(form_->citekeys.size()); - citeLB->setSelected( n-1, true ); - - form_->setBibButtons(FormCitation::OFF); - form_->setCiteButtons(FormCitation::ON); - - // form_->bc().input( ButtonPolicy::SMI_VALID ); -} - - -void FormCitationDialogImpl::slotDelClicked() -{ - int const sel = citeLB->currentItem(); - if (sel < 0 || sel >= (int)form_->citekeys.size()) { - // form_->bc().input( ButtonPolicy::SMI_NOOP ); - return; - } - - // Remove the selected key from browser_cite - citeLB->removeItem( sel ); - form_->citekeys.erase(form_->citekeys.begin() + sel ); - - form_->setBibButtons(FormCitation::ON); - form_->setCiteButtons(FormCitation::OFF); - - // form_->bc().input( ButtonPolicy::SMI_VALID ); -} - - -void FormCitationDialogImpl::slotUpClicked() -{ - int const sel = citeLB->currentItem(); - if (sel < 1 || sel >= (int)form_->citekeys.size()) { - // form_->bc().input( ButtonPolicy::SMI_NOOP ); - return; - } - - // Move the selected key up one line - vector::iterator it = form_->citekeys.begin() + sel; - string const tmp = *it; - - citeLB->removeItem( sel ); - form_->citekeys.erase(it); - - citeLB->insertItem( tmp.c_str(), sel-1 ); - citeLB->setSelected( sel-1, true ); - form_->citekeys.insert(it-1, tmp); - form_->setCiteButtons(FormCitation::ON); - - // form_->bc().input( ButtonPolicy::SMI_VALID ); -} - - -void FormCitationDialogImpl::slotDownClicked() -{ - int const sel = citeLB->currentItem(); - if (sel < 0 || sel >= (int)form_->citekeys.size()-1) { - // form_->bc().input( ButtonPolicy::SMI_NOOP ); - return; - } - - // Move the selected key down one line - vector::iterator it = form_->citekeys.begin() + sel; - string const tmp = *it; - - citeLB->removeItem( sel ); - form_->citekeys.erase(it); - - citeLB->insertItem( tmp.c_str(), sel+1 ); - citeLB->setSelected( sel+1, true ); - form_->citekeys.insert(it+1, tmp); - form_->setCiteButtons(FormCitation::ON); - - // form_->bc().input( ButtonPolicy::SMI_VALID ); -} - - -void FormCitationDialogImpl::slotPreviousClicked() -{ - doPreviousNext( false ); -} - - -void FormCitationDialogImpl::slotNextClicked() -{ - doPreviousNext( true ); -} - - -void FormCitationDialogImpl::doPreviousNext( bool next ) -{ - biblio::InfoMap const & theMap = form_->controller().bibkeysInfo(); - string const str = searchED->text().latin1(); - - biblio::Direction const dir = - next ? - biblio::FORWARD : biblio::BACKWARD; - - biblio::Search const type = - searchTypeCB->isChecked() ? - biblio::REGEX : biblio::SIMPLE; - - vector::const_iterator start = form_->bibkeys.begin(); - int const sel = bibLB->currentItem(); - if (sel >= 0 && sel <= int(form_->bibkeys.size()-1)) - start += sel; - - // Find the NEXT instance... - if (dir == biblio::FORWARD) - start += 1; - else - start -= 1; - - bool const caseSensitive = searchCaseCB->isChecked(); - - vector::const_iterator const cit = - biblio::searchKeys(theMap, form_->bibkeys, str, - start, type, dir, caseSensitive ); - - if (cit == form_->bibkeys.end()) { - // form_->bc().input( ButtonPolicy::SMI_NOOP ); - return; - } - - int const found = int(cit - form_->bibkeys.begin()); - if (found == sel) { - // form_->bc().input( ButtonPolicy::SMI_NOOP ); - return; - } - - // Update the display - int const top = max(found-5, 1); - bibLB->setTopItem( top ); - bibLB->setSelected( found, true ); - slotBibSelected( 0 ); - - // form_->bc().input( ButtonPolicy::SMI_VALID ); -} - - -void FormCitationDialogImpl::slotCitationStyleSelected( int ) -{ - // form_->bc().input( ButtonPolicy::SMI_VALID ); -} - - -void FormCitationDialogImpl::slotTextBeforeReturn() -{ - // form_->bc().input( ButtonPolicy::SMI_VALID ); -} - - -void FormCitationDialogImpl::slotTextAfterReturn() -{ - // form_->bc().input( ButtonPolicy::SMI_VALID ); -} - diff --git a/src/frontends/qt2/FormCitationDialogImpl.h b/src/frontends/qt2/FormCitationDialogImpl.h deleted file mode 100644 index e3c3bb8910..0000000000 --- a/src/frontends/qt2/FormCitationDialogImpl.h +++ /dev/null @@ -1,39 +0,0 @@ -/** - * $Id: FormCitationDialogImpl.h,v 1.3 2001/03/31 08:39:24 kalle Exp $ - */ - -#ifndef FORMCITATIONDIALOGIMPL_H -#define FORMCITATIONDIALOGIMPL_H -#include "FormCitationDialog.h" - -class FormCitation; - -class FormCitationDialogImpl : public FormCitationDialog -{ - Q_OBJECT - -public: - FormCitationDialogImpl( FormCitation* form, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); - ~FormCitationDialogImpl(); - -protected slots: - virtual void slotBibSelected( int sel ); - virtual void slotCiteSelected( int sel ); - virtual void slotAddClicked(); - virtual void slotDelClicked(); - virtual void slotUpClicked(); - virtual void slotDownClicked(); - virtual void slotPreviousClicked(); - virtual void slotNextClicked(); - virtual void slotCitationStyleSelected( int ); - virtual void slotTextBeforeReturn(); - virtual void slotTextAfterReturn(); - -private: - void doPreviousNext( bool ); - -private: - FormCitation* form_; -}; - -#endif // FORMCITATIONDIALOGIMPL_H diff --git a/src/frontends/qt2/FormCopyright.C b/src/frontends/qt2/FormCopyright.C deleted file mode 100644 index 91af4a5a6d..0000000000 --- a/src/frontends/qt2/FormCopyright.C +++ /dev/null @@ -1,52 +0,0 @@ -/*************************************************************************** - formcopyright.cpp - description - ------------------- - begin : Thu Feb 3 2000 - copyright : (C) 2000 by Jürgen Vigna, 2001 by Kalle Dalheimer - email : kalle@klaralvdalens-datakonsult.se - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#include - -#include "gettext.h" -#include "FormCopyrightDialogImpl.h" -#include -#include -#undef emit -#include "ButtonControllerBase.h" -#include "qt2BC.h" -#include "ControlCopyright.h" -#include "FormCopyright.h" - -typedef Qt2CB > base_class; - -FormCopyright::FormCopyright( ControlCopyright& c ) : - base_class( c, _( "Copyright and Warranty" ) ) -{ -} - - -void FormCopyright::build() -{ - // PENDING(kalle) Parent??? - dialog_.reset( new FormCopyrightDialogImpl() ); - connect( dialog_.get()->closePB, SIGNAL( clicked() ), - this, SLOT( slotCancel() ) ); - - dialog_->copyrightLA->setText( controller().getCopyright().c_str() ); - dialog_->licenseLA->setText( controller().getLicence().c_str() ); - dialog_->disclaimerLA->setText( controller().getDisclaimer().c_str() ); - - // Manage the cancel/close button - bc().setCancel(dialog_->closePB); - bc().refresh(); -} diff --git a/src/frontends/qt2/FormCopyright.h b/src/frontends/qt2/FormCopyright.h deleted file mode 100644 index cfeccb727e..0000000000 --- a/src/frontends/qt2/FormCopyright.h +++ /dev/null @@ -1,48 +0,0 @@ -// -*- C++ -*- -/*************************************************************************** - formcopyright.h - description - ------------------- - begin : Thu Feb 3 2000 - copyright : (C) 2000 by Jürgen Vigna, 2001 by Kalle Dalheimer - email : kalle@klaralvdalens-datakonsult.se - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef FORMCOPYRIGHT_H -#define FORMCOPYRIGHT_H - -#include "Qt2Base.h" -#include "boost/utility.hpp" - -class Dialogs; -class LyXView; -class FormCopyrightDialogImpl; -class ControlCopyright; - -/** - @author Kalle Dalheimer - */ -class FormCopyright - : public Qt2CB > -{ -public: - FormCopyright( ControlCopyright& ); - -private: - /// not needed - virtual void apply() {} - /// not needed - virtual void update() {} - // build the dialog - virtual void build(); -}; - -#endif diff --git a/src/frontends/qt2/FormCopyrightDialogImpl.C b/src/frontends/qt2/FormCopyrightDialogImpl.C deleted file mode 100644 index f09e45e1e4..0000000000 --- a/src/frontends/qt2/FormCopyrightDialogImpl.C +++ /dev/null @@ -1,22 +0,0 @@ -#include "FormCopyrightDialogImpl.h" - -/* - * Constructs a FormCopyrightDialogImpl which is a child of 'parent', with the - * name 'name' and widget flags set to 'f' - * - * The dialog will by default be modeless, unless you set 'modal' to - * TRUE to construct a modal dialog. - */ -FormCopyrightDialogImpl::FormCopyrightDialogImpl( QWidget* parent, const char* name, bool modal, WFlags fl ) - : FormCopyrightDialog( parent, name, modal, fl ) -{ -} - -/* - * Destroys the object and frees any allocated resources - */ -FormCopyrightDialogImpl::~FormCopyrightDialogImpl() -{ - // no need to delete child widgets, Qt does it all for us -} - diff --git a/src/frontends/qt2/FormCopyrightDialogImpl.h b/src/frontends/qt2/FormCopyrightDialogImpl.h deleted file mode 100644 index 05f40d5575..0000000000 --- a/src/frontends/qt2/FormCopyrightDialogImpl.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef FORMCOPYRIGHTDIALOGIMPL_H -#define FORMCOPYRIGHTDIALOGIMPL_H -#include "FormCopyrightDialog.h" - -class FormCopyrightDialogImpl : public FormCopyrightDialog -{ - Q_OBJECT - -public: - FormCopyrightDialogImpl( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); - ~FormCopyrightDialogImpl(); - -}; - -#endif // FORMCOPYRIGHTDIALOGIMPL_H diff --git a/src/frontends/qt2/FormCredits.C b/src/frontends/qt2/FormCredits.C deleted file mode 100644 index cd7c8d417e..0000000000 --- a/src/frontends/qt2/FormCredits.C +++ /dev/null @@ -1,58 +0,0 @@ -/** - * \file FormCredits.C - * Copyright 2001 The LyX Team. - * See the file COPYING. - * - * \author Edwin Leuven, leuven@fee.uva.nl - * \author Angus Leeming, a.leeming@.ac.uk - * \author Kalle Dalheimer, kalle@klaralvdalens-datakonsult.se - */ - -#ifdef __GNUG__ -#pragma implementation -#endif - -#include - -#include "gettext.h" -#include "FormCreditsDialogImpl.h" -#include -#include -#undef emit - -#include "qt2BC.h" -#include "ControlCredits.h" -#include "FormCredits.h" -#include "Lsstream.h" - -using std::getline; - -typedef Qt2CB > base_class; - -FormCredits::FormCredits(ControlCredits & c) - : base_class(c, _("Credits")) -{} - - -void FormCredits::build() -{ - // PENDING(kalle) Parent? - dialog_.reset(new FormCreditsDialogImpl( this )); - - // Manage the cancel/close button - bc().setCancel(dialog_->okPB); - bc().refresh(); - - stringstream ss; - QString xformscredits = controller().getCredits( ss ).str().c_str(); - QStringList xformslist = QStringList::split( '\n', controller().getCredits( ss ).str().c_str(), true ); - for( QStringList::Iterator it = xformslist.begin(); it != xformslist.end(); ++it ) { - QString line = *it; - if( line.left( 2 ) == "@b" ) - dialog_->creditsTV->append( "" + line.mid( 2 ) + "" ); - else if( line.left( 2 ) == "@i" ) - dialog_->creditsTV->append( "" + line.mid( 2 ) + "" ); - else - dialog_->creditsTV->append( line ); - } -} diff --git a/src/frontends/qt2/FormCredits.h b/src/frontends/qt2/FormCredits.h deleted file mode 100644 index 8576d471e1..0000000000 --- a/src/frontends/qt2/FormCredits.h +++ /dev/null @@ -1,41 +0,0 @@ -// -*- C++ -*- -/** - * \file FormCredits.h - * Copyright 2001 The LyX Team. - * See the file COPYING. - * - * \author Edwin Leuven, leuven@fee.uva.nl - * \author Angus Leeming, a.leeming@.ac.uk - * \author Kalle Dalheimer, kalle@klaralvdalens-datakonsult.se - */ - -#ifndef FORMCREDITS_H -#define FORMCREDITS_H - -#ifdef __GNUG__ -#pragma interface -#endif - -#include "Qt2Base.h" - -class ControlCredits; -class FormCreditsDialogImpl; - -/** This class provides a Qt2 implementation of the FormCredits Dialog. - */ -class FormCredits : public Qt2CB > { -public: - /// - FormCredits(ControlCredits &); - -private: - /// not needed. - virtual void apply() {} - /// not needed. - virtual void update() {} - /// Build the dialog - virtual void build(); -}; - -#endif - diff --git a/src/frontends/qt2/FormCreditsDialog.ui b/src/frontends/qt2/FormCreditsDialog.ui deleted file mode 100644 index 0f3f8399c0..0000000000 --- a/src/frontends/qt2/FormCreditsDialog.ui +++ /dev/null @@ -1,167 +0,0 @@ - -FormCreditsDialog - - QDialog - - name - FormCreditsDialog - - - geometry - - 0 - 0 - 366 - 301 - - - - caption - Form1 - - - - margin - 11 - - - spacing - 6 - - - QLabel - - name - TextLabel1 - - - text - All these people have contributed to the LyX project. Thanks, - - - alignment - AlignCenter - - - hAlign - - - - QLabel - - name - TextLabel2 - - - font - - 1 - - - - text - Matthias - - - alignment - AlignCenter - - - hAlign - - - - QTextView - - name - creditsTV - - - minimumSize - - 0 - 200 - - - - textFormat - RichText - - - - QLayoutWidget - - name - Layout8 - - - - margin - 0 - - - spacing - 6 - - - - name - Spacer1 - - - orientation - Horizontal - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - QPushButton - - name - okPB - - - text - OK - - - default - true - - - - - name - Spacer2 - - - orientation - Horizontal - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - - - - diff --git a/src/frontends/qt2/FormCreditsDialogImpl.C b/src/frontends/qt2/FormCreditsDialogImpl.C deleted file mode 100644 index 831f7701aa..0000000000 --- a/src/frontends/qt2/FormCreditsDialogImpl.C +++ /dev/null @@ -1,27 +0,0 @@ -#include "FormCreditsDialogImpl.h" -#include "FormCredits.h" -#include - -/* - * Constructs a FormCreditsDialogImpl which is a child of 'parent', with the - * name 'name' and widget flags set to 'f' - * - * The dialog will by default be modeless, unless you set 'modal' to - * TRUE to construct a modal dialog. - */ -FormCreditsDialogImpl::FormCreditsDialogImpl( FormCredits* form, QWidget* parent, - const char* name, bool modal, WFlags fl ) - : FormCreditsDialog( parent, name, modal, fl ) -{ - connect( okPB, SIGNAL( clicked() ), - form, SLOT( slotCancel() ) ); -} - -/* - * Destroys the object and frees any allocated resources - */ -FormCreditsDialogImpl::~FormCreditsDialogImpl() -{ - // no need to delete child widgets, Qt does it all for us -} - diff --git a/src/frontends/qt2/FormCreditsDialogImpl.h b/src/frontends/qt2/FormCreditsDialogImpl.h deleted file mode 100644 index 85cb0e056d..0000000000 --- a/src/frontends/qt2/FormCreditsDialogImpl.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef FORMCREDITSDIALOGIMPL_H -#define FORMCREDITSDIALOGIMPL_H -#include "FormCreditsDialog.h" - -class FormCredits; - -class FormCreditsDialogImpl : public FormCreditsDialog -{ - Q_OBJECT - -public: - FormCreditsDialogImpl( FormCredits* form, QWidget* parent = 0, - const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); - ~FormCreditsDialogImpl(); - -}; - -#endif // FORMCREDITSDIALOGIMPL_H diff --git a/src/frontends/qt2/FormDocumentDialogImpl.C b/src/frontends/qt2/FormDocumentDialogImpl.C deleted file mode 100644 index d6d7754cde..0000000000 --- a/src/frontends/qt2/FormDocumentDialogImpl.C +++ /dev/null @@ -1,502 +0,0 @@ -#include "FormDocumentDialog.h" -#include "Dialogs.h" -#include "FormDocument.h" - -#include -#include -#include -#include -#include -#include - -/* - * Constructs a FormDocumentDialog which is a child of 'parent', with the - * name 'name' and widget flags set to 'f' - * - * The dialog will by default be modeless, unless you set 'modal' to - * TRUE to construct a modal dialog. - */ -FormDocumentDialog::FormDocumentDialog( FormDocument* _form, QWidget* parent, const char* name, bool modal, WFlags fl ) - : FormDocumentDialogBase( parent, name, modal, fl ), - form( _form ) -{ - // Copy the pointers to the bullet buttons into an array so that - // they can all be manipulated together. - bulletbuttons[0] = bullet00PB; - bulletbuttons[1] = bullet01PB; - bulletbuttons[2] = bullet02PB; - bulletbuttons[3] = bullet03PB; - bulletbuttons[4] = bullet04PB; - bulletbuttons[5] = bullet05PB; - bulletbuttons[6] = bullet10PB; - bulletbuttons[7] = bullet11PB; - bulletbuttons[8] = bullet12PB; - bulletbuttons[9] = bullet13PB; - bulletbuttons[10] = bullet14PB; - bulletbuttons[11] = bullet15PB; - bulletbuttons[12] = bullet20PB; - bulletbuttons[13] = bullet21PB; - bulletbuttons[14] = bullet22PB; - bulletbuttons[15] = bullet23PB; - bulletbuttons[16] = bullet24PB; - bulletbuttons[17] = bullet25PB; - bulletbuttons[18] = bullet30PB; - bulletbuttons[19] = bullet31PB; - bulletbuttons[20] = bullet32PB; - bulletbuttons[21] = bullet33PB; - bulletbuttons[22] = bullet34PB; - bulletbuttons[23] = bullet35PB; - bulletbuttons[24] = bullet40PB; - bulletbuttons[25] = bullet41PB; - bulletbuttons[26] = bullet42PB; - bulletbuttons[27] = bullet43PB; - bulletbuttons[28] = bullet44PB; - bulletbuttons[29] = bullet45PB; - bulletbuttons[30] = bullet50PB; - bulletbuttons[31] = bullet51PB; - bulletbuttons[32] = bullet52PB; - bulletbuttons[33] = bullet53PB; - bulletbuttons[34] = bullet54PB; - bulletbuttons[35] = bullet55PB; -} - -/* - * Destroys the object and frees any allocated resources - */ -FormDocumentDialog::~FormDocumentDialog() -{ - // no need to delete child widgets, Qt does it all for us -} - -/* - * public slot - */ -void FormDocumentDialog::slotApply() -{ - form->apply(); - // PENDING(kalle) Check whether we need this - // form->bc_->apply(); -} -/* - * public slot - */ -void FormDocumentDialog::slotAMSMath(bool) -{ - form->checkDocumentInput( amsMathCB ); -} -/* - * public slot - */ -void FormDocumentDialog::slotBulletDepth1() -{ - form->bulletDepth( 0 ); -} -/* - * public slot - */ -void FormDocumentDialog::slotBulletDepth2() -{ - form->bulletDepth( 1 ); -} -/* - * public slot - */ -void FormDocumentDialog::slotBulletDepth3() -{ - form->bulletDepth( 2 ); -} -/* - * public slot - */ -void FormDocumentDialog::slotBulletDepth4() -{ - form->bulletDepth( 3 ); -} -/* - * public slot - */ -void FormDocumentDialog::slotBulletDing1() -{ - qDebug( "FormDocumentDialog::slotBulletDing1()" ); - form->checkDocumentInput( bulletDing1PB ); - form->setBulletPics(); - bulletStandardPB->setOn( false ); - bulletMathsPB->setOn( false ); - bulletDing2PB->setOn( false ); - bulletDing3PB->setOn( false ); - bulletDing4PB->setOn( false ); -} -/* - * public slot - */ -void FormDocumentDialog::slotBulletDing2() -{ - form->checkDocumentInput( bulletDing2PB ); - form->setBulletPics(); - bulletStandardPB->setOn( false ); - bulletMathsPB->setOn( false ); - bulletDing1PB->setOn( false ); - bulletDing3PB->setOn( false ); - bulletDing4PB->setOn( false ); -} -/* - * public slot - */ -void FormDocumentDialog::slotBulletDing3() -{ - form->checkDocumentInput( bulletDing3PB ); - form->setBulletPics(); - bulletStandardPB->setOn( false ); - bulletMathsPB->setOn( false ); - bulletDing2PB->setOn( false ); - bulletDing1PB->setOn( false ); - bulletDing4PB->setOn( false ); -} -/* - * public slot - */ -void FormDocumentDialog::slotBulletDing4() -{ - form->checkDocumentInput( bulletDing4PB ); - form->setBulletPics(); - bulletStandardPB->setOn( false ); - bulletMathsPB->setOn( false ); - bulletDing2PB->setOn( false ); - bulletDing3PB->setOn( false ); - bulletDing1PB->setOn( false ); -} -/* - * public slot - */ -void FormDocumentDialog::slotBulletMaths() -{ - form->checkDocumentInput( bulletMathsPB ); - form->setBulletPics(); - bulletStandardPB->setOn( false ); - bulletDing1PB->setOn( false ); - bulletDing2PB->setOn( false ); - bulletDing3PB->setOn( false ); - bulletDing4PB->setOn( false ); -} -/* - * public slot - */ -void FormDocumentDialog::slotBulletSize(int) -{ - form->choiceBulletSize(); - form->checkDocumentInput( bulletSizeCO ); -} -/* - * public slot - */ -void FormDocumentDialog::slotBulletStandard() -{ - form->checkDocumentInput( bulletStandardPB ); - form->setBulletPics(); - bulletDing1PB->setOn( false ); - bulletMathsPB->setOn( false ); - bulletDing2PB->setOn( false ); - bulletDing3PB->setOn( false ); - bulletDing4PB->setOn( false ); -} -/* - * public slot - */ -void FormDocumentDialog::slotBulletSymbol(int n) -{ - qDebug( "FormDocumentDialog::slotBulletSymbol( %d )", n ); - for( int i = 0; i < 36; i++ ) - bulletbuttons[i]->setOn( false ); - bulletbuttons[n]->setOn( true ); - form->bulletBMTable( n ); - form->checkDocumentInput( bulletTypeBG ); -} -/* - * public slot - */ -void FormDocumentDialog::slotClass(int) -{ - form->checkChoiceClass( 0 ); - form->checkDocumentInput( classesCO ); -} -/* - * public slot - */ -void FormDocumentDialog::slotClose() -{ - form->cancel(); - form->hide(); - // PENDING(kalle) do something with this - // form->bc_->cancel(); -} -/* - * public slot - */ -void FormDocumentDialog::slotColumns(int) -{ - form->checkDocumentInput( columnsBG ); -} -/* - * public slot - */ -void FormDocumentDialog::slotDefaultSkip(const QString&) -{ - form->checkDocumentInput( defaultSkipED ); -} -/* - * public slot - */ -void FormDocumentDialog::slotDefaultSkip(int) -{ - form->checkChoiceClass( defaultSkipCO ); - form->checkDocumentInput( defaultSkipCO ); -} -/* - * public slot - */ -void FormDocumentDialog::slotEncoding(int) -{ - form->checkChoiceClass( encodingCO ); - form->checkDocumentInput( encodingCO ); -} -/* - * public slot - */ -void FormDocumentDialog::slotExtraOptions(const QString&) -{ - form->checkDocumentInput( extraOptionsED ); -} -/* - * public slot - */ -void FormDocumentDialog::slotFloatPlacement(const QString&) -{ - form->checkDocumentInput( floatPlacementED ); -} -/* - * public slot - */ -void FormDocumentDialog::slotFont(int) -{ - form->checkChoiceClass( fontsCO ); - form->checkDocumentInput( fontsCO ); -} -/* - * public slot - */ -void FormDocumentDialog::slotFontSize(int) -{ - form->checkChoiceClass( fontSizeCO ); - form->checkDocumentInput( fontSizeCO ); -} -/* - * public slot - */ -void FormDocumentDialog::slotFootskip(const QString&) -{ - form->checkDocumentInput( footskipED ); -} -/* - * public slot - */ -void FormDocumentDialog::slotHeadheight(const QString&) -{ - form->checkDocumentInput( headheightED ); -} -/* - * public slot - */ -void FormDocumentDialog::slotHeadsep(const QString&) -{ - form->checkDocumentInput( headsepED ); -} -/* - * public slot - */ -void FormDocumentDialog::slotHeight(const QString&) -{ - form->checkDocumentInput( customHeightED ); -} -/* - * public slot - */ -void FormDocumentDialog::slotLanguage(int) -{ - form->checkChoiceClass( languageCO ); - form->checkDocumentInput( languageCO ); -} -/* - * public slot - */ -void FormDocumentDialog::slotBulletLaTeX(const QString&) -{ - form->inputBulletLaTeX(); - form->checkDocumentInput( latexED ); -} -/* - * public slot - */ -void FormDocumentDialog::slotMarginBottom(const QString&) -{ - form->checkDocumentInput( marginBottomED ); -} -/* - * public slot - */ -void FormDocumentDialog::slotMarginLeft(const QString&) -{ - form->checkDocumentInput( marginLeftED ); -} -/* - * public slot - */ -void FormDocumentDialog::slotMarginRight(const QString&) -{ - form->checkDocumentInput( marginRightED ); -} -/* - * public slot - */ -void FormDocumentDialog::slotMarginTop(const QString&) -{ - form->checkDocumentInput( marginTopED ); -} -/* - * public slot - */ -void FormDocumentDialog::slotOK() -{ - form->apply(); - form->hide(); - // PENDING(kalle) Do something about this. - // form->bc_->ok(); -} -/* - * public slot - */ -void FormDocumentDialog::slotOrientation(int) -{ - form->checkDocumentInput( orientationBG ); -} -/* - * public slot - */ -void FormDocumentDialog::slotPSDriver(int) -{ - form->checkChoiceClass( psDriverCO ); - form->checkDocumentInput( psDriverCO ); -} -/* - * public slot - */ -void FormDocumentDialog::slotPageStyle(int) -{ - form->checkChoiceClass( pagestyleCO ); - form->checkDocumentInput( pagestyleCO ); -} -/* - * public slot - */ -void FormDocumentDialog::slotPapersize(int) -{ - form->checkChoiceClass( pagestyleCO ); - form->checkDocumentInput( papersizeCO ); -} -/* - * public slot - */ -void FormDocumentDialog::slotQuoteStyle(int) -{ - form->checkChoiceClass( quoteStyleTypeCO ); - form->checkDocumentInput( quoteStyleTypeCO ); -} -/* - * public slot - */ -void FormDocumentDialog::slotQuoteType(int) -{ - // Intentionally left blank -} -/* - * public slot - */ -void FormDocumentDialog::slotRestore() -{ - form->update(); - // PENDING(kalle) Do something about this. - // form->bc_->updateAll(); -} -/* - * public slot - */ -void FormDocumentDialog::slotSectionNumberDepth(int) -{ - form->checkDocumentInput( sectionNumberDepthSB ); -} -/* - * public slot - */ -void FormDocumentDialog::slotSeparation(int) -{ - form->checkDocumentInput( separationBG ); -} -/* - * public slot - */ -void FormDocumentDialog::slotSides(int) -{ - form->checkDocumentInput( sidesBG ); -} -/* - * public slot - */ -void FormDocumentDialog::slotSpacing(const QString&) -{ - form->checkDocumentInput( spacingED ); -} -/* - * public slot - */ -void FormDocumentDialog::slotSpacing(int) -{ - form->checkDocumentInput( spacingCO ); - form->checkDocumentInput( spacingCO ); -} -/* - * public slot - */ -void FormDocumentDialog::slotSpecialPaperPackage(int) -{ - form->checkChoiceClass( specialCO ); - form->checkDocumentInput( specialCO ); -} -/* - * public slot - */ -void FormDocumentDialog::slotTOCDepth(int) -{ - form->checkDocumentInput( tocDepthSB ); -} -/* - * public slot - */ -void FormDocumentDialog::slotUseGeometryPackage(bool) -{ - form->checkDocumentInput( CheckBox1 ); -} -/* - * public slot - */ -void FormDocumentDialog::slotWidth(const QString&) -{ - form->checkDocumentInput( customWidthED ); -} - - -void FormDocumentDialog::closeEvent( QCloseEvent* e ) -{ - form->hide(); - //PENDING(kalle) Do something about this. - // form->bc_->hide(); - e->accept(); -} diff --git a/src/frontends/qt2/FormDocumentDialogImpl.h b/src/frontends/qt2/FormDocumentDialogImpl.h deleted file mode 100644 index b593e64c30..0000000000 --- a/src/frontends/qt2/FormDocumentDialogImpl.h +++ /dev/null @@ -1,76 +0,0 @@ -#ifndef FORMDOCUMENTDIALOGIMPL_H -#define FORMDOCUMENTDIALOGIMPL_H -#include "FormDocumentDialog.h" - -class FormDocument; - -class FormDocumentDialogImpl : public FormDocumentDialog -{ - Q_OBJECT - -public: - FormDocumentDialogImpl( FormDocument* form, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); - ~FormDocumentDialogImpl(); - -public slots: - void slotApply(); - void slotBulletLaTeX(const QString&); - void slotAMSMath(bool); - void slotBulletDepth1(); - void slotBulletDepth2(); - void slotBulletDepth3(); - void slotBulletDepth4(); - void slotBulletDing1(); - void slotBulletDing2(); - void slotBulletDing3(); - void slotBulletDing4(); - void slotBulletMaths(); - void slotBulletSize(int); - void slotBulletStandard(); - void slotBulletSymbol(int); - void slotClass(int); - void slotClose(); - void slotColumns(int); - void slotDefaultSkip(const QString&); - void slotDefaultSkip(int); - void slotEncoding(int); - void slotExtraOptions(const QString&); - void slotFloatPlacement(const QString&); - void slotFont(int); - void slotFontSize(int); - void slotFootskip(const QString&); - void slotHeadheight(const QString&); - void slotHeadsep(const QString&); - void slotHeight(const QString&); - void slotLanguage(int); - void slotMarginBottom(const QString&); - void slotMarginLeft(const QString&); - void slotMarginRight(const QString&); - void slotMarginTop(const QString&); - void slotOK(); - void slotOrientation(int); - void slotPSDriver(int); - void slotPageStyle(int); - void slotPapersize(int); - void slotQuoteStyle(int); - void slotQuoteType(int); - void slotRestore(); - void slotSectionNumberDepth(int); - void slotSeparation(int); - void slotSides(int); - void slotSpacing(const QString&); - void slotSpacing(int); - void slotSpecialPaperPackage(int); - void slotTOCDepth(int); - void slotUseGeometryPackage(bool); - void slotWidth(const QString&); - -protected: - void closeEvent( QCloseEvent* ); - -private: - FormDocument* form; - QToolButton* bulletbuttons[36]; -}; - -#endif // FORMDOCUMENTDIALOG_H diff --git a/src/frontends/qt2/FormIndex.C b/src/frontends/qt2/FormIndex.C deleted file mode 100644 index a6bfc5cde6..0000000000 --- a/src/frontends/qt2/FormIndex.C +++ /dev/null @@ -1,132 +0,0 @@ -/* - * FormIndex.C - * (C) 2000 LyX Team - * John Levon, moz@compsoc.man.ac.uk - */ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#include - -#include "FormIndexDialog.h" -#undef emit - -#include "Dialogs.h" -#include "FormIndex.h" -#include "gettext.h" -#include "buffer.h" -#include "LyXView.h" -#include "lyxfunc.h" - -#include -#include - -FormIndex::FormIndex(LyXView *v, Dialogs *d) - : dialog_(0), lv_(v), d_(d), inset_(0), h_(0), u_(0), ih_(0) -{ - // 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->showIndex.connect(slot(this, &FormIndex::showIndex)); - d->createIndex.connect(slot(this, &FormIndex::createIndex)); -} - -FormIndex::~FormIndex() -{ - delete dialog_; -} - -void FormIndex::showIndex(InsetCommand * const inset) -{ - // FIXME: when could inset be 0 here ? - if (inset==0) - return; - - inset_ = inset; - readonly = lv_->buffer()->isReadonly(); - ih_ = inset_->hide.connect(slot(this,&FormIndex::hide)); - params = inset->params(); - - show(); -} - -void FormIndex::createIndex(string const & arg) -{ - // we could already be showing a URL, clear it out - if (inset_) - close(); - - readonly = lv_->buffer()->isReadonly(); - params.setFromString(arg); - show(); -} - -void FormIndex::update() -{ - dialog_->keywordED->setText(params.getContents().c_str()); - - if (readonly) { - dialog_->keywordED->setFocusPolicy(QWidget::NoFocus); - dialog_->okPB->setEnabled(false); - dialog_->cancelPB->setText(_("Close")); - } else { - dialog_->keywordED->setFocusPolicy(QWidget::StrongFocus); - dialog_->keywordED->setFocus(); - dialog_->okPB->setEnabled(true); - dialog_->cancelPB->setText(_("Cancel")); - } -} - -void FormIndex::apply() -{ - if (readonly) - return; - - params.setContents(dialog_->keywordED->text().latin1()); - - if (inset_ != 0) { - if (params != inset_->params()) { - inset_->setParams(params); - lv_->view()->updateInset(inset_, true); - } - } else - lv_->getLyXFunc()->Dispatch(LFUN_INDEX_INSERT, params.getAsString().c_str()); -} - -void FormIndex::show() -{ - if (!dialog_) - dialog_ = new FormIndexDialog(this, 0, _("LyX: Index"), false); - - if (!dialog_->isVisible()) { - h_ = d_->hideBufferDependent.connect(slot(this, &FormIndex::hide)); - u_ = d_->updateBufferDependent.connect(slot(this, &FormIndex::update)); - } - - dialog_->raise(); - dialog_->setActiveWindow(); - - update(); - dialog_->show(); -} - -void FormIndex::close() -{ - h_.disconnect(); - u_.disconnect(); - ih_.disconnect(); - inset_ = 0; -} - -void FormIndex::hide() -{ - dialog_->hide(); - close(); -} diff --git a/src/frontends/qt2/FormIndex.h b/src/frontends/qt2/FormIndex.h deleted file mode 100644 index 962efcb36b..0000000000 --- a/src/frontends/qt2/FormIndex.h +++ /dev/null @@ -1,83 +0,0 @@ -// -*- C++ -*- -/* FormIndex.h - * (C) 2000 LyX Team - * John Levon, moz@compsoc.man.ac.uk - * Adapted for Qt2 frontend by Kalle Dalheimer, - * kalle@klaralvdalens-datakonsult.se - */ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef FORMINDEX_H -#define FORMINDEX_H - -#include "DialogBase.h" -#include "LString.h" -#include "boost/utility.hpp" -#include "insets/insetindex.h" - -class Dialogs; -class LyXView; -class FormIndexDialog; - -class FormIndex : public DialogBase { -public: - /**@name Constructors and Destructors */ - //@{ - /// - FormIndex(LyXView *, Dialogs *); - /// - ~FormIndex(); - //@} - - /// Apply changes - void apply(); - /// close the connections - void close(); - -private: - /// Create the dialog if necessary, update it and display it. - void show(); - /// Hide the dialog. - void hide(); - /// Update the dialog. - void update(); - - /// create an Index inset - void createIndex(string const &); - /// edit an Index inset - void showIndex(InsetCommand * const); - - /// Real GUI implementation. - FormIndexDialog * dialog_; - - /// the LyXView we belong to - LyXView * lv_; - - /** Which Dialogs do we belong to? - Used so we can get at the signals we have to connect to. - */ - Dialogs * d_; - /// pointer to the inset if any - InsetCommand * inset_; - /// insets params - InsetCommandParams params; - /// is the inset we are reading from a readonly buffer ? - bool readonly; - - /// Hide connection. - Connection h_; - /// Update connection. - Connection u_; - /// Inset hide connection. - Connection ih_; -}; - -#endif diff --git a/src/frontends/qt2/FormIndexDialog.C b/src/frontends/qt2/FormIndexDialog.C deleted file mode 100644 index 4d0d8c2b6f..0000000000 --- a/src/frontends/qt2/FormIndexDialog.C +++ /dev/null @@ -1,46 +0,0 @@ -#include "FormIndexDialog.h" -#include "Dialogs.h" -#include "FormIndex.h" - -/* - * Constructs a FormIndexDialog which is a child of 'parent', with the - * name 'name' and widget flags set to 'f' - * - * The dialog will by default be modeless, unless you set 'modal' to - * TRUE to construct a modal dialog. - */ -FormIndexDialog::FormIndexDialog( FormIndex* form_, QWidget* parent, const char* name, bool modal, WFlags fl ) - : FormIndexDialogBase( parent, name, modal, fl ), - form( form_ ) -{ -} - -/* - * Destroys the object and frees any allocated resources - */ -FormIndexDialog::~FormIndexDialog() -{ - // no need to delete child widgets, Qt does it all for us -} - - -void FormIndexDialog::apply_adaptor() -{ - form->apply(); - form->close(); - hide(); -} - - -void FormIndexDialog::close_adaptor() -{ - form->close(); - hide(); -} - - -void FormIndexDialog::closeEvent(QCloseEvent *e) -{ - form->close(); - e->accept(); -} diff --git a/src/frontends/qt2/FormIndexDialog.h b/src/frontends/qt2/FormIndexDialog.h deleted file mode 100644 index 9ee2b40e88..0000000000 --- a/src/frontends/qt2/FormIndexDialog.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef FORMINDEXDIALOG_H -#define FORMINDEXDIALOG_H -#include "FormIndexDialogBase.h" - -class FormIndex; - -class FormIndexDialog : public FormIndexDialogBase -{ - Q_OBJECT - -public: - FormIndexDialog( FormIndex* form, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); - ~FormIndexDialog(); - -public slots: - void apply_adaptor(); - void close_adaptor(); - -protected: - void closeEvent(QCloseEvent *e); - -private: - FormIndex* form; -}; - -#endif // FORMINDEXDIALOG_H diff --git a/src/frontends/qt2/FormRefDialog.C b/src/frontends/qt2/FormRefDialog.C deleted file mode 100644 index 49a7a5bf53..0000000000 --- a/src/frontends/qt2/FormRefDialog.C +++ /dev/null @@ -1,83 +0,0 @@ -#include "FormRefDialog.h" -#include "Dialogs.h" -#include "FormRef.h" - -/* - * Constructs a FormRefDialog which is a child of 'parent', with the - * name 'name' and widget flags set to 'f' - * - * The dialog will by default be modeless, unless you set 'modal' to - * TRUE to construct a modal dialog. - */ -FormRefDialog::FormRefDialog( FormRef* _form, QWidget* parent, const char* name, bool modal, WFlags fl ) - : FormReferenceDialogBase( parent, name, modal, fl ), - form( _form ) -{ -} - -/* - * Destroys the object and frees any allocated resources - */ -FormRefDialog::~FormRefDialog() -{ - // no need to delete child widgets, Qt does it all for us -} - -/* - * public slot - */ -void FormRefDialog::apply_adaptor() -{ - form->apply(); - form->close(); - hide(); -} -/* - * public slot - */ -void FormRefDialog::goto_adaptor() -{ - form->goto_ref(); -} -/* - * public slot - */ -void FormRefDialog::highlight_adaptor(const QString& sel) -{ - form->highlight(sel); -} -/* - * public slot - */ -void FormRefDialog::close_adaptor() -{ - form->close(); - hide(); -} -/* - * public slot - */ -void FormRefDialog::select_adaptor(const QString& sel) -{ - form->select(sel); -} -/* - * public slot - */ -void FormRefDialog::sort_adaptor(bool sort) -{ - form->set_sort(sort); -} -/* - * public slot - */ -void FormRefDialog::update_adaptor() -{ - form->do_ref_update(); -} - -void FormRefDialog::closeEvent(QCloseEvent *e) -{ - form->close(); - e->accept(); -} diff --git a/src/frontends/qt2/FormRefDialog.h b/src/frontends/qt2/FormRefDialog.h deleted file mode 100644 index c26630b68b..0000000000 --- a/src/frontends/qt2/FormRefDialog.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef FORMREFDIALOG_H -#define FORMREFDIALOG_H -#include "FormRefDialogBase.h" - -class FormRef; - -class FormRefDialog : public FormReferenceDialogBase -{ - Q_OBJECT - -public: - FormRefDialog( FormRef* form, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); - ~FormRefDialog(); - -public slots: - void apply_adaptor(); - void goto_adaptor(); - void highlight_adaptor(const QString&); - void close_adaptor(); - void select_adaptor(const QString&); - void sort_adaptor(bool); - void update_adaptor(); - -protected: - void closeEvent(QCloseEvent *e); - -private: - FormRef* form; -}; - -#endif // FORMREFDIALOG_H diff --git a/src/frontends/qt2/FormSplashImpl.C b/src/frontends/qt2/FormSplashImpl.C deleted file mode 100644 index 5ebe8ebf67..0000000000 --- a/src/frontends/qt2/FormSplashImpl.C +++ /dev/null @@ -1,52 +0,0 @@ -/** - * \file FormSplashBase.C - * Copyright 2001 the LyX Team - * Read the file COPYING - * - * \author Edwin Leuven - */ - -#include - -#include -#include -#include -#include - -#include "FormSplashImpl.h" -#include "version.h" -#include "support/filetools.h" -#include "lyxrc.h" - -FormSplashBase::FormSplashBase( QWidget* parent, const char* name, WFlags fl, bool modal ) - : QFrame( parent, name, fl, modal) -{ - string banner_file = LibFileSearch("images", "banner", "xpm"); - if (banner_file.empty()) - return; - - QPixmap pm(tostr(banner_file).c_str()); - int w = pm.width(); - int h = pm.height(); - - setBackgroundPixmap(pm); - setLineWidth(0); - setGeometry(QApplication::desktop()->width ()/2-w/2, - QApplication::desktop()->height()/2-h/2, - w, h ); - - QTimer::singleShot( 5*1000, this, SLOT(hide()) ); -} - -FormSplashBase::~FormSplashBase() -{ -} - - -void FormSplashBase::mousePressEvent( QMouseEvent * ) -{ - hide(); -} - - - diff --git a/src/frontends/qt2/FormSplashImpl.h b/src/frontends/qt2/FormSplashImpl.h deleted file mode 100644 index fb8e4a6e03..0000000000 --- a/src/frontends/qt2/FormSplashImpl.h +++ /dev/null @@ -1,27 +0,0 @@ -/** - * \file FormSplashBase.C - * Copyright 2001 the LyX Team - * Read the file COPYING - * - * \author Edwin Leuven - */ - -#ifndef FORMSPLASHBASE_H -#define FORMSPLASHBASE_H - -class FormSplashBase : public QFrame -{ - public: - - FormSplashBase(QWidget* parent, const char* name, - WFlags fl = QWidget::WStyle_NoBorder | QWidget::WStyle_Customize, - bool modal = false ); - - ~FormSplashBase(); - - protected: - - virtual void mousePressEvent( QMouseEvent * ); -}; - -#endif // FORMSPLASHBASE_H diff --git a/src/frontends/qt2/FormTabularCreate.C b/src/frontends/qt2/FormTabularCreate.C deleted file mode 100644 index 3974702daf..0000000000 --- a/src/frontends/qt2/FormTabularCreate.C +++ /dev/null @@ -1,70 +0,0 @@ -/** - * \file FormTabularCreate.C - * Copyright 2001 LyX Team - * see the file COPYING - * - * \author John Levon, moz@compsoc.man.ac.uk - */ - -#include - -#include "tabularcreatedlgimpl.h" -#include "Dialogs.h" -#include "FormTabularCreate.h" -#include "gettext.h" -#include "QtLyXView.h" -#include "BufferView.h" -#include "insets/insettabular.h" -#include "support/lstrings.h" - -using SigC::slot; - -FormTabularCreate::FormTabularCreate(LyXView *v, Dialogs *d) - : dialog_(0), lv_(v), d_(d), h_(0) -{ - // 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->showTabularCreate.connect(slot(this, &FormTabularCreate::show)); -} - -FormTabularCreate::~FormTabularCreate() -{ - delete dialog_; -} - -void FormTabularCreate::apply(int rows, int cols) -{ - if (!lv_->view()->available()) - return; - - string tmp = tostr(rows) + " " + tostr(cols); - lv_->getLyXFunc()->Dispatch(LFUN_INSET_TABULAR, tmp); -} - -void FormTabularCreate::show() -{ - if (!dialog_) - dialog_ = new TabularCreateDlgImpl(this, 0, _("LyX: Insert Table")); - - if (!dialog_->isVisible()) { - h_ = d_->hideBufferDependent.connect(slot(this, &FormTabularCreate::hide)); - } - - dialog_->raise(); - dialog_->setActiveWindow(); - - update(); - dialog_->show(); -} - -void FormTabularCreate::close() -{ - h_.disconnect(); -} - -void FormTabularCreate::hide() -{ - dialog_->hide(); - close(); -} diff --git a/src/frontends/qt2/FormTabularCreate.h b/src/frontends/qt2/FormTabularCreate.h deleted file mode 100644 index c5d2ddbce7..0000000000 --- a/src/frontends/qt2/FormTabularCreate.h +++ /dev/null @@ -1,63 +0,0 @@ -// -*- C++ -*- -/* FormTabularCreate.h - * (C) 2000 LyX Team - * John Levon, moz@compsoc.man.ac.uk - */ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef FORMTABULARCREATE_H -#define FORMTABULARCREATE_H - -#include "DialogBase.h" -#include "LString.h" -#include "boost/utility.hpp" - -class Dialogs; -class LyXView; -class TabularCreateDlgImpl; - -class FormTabularCreate : public DialogBase { -public: - /**@name Constructors and Destructors */ - //@{ - /// - FormTabularCreate(LyXView *, Dialogs *); - /// - ~FormTabularCreate(); - //@} - - /// create the table - void apply(int rows, int cols); - /// close the connections - void close(); - -private: - /// Create the dialog if necessary, update it and display it. - void show(); - /// Hide the dialog. - void hide(); - - /// Real GUI implementation. - TabularCreateDlgImpl * dialog_; - - /// the LyXView we belong to - LyXView * lv_; - - /** Which Dialogs do we belong to? - Used so we can get at the signals we have to connect to. - */ - Dialogs * d_; - - /// Hide connection. - SigC::Connection h_; -}; - -#endif diff --git a/src/frontends/qt2/FormToc.h b/src/frontends/qt2/FormToc.h deleted file mode 100644 index 8c99f2663e..0000000000 --- a/src/frontends/qt2/FormToc.h +++ /dev/null @@ -1,90 +0,0 @@ -// -*- C++ -*- -/* FormToc.h - * (C) 2000 LyX Team - * John Levon, moz@compsoc.man.ac.uk - * Adapted for Qt2 frontend by Kalle Dalheimer, - * kalle@klaralvdalens-datakonsult.se - */ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef FORMTOC_H -#define FORMTOC_H - -#include "DialogBase.h" -#include "LString.h" -#include "boost/utility.hpp" -#include "insets/insetcommand.h" -#include "buffer.h" - -class Dialogs; -class FormTocDialog; - -class FormToc : public DialogBase { -public: - /**@name Constructors and Destructors */ - //@{ - /// - FormToc(LyXView *, Dialogs *); - /// - ~FormToc(); - //@} - - // Build the dialog - virtual void build(); - /// Update the dialog before showing it. - virtual void update(); - /// close the connections - virtual void close(); - -private: - /// Create the dialog if necessary, update it and display it. - void show(); - /// Hide the dialog. - void hide(); - - /// create a Toc inset - void createTOC(string const &); - /// view a Toc inset - void showTOC(InsetCommand * const); - - /// update the Toc - void updateToc(int); - - /// Real GUI implementation. - FormTocDialog * dialog_; - - /// the LyXView we belong to - LyXView * lv_; - - /** Which Dialogs do we belong to? - Used so we can get at the signals we have to connect to. - */ - Dialogs * d_; - /// pointer to the inset if any - InsetCommand * inset_; - /// insets params - InsetCommandParams params; - - /// Hide connection. - Connection h_; - /// Update connection. - Connection u_; - /// Inset hide connection. - Connection ih_; - - /// the toc list - std::vector toclist; - - /// depth of list shown - int depth; -}; - -#endif diff --git a/src/frontends/qt2/FormTocDialog.C b/src/frontends/qt2/FormTocDialog.C deleted file mode 100644 index ebc33ef5f4..0000000000 --- a/src/frontends/qt2/FormTocDialog.C +++ /dev/null @@ -1,87 +0,0 @@ -#include -#include -#include "FormTocDialog.h" -#include "Dialogs.h" -#include "FormToc.h" - -#include - -/* - * Constructs a FormTocDialog which is a child of 'parent', with the - * name 'name' and widget flags set to 'f' - * - * The dialog will by default be modeless, unless you set 'modal' to - * TRUE to construct a modal dialog. - */ -FormTocDialog::FormTocDialog( FormToc* form_, QWidget* parent, const char* name, bool modal, WFlags fl ) - : FormTocDialogBase( parent, name, modal, fl ), - form( form_ ) -{ -} - -/* - * Destroys the object and frees any allocated resources - */ -FormTocDialog::~FormTocDialog() -{ - // no need to delete child widgets, Qt does it all for us -} - -/* - * public slot - */ -void FormTocDialog::activate_adaptor(int index) -{ - switch (index) { - case 0: - form->set_type(Buffer::TOC_TOC); - break; - case 1: - form->set_type(Buffer::TOC_LOF); - break; - case 2: - form->set_type(Buffer::TOC_LOT); - break; - case 3: - form->set_type(Buffer::TOC_LOA); - break; - default: - lyxerr[Debug::GUI] << "Unknown TOC combo selection." << std::endl; - break; - } -} -/* - * public slot - */ -void FormTocDialog::close_adaptor() -{ - form->close(); - hide(); -} -/* - * public slot - */ -void FormTocDialog::depth_adaptor(int depth) -{ - form->set_depth(depth); -} -/* - * public slot - */ -void FormTocDialog::select_adaptor(QListViewItem* item) -{ - form->select(item->text(0)); -} -/* - * public slot - */ -void FormTocDialog::update_adaptor() -{ - form->update(); -} - -void FormTocDialog::closeEvent(QCloseEvent *e) -{ - form->close(); - e->accept(); -} diff --git a/src/frontends/qt2/FormTocDialog.h b/src/frontends/qt2/FormTocDialog.h deleted file mode 100644 index dbb8721151..0000000000 --- a/src/frontends/qt2/FormTocDialog.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef FORMTOCDIALOG_H -#define FORMTOCDIALOG_H -#include "FormTocDialogBase.h" - -class FormToc; - -class FormTocDialog : public FormTocDialogBase -{ - Q_OBJECT - -public: - FormTocDialog( FormToc* form, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); - ~FormTocDialog(); - -public slots: - void activate_adaptor(int); - void close_adaptor(); - void depth_adaptor(int); - void select_adaptor(QListViewItem*); - void update_adaptor(); - -protected: - void closeEvent(QCloseEvent *e); - -private: - FormToc* form; -}; - -#endif // FORMTOCDIALOG_H diff --git a/src/frontends/qt2/FormUrl.h b/src/frontends/qt2/FormUrl.h deleted file mode 100644 index 55b12cb1f9..0000000000 --- a/src/frontends/qt2/FormUrl.h +++ /dev/null @@ -1,83 +0,0 @@ -// -*- C++ -*- -/* FormUrl.h - * (C) 2000 LyX Team - * John Levon, moz@compsoc.man.ac.uk - * Adapted for Qt2 frontend by Kalle Dalheimer, - * kalle@klaralvdalens-datakonsult.se - */ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef FORMURL_H -#define FORMURL_H - -#include "DialogBase.h" -#include "LString.h" -#include "boost/utility.hpp" -#include "insets/inseturl.h" - -class Dialogs; -class LyXView; -class FormUrlDialog; - -class FormUrl : public DialogBase { -public: - /**@name Constructors and Destructors */ - //@{ - /// - FormUrl(LyXView *, Dialogs *); - /// - ~FormUrl(); - //@} - - /// Apply changes - void apply(); - /// close the connections - void close(); - -private: - /// Create the dialog if necessary, update it and display it. - void show(); - /// Hide the dialog. - void hide(); - /// Update the dialog. - void update(); - - /// create a URL inset - void createUrl(string const &); - /// edit a URL inset - void showUrl(InsetCommand * const); - - /// Real GUI implementation. - FormUrlDialog * dialog_; - - /// the LyXView we belong to - LyXView * lv_; - - /** Which Dialogs do we belong to? - Used so we can get at the signals we have to connect to. - */ - Dialogs * d_; - /// pointer to the inset if any - InsetCommand * inset_; - /// insets params - InsetCommandParams params; - /// is the inset we are reading from a readonly buffer - bool readonly; - - /// Hide connection. - Connection h_; - /// Update connection. - Connection u_; - /// Inset hide connection. - Connection ih_; -}; - -#endif diff --git a/src/frontends/qt2/FormUrlDialog.C b/src/frontends/qt2/FormUrlDialog.C deleted file mode 100644 index 488fec8166..0000000000 --- a/src/frontends/qt2/FormUrlDialog.C +++ /dev/null @@ -1,48 +0,0 @@ -#include "FormUrlDialog.h" -#include "Dialogs.h" -#include "FormUrl.h" - -/* - * Constructs a FormUrlDialog which is a child of 'parent', with the - * name 'name' and widget flags set to 'f' - * - * The dialog will by default be modeless, unless you set 'modal' to - * TRUE to construct a modal dialog. - */ -FormUrlDialog::FormUrlDialog( FormUrl* _form, QWidget* parent, const char* name, bool modal, WFlags fl ) - : FormUrlDialogBase( parent, name, modal, fl ), - form( _form ) -{ -} - -/* - * Destroys the object and frees any allocated resources - */ -FormUrlDialog::~FormUrlDialog() -{ - // no need to delete child widgets, Qt does it all for us -} - -/* - * public slot - */ -void FormUrlDialog::apply_adaptor() -{ - form->apply(); - form->close(); - hide(); -} -/* - * public slot - */ -void FormUrlDialog::close_adaptor() -{ - form->close(); - hide(); -} - -void FormUrlDialog::closeEvent(QCloseEvent *e) -{ - form->close(); - e->accept(); -} diff --git a/src/frontends/qt2/FormUrlDialog.h b/src/frontends/qt2/FormUrlDialog.h deleted file mode 100644 index f3c4eb53e8..0000000000 --- a/src/frontends/qt2/FormUrlDialog.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef FORMURLDIALOG_H -#define FORMURLDIALOG_H -#include "FormUrlDialogBase.h" - -class FormUrl; - -class FormUrlDialog : public FormUrlDialogBase -{ - Q_OBJECT - -public: - FormUrlDialog( FormUrl* form, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); - ~FormUrlDialog(); - -public slots: - void apply_adaptor(); - void close_adaptor(); - -protected: - void closeEvent( QCloseEvent* ); - -private: - FormUrl* form; -}; - -#endif // FORMURLDIALOG_H diff --git a/src/frontends/qt2/GUIRunTime.C b/src/frontends/qt2/GUIRunTime.C index 25a8313c2d..802a7379d7 100644 --- a/src/frontends/qt2/GUIRunTime.C +++ b/src/frontends/qt2/GUIRunTime.C @@ -1,11 +1,10 @@ -/* This file is part of - * ====================================================== - * - * LyX, The Document Processor - * - * Copyright 2001 The LyX Team. +/** + * \file GUIRunTime.C + * Copyright 2001 the LyX Team + * Read the file COPYING * - * ====================================================== */ + * \author John Levon + */ #include @@ -13,11 +12,14 @@ #pragma implementation #endif +#include +#include + +#include "QtLyXView.h" +#include "XFormsView.h" #include "GUIRunTime.h" #include "debug.h" -#include - #include FORMS_H_LOCATION using std::endl; @@ -34,29 +36,14 @@ using std::endl; extern bool finished; -namespace { - -int const xforms_include_version = FL_INCLUDE_VERSION; - -} // namespace anon - - int GUIRunTime::initApplication(int argc, char * argv[]) { + int const xforms_include_version = FL_INCLUDE_VERSION; + // Check the XForms version in the forms.h header against // the one in the libforms. If they don't match quit the // execution of LyX. Better with a clean fast exit than // a strange segfault later. - // I realize that this check have to be moved when we - // support several toolkits, but IMO all the toolkits - // should try to have the same kind of check. This could - // be done by having a CheckHeaderAndLib function in - // all the toolkit implementations, this function is - // responsible for notifing the user. - // if (!CheckHeaderAndLib()) { - // // header vs. lib version failed - // return 1; - // } int xforms_lib_version = fl_library_version(0, 0); if (xforms_include_version != xforms_lib_version) { lyxerr << "You are either running LyX with wrong " @@ -75,6 +62,7 @@ int GUIRunTime::initApplication(int argc, char * argv[]) return 0; } + void GUIRunTime::processEvents() { qApp->processEvents(); @@ -88,13 +76,49 @@ void GUIRunTime::runTime() while (!finished) { processEvents(); if (fl_check_forms() == FL_EVENT) { - lyxerr << "LyX: This shouldn't happen..." << endl; fl_XNextEvent(&ev); + lyxerr << "Received unhandled X11 event" << endl; + lyxerr << "Type: 0x" << std::hex << ev.xany.type << + "Target: 0x" << std::hex << ev.xany.window << endl; } } } +LyXView * GUIRunTime::createMainView(int w, int h) +{ + return new XFormsView(w, h); +} + + +Display * GUIRunTime::x11Display() +{ + //return p.device()->x11Display(); + return fl_get_display(); +} + + +int GUIRunTime::x11Screen() +{ + //return p.device()->x11Screen(); + return fl_screen; +} + + +Colormap GUIRunTime::x11Colormap() +{ + //return p.device()->x11Colormap(); + return fl_state[fl_get_vclass()].colormap; +} + + +int GUIRunTime::x11VisualDepth() +{ + //return p.device()->x11Depth(); + return fl_get_visual_depth(); +} + + void GUIRunTime::setDefaults() { FL_IOPT cntl; @@ -115,4 +139,3 @@ void GUIRunTime::setDefaults() | FL_PDMenuFontSize | FL_PDBorderWidth, &cntl); } - diff --git a/src/frontends/qt2/Makefile.am b/src/frontends/qt2/Makefile.am index 52700356f1..f0ad5edcb4 100644 --- a/src/frontends/qt2/Makefile.am +++ b/src/frontends/qt2/Makefile.am @@ -3,45 +3,30 @@ DISTCLEANFILES= *.orig *.rej *~ *.bak core MAINTAINERCLEANFILES = $(srcdir)/Makefile.in noinst_LTLIBRARIES = libqt2.la BOOST_INCLUDES = -I$(top_srcdir)/boost +SUBDIRS=ui moc INCLUDES = -I${top_srcdir}/src/ -I${top_srcdir}/src/frontends/ \ ${SIGC_CFLAGS} ${FRONTEND_INCLUDES} $(BOOST_INCLUDES) \ -I$(top_srcdir)/src/frontends/controllers -DEFINES += -DQT_CLEAN_NAMESPACE +CXXFLAGS += -DQT_CLEAN_NAMESPACE -DQT_GENUINE_STR -# moc generated files -BUILTSOURCES = \ - moc_FileDialog_private.C \ - moc_Qt2Base.C \ - moc_FormCitationDialog.C \ - moc_FormCitationDialogImpl.C \ - moc_FormCopyrightDialog.C \ - moc_FormCopyrightDialogImpl.C \ - moc_FormCreditsDialog.C \ - moc_FormCreditsDialogImpl.C \ - moc_chardlg.C \ - moc_chardlgimpl.C \ - moc_paragraphdlg.C \ - moc_paragraphdlgimpl.C \ - moc_printdlg.C \ - moc_printdlgimpl.C \ - moc_searchdlg.C \ - moc_searchdlgimpl.C \ - moc_tabularcreatedlg.C \ - moc_tabularcreatedlgimpl.C \ - moc_emptytable.C - -LYXDATADIRS = dlg DISTCLEANFILES = $(BUILTSOURCES) *.orig *.rej *~ *.bak core +include Makefile.dialogs + +libqt2_la_DEPENDENCIES = ui/libqt2ui.la moc/libqt2moc.la + libqt2_la_OBJADD = \ + ui/libqt2ui.la \ + moc/libqt2moc.la \ ../controllers/ButtonControllerBase.lo \ ../xforms/combox.lo \ ../xforms/Color.lo \ + ../xforms/FloatMenuImpl.lo \ ../xforms/FormBaseDeprecated.lo \ ../xforms/FormBibitem.lo \ ../xforms/FormBibtex.lo \ ../xforms/FormBrowser.lo \ - ../xforms/FormDocument.lo \ + ../xforms/FormDocument.lo \ ../xforms/FormError.lo \ ../xforms/FormExternal.lo \ ../xforms/FormGraphics.lo \ @@ -66,7 +51,6 @@ libqt2_la_OBJADD = \ ../xforms/form_bibitem.lo \ ../xforms/form_bibtex.lo \ ../xforms/form_browser.lo \ - ../xforms/form_credits.lo \ ../xforms/form_document.lo \ ../xforms/form_error.lo \ ../xforms/form_external.lo \ @@ -90,131 +74,14 @@ LDFLAGS= $(libqt2_la_OBJADD) ETAGS_ARGS = --lang=c++ libqt2_la_SOURCES = \ - $(BUILTSOURCES) \ + $(DIALOGSOURCES) \ Dialogs.C \ GUIRunTime.C \ - FormCharacter.C \ - FormCharacter.h \ - chardlg.C \ - chardlg.h \ - chardlgimpl.C \ - chardlgimpl.h \ FileDialog.C \ FileDialog_private.C \ Qt2Base.C \ Qt2Base.h \ - FormCitation.C \ - FormCitation.h \ - FormCitationDialog.C \ - FormCitationDialog.h \ - FormCitationDialogImpl.C \ - FormCitationDialogImpl.h \ - FormCopyright.C \ - FormCopyright.h \ - FormCopyrightDialog.C \ - FormCopyrightDialog.h \ - FormCopyrightDialogImpl.C \ - FormCopyrightDialogImpl.h \ - FormCredits.C \ - FormCredits.h \ - FormCreditsDialog.C \ - FormCreditsDialog.h \ - FormCreditsDialogImpl.C \ - FormCreditsDialogImpl.h \ - FormParagraph.C \ - FormParagraph.h \ - paragraphdlg.C \ - paragraphdlg.h \ - paragraphdlgimpl.C \ - paragraphdlgimpl.h \ - FormPrint.C \ - FormPrint.h \ - printdlg.C \ - printdlg.h \ - printdlgimpl.C \ - printdlgimpl.h \ emptytable.C \ emptytable.h \ - FormSearch.C \ - FormSearch.h \ - searchdlg.C \ - searchdlg.h \ - searchdlgimpl.C \ - searchdlgimpl.h \ - FormSplash.C \ - FormSplash.h \ - FormSplashImpl.C \ - FormSplashImpl.h \ - FormTabularCreate.C \ - FormTabularCreate.h \ - tabularcreatedlg.C \ - tabularcreatedlg.h \ - tabularcreatedlgimpl.C \ - tabularcreatedlgimpl.h \ qt2BC.C \ qt2BC.h - -# just copied from old lyx repository -dist-hook: - for subdir in $(LYXDATADIRS) ; do \ - test -d $(distdir)/$$subdir \ - || mkdir $(distdir)/$$subdir \ - || exit 1; \ - chmod 777 $(distdir)/$$subdir; \ - list=`(cd $(srcdir)/$$subdir && ls -1 | grep -v CVS)`; \ - echo $$list ; \ - for fil in $$list ; do \ - cp -p $(srcdir)/$$subdir/$$fil $(distdir)/$$subdir ; \ - done ; \ - done - -moc_%.C: %.h - $(MOC) -o $@ $< - -FormCitation.C: FormCitationDialog.h -FormCitationDialog.h: FormCitationDialog.ui - $(UIC) -o $@ $< -FormCitationDialog.C: FormCitationDialog.ui - $(UIC) -impl FormCitationDialog.h -o $@ $< - -FormCopyright.C: FormCopyrightDialogImpl.h -FormCopyrightDialog.h: FormCopyrightDialog.ui - $(UIC) -o $@ $< -FormCopyrightDialog.C: FormCopyrightDialog.ui - $(UIC) -impl FormCopyrightDialog.h -o $@ $< - -FormCredits.C: FormCreditsDialogImpl.h -FormCreditsDialog.h: FormCreditsDialog.ui - $(UIC) -o $@ $< -FormCreditsDialog.C: FormCreditsDialog.ui - $(UIC) -impl FormCreditsDialog.h -o $@ $< - -FormParagraph.C: paragraphdlg.h -paragraphdlg.h: paragraphdlg.ui - $(UIC) -o $@ $< -paragraphdlg.C: paragraphdlg.ui - $(UIC) -impl paragraphdlg.h -o $@ $< - -FormPrint.C: printdlg.h -printdlg.h: printdlg.ui - $(UIC) -o $@ $< -printdlg.C: printdlg.ui - $(UIC) -impl printdlg.h -o $@ $< - -FormTabularCreate.C: tabularcreatedlg.h -tabularcreatedlg.h: tabularcreatedlg.ui - $(UIC) -o $@ $< -tabularcreatedlg.C: tabularcreatedlg.ui - $(UIC) -impl tabularcreatedlg.h -o $@ $< - -FormCharacter.C: chardlg.h -chardlg.h: chardlg.ui - $(UIC) -o $@ $< -chardlg.C: chardlg.ui - $(UIC) -impl chardlg.h -o $@ $< - -FormSearch.C: searchdlg.h -searchdlg.h: searchdlg.ui - $(UIC) -o $@ $< -searchdlg.C: searchdlg.ui - $(UIC) -impl searchdlg.h -o $@ $< diff --git a/src/frontends/qt2/Makefile.dialogs b/src/frontends/qt2/Makefile.dialogs new file mode 100644 index 0000000000..699c36cfcf --- /dev/null +++ b/src/frontends/qt2/Makefile.dialogs @@ -0,0 +1,99 @@ +# this is the master file from which the dialog file rules are generated + +DIALOGS = \ + QAbout \ + QCharacter \ + QCitation \ + QDocument \ + QIndex \ + QParagraph \ + QPrint \ + QRef \ + QSearch \ + QSplash \ + QTabularCreate \ + QToc \ + QURL + +DIALOGSOURCES = \ + QAbout.h QAboutDialog.h \ + QAbout.C QAboutDialog.C \ + QCharacter.h QCharacterDialog.h \ + QCharacter.C QCharacterDialog.C \ + QCitation.h QCitationDialog.h \ + QCitation.C QCitationDialog.C \ + QDocument.h QDocumentDialog.h \ + QDocument.C QDocumentDialog.C \ + QIndex.h QIndexDialog.h \ + QIndex.C QIndexDialog.C \ + QParagraph.h QParagraphDialog.h \ + QParagraph.C QParagraphDialog.C \ + QPrint.h QPrintDialog.h \ + QPrint.C QPrintDialog.C \ + QRef.h QRefDialog.h \ + QRef.C QRefDialog.C \ + QSearch.h QSearchDialog.h \ + QSearch.C QSearchDialog.C \ + QSplash.h QSplashDialog.h \ + QSplash.C QSplashDialog.C \ + QTabularCreate.h QTabularCreateDialog.h \ + QTabularCreate.C QTabularCreateDialog.C \ + QToc.h QTocDialog.h \ + QToc.C QTocDialog.C \ + QURL.h QURLDialog.h \ + QURL.C QURLDialog.C + +MOCDIALOGS = \ + QAboutDialog_moc.C \ + QCharacterDialog_moc.C \ + QCitationDialog_moc.C \ + QDocumentDialog_moc.C \ + QIndexDialog_moc.C \ + QParagraphDialog_moc.C \ + QPrintDialog_moc.C \ + QRefDialog_moc.C \ + QSearchDialog_moc.C \ + QSplashDialog_moc.C \ + QTabularCreateDialog_moc.C \ + QTocDialog_moc.C \ + QURLDialog_moc.C + +UIDIALOGS = \ + QAboutDialogBase.h \ + QAboutDialogBase.C \ + QCharacterDialogBase.h \ + QCharacterDialogBase.C \ + QCitationDialogBase.h \ + QCitationDialogBase.C \ + QDocumentDialogBase.h \ + QDocumentDialogBase.C \ + QIndexDialogBase.h \ + QIndexDialogBase.C \ + QParagraphDialogBase.h \ + QParagraphDialogBase.C \ + QPrintDialogBase.h \ + QPrintDialogBase.C \ + QRefDialogBase.h \ + QRefDialogBase.C \ + QSearchDialogBase.h \ + QSearchDialogBase.C \ + QTabularCreateDialogBase.h \ + QTabularCreateDialogBase.C \ + QTocDialogBase.h \ + QTocDialogBase.C \ + QURLDialogBase.h \ + QURLDialogBase.C + +UIMOCDIALOGS = \ + QAboutDialogBase_moc.C \ + QCharacterDialogBase_moc.C \ + QCitationDialogBase_moc.C \ + QDocumentDialogBase_moc.C \ + QIndexDialogBase_moc.C \ + QParagraphDialogBase_moc.C \ + QPrintDialogBase_moc.C \ + QRefDialogBase_moc.C \ + QSearchDialogBase_moc.C \ + QTabularCreateDialogBase_moc.C \ + QTocDialogBase_moc.C \ + QURLDialogBase_moc.C diff --git a/src/frontends/qt2/QAbout.C b/src/frontends/qt2/QAbout.C new file mode 100644 index 0000000000..f78298ca66 --- /dev/null +++ b/src/frontends/qt2/QAbout.C @@ -0,0 +1,44 @@ +/** + * \file QAbout.C + * Copyright 2001 the LyX Team + * Read the file COPYING + * + * \author Kalle Dalheimer + */ + +#include + +#include "gettext.h" +#include "QAboutDialog.h" + +#include +#include +#include "QtLyXView.h" + +#include "ButtonControllerBase.h" +#include "qt2BC.h" +#include "ControlAboutlyx.h" +#include "QAbout.h" + +typedef Qt2CB > base_class; + +QAbout::QAbout(ControlAboutlyx & c) + : base_class(c, _("About LyX")) +{ +} + + +void QAbout::build() +{ + dialog_.reset(new QAboutDialog()); + connect(dialog_.get()->closePB, SIGNAL(clicked()), + this, SLOT(slotCancel())); + + dialog_->copyrightLA->setText(controller().getCopyright().c_str()); + dialog_->licenseLA->setText(controller().getLicense().c_str()); + dialog_->disclaimerLA->setText(controller().getDisclaimer().c_str()); + + // Manage the cancel/close button + bc().setCancel(dialog_->closePB); + bc().refresh(); +} diff --git a/src/frontends/qt2/QAbout.h b/src/frontends/qt2/QAbout.h new file mode 100644 index 0000000000..7d50c1e40e --- /dev/null +++ b/src/frontends/qt2/QAbout.h @@ -0,0 +1,36 @@ +// -*- C++ -*- +/** + * \file QAbout.h + * Copyright 2001 the LyX Team + * Read the file COPYING + * + * \author Kalle Dalheimer + */ + +#ifndef FORMABOUT_H +#define FORMABOUT_H + +#include "Qt2Base.h" +#include "boost/utility.hpp" + +class Dialogs; +class LyXView; +class QAboutDialog; +class ControlAboutlyx; + +class QAbout + : public Qt2CB > +{ +public: + QAbout(ControlAboutlyx &); + +private: + /// not needed + virtual void apply() {} + /// not needed + virtual void update() {} + // build the dialog + virtual void build(); +}; + +#endif // FORMABOUT_H diff --git a/src/frontends/qt2/QAboutDialog.C b/src/frontends/qt2/QAboutDialog.C new file mode 100644 index 0000000000..94e642d856 --- /dev/null +++ b/src/frontends/qt2/QAboutDialog.C @@ -0,0 +1,19 @@ +/** + * \file QAboutDialog.C + * Copyright 2001 the LyX Team + * Read the file COPYING + * + * \author Kalle Dalheimer + */ + +#include "QAboutDialog.h" + +QAboutDialog::QAboutDialog(QWidget * parent, const char * name, bool modal, WFlags fl) + : QAboutDialogBase(parent, name, modal, fl) +{ +} + + +QAboutDialog::~QAboutDialog() +{ +} diff --git a/src/frontends/qt2/QAboutDialog.h b/src/frontends/qt2/QAboutDialog.h new file mode 100644 index 0000000000..4ae90d19af --- /dev/null +++ b/src/frontends/qt2/QAboutDialog.h @@ -0,0 +1,21 @@ +/** + * \file QAboutDialog.h + * Copyright 2001 the LyX Team + * Read the file COPYING + * + * \author Kalle Dalheimer + */ + +#ifndef QABOUTDIALOG_H +#define QABOUTDIALOG_H +#include "ui/QAboutDialogBase.h" + +class QAboutDialog : public QAboutDialogBase +{ +Q_OBJECT +public: + QAboutDialog(QWidget * parent = 0, const char * name = 0, bool modal = FALSE, WFlags fl = 0); + ~QAboutDialog(); +}; + +#endif // QABOUTDIALOG_H diff --git a/src/frontends/qt2/FormCharacter.C b/src/frontends/qt2/QCharacter.C similarity index 55% rename from src/frontends/qt2/FormCharacter.C rename to src/frontends/qt2/QCharacter.C index 67319f2752..07f38fb81a 100644 --- a/src/frontends/qt2/FormCharacter.C +++ b/src/frontends/qt2/QCharacter.C @@ -1,5 +1,5 @@ /** - * \file FormCharacter.C + * \file QCharacter.C * Copyright 2001 The LyX Team. * See the file COPYING. * @@ -9,8 +9,8 @@ #include #include "gettext.h" -#include "chardlgimpl.h" -#include "FormCharacter.h" +#include "QCharacterDialog.h" +#include "QCharacter.h" #include "bufferview_funcs.h" #include "Dialogs.h" #include "Liason.h" @@ -24,25 +24,22 @@ using SigC::slot; using Liason::setMinibuffer; -FormCharacter::FormCharacter(LyXView *v, Dialogs *d) +QCharacter::QCharacter(LyXView *v, Dialogs *d) : dialog_(0), lv_(v), d_(d), h_(0), u_(0) { - // 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->showCharacter.connect(slot(this, &FormCharacter::show)); + d->showCharacter.connect(slot(this, &QCharacter::show)); // for LFUN_FREE - d->setUserFreeFont.connect(slot(this, &FormCharacter::apply)); + d->setUserFreeFont.connect(slot(this, &QCharacter::apply)); } -FormCharacter::~FormCharacter() +QCharacter::~QCharacter() { delete dialog_; } -void FormCharacter::apply() +void QCharacter::apply() { if (!lv_->view()->available() || !dialog_) return; @@ -52,27 +49,29 @@ void FormCharacter::apply() if (dialog_->langItem()==1) font.setLanguage(lv_->buffer()->params.language); - ToggleAndShow(lv_->view(), font, dialog_->toggleAll()); + toggleAndShow(lv_->view(), font, dialog_->toggleAll()); lv_->view()->setState(); lv_->buffer()->markDirty(); setMinibuffer(lv_, _("Character set")); } + -void FormCharacter::show() +void QCharacter::show() { if (!dialog_) { - dialog_ = new CharDlgImpl(this, 0, _("Character Options"), false); + dialog_ = new QCharacterDialog(this, 0, _("Character Settings"), false); + // add languages for (Languages::const_iterator cit = languages.begin(); cit != languages.end(); ++cit) { - const string language = (*cit).second.lang(); - dialog_->lang->insertItem( tostr(language).c_str(), -1 ); + string const language = cit->second.lang(); + dialog_->lang->insertItem(tostr(language).c_str(), -1); } } if (!dialog_->isVisible()) { - h_ = d_->hideBufferDependent.connect(slot(this, &FormCharacter::hide)); - u_ = d_->updateBufferDependent.connect(slot(this, &FormCharacter::update)); + h_ = d_->hideBufferDependent.connect(slot(this, &QCharacter::hide)); + u_ = d_->updateBufferDependent.connect(slot(this, &QCharacter::update)); } dialog_->raise(); @@ -81,19 +80,22 @@ void FormCharacter::show() dialog_->show(); } -void FormCharacter::close() + +void QCharacter::close() { h_.disconnect(); u_.disconnect(); } -void FormCharacter::hide() + +void QCharacter::hide() { dialog_->hide(); close(); } -void FormCharacter::update(bool) + +void QCharacter::update(bool) { if (!lv_->view()->available()) return; diff --git a/src/frontends/qt2/FormCharacter.h b/src/frontends/qt2/QCharacter.h similarity index 76% rename from src/frontends/qt2/FormCharacter.h rename to src/frontends/qt2/QCharacter.h index fffa13c021..7bee61c4a9 100644 --- a/src/frontends/qt2/FormCharacter.h +++ b/src/frontends/qt2/QCharacter.h @@ -1,27 +1,27 @@ // -*- C++ -*- /** - * \file FormCharacter.h + * \file QCharacter.h * Copyright 2001 The LyX Team. * See the file COPYING. * * \author Edwin Leuven */ -#ifndef FORM_CHARACTER_H -#define FORM_CHARACTER_H +#ifndef QCHARACTER_H +#define QCHARACTER_H #include "DialogBase.h" class LyXView; class Dialogs; -class CharDlgImpl; +class QCharacterDialog; -class FormCharacter : public DialogBase { +class QCharacter : public DialogBase { public: /// - FormCharacter(LyXView *, Dialogs *); + QCharacter(LyXView *, Dialogs *); /// - ~FormCharacter(); + ~QCharacter(); /// Apply changes. void apply(); @@ -38,7 +38,7 @@ private: void update(bool switched = false); /// Real GUI implementation. - CharDlgImpl * dialog_; + QCharacterDialog * dialog_; /// the LyXView we belong to. LyXView * lv_; @@ -58,4 +58,4 @@ private: SigC::Connection u_; }; -#endif +#endif // QCHARACTER_H diff --git a/src/frontends/qt2/chardlgimpl.C b/src/frontends/qt2/QCharacterDialog.C similarity index 75% rename from src/frontends/qt2/chardlgimpl.C rename to src/frontends/qt2/QCharacterDialog.C index f16755ec17..e76d3e4fc1 100644 --- a/src/frontends/qt2/chardlgimpl.C +++ b/src/frontends/qt2/QCharacterDialog.C @@ -1,14 +1,12 @@ /** - * \file chardlgimpl.C - * Copyright 2001 The LyX Team. + * \file QCharacterDialog.C + * Copyright 2001 the LyX Team * See the file COPYING. * * \author Edwin Leuven, leuven@fee.uva.nl */ -#include "chardlg.h" -#include "chardlgimpl.h" -#include "FormCharacter.h" +#include "QCharacterDialog.h" #include "lyxtext.h" #include "language.h" @@ -17,22 +15,23 @@ #include #include -CharDlgImpl::CharDlgImpl(FormCharacter* form, QWidget * parent, const char* name, bool modal, WFlags fl ) - : CharDlg( parent, name, modal, fl ), form_(form) +QCharacterDialog::QCharacterDialog(QCharacter * form, QWidget * parent, const char * name, bool modal, WFlags fl) + : QCharacterDialogBase(parent, name, modal, fl), form_(form) { setCaption(name); } + -CharDlgImpl::~CharDlgImpl() +QCharacterDialog::~QCharacterDialog() { } + -LyXFont CharDlgImpl::getChar() +LyXFont QCharacterDialog::getChar() { LyXFont font(LyXFont::ALL_IGNORE); - int pos = family->currentItem(); - switch (pos) { + switch (family->currentItem()) { case 0: font.setFamily(LyXFont::IGNORE_FAMILY); break; case 1: font.setFamily(LyXFont::INHERIT_FAMILY); break; case 2: font.setFamily(LyXFont::ROMAN_FAMILY); break; @@ -40,16 +39,14 @@ LyXFont CharDlgImpl::getChar() case 4: font.setFamily(LyXFont::TYPEWRITER_FAMILY); break; } - pos = series->currentItem(); - switch (pos) { + switch (series->currentItem()) { case 0: font.setSeries(LyXFont::IGNORE_SERIES); break; case 1: font.setSeries(LyXFont::INHERIT_SERIES); break; case 2: font.setSeries(LyXFont::MEDIUM_SERIES); break; case 3: font.setSeries(LyXFont::BOLD_SERIES); break; } - pos = shape->currentItem(); - switch (pos) { + switch (shape->currentItem()) { case 0: font.setShape(LyXFont::IGNORE_SHAPE); break; case 1: font.setShape(LyXFont::INHERIT_SHAPE); break; case 2: font.setShape(LyXFont::UP_SHAPE); break; @@ -58,8 +55,7 @@ LyXFont CharDlgImpl::getChar() case 5: font.setShape(LyXFont::SMALLCAPS_SHAPE); break; } - pos = size->currentItem(); - switch (pos) { + switch (size->currentItem()) { case 0: font.setSize(LyXFont::IGNORE_SIZE); break; case 1: font.setSize(LyXFont::INHERIT_SIZE); break; case 2: font.setSize(LyXFont::SIZE_TINY); break; @@ -76,26 +72,24 @@ LyXFont CharDlgImpl::getChar() case 13: font.setSize(LyXFont::DECREASE_SIZE); break; } - pos = misc->currentItem(); - switch (pos) { + switch (misc->currentItem()) { case 0: font.setEmph(LyXFont::IGNORE); font.setUnderbar(LyXFont::IGNORE); font.setNoun(LyXFont::IGNORE); - font.setLatex(LyXFont::IGNORE); + // FIXME font.setLatex(LyXFont::IGNORE); break; case 1: font.setEmph(LyXFont::INHERIT); font.setUnderbar(LyXFont::INHERIT); font.setNoun(LyXFont::INHERIT); - font.setLatex(LyXFont::INHERIT); + // FIXME font.setLatex(LyXFont::INHERIT); break; case 2: font.setEmph(LyXFont::TOGGLE); break; case 3: font.setUnderbar(LyXFont::TOGGLE); break; case 4: font.setNoun(LyXFont::TOGGLE); break; - case 5: font.setLatex(LyXFont::TOGGLE); break; + case 5: break; // FIXMEfont.setLatex(LyXFont::TOGGLE); break; } - pos = color->currentItem(); - switch (pos) { + switch (color->currentItem()) { case 0: font.setColor(LColor::ignore); break; case 1: font.setColor(LColor::inherit); break; case 2: font.setColor(LColor::none); break; @@ -109,24 +103,25 @@ LyXFont CharDlgImpl::getChar() case 10: font.setColor(LColor::yellow); break; } - pos = lang->currentItem(); - if (pos==0) { + int const pos = lang->currentItem(); + if (pos == 0) { font.setLanguage(ignore_language); - } else if (pos!=1) { - string language(lang->currentText()); - font.setLanguage(languages.getLanguage(language)); + } else if (pos != 1) { + font.setLanguage(languages.getLanguage(lang->currentText().latin1())); }; return font; } -void CharDlgImpl::closeEvent(QCloseEvent * e) + +void QCharacterDialog::closeEvent(QCloseEvent * e) { form_->close(); e->accept(); } -void CharDlgImpl::setReadOnly(bool readonly) + +void QCharacterDialog::setReadOnly(bool readonly) { sizeGB->setEnabled(!readonly); charGB->setEnabled(!readonly); diff --git a/src/frontends/qt2/QCharacterDialog.h b/src/frontends/qt2/QCharacterDialog.h new file mode 100644 index 0000000000..235f2f2c26 --- /dev/null +++ b/src/frontends/qt2/QCharacterDialog.h @@ -0,0 +1,71 @@ +/** + * \file QCharacterDialog.h + * Copyright 2001 the LyX Team + * see the file COPYING + * + * \author Edwin Leuven + */ + +#ifndef QCHARACTERDIALOG_H +#define QCHARACTERDIALOG_H + +#include + +#include "ui/QCharacterDialogBase.h" +#include "QCharacter.h" + +#include +#include +#include + +class LyXFont; + +class QCharacterDialog : public QCharacterDialogBase +{ Q_OBJECT + +public: + QCharacterDialog(QCharacter * form, QWidget * parent = 0, const char * name = 0, bool modal = FALSE, WFlags fl = 0); + ~QCharacterDialog(); + + /// FIXME + LyXFont getChar(); + + /// return the currently selected language item + int langItem() { + return lang->currentItem(); + }; + + /// return true if toggle all is selected + bool toggleAll() { + return toggleall->isChecked(); + }; + + /// set dialog read only + void setReadOnly(bool); + +protected: + void closeEvent(QCloseEvent * e); + +private: + QCharacter * form_; + +protected slots: + + void apply_adaptor() { + form_->apply(); + } + + void cancel_adaptor() { + form_->close(); + hide(); + } + + void close_adaptor() { + form_->apply(); + form_->close(); + hide(); + } + +}; + +#endif // QCHARACTERDIALOG_H diff --git a/src/frontends/qt2/FormCitation.C b/src/frontends/qt2/QCitation.C similarity index 64% rename from src/frontends/qt2/FormCitation.C rename to src/frontends/qt2/QCitation.C index 82aa96b102..d4072e20fb 100644 --- a/src/frontends/qt2/FormCitation.C +++ b/src/frontends/qt2/QCitation.C @@ -1,13 +1,10 @@ -/* This file is part of - * ====================================================== - * - * LyX, The Document Processor - * - * Copyright 2000 The LyX Team. - * - * ====================================================== +/** + * \file QCitation.C + * Copyright 2001 the LyX Team + * Read the file COPYING * * \author Angus Leeming + * \author Kalle Dalheimer */ #include @@ -16,8 +13,8 @@ #pragma implementation #endif -#include "FormCitationDialogImpl.h" -#include "FormCitation.h" +#include "QCitationDialog.h" +#include "QCitation.h" #include #include @@ -26,7 +23,7 @@ #include #include -#undef emit +#include "QtLyXView.h" #include "qt2BC.h" #include "ControlCitation.h" #include "gettext.h" @@ -41,14 +38,14 @@ using std::pair; using std::sort; using std::vector; -typedef Qt2CB > base_class; +typedef Qt2CB > base_class; -FormCitation::FormCitation(ControlCitation & c) +QCitation::QCitation(ControlCitation & c) : base_class(c, _("Citation")) {} -void FormCitation::apply() +void QCitation::apply() { controller().params().setCmdName("cite"); controller().params().setContents(getStringFromVector(citekeys)); @@ -58,7 +55,7 @@ void FormCitation::apply() } -void FormCitation::hide() +void QCitation::hide() { citekeys.clear(); bibkeys.clear(); @@ -67,13 +64,12 @@ void FormCitation::hide() } -void FormCitation::build() +void QCitation::build() { - // PENDING(kalle) Parent? - dialog_.reset( new FormCitationDialogImpl( this )); + dialog_.reset(new QCitationDialog(this)); - dialog_->searchTypeCB->setChecked( false ); - dialog_->searchCaseCB->setChecked( false ); + dialog_->searchTypeCB->setChecked(false); + dialog_->searchCaseCB->setChecked(false); // Manage the ok, apply, restore and cancel/close buttons bc().setOK(dialog_->okPB); @@ -88,10 +84,10 @@ void FormCitation::build() bc().addReadOnly(dialog_->citationStyleCO); bc().addReadOnly(dialog_->textBeforeED); bc().addReadOnly(dialog_->textAfterED); -} +} -void FormCitation::update() +void QCitation::update() { // Make the list of all available bibliography keys bibkeys = biblio::getKeys(controller().bibkeysInfo()); @@ -110,35 +106,36 @@ void FormCitation::update() } -void FormCitation::updateBrowser( QListBox* browser, +void QCitation::updateBrowser(QListBox* browser, vector const & keys) const { browser->clear(); for (vector::const_iterator it = keys.begin(); it < keys.end(); ++it) { - string key = frontStrip(strip(*it)); - if( !key.empty() ) - browser->insertItem( key.c_str() ); + string const key = frontStrip(strip(*it)); + // FIXME: why the .empty() test ? + if(!key.empty()) + browser->insertItem(key.c_str()); } } -void FormCitation::setBibButtons(State status) const +void QCitation::setBibButtons(State status) const { - dialog_->addPB->setEnabled( (status == ON) ); + dialog_->addPB->setEnabled((status == ON)); } -void FormCitation::setCiteButtons(State status) const +void QCitation::setCiteButtons(State status) const { int const sel = dialog_->citeLB->currentItem(); - int const maxline = dialog_->citeLB->count()-1; + int const maxline = dialog_->citeLB->count() - 1; bool const activate = (status == ON); bool const activate_up = (activate && sel != 0); bool const activate_down = (activate && sel != maxline); - dialog_->delPB->setEnabled( activate ); - dialog_->upPB->setEnabled( activate_up ); - dialog_->downPB->setEnabled( activate_down ); + dialog_->delPB->setEnabled(activate); + dialog_->upPB->setEnabled(activate_up); + dialog_->downPB->setEnabled(activate_down); } diff --git a/src/frontends/qt2/FormCitation.h b/src/frontends/qt2/QCitation.h similarity index 51% rename from src/frontends/qt2/FormCitation.h rename to src/frontends/qt2/QCitation.h index 5d4034350d..a350cc41d6 100644 --- a/src/frontends/qt2/FormCitation.h +++ b/src/frontends/qt2/QCitation.h @@ -1,19 +1,15 @@ // -*- C++ -*- -/* This file is part of - * ====================================================== - * - * LyX, The Document Processor - * - * Copyright 2000 The LyX Team. - * - * ====================================================== +/** + * \file QCitation.h + * Copyright 2001 the LyX Team + * Read the file COPYING * * \author Angus Leeming * \author Kalle Dalheimer -*/ + */ -#ifndef FORMCITATION_H -#define FORMCITATION_H +#ifndef QCITATION_H +#define QCITATION_H #ifdef __GNUG__ #pragma interface @@ -22,20 +18,16 @@ class QListBox; #include "Qt2Base.h" -#undef emit -/** This class provides a Qt2 implementation of the Citation Dialog. - @author Kalle Dalheimer -*/ class ControlCitation; -class FormCitationDialogImpl; +class QCitationDialog; -class FormCitation : public Qt2CB > { - friend class FormCitationDialogImpl; +class QCitation : public Qt2CB > { + friend class QCitationDialog; public: /// - FormCitation(ControlCitation &); + QCitation(ControlCitation &); private: /// @@ -54,8 +46,6 @@ private: virtual void hide(); /// Update dialog before/whilst showing it. virtual void update(); - // /// Filter the inputs on callback from xforms - // virtual ButtonPolicy::SMInput input(FL_OBJECT *, long); void updateBrowser(QListBox*, std::vector const &) const; /// @@ -69,4 +59,4 @@ private: std::vector bibkeys; }; -#endif // FORMCITATION_H +#endif // QCITATION_H diff --git a/src/frontends/qt2/QCitationDialog.C b/src/frontends/qt2/QCitationDialog.C new file mode 100644 index 0000000000..bb0e07c516 --- /dev/null +++ b/src/frontends/qt2/QCitationDialog.C @@ -0,0 +1,277 @@ +/** + * \file QCitationDialog.C + * Copyright 2001 the LyX Team + * Read the file COPYING + * + * \author Kalle Dalheimer + */ + +#include + +#include "QCitationDialog.h" +#include "Dialogs.h" +#include "QCitation.h" +#include "qt2BC.h" +#include "controllers/ControlCitation.h" + +#include +#include +#include +#include +#include + +#include "QtLyXView.h" + +#include +#include "buffer.h" + +using std::vector; +using std::find; +using std::max; + +QCitationDialog::QCitationDialog(QCitation * form, QWidget * parent, const char * name, bool modal, WFlags fl) + : QCitationDialogBase(parent, name, modal, fl), + form_(form) +{ + connect(okPB, SIGNAL(clicked()), + form, SLOT(slotOK())); + connect(cancelPB, SIGNAL(clicked()), + form, SLOT(slotCancel())); + connect(restorePB, SIGNAL(clicked()), + form, SLOT(slotRestore())); + connect(applyPB, SIGNAL(clicked()), + form, SLOT(slotApply())); +} + + +QCitationDialog::~QCitationDialog() +{ +} + + +void QCitationDialog::slotBibSelected( int sel ) +{ + biblio::InfoMap const & theMap = form_->controller().bibkeysInfo(); + + citeLB->clearSelection(); + + // FIXME: why would this happen ? + if (sel < 0 || sel >= (int)form_->bibkeys.size()) { + return; + } + + // Put into browser_info the additional info associated with + // the selected browser_bib key + infoML->clear(); + + infoML->setText(biblio::getInfo(theMap, form_->bibkeys[sel]).c_str()); + + // Highlight the selected browser_bib key in browser_cite if + // present + vector::const_iterator cit = + std::find(form_->citekeys.begin(), form_->citekeys.end(), + form_->bibkeys[sel]); + + if (cit != form_->citekeys.end()) { + int const n = int(cit - form_->citekeys.begin()); + citeLB->setSelected(n, true); + citeLB->setTopItem(n); + } + + if (!form_->controller().isReadonly()) { + if (cit != form_->citekeys.end()) { + form_->setBibButtons(QCitation::OFF); + form_->setCiteButtons(QCitation::ON); + } else { + form_->setBibButtons(QCitation::ON); + form_->setCiteButtons(QCitation::OFF); + } + } +} + + +void QCitationDialog::slotCiteSelected(int sel) +{ + biblio::InfoMap const & theMap = form_->controller().bibkeysInfo(); + + // FIXME: why would this happen ? + if (sel < 0 || sel >= (int)form_->citekeys.size()) { + return; + } + + if (!form_->controller().isReadonly()) { + form_->setBibButtons(QCitation::OFF); + form_->setCiteButtons(QCitation::ON); + } + + // Highlight the selected browser_cite key in browser_bib + vector::const_iterator cit = + std::find(form_->bibkeys.begin(), + form_->bibkeys.end(), form_->citekeys[sel]); + + if (cit != form_->bibkeys.end()) { + int const n = int(cit - form_->bibkeys.begin()); + bibLB->setSelected(n, true); + bibLB->setTopItem(n); + + // Put into browser_info the additional info associated + // with the selected browser_cite key + infoML->clear(); + infoML->setText(biblio::getInfo(theMap, form_->bibkeys[sel]).c_str()); + } +} + + +void QCitationDialog::slotAddClicked() +{ + int const sel = bibLB->currentItem(); + + // FIXME: why ? + if (sel < 0 || sel >= (int)form_->bibkeys.size()) { + return; + } + + // Add the selected browser_bib key to browser_cite + citeLB->insertItem(form_->bibkeys[sel].c_str()); + form_->citekeys.push_back(form_->bibkeys[sel]); + + int const n = int(form_->citekeys.size()); + citeLB->setSelected(n - 1, true); + + form_->setBibButtons(QCitation::OFF); + form_->setCiteButtons(QCitation::ON); +} + + +void QCitationDialog::slotDelClicked() +{ + int const sel = citeLB->currentItem(); + + // FIXME: why ? + if (sel < 0 || sel >= (int)form_->citekeys.size()) { + return; + } + + // Remove the selected key from browser_cite + citeLB->removeItem(sel); + form_->citekeys.erase(form_->citekeys.begin() + sel); + + form_->setBibButtons(QCitation::ON); + form_->setCiteButtons(QCitation::OFF); +} + + +void QCitationDialog::slotUpClicked() +{ + int const sel = citeLB->currentItem(); + + // FIXME: why ? + if (sel < 1 || sel >= (int)form_->citekeys.size()) { + return; + } + + // Move the selected key up one line + vector::iterator it = form_->citekeys.begin() + sel; + string const tmp = *it; + + citeLB->removeItem(sel); + form_->citekeys.erase(it); + + citeLB->insertItem(tmp.c_str(), sel - 1); + citeLB->setSelected(sel - 1, true); + form_->citekeys.insert(it - 1, tmp); + form_->setCiteButtons(QCitation::ON); +} + + +void QCitationDialog::slotDownClicked() +{ + int const sel = citeLB->currentItem(); + + // FIXME: ? + if (sel < 0 || sel >= (int)form_->citekeys.size() - 1) { + return; + } + + // Move the selected key down one line + vector::iterator it = form_->citekeys.begin() + sel; + string const tmp = *it; + + citeLB->removeItem(sel); + form_->citekeys.erase(it); + + citeLB->insertItem(tmp.c_str(), sel + 1); + citeLB->setSelected(sel + 1, true); + form_->citekeys.insert(it + 1, tmp); + form_->setCiteButtons(QCitation::ON); +} + + +void QCitationDialog::slotPreviousClicked() +{ + doFind(biblio::BACKWARD); +} + + +void QCitationDialog::slotNextClicked() +{ + doFind(biblio::FORWARD); +} + + +void QCitationDialog::doFind(biblio::Direction const dir) +{ + biblio::InfoMap const & theMap = form_->controller().bibkeysInfo(); + string const str = searchED->text().latin1(); + + biblio::Search const type = + searchTypeCB->isChecked() ? + biblio::REGEX : biblio::SIMPLE; + + vector::const_iterator start = form_->bibkeys.begin(); + int const sel = bibLB->currentItem(); + if (sel >= 0 && sel <= int(form_->bibkeys.size()-1)) + start += sel; + + // Find the NEXT instance... + if (dir == biblio::FORWARD) + start += 1; + else + start -= 1; + + bool const caseSensitive = searchCaseCB->isChecked(); + + vector::const_iterator const cit = + biblio::searchKeys(theMap, form_->bibkeys, str, + start, type, dir, caseSensitive); + + if (cit == form_->bibkeys.end()) { + return; + } + + int const found = int(cit - form_->bibkeys.begin()); + if (found == sel) { + return; + } + + // Update the display + int const top = max(found - 5, 1); + bibLB->setTopItem(top); + bibLB->setSelected(found, true); + slotBibSelected(0); +} + + +void QCitationDialog::slotCitationStyleSelected( int ) +{ +} + + +void QCitationDialog::slotTextBeforeReturn() +{ +} + + +void QCitationDialog::slotTextAfterReturn() +{ +} diff --git a/src/frontends/qt2/QCitationDialog.h b/src/frontends/qt2/QCitationDialog.h new file mode 100644 index 0000000000..9201aa8af7 --- /dev/null +++ b/src/frontends/qt2/QCitationDialog.h @@ -0,0 +1,47 @@ +/** + * \file QCitationDialog.h + * Copyright 2001 the LyX Team + * Read the file COPYING + * + * \author Kalle Dalheimer + */ + +#ifndef QCITATIONDIALOG_H +#define QCITATIONDIALOG_H + +class QCitation; + +#include +#include "support/lstrings.h" + +#include "ui/QCitationDialogBase.h" +#include "controllers/biblio.h" + +class QCitationDialog : public QCitationDialogBase +{ Q_OBJECT + +public: + QCitationDialog(QCitation * form, QWidget * parent = 0, const char * name = 0, bool modal = FALSE, WFlags fl = 0); + ~QCitationDialog(); + +protected slots: + virtual void slotBibSelected(int sel); + virtual void slotCiteSelected(int sel); + virtual void slotAddClicked(); + virtual void slotDelClicked(); + virtual void slotUpClicked(); + virtual void slotDownClicked(); + virtual void slotPreviousClicked(); + virtual void slotNextClicked(); + virtual void slotCitationStyleSelected(int); + virtual void slotTextBeforeReturn(); + virtual void slotTextAfterReturn(); + +private: + void doFind(biblio::Direction dir); + +private: + QCitation * form_; +}; + +#endif // QCITATIOINDIALOG_H diff --git a/src/frontends/qt2/FormDocument.C b/src/frontends/qt2/QDocument.C similarity index 93% rename from src/frontends/qt2/FormDocument.C rename to src/frontends/qt2/QDocument.C index 95e2ece407..e5597afa8d 100644 --- a/src/frontends/qt2/FormDocument.C +++ b/src/frontends/qt2/QDocument.C @@ -1,13 +1,10 @@ -/* This file is part of - * ====================================================== +/** + * \file QDocument.C + * Copyright 2001 the LyX Team + * Read the file COPYING * - * LyX, The Document Processor - * - * Copyright 2000 The LyX Team. - * - * @author Kalle Dalheimer - * - *======================================================*/ + * \author Kalle Dalheimer + */ #include @@ -15,9 +12,8 @@ #pragma implementation #endif -#include "FormDocument.h" -#include "FormDocumentDialogImpl.h" -#undef emit +#include "QDocument.h" +#include "QDocumentDialog.h" #include "lyx_gui_misc.h" @@ -29,7 +25,6 @@ #include "vspace.h" #include "support/filetools.h" #include "language.h" -#include "LyXView.h" #include "BufferView.h" #include "buffer.h" #include "Liason.h" @@ -44,22 +39,24 @@ using Liason::setMinibuffer; using SigC::slot; -typedef Qt2CB > base_class; +typedef Qt2CB > base_class; -FormDocument::FormDocument( ControlDocument& c ) - : base_class( c, _("Document Layout")) +#if 0 +QDocument::QDocument(ControlDocument & c) + : base_class(c, _("Document Settings")) { } +#endif -void FormDocument::build() +void QDocument::build() { int n; // the tabbed folder - // PENDING(kalle) Parent??? - dialog_.reset( new FormDocumentDialogImpl()); + //dialog_.reset(new QDocumentDialog()); +#if 0 // Manage the restore, ok, apply, restore and cancel/close buttons bc().setOK(dialog_->okPB); bc().setApply(dialog_->applyPB); @@ -68,7 +65,7 @@ void FormDocument::build() bc().refresh(); // the document paper page - FormDocumentDialogImpl* dialog = dialog_.get(); + QDocumentDialog * dialog = dialog_.get(); dialog->papersize2CO->insertItem( _( "Default" ) ); dialog->papersize2CO->insertItem( _( "Custom" ) ); dialog->papersize2CO->insertItem( _( "USletter" ) ); @@ -209,14 +206,16 @@ void FormDocument::build() bc().addReadOnly (dialog->bulletPanelBG); bc().addReadOnly (dialog->bulletSizeCO); bc().addReadOnly (dialog->bulletLatexED); +#endif } -void FormDocument::apply() +void QDocument::apply() { - if (!lv_->view()->available() || !dialog_.get()) - return; + //if (!lv_->view()->available() || !dialog_.get()) + // return; +#if 0 bool redo = class_apply(); paper_apply(); redo = language_apply() || redo; @@ -228,11 +227,13 @@ void FormDocument::apply() } lv_->buffer()->markDirty(); setMinibuffer(lv_, _("Document layout set")); +#endif } -void FormDocument::cancel() +void QDocument::cancel() { +#if 0 // this avoids confusion when reopening BufferParams & param = lv_->buffer()->params; param.temp_bullets[0] = param.user_defined_bullets[0]; @@ -240,14 +241,16 @@ void FormDocument::cancel() param.temp_bullets[2] = param.user_defined_bullets[2]; param.temp_bullets[3] = param.user_defined_bullets[3]; hide(); +#endif } -void FormDocument::update() +void QDocument::update() { if (!dialog_.get()) return; +#if 0 checkReadOnly(); BufferParams const & params = lv_->buffer()->params; @@ -257,11 +260,12 @@ void FormDocument::update() language_update(params); options_update(params); bullets_update(params); +#endif } -#ifdef K -bool FormDocument::input( FL_OBJECT * ob, long data ) +#if 0 +bool QDocument::input( FL_OBJECT * ob, long data ) { State cb = static_cast( data ); @@ -309,21 +313,17 @@ bool FormDocument::input( FL_OBJECT * ob, long data ) return true; } -#endif -// FIXME: "K" ??? -#ifdef K -void FormDocument::ComboInputCB(int, void * v, Combox * combox) +void QDocument::ComboInputCB(int, void * v, Combox * combox) { - FormDocument * pre = static_cast(v); + QDocument * pre = static_cast(v); if (combox == pre->combo_doc_class.get()) pre->CheckChoiceClass(0, 0); pre->bc().valid(pre->CheckDocumentInput(0,0)); } -#endif -bool FormDocument::class_apply() +bool QDocument::class_apply() { bool redo = false; BufferParams ¶ms = lv_->buffer()->params; @@ -440,7 +440,7 @@ bool FormDocument::class_apply() } -void FormDocument::paper_apply() +void QDocument::paper_apply() { BufferParams & params = lv_->buffer()->params; @@ -466,7 +466,7 @@ void FormDocument::paper_apply() } -bool FormDocument::language_apply() +bool QDocument::language_apply() { BufferParams & params = lv_->buffer()->params; InsetQuotes::quote_language lga = InsetQuotes::EnglishQ; @@ -519,7 +519,7 @@ bool FormDocument::language_apply() } -bool FormDocument::options_apply() +bool QDocument::options_apply() { BufferParams & params = lv_->buffer()->params; bool redo = false; @@ -542,7 +542,7 @@ bool FormDocument::options_apply() } -void FormDocument::bullets_apply() +void QDocument::bullets_apply() { /* update the bullet settings */ BufferParams & param = lv_->buffer()->params; @@ -555,7 +555,7 @@ void FormDocument::bullets_apply() } -void FormDocument::class_update(BufferParams const & params) +void QDocument::class_update(BufferParams const & params) { if (!class_.get()) return; @@ -640,7 +640,7 @@ void FormDocument::class_update(BufferParams const & params) } -void FormDocument::language_update(BufferParams const & params) +void QDocument::language_update(BufferParams const & params) { if (!language_.get()) return; @@ -657,7 +657,7 @@ void FormDocument::language_update(BufferParams const & params) } -void FormDocument::options_update(BufferParams const & params) +void QDocument::options_update(BufferParams const & params) { if (!options_.get()) return; @@ -674,7 +674,7 @@ void FormDocument::options_update(BufferParams const & params) } -void FormDocument::paper_update(BufferParams const & params) +void QDocument::paper_update(BufferParams const & params) { if (!paper_.get()) return; @@ -701,7 +701,7 @@ void FormDocument::paper_update(BufferParams const & params) } -void FormDocument::bullets_update(BufferParams const & params) +void QDocument::bullets_update(BufferParams const & params) { bool const isLinuxDoc = lv_->buffer()->isLinuxDoc(); setEnabled(fbullet, !isLinuxDoc); @@ -714,7 +714,7 @@ void FormDocument::bullets_update(BufferParams const & params) } -void FormDocument::checkReadOnly() +void QDocument::checkReadOnly() { if (bc().readOnly(lv_->buffer()->isReadonly())) { dialog_->docClassCO->setEnabled( false ); @@ -730,7 +730,7 @@ void FormDocument::checkReadOnly() } -void FormDocument::checkMarginValues() +void QDocument::checkMarginValues() { bool const not_empty = !dialog_->topMarginED->text().isEmpty() || @@ -746,8 +746,8 @@ void FormDocument::checkMarginValues() dialog_->useGeometryCB->setChecked( true ); } -#ifdef K -bool FormDocument::CheckDocumentInput(FL_OBJECT * ob, long) +#ifdef I_SUPPOSE_THIS_NEEDS_TO_FIXED +bool QDocument::CheckDocumentInput(FL_OBJECT * ob, long) { string str; int val; @@ -837,7 +837,7 @@ bool FormDocument::CheckDocumentInput(FL_OBJECT * ob, long) } -void FormDocument::ChoiceBulletSize(FL_OBJECT * ob, long /*data*/ ) +void QDocument::ChoiceBulletSize(FL_OBJECT * ob, long /*data*/ ) { BufferParams & param = lv_->buffer()->params; @@ -848,7 +848,7 @@ void FormDocument::ChoiceBulletSize(FL_OBJECT * ob, long /*data*/ ) } -void FormDocument::InputBulletLaTeX(FL_OBJECT *, long) +void QDocument::InputBulletLaTeX(FL_OBJECT *, long) { BufferParams & param = lv_->buffer()->params; @@ -857,7 +857,7 @@ void FormDocument::InputBulletLaTeX(FL_OBJECT *, long) } -void FormDocument::BulletDepth(FL_OBJECT * ob, State cb) +void QDocument::BulletDepth(FL_OBJECT * ob, State cb) { /* Should I do the following: * 1. change to the panel that the current bullet belongs in @@ -894,7 +894,7 @@ void FormDocument::BulletDepth(FL_OBJECT * ob, State cb) } -void FormDocument::BulletPanel(FL_OBJECT * /*ob*/, State cb) +void QDocument::BulletPanel(FL_OBJECT * /*ob*/, State cb) { /* Here we have to change the background pixmap to that selected */ /* by the user. (eg. standard.xpm, psnfss1.xpm etc...) */ @@ -956,7 +956,7 @@ void FormDocument::BulletPanel(FL_OBJECT * /*ob*/, State cb) } -void FormDocument::BulletBMTable(FL_OBJECT * ob, long /*data*/ ) +void QDocument::BulletBMTable(FL_OBJECT * ob, long /*data*/ ) { /* handle the user input by setting the current bullet depth's pixmap */ /* to that extracted from the current chosen position of the BMTable */ @@ -974,7 +974,7 @@ void FormDocument::BulletBMTable(FL_OBJECT * ob, long /*data*/ ) } -void FormDocument::CheckChoiceClass(FL_OBJECT * ob, long) +void QDocument::CheckChoiceClass(FL_OBJECT * ob, long) { if (!ob) ob = class_->choice_doc_class; @@ -1005,7 +1005,7 @@ void FormDocument::CheckChoiceClass(FL_OBJECT * ob, long) } #endif -void FormDocument::UpdateLayoutDocument(BufferParams const & params) +void QDocument::UpdateLayoutDocument(BufferParams const & params) { if (!dialog_.get()) return; @@ -1017,3 +1017,4 @@ void FormDocument::UpdateLayoutDocument(BufferParams const & params) options_update(params); bullets_update(params); } +#endif // 0 diff --git a/src/frontends/qt2/FormDocument.h b/src/frontends/qt2/QDocument.h similarity index 77% rename from src/frontends/qt2/FormDocument.h rename to src/frontends/qt2/QDocument.h index 38e5480cce..5f390bd146 100644 --- a/src/frontends/qt2/FormDocument.h +++ b/src/frontends/qt2/QDocument.h @@ -1,44 +1,39 @@ // -*- C++ -*- -/* This file is part of - * ====================================================== +/** + * \file QDocument.h + * Copyright 2001 the LyX Team + * Read the file COPYING * - * LyX, The Document Processor - * - * Copyright (C) 2000 The LyX Team. - * - * @author Kalle Dalheimer - * - *======================================================*/ + * \author Kalle Dalheimer + */ -#ifndef FORM_DOCUMENT_H -#define FORM_DOCUMENT_H + +#ifndef QDOCUMENT_H +#define QDOCUMENT_H #include #include #include "Qt2Base.h" #include "qt2BC.h" -#undef emit +#include "QtLyXView.h" #ifdef __GNUG_ #pragma interface #endif class ControlDocument; -class FormDocumentDialogImpl; +class QDocumentDialog; class BufferParams; class LyXView; class Dialogs; -/** This class provides an Qt2 implementation of the FormDocument dialog. - The table-layout-form here changes values for latex-tabulars - @author Kalle Dalheimer - */ -class FormDocument - : public Qt2CB > +class QDocument + //FIXME !!!!! : public Qt2CB > { public: - FormDocument(LyXView *, Dialogs *); + // FIXME!!!!!!! + QDocument(LyXView *, Dialogs *) {}; private: /// enum State { @@ -89,6 +84,7 @@ private: // /// // virtual QDialog* form() const; +#if 0 /// bool CheckDocumentInput(QWidget* ob, long); /// @@ -144,9 +140,9 @@ private: QDialog* build_doc_options(); /// QDialog* build_doc_bullet(); - +#endif /// Real GUI implementation. - boost::scoped_ptr dialog_; + boost::scoped_ptr dialog_; /// int ActCell; /// @@ -167,9 +163,9 @@ private: inline -qt2BC & FormDocument::bc() +qt2BC & QDocument::bc() { return bc_; } -#endif +#endif // QDOCUMENT_H diff --git a/src/frontends/qt2/QDocumentDialog.C b/src/frontends/qt2/QDocumentDialog.C new file mode 100644 index 0000000000..2489847158 --- /dev/null +++ b/src/frontends/qt2/QDocumentDialog.C @@ -0,0 +1,454 @@ +/** + * \file QDocumentDialog.C + * Copyright 2001 the LyX Team + * Read the file COPYING + * + * \author Kalle Dalheimer + */ + +#include + +#include "QDocumentDialog.h" +#include "Dialogs.h" +#include "QDocument.h" + +#include +#include +#include +#include +#include +#include + +QDocumentDialog::QDocumentDialog(QDocument * form, QWidget * parent, const char * name, bool modal, WFlags fl) + : QDocumentDialogBase(parent, name, modal, fl), + form_(form) +{ +#if 0 + // Copy the pointers to the bullet buttons into an array so that + // they can all be manipulated together. + bulletbuttons[0] = bullet00PB; + bulletbuttons[1] = bullet01PB; + bulletbuttons[2] = bullet02PB; + bulletbuttons[3] = bullet03PB; + bulletbuttons[4] = bullet04PB; + bulletbuttons[5] = bullet05PB; + bulletbuttons[6] = bullet10PB; + bulletbuttons[7] = bullet11PB; + bulletbuttons[8] = bullet12PB; + bulletbuttons[9] = bullet13PB; + bulletbuttons[10] = bullet14PB; + bulletbuttons[11] = bullet15PB; + bulletbuttons[12] = bullet20PB; + bulletbuttons[13] = bullet21PB; + bulletbuttons[14] = bullet22PB; + bulletbuttons[15] = bullet23PB; + bulletbuttons[16] = bullet24PB; + bulletbuttons[17] = bullet25PB; + bulletbuttons[18] = bullet30PB; + bulletbuttons[19] = bullet31PB; + bulletbuttons[20] = bullet32PB; + bulletbuttons[21] = bullet33PB; + bulletbuttons[22] = bullet34PB; + bulletbuttons[23] = bullet35PB; + bulletbuttons[24] = bullet40PB; + bulletbuttons[25] = bullet41PB; + bulletbuttons[26] = bullet42PB; + bulletbuttons[27] = bullet43PB; + bulletbuttons[28] = bullet44PB; + bulletbuttons[29] = bullet45PB; + bulletbuttons[30] = bullet50PB; + bulletbuttons[31] = bullet51PB; + bulletbuttons[32] = bullet52PB; + bulletbuttons[33] = bullet53PB; + bulletbuttons[34] = bullet54PB; + bulletbuttons[35] = bullet55PB; +#endif +} + + +QDocumentDialog::~QDocumentDialog() +{ +} + + +#if 0 +void QDocumentDialog::slotApply() +{ + form->apply(); + // PENDING(kalle) Check whether we need this + // form->bc_->apply(); +} + + +void QDocumentDialog::slotAMSMath(bool) +{ + form->checkDocumentInput( amsMathCB ); +} + + +void QDocumentDialog::slotBulletDepth1() +{ + form->bulletDepth( 0 ); +} + + +void QDocumentDialog::slotBulletDepth2() +{ + form->bulletDepth( 1 ); +} + + +void QDocumentDialog::slotBulletDepth3() +{ + form->bulletDepth( 2 ); +} + + +void QDocumentDialog::slotBulletDepth4() +{ + form->bulletDepth( 3 ); +} + + +void QDocumentDialog::slotBulletDing1() +{ + qDebug( "QDocumentDialog::slotBulletDing1()" ); + form->checkDocumentInput( bulletDing1PB ); + form->setBulletPics(); + bulletStandardPB->setOn( false ); + bulletMathsPB->setOn( false ); + bulletDing2PB->setOn( false ); + bulletDing3PB->setOn( false ); + bulletDing4PB->setOn( false ); +} + + +void QDocumentDialog::slotBulletDing2() +{ + form->checkDocumentInput( bulletDing2PB ); + form->setBulletPics(); + bulletStandardPB->setOn( false ); + bulletMathsPB->setOn( false ); + bulletDing1PB->setOn( false ); + bulletDing3PB->setOn( false ); + bulletDing4PB->setOn( false ); +} + + +void QDocumentDialog::slotBulletDing3() +{ + form->checkDocumentInput( bulletDing3PB ); + form->setBulletPics(); + bulletStandardPB->setOn( false ); + bulletMathsPB->setOn( false ); + bulletDing2PB->setOn( false ); + bulletDing1PB->setOn( false ); + bulletDing4PB->setOn( false ); +} + + +void QDocumentDialog::slotBulletDing4() +{ + form->checkDocumentInput( bulletDing4PB ); + form->setBulletPics(); + bulletStandardPB->setOn( false ); + bulletMathsPB->setOn( false ); + bulletDing2PB->setOn( false ); + bulletDing3PB->setOn( false ); + bulletDing1PB->setOn( false ); +} + + +void QDocumentDialog::slotBulletMaths() +{ + form->checkDocumentInput( bulletMathsPB ); + form->setBulletPics(); + bulletStandardPB->setOn( false ); + bulletDing1PB->setOn( false ); + bulletDing2PB->setOn( false ); + bulletDing3PB->setOn( false ); + bulletDing4PB->setOn( false ); +} + + +void QDocumentDialog::slotBulletSize(int) +{ + form->choiceBulletSize(); + form->checkDocumentInput( bulletSizeCO ); +} + + +void QDocumentDialog::slotBulletStandard() +{ + form->checkDocumentInput( bulletStandardPB ); + form->setBulletPics(); + bulletDing1PB->setOn( false ); + bulletMathsPB->setOn( false ); + bulletDing2PB->setOn( false ); + bulletDing3PB->setOn( false ); + bulletDing4PB->setOn( false ); +} + + +void QDocumentDialog::slotBulletSymbol(int n) +{ + qDebug( "QDocumentDialog::slotBulletSymbol( %d )", n ); + for( int i = 0; i < 36; i++ ) + bulletbuttons[i]->setOn( false ); + bulletbuttons[n]->setOn( true ); + form->bulletBMTable( n ); + form->checkDocumentInput( bulletTypeBG ); +} + + +void QDocumentDialog::slotClass(int) +{ + form->checkChoiceClass( 0 ); + form->checkDocumentInput( classesCO ); +} + + +void QDocumentDialog::slotClose() +{ + form->cancel(); + form->hide(); + // PENDING(kalle) do something with this + // form->bc_->cancel(); +} + + +void QDocumentDialog::slotColumns(int) +{ + form->checkDocumentInput( columnsBG ); +} + + +void QDocumentDialog::slotDefaultSkip(const QString&) +{ + form->checkDocumentInput( defaultSkipED ); +} + + +void QDocumentDialog::slotDefaultSkip(int) +{ + form->checkChoiceClass( defaultSkipCO ); + form->checkDocumentInput( defaultSkipCO ); +} + + +void QDocumentDialog::slotEncoding(int) +{ + form->checkChoiceClass( encodingCO ); + form->checkDocumentInput( encodingCO ); +} + + +void QDocumentDialog::slotExtraOptions(const QString&) +{ + form->checkDocumentInput( extraOptionsED ); +} + + +void QDocumentDialog::slotFloatPlacement(const QString&) +{ + form->checkDocumentInput( floatPlacementED ); +} + + +void QDocumentDialog::slotFont(int) +{ + form->checkChoiceClass( fontsCO ); + form->checkDocumentInput( fontsCO ); +} + + +void QDocumentDialog::slotFontSize(int) +{ + form->checkChoiceClass( fontSizeCO ); + form->checkDocumentInput( fontSizeCO ); +} + + +void QDocumentDialog::slotFootskip(const QString&) +{ + form->checkDocumentInput( footskipED ); +} + + +void QDocumentDialog::slotHeadheight(const QString&) +{ + form->checkDocumentInput( headheightED ); +} + + +void QDocumentDialog::slotHeadsep(const QString&) +{ + form->checkDocumentInput( headsepED ); +} + + +void QDocumentDialog::slotHeight(const QString&) +{ + form->checkDocumentInput( customHeightED ); +} + + +void QDocumentDialog::slotLanguage(int) +{ + form->checkChoiceClass( languageCO ); + form->checkDocumentInput( languageCO ); +} + + +void QDocumentDialog::slotBulletLaTeX(const QString&) +{ + form->inputBulletLaTeX(); + form->checkDocumentInput( latexED ); +} + + +void QDocumentDialog::slotMarginBottom(const QString&) +{ + form->checkDocumentInput( marginBottomED ); +} + + +void QDocumentDialog::slotMarginLeft(const QString&) +{ + form->checkDocumentInput( marginLeftED ); +} + + +void QDocumentDialog::slotMarginRight(const QString&) +{ + form->checkDocumentInput( marginRightED ); +} + + +void QDocumentDialog::slotMarginTop(const QString&) +{ + form->checkDocumentInput( marginTopED ); +} + + +void QDocumentDialog::slotOK() +{ + form->apply(); + form->hide(); + // PENDING(kalle) Do something about this. + // form->bc_->ok(); +} + + +void QDocumentDialog::slotOrientation(int) +{ + form->checkDocumentInput( orientationBG ); +} + + +void QDocumentDialog::slotPSDriver(int) +{ + form->checkChoiceClass( psDriverCO ); + form->checkDocumentInput( psDriverCO ); +} + + +void QDocumentDialog::slotPageStyle(int) +{ + form->checkChoiceClass( pagestyleCO ); + form->checkDocumentInput( pagestyleCO ); +} + + +void QDocumentDialog::slotPapersize(int) +{ + form->checkChoiceClass( pagestyleCO ); + form->checkDocumentInput( papersizeCO ); +} + + +void QDocumentDialog::slotQuoteStyle(int) +{ + form->checkChoiceClass( quoteStyleTypeCO ); + form->checkDocumentInput( quoteStyleTypeCO ); +} + + +void QDocumentDialog::slotQuoteType(int) +{ + // Intentionally left blank +} + + +void QDocumentDialog::slotRestore() +{ + form->update(); + // PENDING(kalle) Do something about this. + // form->bc_->updateAll(); +} + + +void QDocumentDialog::slotSectionNumberDepth(int) +{ + form->checkDocumentInput( sectionNumberDepthSB ); +} + + +void QDocumentDialog::slotSeparation(int) +{ + form->checkDocumentInput( separationBG ); +} + + +void QDocumentDialog::slotSides(int) +{ + form->checkDocumentInput( sidesBG ); +} + + +void QDocumentDialog::slotSpacing(const QString&) +{ + form->checkDocumentInput( spacingED ); +} + + +void QDocumentDialog::slotSpacing(int) +{ + form->checkDocumentInput( spacingCO ); + form->checkDocumentInput( spacingCO ); +} + + +void QDocumentDialog::slotSpecialPaperPackage(int) +{ + form->checkChoiceClass( specialCO ); + form->checkDocumentInput( specialCO ); +} + + +void QDocumentDialog::slotTOCDepth(int) +{ + form->checkDocumentInput( tocDepthSB ); +} + + +void QDocumentDialog::slotUseGeometryPackage(bool) +{ + form->checkDocumentInput( CheckBox1 ); +} + + +void QDocumentDialog::slotWidth(const QString&) +{ + form->checkDocumentInput( customWidthED ); +} +#endif + + +void QDocumentDialog::closeEvent( QCloseEvent* e ) +{ + //form_->hide(); + //PENDING(kalle) Do something about this. + // form->bc_->hide(); + e->accept(); +} diff --git a/src/frontends/qt2/QDocumentDialog.h b/src/frontends/qt2/QDocumentDialog.h new file mode 100644 index 0000000000..d1d19c1c3f --- /dev/null +++ b/src/frontends/qt2/QDocumentDialog.h @@ -0,0 +1,86 @@ +/** + * \file QDocumentDialog.h + * Copyright 2001 the LyX Team + * Read the file COPYING + * + * \author Kalle Dalheimer + */ + +#ifndef QDOCUMENTDIALOG_H +#define QDOCUMENTDIALOG_H + +#include "ui/QDocumentDialogBase.h" + +class QDocument; + +class QDocumentDialog : public QDocumentDialogBase +{ Q_OBJECT + +public: + QDocumentDialog(QDocument * form, QWidget * parent = 0, const char * name = 0, bool modal = FALSE, WFlags fl = 0); + ~QDocumentDialog(); + +public slots: +#if 0 + void slotApply(); + void slotBulletLaTeX(const QString&); + void slotAMSMath(bool); + void slotBulletDepth1(); + void slotBulletDepth2(); + void slotBulletDepth3(); + void slotBulletDepth4(); + void slotBulletDing1(); + void slotBulletDing2(); + void slotBulletDing3(); + void slotBulletDing4(); + void slotBulletMaths(); + void slotBulletSize(int); + void slotBulletStandard(); + void slotBulletSymbol(int); + void slotClass(int); + void slotClose(); + void slotColumns(int); + void slotDefaultSkip(const QString&); + void slotDefaultSkip(int); + void slotEncoding(int); + void slotExtraOptions(const QString&); + void slotFloatPlacement(const QString&); + void slotFont(int); + void slotFontSize(int); + void slotFootskip(const QString&); + void slotHeadheight(const QString&); + void slotHeadsep(const QString&); + void slotHeight(const QString&); + void slotLanguage(int); + void slotMarginBottom(const QString&); + void slotMarginLeft(const QString&); + void slotMarginRight(const QString&); + void slotMarginTop(const QString&); + void slotOK(); + void slotOrientation(int); + void slotPSDriver(int); + void slotPageStyle(int); + void slotPapersize(int); + void slotQuoteStyle(int); + void slotQuoteType(int); + void slotRestore(); + void slotSectionNumberDepth(int); + void slotSeparation(int); + void slotSides(int); + void slotSpacing(const QString&); + void slotSpacing(int); + void slotSpecialPaperPackage(int); + void slotTOCDepth(int); + void slotUseGeometryPackage(bool); + void slotWidth(const QString&); +#endif + +protected: + void closeEvent(QCloseEvent *); + +private: + QDocument * form_; + QToolButton* bulletbuttons[36]; +}; + +#endif // QDOCUMENTDIALOG_H diff --git a/src/frontends/qt2/QIndex.C b/src/frontends/qt2/QIndex.C new file mode 100644 index 0000000000..5769ececd8 --- /dev/null +++ b/src/frontends/qt2/QIndex.C @@ -0,0 +1,130 @@ +/** + * \file QIndex.C + * Copyright 2001 the LyX Team + * Read the file COPYING + * + * \author John Levon + */ + +#include + +#include "QIndexDialog.h" +#include "QtLyXView.h" +#include "BufferView.h" + +#include "Dialogs.h" +#include "QIndex.h" +#include "gettext.h" +#include "buffer.h" +#include "lyxfunc.h" + +#include +#include + +QIndex::QIndex(LyXView *v, Dialogs *d) + : dialog_(0), lv_(v), d_(d), inset_(0), h_(0), u_(0), ih_(0) +{ + d->showIndex.connect(slot(this, &QIndex::showIndex)); + d->createIndex.connect(slot(this, &QIndex::createIndex)); +} + + +QIndex::~QIndex() +{ + delete dialog_; +} + + +void QIndex::showIndex(InsetCommand * const inset) +{ + // FIXME: when could inset be 0 here ? + if (inset==0) + return; + + inset_ = inset; + readonly = lv_->buffer()->isReadonly(); + //FIXME ih_ = inset_->hide.connect(slot(this,&QIndex::hide)); + params = inset->params(); + + show(); +} + + +void QIndex::createIndex(string const & arg) +{ + // we could already be showing a URL, clear it out + if (inset_) + close(); + + readonly = lv_->buffer()->isReadonly(); + params.setFromString(arg); + show(); +} + + +void QIndex::update() +{ + dialog_->keywordED->setText(params.getContents().c_str()); + + if (readonly) { + dialog_->keywordED->setFocusPolicy(QWidget::NoFocus); + dialog_->okPB->setEnabled(false); + dialog_->cancelPB->setText(_("Close")); + } else { + dialog_->keywordED->setFocusPolicy(QWidget::StrongFocus); + dialog_->keywordED->setFocus(); + dialog_->okPB->setEnabled(true); + dialog_->cancelPB->setText(_("Cancel")); + } +} + + +void QIndex::apply() +{ + if (readonly) + return; + + params.setContents(dialog_->keywordED->text().latin1()); + + if (inset_ != 0) { + if (params != inset_->params()) { + inset_->setParams(params); + lv_->view()->updateInset(inset_, true); + } + } else + lv_->getLyXFunc()->dispatch(LFUN_INDEX_INSERT, params.getAsString().c_str()); +} + + +void QIndex::show() +{ + if (!dialog_) + dialog_ = new QIndexDialog(this, 0, _("LyX: Index"), false); + + if (!dialog_->isVisible()) { + h_ = d_->hideBufferDependent.connect(slot(this, &QIndex::hide)); + //u_ = d_->updateBufferDependent.connect(slot(this, &QIndex::update)); + } + + dialog_->raise(); + dialog_->setActiveWindow(); + + update(); + dialog_->show(); +} + + +void QIndex::close() +{ + h_.disconnect(); + u_.disconnect(); + ih_.disconnect(); + inset_ = 0; +} + + +void QIndex::hide() +{ + dialog_->hide(); + close(); +} diff --git a/src/frontends/qt2/QIndex.h b/src/frontends/qt2/QIndex.h new file mode 100644 index 0000000000..6611b05e7e --- /dev/null +++ b/src/frontends/qt2/QIndex.h @@ -0,0 +1,71 @@ +// -*- C++ -*- +/** + * \file QIndex.h + * Copyright 2001 the LyX Team + * Read the file COPYING + * + * \author John Levon + * \author Kalle Dalheimer + */ + +#ifndef QINDEX_H +#define QINDEX_H + +#include "DialogBase.h" +#include "LString.h" +#include "boost/utility.hpp" +#include "insets/insetindex.h" + +class Dialogs; +class LyXView; +class QIndexDialog; + +class QIndex : public DialogBase { +public: + QIndex(LyXView *, Dialogs *); + ~QIndex(); + + /// Apply changes + void apply(); + /// close the connections + void close(); + +private: + /// Create the dialog if necessary, update it and display it. + void show(); + /// Hide the dialog. + void hide(); + /// Update the dialog. + void update(); + + /// create an Index inset + void createIndex(string const &); + /// edit an Index inset + void showIndex(InsetCommand * const); + + /// Real GUI implementation. + QIndexDialog * dialog_; + + /// the LyXView we belong to + LyXView * lv_; + + /** Which Dialogs do we belong to? + Used so we can get at the signals we have to connect to. + */ + Dialogs * d_; + /// pointer to the inset if any + InsetCommand * inset_; + /// insets params + InsetCommandParams params; + /// is the inset we are reading from a readonly buffer ? + bool readonly; + + /// Hide connection. + SigC::Connection h_; + /// Update connection. + SigC::Connection u_; + /// Inset hide connection. + SigC::Connection ih_; +}; + +#endif // QINDEX_H diff --git a/src/frontends/qt2/QIndexDialog.C b/src/frontends/qt2/QIndexDialog.C new file mode 100644 index 0000000000..b426076dd1 --- /dev/null +++ b/src/frontends/qt2/QIndexDialog.C @@ -0,0 +1,44 @@ +/** + * \file QIndexDialog.C + * Copyright 2001 the LyX Team + * Read the file COPYING + * + * \author John Levon + */ + +#include "QIndexDialog.h" +#include "Dialogs.h" +#include "QIndex.h" + +QIndexDialog::QIndexDialog(QIndex * form, QWidget * parent, const char * name, bool modal, WFlags fl) + : QIndexDialogBase(parent, name, modal, fl), + form_(form) +{ +} + + +QIndexDialog::~QIndexDialog() +{ +} + + +void QIndexDialog::apply_adaptor() +{ + form_->apply(); + form_->close(); + hide(); +} + + +void QIndexDialog::close_adaptor() +{ + form_->close(); + hide(); +} + + +void QIndexDialog::closeEvent(QCloseEvent *e) +{ + form_->close(); + e->accept(); +} diff --git a/src/frontends/qt2/QIndexDialog.h b/src/frontends/qt2/QIndexDialog.h new file mode 100644 index 0000000000..559bc3ff67 --- /dev/null +++ b/src/frontends/qt2/QIndexDialog.h @@ -0,0 +1,36 @@ +/** + * \file QIndexDialog.h + * Copyright 2001 the LyX Team + * Read the file COPYING + * + * \author John Levon + */ + +#ifndef QINDEXDIALOG_H +#define QINDEXDIALOG_H + +#include + +#include "ui/QIndexDialogBase.h" + +class QIndex; + +class QIndexDialog : public QIndexDialogBase +{ Q_OBJECT + +public: + QIndexDialog(QIndex * form, QWidget * parent = 0, const char * name = 0, bool modal = FALSE, WFlags fl = 0); + ~QIndexDialog(); + +public slots: + void apply_adaptor(); + void close_adaptor(); + +protected: + void closeEvent(QCloseEvent * e); + +private: + QIndex * form_; +}; + +#endif // QINDEXDIALOG_H diff --git a/src/frontends/qt2/FormParagraph.C b/src/frontends/qt2/QParagraph.C similarity index 87% rename from src/frontends/qt2/FormParagraph.C rename to src/frontends/qt2/QParagraph.C index dc62aedf54..602db737c5 100644 --- a/src/frontends/qt2/FormParagraph.C +++ b/src/frontends/qt2/QParagraph.C @@ -1,5 +1,5 @@ /** - * \file FormParagraph.C + * \file QParagraph.C * Copyright 2001 LyX Team * see the file COPYING * @@ -8,9 +8,9 @@ #include -#include "paragraphdlgimpl.h" +#include "QParagraphDialog.h" -#include "FormParagraph.h" +#include "QParagraph.h" #include "Dialogs.h" #include "Liason.h" #include "gettext.h" @@ -26,23 +26,20 @@ using Liason::setMinibuffer; using std::endl; -FormParagraph::FormParagraph(LyXView *v, Dialogs *d) +QParagraph::QParagraph(LyXView *v, Dialogs *d) : dialog_(0), lv_(v), d_(d), h_(0) { - // 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->showParagraph.connect(slot(this, &FormParagraph::show)); + d->showParagraph.connect(slot(this, &QParagraph::show)); } -FormParagraph::~FormParagraph() +QParagraph::~QParagraph() { delete dialog_; } -void FormParagraph::update(bool switched) +void QParagraph::update(bool switched) { if (switched) { hide(); @@ -121,7 +118,7 @@ void FormParagraph::update(bool switched) } -void FormParagraph::apply() +void QParagraph::apply() { if (readonly) return; @@ -148,7 +145,7 @@ void FormParagraph::apply() lv_->view()->text->setParagraph(lv_->view(), dialog_->getLineAbove(), dialog_->getLineBelow(), dialog_->getPagebreakAbove(), dialog_->getPagebreakBelow(), - spaceabove, spacebelow, dialog_->getAlign(), + spaceabove, spacebelow, Spacing(), dialog_->getAlign(), dialog_->getLabelWidth(), dialog_->getNoIndent()); // extra stuff @@ -175,16 +172,16 @@ void FormParagraph::apply() } -void FormParagraph::show() +void QParagraph::show() { if (!dialog_) - dialog_ = new ParagraphDlgImpl(this, 0, - _("LyX: Paragraph Options"), + dialog_ = new QParagraphDialog(this, 0, + _("LyX: Paragraph Settings"), false); if (!dialog_->isVisible()) h_ = d_->hideBufferDependent - .connect(slot(this, &FormParagraph::hide)); + .connect(slot(this, &QParagraph::hide)); dialog_->raise(); dialog_->setActiveWindow(); @@ -194,13 +191,13 @@ void FormParagraph::show() } -void FormParagraph::close() +void QParagraph::close() { h_.disconnect(); } -void FormParagraph::hide() +void QParagraph::hide() { dialog_->hide(); close(); diff --git a/src/frontends/qt2/FormParagraph.h b/src/frontends/qt2/QParagraph.h similarity index 71% rename from src/frontends/qt2/FormParagraph.h rename to src/frontends/qt2/QParagraph.h index 0c9d07a4d0..3f96094ee1 100644 --- a/src/frontends/qt2/FormParagraph.h +++ b/src/frontends/qt2/QParagraph.h @@ -1,14 +1,14 @@ // -*- C++ -*- /** - * \file FormParagraph.h + * \file QParagraph.h * Copyright 2001 LyX Team * see the file COPYING * * \author John Levon, moz@compsoc.man.ac.uk */ -#ifndef FORMPARAGRAPH_H -#define FORMPARAGRAPH_H +#ifndef QPARAGRAPH_H +#define QPARAGRAPH_H #include "DialogBase.h" #include "LString.h" @@ -16,17 +16,12 @@ class Dialogs; class LyXView; -class ParagraphDlgImpl; +class QParagraphDialog; -class FormParagraph : public DialogBase { +class QParagraph : public DialogBase { public: - /**@name Constructors and Destructors */ - //@{ - /// - FormParagraph(LyXView *, Dialogs *); - /// - ~FormParagraph(); - //@} + QParagraph(LyXView *, Dialogs *); + ~QParagraph(); /// Apply changes void apply(); @@ -42,7 +37,7 @@ private: void hide(); /// Real GUI implementation. - ParagraphDlgImpl * dialog_; + QParagraphDialog * dialog_; /// the LyXView we belong to LyXView * lv_; @@ -57,4 +52,4 @@ private: bool readonly; }; -#endif +#endif // QPARAGRAPH_H diff --git a/src/frontends/qt2/paragraphdlgimpl.C b/src/frontends/qt2/QParagraphDialog.C similarity index 77% rename from src/frontends/qt2/paragraphdlgimpl.C rename to src/frontends/qt2/QParagraphDialog.C index bb0ef288b7..a63a6234bf 100644 --- a/src/frontends/qt2/paragraphdlgimpl.C +++ b/src/frontends/qt2/QParagraphDialog.C @@ -1,5 +1,5 @@ /** - * \file paragraphdlgimpl.C + * \file QParagraphDialog.C * Copyright 2001 LyX Team * see the file COPYING * @@ -7,40 +7,39 @@ * \author Edwin Leuven, leuven@fee.uva.nl */ -#include "paragraphdlg.h" - #include #include #include -#include "paragraphdlgimpl.h" -#include "FormParagraph.h" +#include "QParagraphDialog.h" +#include "QParagraph.h" #include "support/lstrings.h" #include "debug.h" -#include "qlineedit.h" -#include "qcombobox.h" -#include "qcheckbox.h" -#include "qpushbutton.h" -#include "qtabwidget.h" -#include "qlabel.h" -#include "qgroupbox.h" +#include +#include +#include +#include +#include +#include +#include using std::endl; -ParagraphDlgImpl::ParagraphDlgImpl(FormParagraph *form, QWidget* parent, const char* name, bool modal, WFlags fl ) - : ParagraphDlg( parent, name, modal, fl ), form_(form) +QParagraphDialog::QParagraphDialog(QParagraph * form, QWidget * parent, const char * name, bool modal, WFlags fl) + : QParagraphDialogBase(parent, name, modal, fl), + form_(form) { setCaption(name); } -ParagraphDlgImpl::~ParagraphDlgImpl() +QParagraphDialog::~QParagraphDialog() { } -void ParagraphDlgImpl::setReadOnly(bool readonly) +void QParagraphDialog::setReadOnly(bool readonly) { TabsParagraph->setEnabled(!readonly); okPB->setEnabled(!readonly); @@ -50,7 +49,7 @@ void ParagraphDlgImpl::setReadOnly(bool readonly) } -void ParagraphDlgImpl::setLabelWidth(const char *text) +void QParagraphDialog::setLabelWidth(const char *text) { // FIXME: should be cleverer here if (!strcmp(_("Senseless with this layout!"),text)) { @@ -63,7 +62,7 @@ void ParagraphDlgImpl::setLabelWidth(const char *text) } -void ParagraphDlgImpl::setAlign(int type) +void QParagraphDialog::setAlign(int type) { int item=0; switch (type) { @@ -78,7 +77,7 @@ void ParagraphDlgImpl::setAlign(int type) } -void ParagraphDlgImpl::setChecks(bool labove, bool lbelow, bool pabove, bool pbelow, bool noindent) +void QParagraphDialog::setChecks(bool labove, bool lbelow, bool pabove, bool pbelow, bool noindent) { lineAbove->setChecked(labove); lineBelow->setChecked(lbelow); @@ -88,7 +87,7 @@ void ParagraphDlgImpl::setChecks(bool labove, bool lbelow, bool pabove, bool pbe } -void ParagraphDlgImpl::setSpace(VSpace::vspace_kind kindabove, VSpace::vspace_kind kindbelow, bool keepabove, bool keepbelow) +void QParagraphDialog::setSpace(VSpace::vspace_kind kindabove, VSpace::vspace_kind kindbelow, bool keepabove, bool keepbelow) { int item=0; @@ -126,7 +125,7 @@ void ParagraphDlgImpl::setSpace(VSpace::vspace_kind kindabove, VSpace::vspace_ki } -void ParagraphDlgImpl::setAboveLength(float val, float plus, float minus, +void QParagraphDialog::setAboveLength(float val, float plus, float minus, LyXLength::UNIT vunit, LyXLength::UNIT punit, LyXLength::UNIT munit) { if (vunit==LyXLength::UNIT_NONE) { @@ -146,7 +145,7 @@ void ParagraphDlgImpl::setAboveLength(float val, float plus, float minus, } -void ParagraphDlgImpl::setBelowLength(float val, float plus, float minus, +void QParagraphDialog::setBelowLength(float val, float plus, float minus, LyXLength::UNIT vunit, LyXLength::UNIT punit, LyXLength::UNIT munit) { if (vunit==LyXLength::UNIT_NONE) { @@ -165,7 +164,7 @@ void ParagraphDlgImpl::setBelowLength(float val, float plus, float minus, } -void ParagraphDlgImpl::setExtra(float widthval, LyXLength::UNIT units, const string percent, int align, +void QParagraphDialog::setExtra(float widthval, LyXLength::UNIT units, const string percent, int align, bool hfill, bool startminipage, Paragraph::PEXTRA_TYPE type) { if (type!=Paragraph::PEXTRA_NONE) { @@ -216,7 +215,7 @@ void ParagraphDlgImpl::setExtra(float widthval, LyXLength::UNIT units, const str } -LyXGlueLength ParagraphDlgImpl::getAboveLength() const +LyXGlueLength QParagraphDialog::getAboveLength() const { LyXGlueLength len( spacingAboveValue->text().toFloat(), @@ -230,7 +229,7 @@ LyXGlueLength ParagraphDlgImpl::getAboveLength() const } -LyXGlueLength ParagraphDlgImpl::getBelowLength() const +LyXGlueLength QParagraphDialog::getBelowLength() const { LyXGlueLength len( spacingBelowValue->text().toFloat(), @@ -244,7 +243,7 @@ LyXGlueLength ParagraphDlgImpl::getBelowLength() const } -LyXLength ParagraphDlgImpl::getExtraWidth() const +LyXLength QParagraphDialog::getExtraWidth() const { if (extraUnit->currentItem()!=11) { LyXLength len( @@ -259,7 +258,7 @@ LyXLength ParagraphDlgImpl::getExtraWidth() const } -string ParagraphDlgImpl::getExtraWidthPercent() const +string QParagraphDialog::getExtraWidthPercent() const { double val = (extraWidth->text()).toDouble(); if (val > 100.0) @@ -270,12 +269,14 @@ string ParagraphDlgImpl::getExtraWidthPercent() const } -const char * ParagraphDlgImpl::getLabelWidth() const { +const char * QParagraphDialog::getLabelWidth() const +{ return labelWidth->text(); } -LyXAlignment ParagraphDlgImpl::getAlign() const { +LyXAlignment QParagraphDialog::getAlign() const +{ switch (alignment->currentItem()) { case 0: return LYX_ALIGN_BLOCK; case 1: return LYX_ALIGN_LEFT; @@ -286,52 +287,62 @@ LyXAlignment ParagraphDlgImpl::getAlign() const { } -bool ParagraphDlgImpl::getAboveKeep() const { +bool QParagraphDialog::getAboveKeep() const +{ return spacingAboveKeep->isChecked(); } -bool ParagraphDlgImpl::getBelowKeep() const { +bool QParagraphDialog::getBelowKeep() const +{ return spacingBelowKeep->isChecked(); } -bool ParagraphDlgImpl::getLineAbove() const { +bool QParagraphDialog::getLineAbove() const +{ return lineAbove->isChecked(); } -bool ParagraphDlgImpl::getLineBelow() const { +bool QParagraphDialog::getLineBelow() const +{ return lineBelow->isChecked(); } -bool ParagraphDlgImpl::getPagebreakAbove() const { +bool QParagraphDialog::getPagebreakAbove() const +{ return pagebreakAbove->isChecked(); } -bool ParagraphDlgImpl::getPagebreakBelow() const { +bool QParagraphDialog::getPagebreakBelow() const +{ return pagebreakBelow->isChecked(); } -bool ParagraphDlgImpl::getNoIndent() const { +bool QParagraphDialog::getNoIndent() const +{ return noIndent->isChecked(); } -VSpace::vspace_kind ParagraphDlgImpl::getSpaceAboveKind() const { +VSpace::vspace_kind QParagraphDialog::getSpaceAboveKind() const +{ return getSpaceKind(spacingAbove->currentItem()); } -VSpace::vspace_kind ParagraphDlgImpl::getSpaceBelowKind() const { +VSpace::vspace_kind QParagraphDialog::getSpaceBelowKind() const +{ return getSpaceKind(spacingBelow->currentItem()); } -Paragraph::PEXTRA_TYPE ParagraphDlgImpl::getExtraType() const { +Paragraph::PEXTRA_TYPE QParagraphDialog::getExtraType() const +{ switch (extraType->currentItem()) { case 0: return Paragraph::PEXTRA_NONE; case 1: return Paragraph::PEXTRA_MINIPAGE; @@ -342,7 +353,8 @@ Paragraph::PEXTRA_TYPE ParagraphDlgImpl::getExtraType() const { } -Paragraph::MINIPAGE_ALIGNMENT ParagraphDlgImpl::getExtraAlign() const { +Paragraph::MINIPAGE_ALIGNMENT QParagraphDialog::getExtraAlign() const +{ switch (minipageValign->currentItem()) { case 0: return Paragraph::MINIPAGE_ALIGN_TOP; case 1: return Paragraph::MINIPAGE_ALIGN_MIDDLE; @@ -352,17 +364,20 @@ Paragraph::MINIPAGE_ALIGNMENT ParagraphDlgImpl::getExtraAlign() const { } -bool ParagraphDlgImpl::getHfillBetween() const { +bool QParagraphDialog::getHfillBetween() const +{ return minipageHfill->isChecked(); } -bool ParagraphDlgImpl::getStartNewMinipage() const { +bool QParagraphDialog::getStartNewMinipage() const +{ return minipageStart->isChecked(); } -VSpace::vspace_kind ParagraphDlgImpl::getSpaceKind(int val) const { +VSpace::vspace_kind QParagraphDialog::getSpaceKind(int val) const +{ switch (val) { case 0: return VSpace::NONE; case 1: return VSpace::DEFSKIP; @@ -378,7 +393,8 @@ VSpace::vspace_kind ParagraphDlgImpl::getSpaceKind(int val) const { } -LyXLength::UNIT ParagraphDlgImpl::getLyXLength(int val) const { +LyXLength::UNIT QParagraphDialog::getLyXLength(int val) const +{ switch (val) { case 0: return LyXLength::CM; case 1: return LyXLength::IN; @@ -398,7 +414,8 @@ LyXLength::UNIT ParagraphDlgImpl::getLyXLength(int val) const { } -int ParagraphDlgImpl::getItem(LyXLength::UNIT unit) const { +int QParagraphDialog::getItem(LyXLength::UNIT unit) const +{ int item=0; switch (unit) { case LyXLength::CM: item = 0; break; @@ -421,9 +438,9 @@ int ParagraphDlgImpl::getItem(LyXLength::UNIT unit) const { } -void ParagraphDlgImpl::enable_extraOptions(int item) +void QParagraphDialog::enable_extraOptions(int item) { - bool enable = (item!=0); + bool const enable = (item!=0); extraWidth->setEnabled(enable); extraWidthL->setEnabled(enable); extraUnit->setEnabled(enable); @@ -431,15 +448,15 @@ void ParagraphDlgImpl::enable_extraOptions(int item) } -void ParagraphDlgImpl::enable_minipageOptions(int item) +void QParagraphDialog::enable_minipageOptions(int item) { minipageOptions->setEnabled( item==1 ); } -void ParagraphDlgImpl::enable_spacingAbove(int item) +void QParagraphDialog::enable_spacingAbove(int item) { - bool enable = (item==6); + bool const enable = (item==6); spacingAboveValue->setEnabled(enable); spacingAbovePlus->setEnabled(enable); spacingAboveMinus->setEnabled(enable); @@ -447,16 +464,16 @@ void ParagraphDlgImpl::enable_spacingAbove(int item) spacingAbovePlusUnit->setEnabled(enable); spacingAboveMinusUnit->setEnabled(enable); spacingAboveUnitsL->setEnabled(enable); - bool enablel = ( (item==6) || (item!=6 && spacingBelow->currentItem()==6) ); + bool const enablel = ( (item==6) || (item!=6 && spacingBelow->currentItem()==6) ); spacingValueL->setEnabled(enablel); spacingPlusL->setEnabled(enablel); spacingMinusL->setEnabled(enablel); } -void ParagraphDlgImpl::enable_spacingBelow(int item) +void QParagraphDialog::enable_spacingBelow(int item) { - bool enable = (item==6); + bool const enable = (item==6); spacingBelowValue->setEnabled(enable); spacingBelowPlus->setEnabled(enable); spacingBelowMinus->setEnabled(enable); @@ -464,34 +481,34 @@ void ParagraphDlgImpl::enable_spacingBelow(int item) spacingBelowPlusUnit->setEnabled(enable); spacingBelowMinusUnit->setEnabled(enable); spacingBelowUnitsL->setEnabled(enable); - bool enablel = ( (item==6) || (item!=6 && spacingAbove->currentItem()==6) ); + bool const enablel = ( (item==6) || (item!=6 && spacingAbove->currentItem()==6) ); spacingValueL->setEnabled(enablel); spacingPlusL->setEnabled(enablel); spacingMinusL->setEnabled(enablel); } -void ParagraphDlgImpl::closeEvent(QCloseEvent * e) +void QParagraphDialog::closeEvent(QCloseEvent * e) { form_->close(); e->accept(); } -void ParagraphDlgImpl::apply_adaptor() +void QParagraphDialog::apply_adaptor() { form_->apply(); } -void ParagraphDlgImpl::cancel_adaptor() +void QParagraphDialog::cancel_adaptor() { form_->close(); hide(); } -void ParagraphDlgImpl::ok_adaptor() +void QParagraphDialog::ok_adaptor() { apply_adaptor(); form_->close(); @@ -499,7 +516,7 @@ void ParagraphDlgImpl::ok_adaptor() } -void ParagraphDlgImpl::restore_adaptor() +void QParagraphDialog::restore_adaptor() { form_->update(); } diff --git a/src/frontends/qt2/paragraphdlgimpl.h b/src/frontends/qt2/QParagraphDialog.h similarity index 83% rename from src/frontends/qt2/paragraphdlgimpl.h rename to src/frontends/qt2/QParagraphDialog.h index e5e3871deb..fa5c5be6a9 100644 --- a/src/frontends/qt2/paragraphdlgimpl.h +++ b/src/frontends/qt2/QParagraphDialog.h @@ -1,5 +1,5 @@ /** - * \file paragraphdlgimpl.h + * \file QParagraphDialog.h * Copyright 2001 LyX Team * see the file COPYING * @@ -7,26 +7,24 @@ * \author Edwin Leuven, leuven@fee.uva.nl */ -#ifndef PARAGRAPHDLGIMPL_H -#define PARAGRAPHDLGIMPL_H +#ifndef QPARAGRAPHDIALOG_H +#define QPARAGRAPHDIALOG_H #include -#include "paragraphdlg.h" +#include "ui/QParagraphDialogBase.h" #include "vspace.h" #include "paragraph.h" -class FormParagraph; +class QParagraph; -class ParagraphDlgImpl : public ParagraphDlg -{ - Q_OBJECT +class QParagraphDialog : public QParagraphDialogBase +{ Q_OBJECT public: - - ParagraphDlgImpl(FormParagraph *form, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); - ~ParagraphDlgImpl(); + QParagraphDialog(QParagraph * form, QWidget * parent = 0, const char * name = 0, bool modal = FALSE, WFlags fl = 0); + ~QParagraphDialog(); void setReadOnly(bool); void setLabelWidth(const char *); @@ -57,21 +55,17 @@ public: bool getHfillBetween() const; bool getStartNewMinipage() const; - protected: - void closeEvent (QCloseEvent * e); private: - - FormParagraph * form_; + QParagraph * form_; VSpace::vspace_kind getSpaceKind(int val) const; LyXLength::UNIT getLyXLength(int val) const; int getItem(LyXLength::UNIT unit) const; protected slots: - void apply_adaptor(); void cancel_adaptor(); void enable_extraOptions(int); @@ -82,4 +76,4 @@ protected slots: void restore_adaptor(); }; -#endif // PARAGRAPHDLGIMPL_H +#endif // QPARAGRAPHDIALOG_H diff --git a/src/frontends/qt2/FormPrint.C b/src/frontends/qt2/QPrint.C similarity index 77% rename from src/frontends/qt2/FormPrint.C rename to src/frontends/qt2/QPrint.C index 8dee1d43a1..52a3080333 100644 --- a/src/frontends/qt2/FormPrint.C +++ b/src/frontends/qt2/QPrint.C @@ -1,5 +1,5 @@ /** - * \file FormPrint.C + * \file QPrint.C * Copyright 2001 LyX Team * see the file COPYING * @@ -8,8 +8,8 @@ #include -#include "printdlgimpl.h" -#include "FormPrint.h" +#include "QPrintDialog.h" +#include "QPrint.h" #include "Dialogs.h" #include "gettext.h" #include "buffer.h" @@ -26,22 +26,21 @@ using Liason::printBuffer; using Liason::getPrinterParams; using std::max; -FormPrint::FormPrint(LyXView *v, Dialogs *d) +QPrint::QPrint(LyXView *v, Dialogs *d) : dialog_(0), lv_(v), d_(d), h_(0), u_(0) { - // 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->showPrint.connect(SigC::slot(this, &FormPrint::show)); + d->showPrint.connect(SigC::slot(this, &QPrint::show)); } -FormPrint::~FormPrint() + +QPrint::~QPrint() { delete dialog_; } + // we can safely ignore the parameter because we can always update -void FormPrint::update(bool) +void QPrint::update(bool) { if (!lv_->view()->available()) return; @@ -67,8 +66,9 @@ void FormPrint::update(bool) dialog_->setTo(""); } } + -void FormPrint::print() +void QPrint::print() { if (!lv_->view()->available()) return; @@ -98,14 +98,15 @@ void FormPrint::print() } } -void FormPrint::show() + +void QPrint::show() { if (!dialog_) - dialog_ = new PrintDlgImpl(this, 0, _("LyX: Print")); + dialog_ = new QPrintDialog(this, 0, _("LyX: Print")); if (!dialog_->isVisible()) { - h_ = d_->hideBufferDependent.connect(SigC::slot(this, &FormPrint::hide)); - u_ = d_->updateBufferDependent.connect(SigC::slot(this, &FormPrint::update)); + h_ = d_->hideBufferDependent.connect(SigC::slot(this, &QPrint::hide)); + u_ = d_->updateBufferDependent.connect(SigC::slot(this, &QPrint::update)); } dialog_->raise(); @@ -115,13 +116,15 @@ void FormPrint::show() dialog_->show(); } -void FormPrint::close() + +void QPrint::close() { h_.disconnect(); u_.disconnect(); } + -void FormPrint::hide() +void QPrint::hide() { dialog_->hide(); close(); diff --git a/src/frontends/qt2/FormPrint.h b/src/frontends/qt2/QPrint.h similarity index 73% rename from src/frontends/qt2/FormPrint.h rename to src/frontends/qt2/QPrint.h index e8d17f3a7f..18630dddc5 100644 --- a/src/frontends/qt2/FormPrint.h +++ b/src/frontends/qt2/QPrint.h @@ -1,30 +1,25 @@ // -*- C++ -*- /** - * \file FormPrint.h + * \file QPrint.h * Copyright 2001 LyX Team * see the file COPYING * * \author John Levon, moz@compsoc.man.ac.uk */ -#ifndef FORMPRINT_H -#define FORMPRINT_H +#ifndef QPRINT_H +#define QPRINT_H #include "DialogBase.h" #include "boost/utility.hpp" class Dialogs; class LyXView; -class PrintDlgImpl; +class QPrintDialog; -class FormPrint : public DialogBase { +class QPrint : public DialogBase { public: - /**@name Constructors and Destructors */ - //@{ - /// - FormPrint(LyXView *, Dialogs *); - /// - ~FormPrint(); - //@} + QPrint(LyXView *, Dialogs *); + ~QPrint(); /// start print void print(); @@ -40,7 +35,7 @@ private: void update(bool = false); /// Real GUI implementation. - PrintDlgImpl * dialog_; + QPrintDialog * dialog_; /// the LyXView we belong to LyXView * lv_; @@ -56,4 +51,4 @@ private: SigC::Connection u_; }; -#endif +#endif // QPRINT_H diff --git a/src/frontends/qt2/printdlgimpl.C b/src/frontends/qt2/QPrintDialog.C similarity index 50% rename from src/frontends/qt2/printdlgimpl.C rename to src/frontends/qt2/QPrintDialog.C index 6969ae6723..859a8c5779 100644 --- a/src/frontends/qt2/printdlgimpl.C +++ b/src/frontends/qt2/QPrintDialog.C @@ -1,5 +1,5 @@ /** - * \file printdlgimpl.C + * \file QPrintDialog.C * Copyright 2001 LyX Team * see the file COPYING * @@ -7,16 +7,16 @@ * \author Edwin Leuven, leuven@fee.uva.nl */ -#include "qfiledialog.h" -#include "qcheckbox.h" -#include "qlabel.h" -#include "qlineedit.h" -#include "qpushbutton.h" -#include "qradiobutton.h" -#include "qspinbox.h" +#include +#include +#include +#include +#include +#include +#include -#include "printdlgimpl.h" -#include "FormPrint.h" +#include "QPrintDialog.h" +#include "QPrint.h" #include @@ -29,46 +29,48 @@ #include -PrintDlgImpl::PrintDlgImpl( FormPrint *f, QWidget* parent, const char* name, bool modal, WFlags fl ) - : PrintDlg( parent, name, modal, fl ), form_(f) +QPrintDialog::QPrintDialog(QPrint * f, QWidget * parent, const char * name, bool modal, WFlags fl) + : QPrintDialogBase(parent, name, modal, fl), + form_(f) { setCaption(name); } -PrintDlgImpl::~PrintDlgImpl() +QPrintDialog::~QPrintDialog() { - // no need to delete child widgets, Qt does it all for us } -const char * PrintDlgImpl::getFrom() { +const char * QPrintDialog::getFrom() { return fromPage->text(); } -const char * PrintDlgImpl::getTo() { +const char * QPrintDialog::getTo() { return toPage->text(); } -PrinterParams::Target PrintDlgImpl::getTarget() { +PrinterParams::Target QPrintDialog::getTarget() { if (toPrinter->isChecked()) return PrinterParams::PRINTER; else return PrinterParams::FILE; } - -const char * PrintDlgImpl::getPrinter() { + +const char * QPrintDialog::getPrinter() { return printerName->text(); } -const char * PrintDlgImpl::getFile() { + +const char * QPrintDialog::getFile() { return fileName->text(); } -PrinterParams::WhichPages PrintDlgImpl::getWhichPages() { + +PrinterParams::WhichPages QPrintDialog::getWhichPages() { if (oddPages->isChecked()) return PrinterParams::ODD; else if (evenPages->isChecked()) @@ -77,32 +79,39 @@ PrinterParams::WhichPages PrintDlgImpl::getWhichPages() { return PrinterParams::ALL; } -bool PrintDlgImpl::getReverse() { + +bool QPrintDialog::getReverse() { return reverse->isChecked(); } -bool PrintDlgImpl::getSort() { + +bool QPrintDialog::getSort() { return collate->isChecked(); } -const char * PrintDlgImpl::getCount() { + +const char * QPrintDialog::getCount() { return copies->text(); } -void PrintDlgImpl::setTarget(PrinterParams::Target t) { + +void QPrintDialog::setTarget(PrinterParams::Target t) { toPrinter->setChecked(t==PrinterParams::PRINTER); toFile->setChecked(t!=PrinterParams::PRINTER); } -void PrintDlgImpl::setPrinter(const char * name) { + +void QPrintDialog::setPrinter(const char * name) { printerName->setText(name); } -void PrintDlgImpl::setFile(const char * name) { + +void QPrintDialog::setFile(const char * name) { fileName->setText(name); } -void PrintDlgImpl::setWhichPages(PrinterParams::WhichPages wp) { + +void QPrintDialog::setWhichPages(PrinterParams::WhichPages wp) { switch (wp) { case PrinterParams::ALL: allPages->setChecked(true); @@ -117,42 +126,42 @@ void PrintDlgImpl::setWhichPages(PrinterParams::WhichPages wp) { } -void PrintDlgImpl::setReverse(bool on) { +void QPrintDialog::setReverse(bool on) { reverse->setChecked(on); } -void PrintDlgImpl::setSort(bool on) { +void QPrintDialog::setSort(bool on) { collate->setChecked(on); } -void PrintDlgImpl::setCount(int num) { +void QPrintDialog::setCount(int num) { copies->setValue(num); collate->setEnabled(num > 1); } -void PrintDlgImpl::setFrom(const char * text) { +void QPrintDialog::setFrom(const char * text) { fromPage->setText(text); } -void PrintDlgImpl::setTo(const char * text) { +void QPrintDialog::setTo(const char * text) { toPage->setText(text); } -void PrintDlgImpl::browse_file() +void QPrintDialog::browse_file() { - QString d( OnlyPath(tostr(fileName->text())).c_str() ); - QString s( QFileDialog::getOpenFileName( d, "PostScript Files (*.ps)", this ) ); + QString d( OnlyPath(tostr(fileName->text())).c_str()); + QString s( QFileDialog::getOpenFileName(d, "PostScript Files (*.ps)", this)); if (!s.isNull()) fileName->setText(s); } -void PrintDlgImpl::print() +void QPrintDialog::print() { form_->print(); form_->close(); @@ -160,14 +169,14 @@ void PrintDlgImpl::print() } -void PrintDlgImpl::cancel_adaptor() +void QPrintDialog::cancel_adaptor() { form_->close(); hide(); } -void PrintDlgImpl::set_collate(int copies) +void QPrintDialog::set_collate(int copies) { collate->setEnabled(copies > 1); } diff --git a/src/frontends/qt2/printdlgimpl.h b/src/frontends/qt2/QPrintDialog.h similarity index 72% rename from src/frontends/qt2/printdlgimpl.h rename to src/frontends/qt2/QPrintDialog.h index 55d1903c18..6c951f2ad9 100644 --- a/src/frontends/qt2/printdlgimpl.h +++ b/src/frontends/qt2/QPrintDialog.h @@ -1,5 +1,5 @@ /** - * \file printdlgimpl.h + * \file QPrintDialog.h * Copyright 2001 LyX Team * see the file COPYING * @@ -7,24 +7,23 @@ * \author Edwin Leuven, leuven@fee.uva.nl */ -#ifndef PRINTDLGIMPL_H -#define PRINTDLGIMPL_H +#ifndef QPRINTDIALOG_H +#define QPRINTDIALOG_H #include -#include "printdlg.h" +#include "ui/QPrintDialogBase.h" #include "lyxrc.h" #include "PrinterParams.h" -class FormPrint; +class QPrint; -class PrintDlgImpl : public PrintDlg -{ - Q_OBJECT +class QPrintDialog : public QPrintDialogBase +{ Q_OBJECT public: - PrintDlgImpl( FormPrint *f, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); - ~PrintDlgImpl(); + QPrintDialog(QPrint * f, QWidget * parent = 0, const char * name = 0, bool modal = FALSE, WFlags fl = 0); + ~QPrintDialog(); // FIXME: these should return std::string ! const char * getFrom(); @@ -54,8 +53,8 @@ protected slots: void set_collate(int); private: - FormPrint * form_; + QPrint * form_; }; -#endif // PRINTDLGIMPL_H +#endif // QPRINTDIALOG_H diff --git a/src/frontends/qt2/FormRef.C b/src/frontends/qt2/QRef.C similarity index 70% rename from src/frontends/qt2/FormRef.C rename to src/frontends/qt2/QRef.C index 433d660444..fc6e5ae331 100644 --- a/src/frontends/qt2/FormRef.C +++ b/src/frontends/qt2/QRef.C @@ -1,28 +1,21 @@ -/* - * FormRef.C - * (C) 2000 LyX Team - * John Levon, moz@compsoc.man.ac.uk +/** + * \file QRef.C + * Copyright 2001 the LyX Team + * Read the file COPYING + * + * \author John Levon */ -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - #include -#include "FormRefDialog.h" -#undef emit +#include "QRefDialog.h" +#include "QtLyXView.h" +#include "BufferView.h" #include "Dialogs.h" -#include "FormRef.h" +#include "QRef.h" #include "gettext.h" #include "buffer.h" -#include "LyXView.h" #include "lyxfunc.h" #include "debug.h" @@ -34,23 +27,25 @@ using std::endl; -FormRef::FormRef(LyXView *v, Dialogs *d) +QRef::QRef(LyXView *v, Dialogs *d) : dialog_(0), lv_(v), d_(d), inset_(0), h_(0), u_(0), ih_(0), sort(0), gotowhere(GOTOREF), type(REF), refs(0) { // 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->showRef.connect(slot(this, &FormRef::showRef)); - d->createRef.connect(slot(this, &FormRef::createRef)); + d->showRef.connect(slot(this, &QRef::showRef)); + d->createRef.connect(slot(this, &QRef::createRef)); } -FormRef::~FormRef() + +QRef::~QRef() { delete dialog_; } -void FormRef::showRef(InsetCommand * const inset) + +void QRef::showRef(InsetCommand * const inset) { // FIXME: when could inset be 0 here ? if (inset==0) @@ -58,13 +53,14 @@ void FormRef::showRef(InsetCommand * const inset) inset_ = inset; readonly = lv_->buffer()->isReadonly(); - ih_ = inset_->hide.connect(slot(this,&FormRef::hide)); + //ih_ = inset_->hide.connect(slot(this,&QRef::hide)); params = inset->params(); show(); } -void FormRef::createRef(string const & arg) + +void QRef::createRef(string const & arg) { if (inset_) close(); @@ -74,13 +70,15 @@ void FormRef::createRef(string const & arg) show(); } -void FormRef::select(const char *text) + +void QRef::select(const char *text) { highlight(text); goto_ref(); } -void FormRef::highlight(const char *text) + +void QRef::highlight(const char *text) { if (gotowhere==GOTOBACK) goto_ref(); @@ -93,7 +91,8 @@ void FormRef::highlight(const char *text) } } -void FormRef::set_sort(bool on) + +void QRef::set_sort(bool on) { if (on!=sort) { sort=on; @@ -102,27 +101,29 @@ void FormRef::set_sort(bool on) } } -void FormRef::goto_ref() + +void QRef::goto_ref() { switch (gotowhere) { case GOTOREF: - lv_->getLyXFunc()->Dispatch(LFUN_REF_GOTO, dialog_->referenceED->text().latin1()); + lv_->getLyXFunc()->dispatch(LFUN_REF_GOTO, dialog_->referenceED->text().latin1()); gotowhere=GOTOBACK; dialog_->gotoPB->setText(_("&Go back")); break; case GOTOBACK: - lv_->getLyXFunc()->Dispatch(LFUN_REF_BACK); + //FIXME lv_->getLyXFunc()->dispatch(LFUN_REF_BACK); gotowhere=GOTOREF; dialog_->gotoPB->setText(_("&Goto reference")); break; } } -void FormRef::updateRefs() + +void QRef::updateRefs() { // list will be re-done, should go back if necessary if (gotowhere==GOTOBACK) { - lv_->getLyXFunc()->Dispatch(LFUN_REF_BACK); + //FIXME lv_->getLyXFunc()->dispatch(LFUN_REF_BACK); gotowhere = GOTOREF; dialog_->gotoPB->setText(_("&Goto reference")); } @@ -133,7 +134,7 @@ void FormRef::updateRefs() // the first item inserted string tmp(dialog_->referenceED->text()); - for (vector< string >::const_iterator iter = refs.begin(); + for (std::vector< string >::const_iterator iter = refs.begin(); iter != refs.end(); ++iter) { if (sort) dialog_->refsLB->inSort(iter->c_str()); @@ -152,7 +153,8 @@ void FormRef::updateRefs() dialog_->refsLB->update(); } -void FormRef::do_ref_update() + +void QRef::do_ref_update() { refs.clear(); dialog_->refsLB->clear(); @@ -161,8 +163,9 @@ void FormRef::do_ref_update() dialog_->sortCB->setEnabled(true); updateRefs(); } + -void FormRef::update() +void QRef::update() { dialog_->referenceED->setText(params.getContents().c_str()); dialog_->nameED->setText(params.getOptions().c_str()); @@ -206,7 +209,8 @@ void FormRef::update() dialog_->cancelPB->setText(_("&Cancel")); } -void FormRef::apply() + +void QRef::apply() { if (readonly) return; @@ -243,17 +247,18 @@ void FormRef::apply() lv_->view()->updateInset(inset_, true); } } else - lv_->getLyXFunc()->Dispatch(LFUN_REF_INSERT, params.getAsString().c_str()); + lv_->getLyXFunc()->dispatch(LFUN_REF_INSERT, params.getAsString().c_str()); } -void FormRef::show() + +void QRef::show() { if (!dialog_) - dialog_ = new FormRefDialog(this, 0, _("LyX: Cross Reference"), false); + dialog_ = new QRefDialog(this, 0, _("LyX: Cross Reference"), false); if (!dialog_->isVisible()) { - h_ = d_->hideBufferDependent.connect(slot(this, &FormRef::hide)); - u_ = d_->updateBufferDependent.connect(slot(this, &FormRef::update)); + h_ = d_->hideBufferDependent.connect(slot(this, &QRef::hide)); + //u_ = d_->updateBufferDependent.connect(slot(this, &QRef::update)); } dialog_->raise(); @@ -263,7 +268,8 @@ void FormRef::show() dialog_->show(); } -void FormRef::close() + +void QRef::close() { h_.disconnect(); u_.disconnect(); @@ -271,7 +277,8 @@ void FormRef::close() inset_ = 0; } -void FormRef::hide() + +void QRef::hide() { dialog_->hide(); close(); diff --git a/src/frontends/qt2/FormRef.h b/src/frontends/qt2/QRef.h similarity index 59% rename from src/frontends/qt2/FormRef.h rename to src/frontends/qt2/QRef.h index 1ef4c42123..60116d7c57 100644 --- a/src/frontends/qt2/FormRef.h +++ b/src/frontends/qt2/QRef.h @@ -1,22 +1,15 @@ // -*- C++ -*- -/* FormRef.h - * (C) 2000 LyX Team - * John Levon, moz@compsoc.man.ac.uk - * Adapted for Qt2 frontend by Kalle Dalheimer, - * kalle@klaralvdalens-datakonsult.se +/** + * \file QRef.h + * Copyright 2001 the LyX Team + * Read the file COPYING + * + * \author John Levon + * \author Kalle Dalheimer */ -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef FORMREF_H -#define FORMREF_H +#ifndef QREF_H +#define QREF_H #include "DialogBase.h" #include "LString.h" @@ -25,17 +18,12 @@ class Dialogs; class LyXView; -class FormRefDialog; +class QRefDialog; -class FormRef : public DialogBase { +class QRef : public DialogBase { public: - /**@name Constructors and Destructors */ - //@{ - /// - FormRef(LyXView *, Dialogs *); - /// - ~FormRef(); - //@} + QRef(LyXView *, Dialogs *); + ~QRef(); /// double-click a ref void select(const char *); @@ -57,7 +45,7 @@ public: private: enum Type { REF, PAGEREF, VREF, VPAGEREF, PRETTYREF - }; + }; enum GotoType { GOTOREF, GOTOBACK @@ -77,7 +65,7 @@ private: void updateRefs(void); /// Real GUI implementation. - FormRefDialog * dialog_; + QRefDialog * dialog_; /// the LyXView we belong to LyXView * lv_; @@ -94,11 +82,11 @@ private: bool readonly; /// Hide connection. - Connection h_; + SigC::Connection h_; /// Update connection. - Connection u_; + SigC::Connection u_; /// Inset hide connection. - Connection ih_; + SigC::Connection ih_; /// to sort or not to sort bool sort; @@ -113,4 +101,4 @@ private: std::vector< string > refs; }; -#endif +#endif // QREF_H diff --git a/src/frontends/qt2/QRefDialog.C b/src/frontends/qt2/QRefDialog.C new file mode 100644 index 0000000000..050c2b826b --- /dev/null +++ b/src/frontends/qt2/QRefDialog.C @@ -0,0 +1,75 @@ +/** + * \file QRefDialog.C + * Copyright 2001 the LyX Team + * Read the file COPYING + * + * \author Kalle Dalheimer + */ + +#include "QRefDialog.h" +#include "Dialogs.h" +#include "QRef.h" + +QRefDialog::QRefDialog(QRef * form, QWidget * parent, const char * name, bool modal, WFlags fl) + : QRefDialogBase(parent, name, modal, fl), + form_(form) +{ +} + + +QRefDialog::~QRefDialog() +{ +} + + +void QRefDialog::apply_adaptor() +{ + form_->apply(); + form_->close(); + hide(); +} + + +void QRefDialog::goto_adaptor() +{ + form_->goto_ref(); +} + + +void QRefDialog::highlight_adaptor(const QString & sel) +{ + form_->highlight(sel); +} + + +void QRefDialog::close_adaptor() +{ + form_->close(); + hide(); +} + + +void QRefDialog::select_adaptor(const QString & sel) +{ + form_->select(sel); +} + + +void QRefDialog::sort_adaptor(bool sort) +{ + form_->set_sort(sort); +} + + +void QRefDialog::update_adaptor() +{ + form_->do_ref_update(); +} + + + +void QRefDialog::closeEvent(QCloseEvent * e) +{ + form_->close(); + e->accept(); +} diff --git a/src/frontends/qt2/QRefDialog.h b/src/frontends/qt2/QRefDialog.h new file mode 100644 index 0000000000..cdd1eb8e21 --- /dev/null +++ b/src/frontends/qt2/QRefDialog.h @@ -0,0 +1,41 @@ +/** + * \file QRefDialog.h + * Copyright 2001 the LyX Team + * Read the file COPYING + * + * \author Kalle Dalheimer + */ + +#ifndef QREFDIALOG_H +#define QREFDIALOG_H + +#include + +#include "ui/QRefDialogBase.h" + +class QRef; + +class QRefDialog : public QRefDialogBase +{ Q_OBJECT + +public: + QRefDialog(QRef * form, QWidget * parent = 0, const char * name = 0, bool modal = FALSE, WFlags fl = 0); + ~QRefDialog(); + +public slots: + void apply_adaptor(); + void goto_adaptor(); + void highlight_adaptor(const QString &); + void close_adaptor(); + void select_adaptor(const QString &); + void sort_adaptor(bool); + void update_adaptor(); + +protected: + void closeEvent(QCloseEvent * e); + +private: + QRef * form_; +}; + +#endif // QREFDIALOG_H diff --git a/src/frontends/qt2/FormSearch.C b/src/frontends/qt2/QSearch.C similarity index 58% rename from src/frontends/qt2/FormSearch.C rename to src/frontends/qt2/QSearch.C index 5fe95c8752..1e9fc2dbf2 100644 --- a/src/frontends/qt2/FormSearch.C +++ b/src/frontends/qt2/QSearch.C @@ -1,5 +1,5 @@ /** - * \file FormSearch.C + * \file QSearch.C * Copyright 2001 The LyX Team. * See the file COPYING. * @@ -9,47 +9,43 @@ #include #include "gettext.h" -#include "searchdlgimpl.h" -#include "FormSearch.h" +#include "QSearchDialog.h" +#include "QSearch.h" #include "Dialogs.h" #include "Liason.h" #include "QtLyXView.h" #include "buffer.h" -//#include "lyxtext.h" #include "lyxfind.h" -//#include "language.h" #include "support/lstrings.h" #include "BufferView.h" using Liason::setMinibuffer; -FormSearch::FormSearch(LyXView *v, Dialogs *d) +QSearch::QSearch(LyXView *v, Dialogs *d) : dialog_(0), lv_(v), d_(d), h_(0), u_(0) { - // 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->showSearch.connect(SigC::slot(this, &FormSearch::show)); + d->showSearch.connect(SigC::slot(this, &QSearch::show)); // perhaps in the future we'd like a // "search again" button/keybinding - // d->searchAgain.connect(slot(this, &FormSearch::FindNext)); + // d->searchAgain.connect(slot(this, &QSearch::FindNext)); } -FormSearch::~FormSearch() +QSearch::~QSearch() { delete dialog_; } -void FormSearch::show() + +void QSearch::show() { if (!dialog_) { - dialog_ = new SearchDlgImpl(this, 0, _("Find and Replace"), false); + dialog_ = new QSearchDialog(this, 0, _("Find and Replace"), false); } if (!dialog_->isVisible()) { - h_ = d_->hideBufferDependent.connect(SigC::slot(this, &FormSearch::hide)); - u_ = d_->updateBufferDependent.connect(SigC::slot(this, &FormSearch::update)); + h_ = d_->hideBufferDependent.connect(SigC::slot(this, &QSearch::hide)); + u_ = d_->updateBufferDependent.connect(SigC::slot(this, &QSearch::update)); } dialog_->raise(); @@ -58,17 +54,19 @@ void FormSearch::show() dialog_->show(); } -void FormSearch::find(string const & searchstr, bool const & casesensitive, + +void QSearch::find(string const & searchstr, bool const & casesensitive, bool const & matchword, bool const & searchback) { - bool found = LyXFind(lv_->view(), searchstr, searchback, - casesensitive, matchword); + bool const found = LyXFind(lv_->view(), searchstr, searchback, + casesensitive, matchword); if (!found) setMinibuffer(lv_, _("String not found!")); - } -void FormSearch::replace(string const & searchstr, string const & replacestr, + + +void QSearch::replace(string const & searchstr, string const & replacestr, bool const & casesensitive, bool const & matchword, bool const & searchback, bool const & replaceall) { @@ -90,19 +88,21 @@ void FormSearch::replace(string const & searchstr, string const & replacestr, } -void FormSearch::close() +void QSearch::close() { h_.disconnect(); u_.disconnect(); } -void FormSearch::hide() + +void QSearch::hide() { dialog_->hide(); close(); } -void FormSearch::update(bool) + +void QSearch::update(bool) { if (!lv_->view()->available()) return; diff --git a/src/frontends/qt2/FormSearch.h b/src/frontends/qt2/QSearch.h similarity index 82% rename from src/frontends/qt2/FormSearch.h rename to src/frontends/qt2/QSearch.h index 6440e1ccfe..5c62c03175 100644 --- a/src/frontends/qt2/FormSearch.h +++ b/src/frontends/qt2/QSearch.h @@ -1,14 +1,14 @@ // -*- C++ -*- /** - * \file FormSearch.h + * \file QSearch.h * Copyright 2001 The LyX Team. * See the file COPYING. * * \author Edwin Leuven */ -#ifndef FORM_SEARCH_H -#define FORM_SEARCH_H +#ifndef QSEARCH_H +#define QSEARCH_H #include "DialogBase.h" #include "LString.h" @@ -16,14 +16,14 @@ class LyXView; class Dialogs; -class SearchDlgImpl; +class QSearchDialog; -class FormSearch : public DialogBase { +class QSearch : public DialogBase { public: /// - FormSearch(LyXView *, Dialogs *); + QSearch(LyXView *, Dialogs *); /// - ~FormSearch(); + ~QSearch(); /// Close connections. void close(); @@ -33,9 +33,7 @@ public: void replace(string const &, string const &, bool const &, bool const &, bool const &, bool const &); - private: - /// Show the dialog. void show(); /// Hide the dialog. @@ -44,7 +42,7 @@ private: void update(bool switched = false); /// Real GUI implementation. - SearchDlgImpl * dialog_; + QSearchDialog * dialog_; /// the LyXView we belong to. LyXView * lv_; @@ -62,4 +60,4 @@ private: }; -#endif +#endif // QSEARCH_H diff --git a/src/frontends/qt2/searchdlgimpl.C b/src/frontends/qt2/QSearchDialog.C similarity index 65% rename from src/frontends/qt2/searchdlgimpl.C rename to src/frontends/qt2/QSearchDialog.C index 2a62f84e87..682ec23fdc 100644 --- a/src/frontends/qt2/searchdlgimpl.C +++ b/src/frontends/qt2/QSearchDialog.C @@ -1,5 +1,5 @@ /** - * \file searchdlgimpl.h + * \file QSearchDialog.C * Copyright 2001 The LyX Team. * See the file COPYING. * @@ -8,34 +8,34 @@ #include -#include "searchdlgimpl.h" +#include "QSearchDialog.h" #include #include #include #include - -SearchDlgImpl::SearchDlgImpl(FormSearch* form, QWidget* parent, const char* name, bool modal, WFlags fl ) - : SearchDlg( parent, name, modal, fl ), form_(form) +QSearchDialog::QSearchDialog(QSearch * form, QWidget * parent, const char * name, bool modal, WFlags fl) + : QSearchDialogBase(parent, name, modal, fl), + form_(form) { setCaption(name); } -SearchDlgImpl::~SearchDlgImpl() +QSearchDialog::~QSearchDialog() { } -void SearchDlgImpl::closeEvent(QCloseEvent * e) +void QSearchDialog::closeEvent(QCloseEvent * e) { form_->close(); e->accept(); } -void SearchDlgImpl::setReadOnly(bool readonly) +void QSearchDialog::setReadOnly(bool readonly) { replace->setEnabled(!readonly); replaceLabel->setEnabled(!readonly); @@ -44,7 +44,7 @@ void SearchDlgImpl::setReadOnly(bool readonly) } -void SearchDlgImpl::Find() +void QSearchDialog::Find() { form_->find(tostr(find->currentText()).c_str(), caseSensitive->isChecked(), @@ -53,7 +53,7 @@ void SearchDlgImpl::Find() } -void SearchDlgImpl::Replace(bool replaceall) +void QSearchDialog::Replace(bool replaceall) { form_->replace(tostr(find->currentText()).c_str(), tostr(replace->currentText()).c_str(), diff --git a/src/frontends/qt2/QSearchDialog.h b/src/frontends/qt2/QSearchDialog.h new file mode 100644 index 0000000000..972dd1c424 --- /dev/null +++ b/src/frontends/qt2/QSearchDialog.h @@ -0,0 +1,54 @@ +/** + * \file QSearchDialog.h + * Copyright 2001 the LyX Team + * Read the file COPYING + * + * \author Edwin Leuven + */ + +#ifndef QSEARCHDIALOG_H +#define QSEARCHDIALOG_H + +#include + +#include "ui/QSearchDialogBase.h" +#include "QSearch.h" + +class QCloseEvent; + +class QSearchDialog : public QSearchDialogBase +{ Q_OBJECT + +public: + QSearchDialog(QSearch * form, QWidget * parent = 0, const char * name = 0, bool modal = FALSE, WFlags fl = 0); + ~QSearchDialog(); + + void setReadOnly(bool); + + void Replace(bool replaceall = false); + +protected: + void closeEvent(QCloseEvent * e); + +private: + QSearch * form_; + +protected slots: + + void Find(); + + void Replace() { + Replace(false); + }; + + void ReplaceAll() { + Replace(true); + }; + + void cancel_adaptor() { + form_->close(); + hide(); + } +}; + +#endif // QSEARCHDIALOG_H diff --git a/src/frontends/qt2/FormSplash.C b/src/frontends/qt2/QSplash.C similarity index 57% rename from src/frontends/qt2/FormSplash.C rename to src/frontends/qt2/QSplash.C index a5f1756977..ffc3a6c6a7 100644 --- a/src/frontends/qt2/FormSplash.C +++ b/src/frontends/qt2/QSplash.C @@ -1,5 +1,5 @@ /** - * \file FormSplash.C + * \file QSplash.C * Copyright 2001 the LyX Team * Read the file COPYING * @@ -10,38 +10,40 @@ #include -#include "FormSplashImpl.h" -#include "FormSplash.h" +#include "QSplashDialog.h" +#include "QSplash.h" #include "Dialogs.h" #include "version.h" #include "support/filetools.h" #include "lyxrc.h" -FormSplash::FormSplash(LyXView *, Dialogs * d) +QSplash::QSplash(LyXView *, Dialogs * d) : dialog_(0), d_(d) { - c_ = d->showSplash.connect(SigC::slot(this, &FormSplash::show)); + c_ = d->showSplash.connect(SigC::slot(this, &QSplash::show)); } -FormSplash::~FormSplash() +QSplash::~QSplash() { c_.disconnect(); delete dialog_; } -void FormSplash::hide() + +void QSplash::hide() { dialog_->hide(); } -void FormSplash::show() + +void QSplash::show() { if (!lyxrc.show_banner) return; if (!dialog_) - dialog_ = new FormSplashBase( 0, "LyX"); + dialog_ = new QSplashDialog( 0, "LyX"); // show banner dialog_->show(); diff --git a/src/frontends/qt2/FormSplash.h b/src/frontends/qt2/QSplash.h similarity index 59% rename from src/frontends/qt2/FormSplash.h rename to src/frontends/qt2/QSplash.h index f701b21fb2..e8976b5103 100644 --- a/src/frontends/qt2/FormSplash.h +++ b/src/frontends/qt2/QSplash.h @@ -1,29 +1,27 @@ // -*- C++ -*- /** - * \file FormSplash.h + * \file QSplash.h * Copyright 2001 the LyX Team * Read the file COPYING * * \author Edwin Leuven */ -#ifndef FORMSPLASH_H -#define FORMSPLASH_H +#ifndef QSPLASH_H +#define QSPLASH_H #include "DialogBase.h" class Dialogs; class LyXView; -class FormSplashBase; +class QSplashDialog; -/** The startup splash screen - */ -class FormSplash : public DialogBase { +class QSplash : public DialogBase { public: - FormSplash(LyXView *, Dialogs *); + QSplash(LyXView *, Dialogs *); - ~FormSplash(); + ~QSplash(); /// hide the dialog void hide(); @@ -33,11 +31,11 @@ private: void show(); /// Real GUI implementation. - FormSplashBase * dialog_; + QSplashDialog * dialog_; /// our container Dialogs * d_; /// the show connection SigC::Connection c_; }; -#endif // FORMSPLASH_H +#endif // QSPLASH_H diff --git a/src/frontends/qt2/QSplashDialog.C b/src/frontends/qt2/QSplashDialog.C new file mode 100644 index 0000000000..07c4e13664 --- /dev/null +++ b/src/frontends/qt2/QSplashDialog.C @@ -0,0 +1,51 @@ +/** + * \file QSplashDialog.C + * Copyright 2001 the LyX Team + * Read the file COPYING + * + * \author Edwin Leuven + */ + +#include + +#include +#include +#include +#include + +#include "version.h" +#include "support/filetools.h" +#include "support/lstrings.h" +#include "lyxrc.h" +#include "QSplashDialog.h" + +QSplashDialog::QSplashDialog(QWidget * parent, const char * name, WFlags fl, bool modal) + : QFrame(parent, name, fl, modal) +{ + string const banner_file = LibFileSearch("images", "banner", "xpm"); + if (banner_file.empty()) + return; + + QPixmap const pm(tostr(banner_file).c_str()); + int const w = pm.width(); + int const h = pm.height(); + + setBackgroundPixmap(pm); + setLineWidth(0); + setGeometry(QApplication::desktop()->width()/2 - w/2, + QApplication::desktop()->height()/2 - h/2, + w, h); + + QTimer::singleShot(5*1000, this, SLOT(hide())); +} + + +QSplashDialog::~QSplashDialog() +{ +} + + +void QSplashDialog::mousePressEvent( QMouseEvent * ) +{ + hide(); +} diff --git a/src/frontends/qt2/QSplashDialog.h b/src/frontends/qt2/QSplashDialog.h new file mode 100644 index 0000000000..0820077204 --- /dev/null +++ b/src/frontends/qt2/QSplashDialog.h @@ -0,0 +1,25 @@ +/** + * \file QSplashDialog.C + * Copyright 2001 the LyX Team + * Read the file COPYING + * + * \author Edwin Leuven + */ + +#ifndef FORMSPLASHBASE_H +#define FORMSPLASHBASE_H + +class QSplashDialog : public QFrame +{ +public: + QSplashDialog(QWidget * parent, const char * name, + WFlags fl = QWidget::WStyle_NoBorder | QWidget::WStyle_Customize, + bool modal = false); + + ~QSplashDialog(); + +protected: + virtual void mousePressEvent(QMouseEvent *); +}; + +#endif // QSPLASHDIALOG_H diff --git a/src/frontends/qt2/QTabularCreate.C b/src/frontends/qt2/QTabularCreate.C new file mode 100644 index 0000000000..fe85d879c0 --- /dev/null +++ b/src/frontends/qt2/QTabularCreate.C @@ -0,0 +1,73 @@ +/** + * \file QTabularCreate.C + * Copyright 2001 the LyX Team + * Read the file COPYING + * + * \author John Levon + */ + +#include + +#include "QTabularCreateDialog.h" +#include "Dialogs.h" +#include "QTabularCreate.h" +#include "gettext.h" +#include "QtLyXView.h" +#include "lyxfunc.h" +#include "BufferView.h" +#include "insets/insettabular.h" +#include "support/lstrings.h" + +using SigC::slot; + +QTabularCreate::QTabularCreate(LyXView *v, Dialogs *d) + : dialog_(0), lv_(v), d_(d), h_(0) +{ + d->showTabularCreate.connect(slot(this, &QTabularCreate::show)); +} + + +QTabularCreate::~QTabularCreate() +{ + delete dialog_; +} + + +void QTabularCreate::apply(int rows, int cols) +{ + if (!lv_->view()->available()) + return; + + string tmp = tostr(rows) + " " + tostr(cols); + lv_->getLyXFunc()->dispatch(LFUN_INSET_TABULAR, tmp); +} + + +void QTabularCreate::show() +{ + if (!dialog_) + dialog_ = new QTabularCreateDialog(this, 0, _("LyX: Insert Table")); + + if (!dialog_->isVisible()) { + h_ = d_->hideBufferDependent.connect(slot(this, &QTabularCreate::hide)); + } + + dialog_->raise(); + dialog_->setActiveWindow(); + + update(); + dialog_->show(); +} + + +void QTabularCreate::close() +{ + h_.disconnect(); +} + + +void QTabularCreate::hide() +{ + dialog_->hide(); + close(); +} diff --git a/src/frontends/qt2/QTabularCreate.h b/src/frontends/qt2/QTabularCreate.h new file mode 100644 index 0000000000..c6406ce163 --- /dev/null +++ b/src/frontends/qt2/QTabularCreate.h @@ -0,0 +1,52 @@ +// -*- C++ -*- +/** + * \file QTabularCreate.h + * Copyright 2001 the LyX Team + * Read the file COPYING + * + * \author John Levon + */ + +#ifndef QTABULARCREATE_H +#define QTABULARCREATE_H + +#include "DialogBase.h" +#include "LString.h" +#include "boost/utility.hpp" + +class Dialogs; +class LyXView; +class QTabularCreateDialog; + +class QTabularCreate : public DialogBase { +public: + QTabularCreate(LyXView *, Dialogs *); + ~QTabularCreate(); + + /// create the table + void apply(int rows, int cols); + /// close the connections + void close(); + +private: + /// Create the dialog if necessary, update it and display it. + void show(); + /// Hide the dialog. + void hide(); + + /// Real GUI implementation. + QTabularCreateDialog * dialog_; + + /// the LyXView we belong to + LyXView * lv_; + + /** Which Dialogs do we belong to? + Used so we can get at the signals we have to connect to. + */ + Dialogs * d_; + + /// Hide connection. + SigC::Connection h_; +}; + +#endif // QTABULARCREATE_H diff --git a/src/frontends/qt2/QTabularCreateDialog.C b/src/frontends/qt2/QTabularCreateDialog.C new file mode 100644 index 0000000000..19dc39a458 --- /dev/null +++ b/src/frontends/qt2/QTabularCreateDialog.C @@ -0,0 +1,69 @@ +/** + * \file QTabularCreateDialog.C + * Copyright 2001 the LyX Team + * Read the file COPYING + * + * \author John Levon, moz@compsoc.man.ac.uk + * \author Edwin Leuven, leuven@fee.uva.nl + */ + +#include +#include + +#include "QTabularCreateDialog.h" +#include "QTabularCreate.h" + +#include "support/lstrings.h" + +#include +#include +#include "emptytable.h" +#include +#include +#include + +QTabularCreateDialog::QTabularCreateDialog(QTabularCreate * form, QWidget * parent, const char * name, bool modal, WFlags fl) + : QTabularCreateDialogBase(parent, name, modal, fl), + form_(form) +{ + setCaption(name); + table->setMinimumSize(100,100); + rows->setValue(5); + columns->setValue(5); + QToolTip::add(table, _("Drag with left mouse button to resize")); +} + + +QTabularCreateDialog::~QTabularCreateDialog() +{ + // no need to delete child widgets, Qt does it all for us +} + + +void QTabularCreateDialog::insert_tabular() +{ + form_->apply((rows->text()).toInt(), (columns->text()).toInt()); + form_->close(); + hide(); +} + + +void QTabularCreateDialog::cancel_adaptor() +{ + form_->close(); + hide(); +} + + +void QTabularCreateDialog::colsChanged(int nr_cols) +{ + if (nr_cols != (columns->text()).toInt()) + columns->setValue(nr_cols); +} + + +void QTabularCreateDialog::rowsChanged(int nr_rows) +{ + if (nr_rows != (rows->text()).toInt()) + rows->setValue(nr_rows); +} diff --git a/src/frontends/qt2/QTabularCreateDialog.h b/src/frontends/qt2/QTabularCreateDialog.h new file mode 100644 index 0000000000..015b234157 --- /dev/null +++ b/src/frontends/qt2/QTabularCreateDialog.h @@ -0,0 +1,33 @@ +/** + * \file QTabularCreateDialog.h + * Copyright 2001 the LyX Team + * Read the file COPYING + * + * \author John Levon + * \author Edwin Leuven + */ + +#ifndef QTABULARCREATEDIALOG_H +#define QTABULARCREATEDIALOG_H +#include "ui/QTabularCreateDialogBase.h" + +class QTabularCreate; + +class QTabularCreateDialog : public QTabularCreateDialogBase +{ Q_OBJECT + +public: + QTabularCreateDialog(QTabularCreate * form, QWidget * parent = 0, const char * name = 0, bool modal = FALSE, WFlags fl = 0); + ~QTabularCreateDialog(); + +protected slots: + void insert_tabular(); + void cancel_adaptor(); + virtual void colsChanged(int); + virtual void rowsChanged(int); + +private: + QTabularCreate * form_; +}; + +#endif // QTABULARCREATEDIALOG_H diff --git a/src/frontends/qt2/FormToc.C b/src/frontends/qt2/QToc.C similarity index 74% rename from src/frontends/qt2/FormToc.C rename to src/frontends/qt2/QToc.C index 8fdfb22377..7d8cc5d212 100644 --- a/src/frontends/qt2/FormToc.C +++ b/src/frontends/qt2/QToc.C @@ -1,32 +1,25 @@ -/* - * FormToc.C - * (C) 2000 LyX Team - * John Levon, moz@compsoc.man.ac.uk +/** + * \file QToc.C + * Copyright 2001 the LyX Team + * Read the file COPYING + * + * \author John Levon */ -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - #include #include #include -#include "FormTocDialog.h" -#undef emit +#include "QTocDialog.h" +#include "QtLyXView.h" #include "Dialogs.h" -#include "FormToc.h" +#include "BufferView.h" +#include "QToc.h" #include "gettext.h" #include "buffer.h" #include "support/lstrings.h" -#include "QtLyXView.h" #include "lyxfunc.h" #include "debug.h" @@ -38,36 +31,36 @@ using std::endl; #include #include -FormToc::FormToc(LyXView *v, Dialogs *d) +QToc::QToc(LyXView *v, Dialogs *d) : dialog_(0), lv_(v), d_(d), inset_(0), h_(0), u_(0), ih_(0), - toclist(0), type(Buffer::TOC_TOC), depth(1) + /*toclist(0),*/ depth(1) { - // 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->showTOC.connect(slot(this, &FormToc::showTOC)); - d->createTOC.connect(slot(this, &FormToc::createTOC)); + d->showTOC.connect(slot(this, &QToc::showTOC)); + d->createTOC.connect(slot(this, &QToc::createTOC)); } -FormToc::~FormToc() + +QToc::~QToc() { delete dialog_; } -void FormToc::showTOC(InsetCommand * const inset) + +void QToc::showTOC(InsetCommand * const inset) { // FIXME: when could inset be 0 here ? - if (inset==0) + if (inset == 0) return; inset_ = inset; - ih_ = inset_->hide.connect(slot(this,&FormToc::hide)); + //FIXME ih_ = inset_->hide.connect(slot(this,&QToc::hide)); params = inset->params(); show(); } -void FormToc::createTOC(string const & arg) + +void QToc::createTOC(string const & arg) { if (inset_) close(); @@ -76,14 +69,16 @@ void FormToc::createTOC(string const & arg) show(); } -void FormToc::updateToc(int newdepth) + +void QToc::updateToc(int newdepth) { if (!lv_->view()->available()) { - toclist.clear(); + //toclist.clear(); dialog_->tocLV->clear(); return; } +#if 0 vector< vector > tmp = lv_->view()->buffer()->getTocList(); @@ -162,7 +157,8 @@ void FormToc::updateToc(int newdepth) dialog_->tocLV->update(); } -void FormToc::setType(Buffer::TocType toctype) + +void QToc::setType(Buffer::TocType toctype) { type = toctype; switch (type) { @@ -189,14 +185,18 @@ void FormToc::setType(Buffer::TocType toctype) } } -void FormToc::set_depth(int newdepth) + +void QToc::set_depth(int newdepth) { if (newdepth!=depth) updateToc(newdepth); +#endif } -void FormToc::update() + +void QToc::update() { +#if 0 if (params.getCmdName()=="tableofcontents") { setType(Buffer::TOC_TOC); dialog_->typeCO->setCurrentItem(0); @@ -214,7 +214,8 @@ void FormToc::update() updateToc(depth); } -void FormToc::select(const char *text) + +void QToc::select(const char *text) { if (!lv_->view()->available()) return; @@ -233,23 +234,26 @@ void FormToc::select(const char *text) lv_->getLyXFunc()->Dispatch(LFUN_GOTO_PARAGRAPH, tostr(iter->par->id()).c_str()); } -void FormToc::set_type(Buffer::TocType toctype) + +void QToc::set_type(Buffer::TocType toctype) { if (toctype==type) return; setType(toctype); updateToc(depth); +#endif } -void FormToc::show() + +void QToc::show() { if (!dialog_) - dialog_ = new FormTocDialog(this, 0, _("LyX: Table of Contents"), false); + dialog_ = new QTocDialog(this, 0, _("LyX: Table of Contents"), false); if (!dialog_->isVisible()) { - h_ = d_->hideBufferDependent.connect(slot(this, &FormToc::hide)); - u_ = d_->updateBufferDependent.connect(slot(this, &FormToc::update)); + h_ = d_->hideBufferDependent.connect(slot(this, &QToc::hide)); + //u_ = d_->updateBufferDependent.connect(slot(this, &QToc::update)); } dialog_->raise(); @@ -259,7 +263,8 @@ void FormToc::show() dialog_->show(); } -void FormToc::close() + +void QToc::close() { h_.disconnect(); u_.disconnect(); @@ -267,7 +272,8 @@ void FormToc::close() inset_ = 0; } -void FormToc::hide() + +void QToc::hide() { dialog_->hide(); close(); diff --git a/src/frontends/qt2/QToc.h b/src/frontends/qt2/QToc.h new file mode 100644 index 0000000000..62edfb5a08 --- /dev/null +++ b/src/frontends/qt2/QToc.h @@ -0,0 +1,78 @@ +// -*- C++ -*- +/** + * \file QToc.h + * Copyright 2001 the LyX Team + * Read the file COPYING + * + * \author John Levon + * \author Kalle Dalheimer + */ + +#ifndef QTOC_H +#define QTOC_H + +#include "DialogBase.h" +#include "LString.h" +#include "boost/utility.hpp" +#include "insets/insetcommand.h" +#include "buffer.h" + +class Dialogs; +class QTocDialog; + +class QToc : public DialogBase { +public: + QToc(LyXView *, Dialogs *); + ~QToc(); + + // Build the dialog + virtual void build(); + /// Update the dialog before showing it. + virtual void update(); + /// close the connections + virtual void close(); + +private: + /// Create the dialog if necessary, update it and display it. + void show(); + /// Hide the dialog. + void hide(); + + /// create a Toc inset + void createTOC(string const &); + /// view a Toc inset + void showTOC(InsetCommand * const); + + /// update the Toc + void updateToc(int); + + /// Real GUI implementation. + QTocDialog * dialog_; + + /// the LyXView we belong to + LyXView * lv_; + + /** Which Dialogs do we belong to? + Used so we can get at the signals we have to connect to. + */ + Dialogs * d_; + /// pointer to the inset if any + InsetCommand * inset_; + /// insets params + InsetCommandParams params; + + /// Hide connection. + SigC::Connection h_; + /// Update connection. + SigC::Connection u_; + /// Inset hide connection. + SigC::Connection ih_; + + /// the toc list + //std::vector toclist; + + /// depth of list shown + int depth; +}; + +#endif // QTOC_H diff --git a/src/frontends/qt2/QTocDialog.C b/src/frontends/qt2/QTocDialog.C new file mode 100644 index 0000000000..ef8fe35fb2 --- /dev/null +++ b/src/frontends/qt2/QTocDialog.C @@ -0,0 +1,79 @@ +/** + * \file QTocDialog.C + * Copyright 2001 the LyX Team + * Read the file COPYING + * + * \author John Levon + */ + +#include +#include +#include "QTocDialog.h" +#include "Dialogs.h" +#include "QToc.h" + +#include + +QTocDialog::QTocDialog(QToc * form, QWidget * parent, const char * name, bool modal, WFlags fl) + : QTocDialogBase(parent, name, modal, fl), + form_(form) +{ +} + + +QTocDialog::~QTocDialog() +{ +} + + +void QTocDialog::activate_adaptor(int index) +{ + switch (index) { + case 0: + //form_->set_type(Buffer::TOC_TOC); + break; + case 1: + //form_->set_type(Buffer::TOC_LOF); + break; + case 2: + //form_->set_type(Buffer::TOC_LOT); + break; + case 3: + //form_->set_type(Buffer::TOC_LOA); + break; + default: + lyxerr[Debug::GUI] << "Unknown TOC combo selection." << std::endl; + break; + } +} + +void QTocDialog::close_adaptor() +{ + form_->close(); + hide(); +} + + +void QTocDialog::depth_adaptor(int depth) +{ + //form_->set_depth(depth); +} + + +void QTocDialog::select_adaptor(QListViewItem * item) +{ + //form_->select(item->text(0)); +} + + +void QTocDialog::update_adaptor() +{ + form_->update(); +} + + +void QTocDialog::closeEvent(QCloseEvent * e) +{ + form_->close(); + e->accept(); +} diff --git a/src/frontends/qt2/QTocDialog.h b/src/frontends/qt2/QTocDialog.h new file mode 100644 index 0000000000..b01da871a9 --- /dev/null +++ b/src/frontends/qt2/QTocDialog.h @@ -0,0 +1,37 @@ +/** + * \file QTocDialog.h + * Copyright 2001 the LyX Team + * Read the file COPYING + * + * \author John Levon + */ + +#ifndef QTOCDIALOG_H +#define QTOCDIALOG_H + +#include "ui/QTocDialogBase.h" + +class QToc; + +class QTocDialog : public QTocDialogBase +{ Q_OBJECT + +public: + QTocDialog(QToc * form, QWidget * parent = 0, const char * name = 0, bool modal = FALSE, WFlags fl = 0); + ~QTocDialog(); + +public slots: + void activate_adaptor(int); + void close_adaptor(); + void depth_adaptor(int); + void select_adaptor(QListViewItem *); + void update_adaptor(); + +protected: + void closeEvent(QCloseEvent * e); + +private: + QToc * form_; +}; + +#endif // QTOCDIALOG_H diff --git a/src/frontends/qt2/FormUrl.C b/src/frontends/qt2/QURL.C similarity index 59% rename from src/frontends/qt2/FormUrl.C rename to src/frontends/qt2/QURL.C index d8f596572c..470a12220c 100644 --- a/src/frontends/qt2/FormUrl.C +++ b/src/frontends/qt2/QURL.C @@ -1,50 +1,45 @@ -/* - * FormUrl.C - * (C) 2000 LyX Team - * John Levon, moz@compsoc.man.ac.uk +/** + * \file QURL.C + * Copyright 2001 the LyX Team + * Read the file COPYING + * + * \author John Levon */ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ #include -#include "FormUrlDialog.h" -#undef emit +#include "QURLDialog.h" +#include "QtLyXView.h" +#include "BufferView.h" #include "Dialogs.h" -#include "FormUrl.h" +#include "QURL.h" #include "gettext.h" #include "buffer.h" -#include "LyXView.h" #include "lyxfunc.h" #include #include #include -FormUrl::FormUrl(LyXView *v, Dialogs *d) +QURL::QURL(LyXView *v, Dialogs *d) : dialog_(0), lv_(v), d_(d), inset_(0), h_(0), u_(0), ih_(0) { // 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->showUrl.connect(slot(this, &FormUrl::showUrl)); - d->createUrl.connect(slot(this, &FormUrl::createUrl)); + d->showUrl.connect(slot(this, &QURL::showUrl)); + d->createUrl.connect(slot(this, &QURL::createUrl)); } -FormUrl::~FormUrl() + +QURL::~QURL() { delete dialog_; } -void FormUrl::showUrl(InsetCommand * const inset) + +void QURL::showUrl(InsetCommand * const inset) { // FIXME: when could inset be 0 here ? if (inset==0) @@ -52,13 +47,14 @@ void FormUrl::showUrl(InsetCommand * const inset) inset_ = inset; readonly = lv_->buffer()->isReadonly(); - ih_ = inset_->hide.connect(slot(this,&FormUrl::hide)); + //ih_ = inset_->hide.connect(slot(this,&QURL::hide)); params = inset->params(); show(); } + -void FormUrl::createUrl(string const & arg) +void QURL::createUrl(string const & arg) { // we could already be showing a URL, clear it out if (inset_) @@ -68,8 +64,9 @@ void FormUrl::createUrl(string const & arg) params.setFromString(arg); show(); } + -void FormUrl::update() +void QURL::update() { dialog_->urlED->setText(params.getContents().c_str()); dialog_->nameED->setText(params.getOptions().c_str()); @@ -94,8 +91,9 @@ void FormUrl::update() dialog_->hyperlinkCB->setEnabled(true); } } + -void FormUrl::apply() +void QURL::apply() { if (readonly) return; @@ -114,17 +112,18 @@ void FormUrl::apply() lv_->view()->updateInset(inset_, true); } } else - lv_->getLyXFunc()->Dispatch(LFUN_INSERT_URL, params.getAsString().c_str()); + lv_->getLyXFunc()->dispatch(LFUN_INSERT_URL, params.getAsString().c_str()); } -void FormUrl::show() + +void QURL::show() { if (!dialog_) - dialog_ = new FormUrlDialog(this, 0, _("LyX: Url"), false); + dialog_ = new QURLDialog(this, 0, _("LyX: Url"), false); if (!dialog_->isVisible()) { - h_ = d_->hideBufferDependent.connect(slot(this, &FormUrl::hide)); - u_ = d_->updateBufferDependent.connect(slot(this, &FormUrl::update)); + h_ = d_->hideBufferDependent.connect(slot(this, &QURL::hide)); + //u_ = d_->updateBufferDependent.connect(slot(this, &QURL::update)); } dialog_->raise(); @@ -134,15 +133,17 @@ void FormUrl::show() dialog_->show(); } -void FormUrl::close() + +void QURL::close() { h_.disconnect(); u_.disconnect(); ih_.disconnect(); inset_ = 0; } + -void FormUrl::hide() +void QURL::hide() { dialog_->hide(); close(); diff --git a/src/frontends/qt2/QURL.h b/src/frontends/qt2/QURL.h new file mode 100644 index 0000000000..6c42099894 --- /dev/null +++ b/src/frontends/qt2/QURL.h @@ -0,0 +1,71 @@ +// -*- C++ -*- +/** + * \file QURL.h + * Copyright 2001 the LyX Team + * Read the file COPYING + * + * \author John Levon + * \author Kalle Dalheimer + */ + +#ifndef QURL_H +#define QURL_H + +#include "DialogBase.h" +#include "LString.h" +#include "boost/utility.hpp" +#include "insets/inseturl.h" + +class Dialogs; +class LyXView; +class QURLDialog; + +class QURL : public DialogBase { +public: + QURL(LyXView *, Dialogs *); + ~QURL(); + + /// Apply changes + void apply(); + /// close the connections + void close(); + +private: + /// Create the dialog if necessary, update it and display it. + void show(); + /// Hide the dialog. + void hide(); + /// Update the dialog. + void update(); + + /// create a URL inset + void createUrl(string const &); + /// edit a URL inset + void showUrl(InsetCommand * const); + + /// Real GUI implementation. + QURLDialog * dialog_; + + /// the LyXView we belong to + LyXView * lv_; + + /** Which Dialogs do we belong to? + Used so we can get at the signals we have to connect to. + */ + Dialogs * d_; + /// pointer to the inset if any + InsetCommand * inset_; + /// insets params + InsetCommandParams params; + /// is the inset we are reading from a readonly buffer + bool readonly; + + /// Hide connection. + SigC::Connection h_; + /// Update connection. + SigC::Connection u_; + /// Inset hide connection. + SigC::Connection ih_; +}; + +#endif // QURL_H diff --git a/src/frontends/qt2/QURLDialog.C b/src/frontends/qt2/QURLDialog.C new file mode 100644 index 0000000000..2512a9663d --- /dev/null +++ b/src/frontends/qt2/QURLDialog.C @@ -0,0 +1,46 @@ +/** + * \file QURLDialog.C + * Copyright 2001 the LyX Team + * Read the file COPYING + * + * \author John Levon + */ + +#include + +#include "QURLDialog.h" +#include "Dialogs.h" +#include "QURL.h" + +QURLDialog::QURLDialog(QURL * form, QWidget * parent, const char * name, bool modal, WFlags fl) + : QURLDialogBase(parent, name, modal, fl), + form_(form) +{ +} + + +QURLDialog::~QURLDialog() +{ +} + + +void QURLDialog::apply_adaptor() +{ + form_->apply(); + form_->close(); + hide(); +} + + +void QURLDialog::close_adaptor() +{ + form_->close(); + hide(); +} + + +void QURLDialog::closeEvent(QCloseEvent * e) +{ + form_->close(); + e->accept(); +} diff --git a/src/frontends/qt2/QURLDialog.h b/src/frontends/qt2/QURLDialog.h new file mode 100644 index 0000000000..2dba0875a6 --- /dev/null +++ b/src/frontends/qt2/QURLDialog.h @@ -0,0 +1,34 @@ +/** + * \file QURLDialog.h + * Copyright 2001 the LyX Team + * Read the file COPYING + * + * \author John Levon + */ + +#ifndef QURLDIALOG_H +#define QURLDIALOG_H + +#include "ui/QURLDialogBase.h" + +class QURL; + +class QURLDialog : public QURLDialogBase +{ Q_OBJECT + +public: + QURLDialog(QURL * form, QWidget * parent = 0, const char * name = 0, bool modal = FALSE, WFlags fl = 0); + ~QURLDialog(); + +public slots: + void apply_adaptor(); + void close_adaptor(); + +protected: + void closeEvent(QCloseEvent *); + +private: + QURL * form_; +}; + +#endif // QURLDIALOG_H diff --git a/src/frontends/qt2/Qt2Base.C b/src/frontends/qt2/Qt2Base.C index d1bcfa8d14..202833ca96 100644 --- a/src/frontends/qt2/Qt2Base.C +++ b/src/frontends/qt2/Qt2Base.C @@ -17,8 +17,8 @@ #endif #include -#undef emit +#include "QtLyXView.h" #include "Dialogs.h" #include "Qt2Base.h" #include "qt2BC.h" diff --git a/src/frontends/qt2/QtLyXView.h b/src/frontends/qt2/QtLyXView.h index 6bbbf04bee..46288fe083 100644 --- a/src/frontends/qt2/QtLyXView.h +++ b/src/frontends/qt2/QtLyXView.h @@ -5,8 +5,8 @@ * moz@compsoc.man.ac.uk */ -/* Qt 1.x has a messy namespace which conflicts with 'emit' in - * src/Timeout.h. This can go away when Qt 2.x happens. +/* Qt has a messy namespace which conflicts with 'emit' in + * src/Timeout.h. Uggghh. */ #undef emit diff --git a/src/frontends/qt2/README b/src/frontends/qt2/README new file mode 100644 index 0000000000..15716ea667 --- /dev/null +++ b/src/frontends/qt2/README @@ -0,0 +1,59 @@ +This file contains some do's and dont's for the Qt2 frontend. + +Don't #undef emit - #include "QtLyXView.h" instead + +Naming conventions +------------------ + +QFoo.[Ch] The file that interacts with the controller +QFooDialog.[Ch] The implementation of the dialog, derived from the generated files +ui/QFooDialog.ui The designer file +ui/QFooDialogBase.[Ch] Generated files from QFooDialog.ui + +slots should be named e.g. slotFooClicked(), slotFooSelected(), where foo is the name +of the widget. + +Widgets should be named like "fooXX", where XX is one of the following +widget types : + +CB - check box +CO - +ED - +ML - +PB - push button +(FIXME: complete this) + + +Dialog Maintainer MVC conversion +---------------------------------------------- +Bibitem +Bibtex +Character Edwin +Citation Kalle In progress +Command +Connections +Copyright Kalle Done +Credits Kalle In progress +Document Kalle In progress (Not yet prepared) +Error +External +File Edwin +Graphics +Include +Index Kalle +Log +Minipage +Paragraph Edwin Not yet prepared +Preamble +Preferences +Print Edwin +Ref Kalle +Search Edwin +Splash Edwin +Tabular Not yet prepared +TabularCreate Edwin +Toc Kalle +Url Kalle +VCLog + + diff --git a/src/frontends/qt2/chardlg.C b/src/frontends/qt2/chardlg.C deleted file mode 100644 index f5b0fddb4e..0000000000 --- a/src/frontends/qt2/chardlg.C +++ /dev/null @@ -1,255 +0,0 @@ -/**************************************************************************** -** Form implementation generated from reading ui file 'chardlg.ui' -** -** Created: Thu Mar 1 12:56:20 2001 -** by: The User Interface Compiler (uic) -** -** WARNING! All changes made in this file will be lost! -****************************************************************************/ -#include "chardlg.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* - * Constructs a CharDlg which is a child of 'parent', with the - * name 'name' and widget flags set to 'f' - * - * The dialog will by default be modeless, unless you set 'modal' to - * TRUE to construct a modal dialog. - */ -CharDlg::CharDlg( QWidget* parent, const char* name, bool modal, WFlags fl ) - : QDialog( parent, name, modal, fl ) -{ - if ( !name ) - setName( "CharDlg" ); - resize( 341, 249 ); - setCaption( tr( "Character" ) ); - setSizeGripEnabled( TRUE ); - CharDlgLayout = new QGridLayout( this ); - CharDlgLayout->setSpacing( 6 ); - CharDlgLayout->setMargin( 11 ); - - sizeGB = new QGroupBox( this, "sizeGB" ); - sizeGB->setTitle( tr( "Never toggled" ) ); - sizeGB->setColumnLayout(0, Qt::Vertical ); - sizeGB->layout()->setSpacing( 0 ); - sizeGB->layout()->setMargin( 0 ); - sizeGBLayout = new QHBoxLayout( sizeGB->layout() ); - sizeGBLayout->setAlignment( Qt::AlignTop ); - sizeGBLayout->setSpacing( 6 ); - sizeGBLayout->setMargin( 11 ); - - sizeL = new QLabel( sizeGB, "sizeL" ); - sizeL->setText( tr( "Size:" ) ); - sizeGBLayout->addWidget( sizeL ); - - size = new QComboBox( FALSE, sizeGB, "size" ); - size->insertItem( tr( "No Change" ) ); - size->insertItem( tr( "Reset" ) ); - size->insertItem( tr( "Tiny" ) ); - size->insertItem( tr( "Smallest" ) ); - size->insertItem( tr( "Smaller" ) ); - size->insertItem( tr( "Small" ) ); - size->insertItem( tr( "Normal" ) ); - size->insertItem( tr( "Large" ) ); - size->insertItem( tr( "Larger" ) ); - size->insertItem( tr( "Largest" ) ); - size->insertItem( tr( "Huge" ) ); - size->insertItem( tr( "Huger" ) ); - size->insertItem( tr( "Increase" ) ); - size->insertItem( tr( "Decrease" ) ); - sizeGBLayout->addWidget( size ); - - CharDlgLayout->addWidget( sizeGB, 0, 1 ); - - miscGB = new QGroupBox( this, "miscGB" ); - miscGB->setTitle( tr( "Always toggled" ) ); - miscGB->setColumnLayout(0, Qt::Vertical ); - miscGB->layout()->setSpacing( 0 ); - miscGB->layout()->setMargin( 0 ); - miscGBLayout = new QHBoxLayout( miscGB->layout() ); - miscGBLayout->setAlignment( Qt::AlignTop ); - miscGBLayout->setSpacing( 6 ); - miscGBLayout->setMargin( 11 ); - - always_toggledL = new QLabel( miscGB, "always_toggledL" ); - always_toggledL->setText( tr( "Misc:" ) ); - miscGBLayout->addWidget( always_toggledL ); - - misc = new QComboBox( FALSE, miscGB, "misc" ); - misc->insertItem( tr( "No Change" ) ); - misc->insertItem( tr( "Reset" ) ); - misc->insertItem( tr( "Emph" ) ); - misc->insertItem( tr( "Underbar" ) ); - misc->insertItem( tr( "Noun" ) ); - misc->insertItem( tr( "LaTeX Mode" ) ); - miscGBLayout->addWidget( misc ); - - CharDlgLayout->addWidget( miscGB, 1, 1 ); - - charGB = new QGroupBox( this, "charGB" ); - charGB->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, charGB->sizePolicy().hasHeightForWidth() ) ); - charGB->setTitle( tr( "Character" ) ); - charGB->setColumnLayout(0, Qt::Vertical ); - charGB->layout()->setSpacing( 0 ); - charGB->layout()->setMargin( 0 ); - charGBLayout = new QGridLayout( charGB->layout() ); - charGBLayout->setAlignment( Qt::AlignTop ); - charGBLayout->setSpacing( 6 ); - charGBLayout->setMargin( 11 ); - - familyL = new QLabel( charGB, "familyL" ); - familyL->setText( tr( "Family:" ) ); - - charGBLayout->addWidget( familyL, 0, 0 ); - - family = new QComboBox( FALSE, charGB, "family" ); - family->insertItem( tr( "No Change" ) ); - family->insertItem( tr( "Reset" ) ); - family->insertItem( tr( "Roman" ) ); - family->insertItem( tr( "Sans Serif" ) ); - family->insertItem( tr( "Typewriter" ) ); - - charGBLayout->addWidget( family, 0, 1 ); - - seriesL = new QLabel( charGB, "seriesL" ); - seriesL->setText( tr( "Series:" ) ); - - charGBLayout->addWidget( seriesL, 1, 0 ); - - langL = new QLabel( charGB, "langL" ); - langL->setText( tr( "Language:" ) ); - - charGBLayout->addWidget( langL, 4, 0 ); - - shape = new QComboBox( FALSE, charGB, "shape" ); - shape->insertItem( tr( "No Change" ) ); - shape->insertItem( tr( "Reset" ) ); - shape->insertItem( tr( "Upright" ) ); - shape->insertItem( tr( "Italic" ) ); - shape->insertItem( tr( "Slanted" ) ); - shape->insertItem( tr( "Small Caps" ) ); - - charGBLayout->addWidget( shape, 2, 1 ); - - color = new QComboBox( FALSE, charGB, "color" ); - color->insertItem( tr( "No Change" ) ); - color->insertItem( tr( "Reset" ) ); - color->insertItem( tr( "No Color" ) ); - color->insertItem( tr( "Black" ) ); - color->insertItem( tr( "White" ) ); - color->insertItem( tr( "Red" ) ); - color->insertItem( tr( "Green" ) ); - color->insertItem( tr( "Blue" ) ); - color->insertItem( tr( "Cyan" ) ); - color->insertItem( tr( "Yellow" ) ); - color->insertItem( tr( "Magenta" ) ); - - charGBLayout->addWidget( color, 3, 1 ); - - shapeL = new QLabel( charGB, "shapeL" ); - shapeL->setText( tr( "Shape:" ) ); - - charGBLayout->addWidget( shapeL, 2, 0 ); - - series = new QComboBox( FALSE, charGB, "series" ); - series->insertItem( tr( "No Change" ) ); - series->insertItem( tr( "Reset" ) ); - series->insertItem( tr( "Medium" ) ); - series->insertItem( tr( "Bold" ) ); - - charGBLayout->addWidget( series, 1, 1 ); - - colorL = new QLabel( charGB, "colorL" ); - colorL->setEnabled( TRUE ); - colorL->setText( tr( "Color:" ) ); - - charGBLayout->addWidget( colorL, 3, 0 ); - - lang = new QComboBox( FALSE, charGB, "lang" ); - lang->insertItem( tr( "No Change" ) ); - lang->insertItem( tr( "Reset" ) ); - - charGBLayout->addWidget( lang, 4, 1 ); - - toggleall = new QCheckBox( charGB, "toggleall" ); - toggleall->setText( tr( "Toggle all" ) ); - - charGBLayout->addWidget( toggleall, 5, 1 ); - QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); - charGBLayout->addItem( spacer, 6, 1 ); - - CharDlgLayout->addMultiCellWidget( charGB, 0, 2, 0, 0 ); - QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); - CharDlgLayout->addItem( spacer_2, 2, 1 ); - - Layout9 = new QHBoxLayout; - Layout9->setSpacing( 6 ); - Layout9->setMargin( 0 ); - QSpacerItem* spacer_3 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - Layout9->addItem( spacer_3 ); - - applyPB = new QPushButton( this, "applyPB" ); - applyPB->setText( tr( "&Apply" ) ); - Layout9->addWidget( applyPB ); - - okPB = new QPushButton( this, "okPB" ); - okPB->setText( tr( "&OK" ) ); - Layout9->addWidget( okPB ); - - cancelPB = new QPushButton( this, "cancelPB" ); - cancelPB->setText( tr( "&Cancel" ) ); - cancelPB->setDefault( TRUE ); - Layout9->addWidget( cancelPB ); - - CharDlgLayout->addMultiCellLayout( Layout9, 3, 3, 0, 1 ); - - // signals and slots connections - connect( cancelPB, SIGNAL( clicked() ), this, SLOT( cancel_adaptor() ) ); - connect( okPB, SIGNAL( clicked() ), this, SLOT( close_adaptor() ) ); - connect( applyPB, SIGNAL( clicked() ), this, SLOT( apply_adaptor() ) ); - - // tab order - setTabOrder( family, series ); - setTabOrder( series, shape ); - setTabOrder( shape, color ); - setTabOrder( color, lang ); - setTabOrder( lang, toggleall ); - setTabOrder( toggleall, size ); - setTabOrder( size, misc ); - setTabOrder( misc, applyPB ); - setTabOrder( applyPB, okPB ); - setTabOrder( okPB, cancelPB ); -} - -/* - * Destroys the object and frees any allocated resources - */ -CharDlg::~CharDlg() -{ - // no need to delete child widgets, Qt does it all for us -} - -void CharDlg::apply_adaptor() -{ - qWarning( "CharDlg::apply_adaptor(): Not implemented yet!" ); -} - -void CharDlg::cancel_adaptor() -{ - qWarning( "CharDlg::cancel_adaptor(): Not implemented yet!" ); -} - -void CharDlg::close_adaptor() -{ - qWarning( "CharDlg::close_adaptor(): Not implemented yet!" ); -} - diff --git a/src/frontends/qt2/chardlg.h b/src/frontends/qt2/chardlg.h deleted file mode 100644 index d2e7b1e243..0000000000 --- a/src/frontends/qt2/chardlg.h +++ /dev/null @@ -1,66 +0,0 @@ -/**************************************************************************** -** Form interface generated from reading ui file 'chardlg.ui' -** -** Created: Thu Mar 1 12:56:14 2001 -** by: The User Interface Compiler (uic) -** -** WARNING! All changes made in this file will be lost! -****************************************************************************/ -#ifndef CHARDLG_H -#define CHARDLG_H - -#include -#include -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QCheckBox; -class QComboBox; -class QGroupBox; -class QLabel; -class QPushButton; - -class CharDlg : public QDialog -{ - Q_OBJECT - -public: - CharDlg( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); - ~CharDlg(); - - QGroupBox* sizeGB; - QLabel* sizeL; - QComboBox* size; - QGroupBox* miscGB; - QLabel* always_toggledL; - QComboBox* misc; - QGroupBox* charGB; - QLabel* familyL; - QComboBox* family; - QLabel* seriesL; - QLabel* langL; - QComboBox* shape; - QComboBox* color; - QLabel* shapeL; - QComboBox* series; - QLabel* colorL; - QComboBox* lang; - QCheckBox* toggleall; - QPushButton* applyPB; - QPushButton* okPB; - QPushButton* cancelPB; - -protected slots: - virtual void apply_adaptor(); - virtual void cancel_adaptor(); - virtual void close_adaptor(); - -protected: - QGridLayout* CharDlgLayout; - QHBoxLayout* sizeGBLayout; - QHBoxLayout* miscGBLayout; - QGridLayout* charGBLayout; - QHBoxLayout* Layout9; -}; - -#endif // CHARDLG_H diff --git a/src/frontends/qt2/chardlgimpl.h b/src/frontends/qt2/chardlgimpl.h deleted file mode 100644 index 6e311899c5..0000000000 --- a/src/frontends/qt2/chardlgimpl.h +++ /dev/null @@ -1,70 +0,0 @@ -/** - * \file chardlgimpl.h - * Copyright 2001 LyX Team - * see the file COPYING - * - * \author Edwin Leuven - */ - -#ifndef CHARDLGIMPL_H -#define CHARDLGIMPL_H - -#include - -#include "chardlg.h" -#include "FormCharacter.h" -#include -#include -#include - -class LyXFont; -class FormCharacter; - -class CharDlgImpl : public CharDlg -{ - Q_OBJECT - -public: - CharDlgImpl(FormCharacter * form, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); - - ~CharDlgImpl(); - - LyXFont getChar(); - - int langItem() { - return lang->currentItem(); - }; - - bool toggleAll() { - return toggleall->isChecked(); - }; - - void setReadOnly(bool); - -protected: - void closeEvent(QCloseEvent * e); - -private: - FormCharacter * form_; - - -protected slots: - - void apply_adaptor() { - form_->apply(); - } - - void cancel_adaptor() { - form_->close(); - hide(); - } - - void close_adaptor() { - form_->apply(); - form_->close(); - hide(); - } - -}; - -#endif // CHARDLGIMPL_H diff --git a/src/frontends/qt2/dialogs-qt2.txt b/src/frontends/qt2/dialogs-qt2.txt deleted file mode 100644 index 2197cd39fc..0000000000 --- a/src/frontends/qt2/dialogs-qt2.txt +++ /dev/null @@ -1,33 +0,0 @@ -Dialog Maintainer MVC conversion ----------------------------------------------- -Bibitem -Bibtex -Character Edwin -Citation Kalle In progress -Command -Connections -Copyright Kalle Done -Credits Kalle In progress -Document Kalle In progress (Not yet prepared) -Error -External -File Edwin -Graphics -Include -Index Kalle -Log -Minipage -Paragraph Edwin Not yet prepared -Preamble -Preferences -Print Edwin -Ref Kalle -Search Edwin -Splash Edwin -Tabular Not yet prepared -TabularCreate Edwin -Toc Kalle -Url Kalle -VCLog - - diff --git a/src/frontends/qt2/emptytable.C b/src/frontends/qt2/emptytable.C index 24ab4f2d71..466c408753 100644 --- a/src/frontends/qt2/emptytable.C +++ b/src/frontends/qt2/emptytable.C @@ -26,8 +26,8 @@ EmptyTable::EmptyTable(QWidget * parent, const char * name) void EmptyTable::paintCell(QPainter *p, int row, int col) { - int x2 = cellWidth(col) - 1; - int y2 = cellHeight(row) - 1; + int const x2 = cellWidth(col) - 1; + int const y2 = cellHeight(row) - 1; p->fillRect(0, 0, x2, y2, QColor("white")); p->drawLine(x2, 0, x2, y2); @@ -62,8 +62,8 @@ void EmptyTable::setNumberRows(int nr_rows) void EmptyTable::mouseMoveEvent(QMouseEvent *ev) { - int x = ev->pos().x(); - int y = ev->pos().y(); + int const x = ev->pos().x(); + int const y = ev->pos().y(); if (x > 0) setNumberColumns(x / cellsize + leftCell()); diff --git a/src/frontends/qt2/moc/.cvsignore b/src/frontends/qt2/moc/.cvsignore new file mode 100644 index 0000000000..0fd82a937c --- /dev/null +++ b/src/frontends/qt2/moc/.cvsignore @@ -0,0 +1,8 @@ +Makefile.in +Makefile +*.deps +*.lo +.libs +libqt2moc.la +moc_*.C +*_moc.C diff --git a/src/frontends/qt2/moc/Makefile.am b/src/frontends/qt2/moc/Makefile.am new file mode 100644 index 0000000000..4f1b3e2bc9 --- /dev/null +++ b/src/frontends/qt2/moc/Makefile.am @@ -0,0 +1,26 @@ +AUTOMAKE_OPTIONS = foreign 1.4 +MAINTAINERCLEANFILES = $(srcdir)/Makefile.in +noinst_LTLIBRARIES = libqt2moc.la +BOOST_INCLUDES = -I$(top_srcdir)/boost +INCLUDES = -I${top_srcdir}/src/ \ + -I${top_srcdir}/src/frontends/ \ + -I${top_srcdir}/src/frontends/controllers \ + ${SIGC_CFLAGS} \ + ${FRONTEND_INCLUDES} \ + $(BOOST_INCLUDES) + +include ../Makefile.dialogs + +libqt2moc_la_SOURCES := FileDialog_private_moc.C \ + emptytable_moc.C \ + Qt2Base_moc.C \ + $(MOCDIALOGS) + #$(patsubst, %, %Dialog_moc.C, $(DIALOGS)) + +DISTCLEANFILES = $(libqt2moc_la_SOURCES) *.orig *.rej *~ *.bak core + +ETAGS_ARGS = --lang=c++ + +%_moc.C: ../%.h + $(MOC) -o $@ $< + diff --git a/src/frontends/qt2/paragraphdlg.C b/src/frontends/qt2/paragraphdlg.C deleted file mode 100644 index 2a57051cb6..0000000000 --- a/src/frontends/qt2/paragraphdlg.C +++ /dev/null @@ -1,618 +0,0 @@ -/**************************************************************************** -** Form implementation generated from reading ui file 'paragraphdlg.ui' -** -** Created: Fri Mar 9 13:08:59 2001 -** by: The User Interface Compiler (uic) -** -** WARNING! All changes made in this file will be lost! -****************************************************************************/ -#include "paragraphdlg.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* - * Constructs a ParagraphDlg which is a child of 'parent', with the - * name 'name' and widget flags set to 'f' - * - * The dialog will by default be modeless, unless you set 'modal' to - * TRUE to construct a modal dialog. - */ -ParagraphDlg::ParagraphDlg( QWidget* parent, const char* name, bool modal, WFlags fl ) - : QDialog( parent, name, modal, fl ) -{ - if ( !name ) - setName( "ParagraphDlg" ); - resize( 559, 387 ); - setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)1, sizePolicy().hasHeightForWidth() ) ); - setCaption( tr( "Paragraph" ) ); - setSizeGripEnabled( TRUE ); - ParagraphDlgLayout = new QVBoxLayout( this ); - ParagraphDlgLayout->setSpacing( 6 ); - ParagraphDlgLayout->setMargin( 11 ); - - TabsParagraph = new QTabWidget( this, "TabsParagraph" ); - - tab = new QWidget( TabsParagraph, "tab" ); - tabLayout = new QVBoxLayout( tab ); - tabLayout->setSpacing( 6 ); - tabLayout->setMargin( 11 ); - - Layout6 = new QHBoxLayout; - Layout6->setSpacing( 6 ); - Layout6->setMargin( 0 ); - - alignmentL = new QLabel( tab, "alignmentL" ); - alignmentL->setText( tr( "Alignment:" ) ); - alignmentL->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)1, alignmentL->sizePolicy().hasHeightForWidth() ) ); - Layout6->addWidget( alignmentL ); - - alignment = new QComboBox( FALSE, tab, "alignment" ); - alignment->insertItem( tr( "Justified" ) ); - alignment->insertItem( tr( "Left" ) ); - alignment->insertItem( tr( "Right" ) ); - alignment->insertItem( tr( "Centered" ) ); - alignment->setInsertionPolicy( QComboBox::AtBottom ); - alignment->setAutoCompletion( FALSE ); - Layout6->addWidget( alignment ); - QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - Layout6->addItem( spacer ); - - noIndent = new QCheckBox( tab, "noIndent" ); - noIndent->setText( tr( "No indentation" ) ); - Layout6->addWidget( noIndent ); - tabLayout->addLayout( Layout6 ); - - spacingOptions = new QGroupBox( tab, "spacingOptions" ); - spacingOptions->setTitle( tr( "Spacing" ) ); - spacingOptions->setEnabled( TRUE ); - spacingOptions->setColumnLayout(0, Qt::Vertical ); - spacingOptions->layout()->setSpacing( 0 ); - spacingOptions->layout()->setMargin( 0 ); - spacingOptionsLayout = new QGridLayout( spacingOptions->layout() ); - spacingOptionsLayout->setAlignment( Qt::AlignTop ); - spacingOptionsLayout->setSpacing( 6 ); - spacingOptionsLayout->setMargin( 11 ); - - spacingBelowValueUnit = new QComboBox( FALSE, spacingOptions, "spacingBelowValueUnit" ); - spacingBelowValueUnit->insertItem( tr( "Centimetres" ) ); - spacingBelowValueUnit->insertItem( tr( "Inches" ) ); - spacingBelowValueUnit->insertItem( tr( "Points" ) ); - spacingBelowValueUnit->insertItem( tr( "Millimetres" ) ); - spacingBelowValueUnit->insertItem( tr( "Picas" ) ); - spacingBelowValueUnit->insertItem( tr( "ex Units" ) ); - spacingBelowValueUnit->insertItem( tr( "em Units" ) ); - spacingBelowValueUnit->insertItem( tr( "Scaled Points" ) ); - spacingBelowValueUnit->insertItem( tr( "Big/PS Points" ) ); - spacingBelowValueUnit->insertItem( tr( "Didot Points" ) ); - spacingBelowValueUnit->insertItem( tr( "Cicero Points" ) ); - spacingBelowValueUnit->setEnabled( FALSE ); - spacingBelowValueUnit->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, spacingBelowValueUnit->sizePolicy().hasHeightForWidth() ) ); - - spacingOptionsLayout->addWidget( spacingBelowValueUnit, 4, 2 ); - - spacingBelowPlusUnit = new QComboBox( FALSE, spacingOptions, "spacingBelowPlusUnit" ); - spacingBelowPlusUnit->insertItem( tr( "Centimetres" ) ); - spacingBelowPlusUnit->insertItem( tr( "Inches" ) ); - spacingBelowPlusUnit->insertItem( tr( "Points" ) ); - spacingBelowPlusUnit->insertItem( tr( "Millimetres" ) ); - spacingBelowPlusUnit->insertItem( tr( "Picas" ) ); - spacingBelowPlusUnit->insertItem( tr( "ex Units" ) ); - spacingBelowPlusUnit->insertItem( tr( "em Units" ) ); - spacingBelowPlusUnit->insertItem( tr( "Scaled Points" ) ); - spacingBelowPlusUnit->insertItem( tr( "Big/PS Points" ) ); - spacingBelowPlusUnit->insertItem( tr( "Didot Points" ) ); - spacingBelowPlusUnit->insertItem( tr( "Cicero Points" ) ); - spacingBelowPlusUnit->setEnabled( FALSE ); - spacingBelowPlusUnit->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, spacingBelowPlusUnit->sizePolicy().hasHeightForWidth() ) ); - - spacingOptionsLayout->addWidget( spacingBelowPlusUnit, 4, 3 ); - - spacingBelowMinusUnit = new QComboBox( FALSE, spacingOptions, "spacingBelowMinusUnit" ); - spacingBelowMinusUnit->insertItem( tr( "Centimetres" ) ); - spacingBelowMinusUnit->insertItem( tr( "Inches" ) ); - spacingBelowMinusUnit->insertItem( tr( "Points" ) ); - spacingBelowMinusUnit->insertItem( tr( "Millimetres" ) ); - spacingBelowMinusUnit->insertItem( tr( "Picas" ) ); - spacingBelowMinusUnit->insertItem( tr( "ex Units" ) ); - spacingBelowMinusUnit->insertItem( tr( "em Units" ) ); - spacingBelowMinusUnit->insertItem( tr( "Scaled Points" ) ); - spacingBelowMinusUnit->insertItem( tr( "Big/PS Points" ) ); - spacingBelowMinusUnit->insertItem( tr( "Didot Points" ) ); - spacingBelowMinusUnit->insertItem( tr( "Cicero Points" ) ); - spacingBelowMinusUnit->setEnabled( FALSE ); - spacingBelowMinusUnit->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, spacingBelowMinusUnit->sizePolicy().hasHeightForWidth() ) ); - - spacingOptionsLayout->addWidget( spacingBelowMinusUnit, 4, 4 ); - - spacingAbovePlusUnit = new QComboBox( FALSE, spacingOptions, "spacingAbovePlusUnit" ); - spacingAbovePlusUnit->insertItem( tr( "Centimetres" ) ); - spacingAbovePlusUnit->insertItem( tr( "Inches" ) ); - spacingAbovePlusUnit->insertItem( tr( "Points" ) ); - spacingAbovePlusUnit->insertItem( tr( "Millimetres" ) ); - spacingAbovePlusUnit->insertItem( tr( "Picas" ) ); - spacingAbovePlusUnit->insertItem( tr( "ex Units" ) ); - spacingAbovePlusUnit->insertItem( tr( "em Units" ) ); - spacingAbovePlusUnit->insertItem( tr( "Scaled Points" ) ); - spacingAbovePlusUnit->insertItem( tr( "Big/PS Points" ) ); - spacingAbovePlusUnit->insertItem( tr( "Didot Points" ) ); - spacingAbovePlusUnit->insertItem( tr( "Cicero Points" ) ); - spacingAbovePlusUnit->setEnabled( FALSE ); - spacingAbovePlusUnit->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, spacingAbovePlusUnit->sizePolicy().hasHeightForWidth() ) ); - - spacingOptionsLayout->addWidget( spacingAbovePlusUnit, 2, 3 ); - - spacingAboveValueUnit = new QComboBox( FALSE, spacingOptions, "spacingAboveValueUnit" ); - spacingAboveValueUnit->insertItem( tr( "Centimetres" ) ); - spacingAboveValueUnit->insertItem( tr( "Inches" ) ); - spacingAboveValueUnit->insertItem( tr( "Points" ) ); - spacingAboveValueUnit->insertItem( tr( "Millimetres" ) ); - spacingAboveValueUnit->insertItem( tr( "Picas" ) ); - spacingAboveValueUnit->insertItem( tr( "ex Units" ) ); - spacingAboveValueUnit->insertItem( tr( "em Units" ) ); - spacingAboveValueUnit->insertItem( tr( "Scaled Points" ) ); - spacingAboveValueUnit->insertItem( tr( "Big/PS Points" ) ); - spacingAboveValueUnit->insertItem( tr( "Didot Points" ) ); - spacingAboveValueUnit->insertItem( tr( "Cicero Points" ) ); - spacingAboveValueUnit->setEnabled( FALSE ); - spacingAboveValueUnit->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, spacingAboveValueUnit->sizePolicy().hasHeightForWidth() ) ); - - spacingOptionsLayout->addWidget( spacingAboveValueUnit, 2, 2 ); - - spacingBelowValue = new QLineEdit( spacingOptions, "spacingBelowValue" ); - spacingBelowValue->setEnabled( FALSE ); - - spacingOptionsLayout->addWidget( spacingBelowValue, 3, 2 ); - - spacingBelowPlus = new QLineEdit( spacingOptions, "spacingBelowPlus" ); - spacingBelowPlus->setEnabled( FALSE ); - - spacingOptionsLayout->addWidget( spacingBelowPlus, 3, 3 ); - - spacingAboveMinusUnit = new QComboBox( FALSE, spacingOptions, "spacingAboveMinusUnit" ); - spacingAboveMinusUnit->insertItem( tr( "Centimetres" ) ); - spacingAboveMinusUnit->insertItem( tr( "Inches" ) ); - spacingAboveMinusUnit->insertItem( tr( "Points" ) ); - spacingAboveMinusUnit->insertItem( tr( "Millimetres" ) ); - spacingAboveMinusUnit->insertItem( tr( "Picas" ) ); - spacingAboveMinusUnit->insertItem( tr( "ex Units" ) ); - spacingAboveMinusUnit->insertItem( tr( "em Units" ) ); - spacingAboveMinusUnit->insertItem( tr( "Scaled Points" ) ); - spacingAboveMinusUnit->insertItem( tr( "Big/PS Points" ) ); - spacingAboveMinusUnit->insertItem( tr( "Didot Points" ) ); - spacingAboveMinusUnit->insertItem( tr( "Cicero Points" ) ); - spacingAboveMinusUnit->setEnabled( FALSE ); - spacingAboveMinusUnit->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, spacingAboveMinusUnit->sizePolicy().hasHeightForWidth() ) ); - - spacingOptionsLayout->addWidget( spacingAboveMinusUnit, 2, 4 ); - - spacingAboveValue = new QLineEdit( spacingOptions, "spacingAboveValue" ); - spacingAboveValue->setEnabled( FALSE ); - - spacingOptionsLayout->addWidget( spacingAboveValue, 1, 2 ); - - spacingAbovePlus = new QLineEdit( spacingOptions, "spacingAbovePlus" ); - spacingAbovePlus->setEnabled( FALSE ); - - spacingOptionsLayout->addWidget( spacingAbovePlus, 1, 3 ); - - spacingAboveMinus = new QLineEdit( spacingOptions, "spacingAboveMinus" ); - spacingAboveMinus->setEnabled( FALSE ); - - spacingOptionsLayout->addWidget( spacingAboveMinus, 1, 4 ); - - spacingBelowMinus = new QLineEdit( spacingOptions, "spacingBelowMinus" ); - spacingBelowMinus->setEnabled( FALSE ); - - spacingOptionsLayout->addWidget( spacingBelowMinus, 3, 4 ); - - Layout2_1 = new QHBoxLayout; - Layout2_1->setSpacing( 6 ); - Layout2_1->setMargin( 0 ); - QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - Layout2_1->addItem( spacer_2 ); - - spacingBelowUnitsL = new QLabel( spacingOptions, "spacingBelowUnitsL" ); - spacingBelowUnitsL->setText( tr( "Units:" ) ); - spacingBelowUnitsL->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)1, spacingBelowUnitsL->sizePolicy().hasHeightForWidth() ) ); - spacingBelowUnitsL->setEnabled( FALSE ); - QToolTip::add( spacingBelowUnitsL, tr( "Unit of Size, Stretch and Slink" ) ); - Layout2_1->addWidget( spacingBelowUnitsL ); - - spacingOptionsLayout->addLayout( Layout2_1, 4, 1 ); - - Layout2_1_2 = new QHBoxLayout; - Layout2_1_2->setSpacing( 6 ); - Layout2_1_2->setMargin( 0 ); - QSpacerItem* spacer_3 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - Layout2_1_2->addItem( spacer_3 ); - - spacingAboveUnitsL = new QLabel( spacingOptions, "spacingAboveUnitsL" ); - spacingAboveUnitsL->setText( tr( "Units:" ) ); - spacingAboveUnitsL->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)1, spacingAboveUnitsL->sizePolicy().hasHeightForWidth() ) ); - spacingAboveUnitsL->setEnabled( FALSE ); - QToolTip::add( spacingAboveUnitsL, tr( "Unit of Size, Stretch and Slink" ) ); - Layout2_1_2->addWidget( spacingAboveUnitsL ); - - spacingOptionsLayout->addLayout( Layout2_1_2, 2, 1 ); - - spacingValueL = new QLabel( spacingOptions, "spacingValueL" ); - spacingValueL->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)1, spacingValueL->sizePolicy().hasHeightForWidth() ) ); - spacingValueL->setText( tr( "Value:" ) ); - spacingValueL->setEnabled( FALSE ); - QToolTip::add( spacingValueL, tr( "Amount of spacing" ) ); - - spacingOptionsLayout->addWidget( spacingValueL, 0, 2 ); - - spacingPlusL = new QLabel( spacingOptions, "spacingPlusL" ); - spacingPlusL->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)1, spacingPlusL->sizePolicy().hasHeightForWidth() ) ); - spacingPlusL->setText( tr( "Stretch:" ) ); - spacingPlusL->setEnabled( FALSE ); - QToolTip::add( spacingPlusL, tr( "Margin by with paragraph is allowed to increase" ) ); - - spacingOptionsLayout->addWidget( spacingPlusL, 0, 3 ); - - spacingMinusL = new QLabel( spacingOptions, "spacingMinusL" ); - spacingMinusL->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)1, spacingMinusL->sizePolicy().hasHeightForWidth() ) ); - spacingMinusL->setText( tr( "Shrink:" ) ); - spacingMinusL->setEnabled( FALSE ); - QToolTip::add( spacingMinusL, tr( "Margin by with paragraph is allowed to increase" ) ); - - spacingOptionsLayout->addWidget( spacingMinusL, 0, 4 ); - - spacingAbove = new QComboBox( FALSE, spacingOptions, "spacingAbove" ); - spacingAbove->insertItem( tr( "None" ) ); - spacingAbove->insertItem( tr( "DefSkip" ) ); - spacingAbove->insertItem( tr( "SmallSkip" ) ); - spacingAbove->insertItem( tr( "MedSkip" ) ); - spacingAbove->insertItem( tr( "BigSkip" ) ); - spacingAbove->insertItem( tr( "VFill" ) ); - spacingAbove->insertItem( tr( "Custom" ) ); - spacingAbove->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, spacingAbove->sizePolicy().hasHeightForWidth() ) ); - - spacingOptionsLayout->addWidget( spacingAbove, 1, 1 ); - - spacingAboveL = new QLabel( spacingOptions, "spacingAboveL" ); - spacingAboveL->setText( tr( "Above:" ) ); - - spacingOptionsLayout->addWidget( spacingAboveL, 1, 0 ); - - spacingBelowL = new QLabel( spacingOptions, "spacingBelowL" ); - spacingBelowL->setText( tr( "Below:" ) ); - - spacingOptionsLayout->addWidget( spacingBelowL, 3, 0 ); - - spacingBelow = new QComboBox( FALSE, spacingOptions, "spacingBelow" ); - spacingBelow->insertItem( tr( "None" ) ); - spacingBelow->insertItem( tr( "DefSkip" ) ); - spacingBelow->insertItem( tr( "SmallSkip" ) ); - spacingBelow->insertItem( tr( "MedSkip" ) ); - spacingBelow->insertItem( tr( "BigSkip" ) ); - spacingBelow->insertItem( tr( "VFill" ) ); - spacingBelow->insertItem( tr( "Custom" ) ); - spacingBelow->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, spacingBelow->sizePolicy().hasHeightForWidth() ) ); - - spacingOptionsLayout->addWidget( spacingBelow, 3, 1 ); - - spacingAboveKeep = new QCheckBox( spacingOptions, "spacingAboveKeep" ); - spacingAboveKeep->setText( tr( "Keep space at the top of the page" ) ); - spacingAboveKeep->setEnabled( TRUE ); - QToolTip::add( spacingAboveKeep, tr( "Keep space at top of the page" ) ); - - spacingOptionsLayout->addMultiCellWidget( spacingAboveKeep, 5, 5, 1, 2 ); - - spacingBelowKeep = new QCheckBox( spacingOptions, "spacingBelowKeep" ); - spacingBelowKeep->setText( tr( "Keep space at the bottom of the page" ) ); - spacingBelowKeep->setEnabled( TRUE ); - QToolTip::add( spacingBelowKeep, tr( "Keep space at the bottom of the page" ) ); - - spacingOptionsLayout->addMultiCellWidget( spacingBelowKeep, 5, 5, 3, 4 ); - tabLayout->addWidget( spacingOptions ); - - listOptions = new QGroupBox( tab, "listOptions" ); - listOptions->setTitle( tr( "List environment" ) ); - listOptions->setEnabled( FALSE ); - listOptions->setColumnLayout(0, Qt::Vertical ); - listOptions->layout()->setSpacing( 0 ); - listOptions->layout()->setMargin( 0 ); - listOptionsLayout = new QHBoxLayout( listOptions->layout() ); - listOptionsLayout->setAlignment( Qt::AlignTop ); - listOptionsLayout->setSpacing( 6 ); - listOptionsLayout->setMargin( 11 ); - - labelWidthL = new QLabel( listOptions, "labelWidthL" ); - labelWidthL->setText( tr( "Label width:" ) ); - labelWidthL->setEnabled( FALSE ); - QToolTip::add( labelWidthL, tr( "Label width in list environment" ) ); - listOptionsLayout->addWidget( labelWidthL ); - - labelWidth = new QLineEdit( listOptions, "labelWidth" ); - labelWidth->setEnabled( FALSE ); - listOptionsLayout->addWidget( labelWidth ); - QSpacerItem* spacer_4 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - listOptionsLayout->addItem( spacer_4 ); - tabLayout->addWidget( listOptions ); - QSpacerItem* spacer_5 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); - tabLayout->addItem( spacer_5 ); - TabsParagraph->insertTab( tab, tr( "&Alignment and Spacing" ) ); - - tab_2 = new QWidget( TabsParagraph, "tab_2" ); - tabLayout_2 = new QGridLayout( tab_2 ); - tabLayout_2->setSpacing( 6 ); - tabLayout_2->setMargin( 11 ); - - pagebreakOptions = new QGroupBox( tab_2, "pagebreakOptions" ); - pagebreakOptions->setTitle( tr( "Page break" ) ); - pagebreakOptions->setOrientation( QGroupBox::Vertical ); - pagebreakOptions->setColumnLayout(0, Qt::Vertical ); - pagebreakOptions->layout()->setSpacing( 0 ); - pagebreakOptions->layout()->setMargin( 0 ); - pagebreakOptionsLayout = new QVBoxLayout( pagebreakOptions->layout() ); - pagebreakOptionsLayout->setAlignment( Qt::AlignTop ); - pagebreakOptionsLayout->setSpacing( 6 ); - pagebreakOptionsLayout->setMargin( 11 ); - - pagebreakAbove = new QCheckBox( pagebreakOptions, "pagebreakAbove" ); - pagebreakAbove->setText( tr( "above paragraph" ) ); - pagebreakOptionsLayout->addWidget( pagebreakAbove ); - - pagebreakBelow = new QCheckBox( pagebreakOptions, "pagebreakBelow" ); - pagebreakBelow->setText( tr( "below paragraph" ) ); - pagebreakOptionsLayout->addWidget( pagebreakBelow ); - - tabLayout_2->addWidget( pagebreakOptions, 0, 1 ); - QSpacerItem* spacer_6 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - tabLayout_2->addItem( spacer_6, 0, 2 ); - QSpacerItem* spacer_7 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); - tabLayout_2->addItem( spacer_7, 1, 2 ); - - lineOptions = new QGroupBox( tab_2, "lineOptions" ); - lineOptions->setTitle( tr( "Line" ) ); - lineOptions->setColumnLayout(0, Qt::Vertical ); - lineOptions->layout()->setSpacing( 0 ); - lineOptions->layout()->setMargin( 0 ); - lineOptionsLayout = new QVBoxLayout( lineOptions->layout() ); - lineOptionsLayout->setAlignment( Qt::AlignTop ); - lineOptionsLayout->setSpacing( 6 ); - lineOptionsLayout->setMargin( 11 ); - - lineAbove = new QCheckBox( lineOptions, "lineAbove" ); - lineAbove->setText( tr( "above paragraph" ) ); - lineOptionsLayout->addWidget( lineAbove ); - - lineBelow = new QCheckBox( lineOptions, "lineBelow" ); - lineBelow->setText( tr( "below paragraph" ) ); - lineOptionsLayout->addWidget( lineBelow ); - - tabLayout_2->addWidget( lineOptions, 0, 0 ); - TabsParagraph->insertTab( tab_2, tr( "&Lines and Page breaks" ) ); - - tab_3 = new QWidget( TabsParagraph, "tab_3" ); - tabLayout_3 = new QGridLayout( tab_3 ); - tabLayout_3->setSpacing( 6 ); - tabLayout_3->setMargin( 11 ); - QSpacerItem* spacer_8 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - tabLayout_3->addItem( spacer_8, 1, 1 ); - - Layout7 = new QGridLayout; - Layout7->setSpacing( 6 ); - Layout7->setMargin( 0 ); - - extraUnitL = new QLabel( tab_3, "extraUnitL" ); - extraUnitL->setText( tr( "Unit:" ) ); - extraUnitL->setEnabled( FALSE ); - - Layout7->addWidget( extraUnitL, 0, 2 ); - - extraUnit = new QComboBox( FALSE, tab_3, "extraUnit" ); - extraUnit->insertItem( tr( "Centimetres" ) ); - extraUnit->insertItem( tr( "Inches" ) ); - extraUnit->insertItem( tr( "Points" ) ); - extraUnit->insertItem( tr( "Millimetres" ) ); - extraUnit->insertItem( tr( "Picas" ) ); - extraUnit->insertItem( tr( "ex Units" ) ); - extraUnit->insertItem( tr( "em Units" ) ); - extraUnit->insertItem( tr( "Scaled Points" ) ); - extraUnit->insertItem( tr( "Big/PS Points" ) ); - extraUnit->insertItem( tr( "Didot Points" ) ); - extraUnit->insertItem( tr( "Cicero Points" ) ); - extraUnit->setFocusPolicy( QComboBox::TabFocus ); - extraUnit->setEnabled( FALSE ); - - Layout7->addWidget( extraUnit, 1, 2 ); - - extraWidth = new QLineEdit( tab_3, "extraWidth" ); - extraWidth->setEnabled( FALSE ); - - Layout7->addWidget( extraWidth, 1, 1 ); - - extraType = new QComboBox( FALSE, tab_3, "extraType" ); - extraType->insertItem( tr( "None" ) ); - extraType->insertItem( tr( "Minipage" ) ); - extraType->insertItem( tr( "Wrap text around floats" ) ); - extraType->insertItem( tr( "Indent whole paragraph" ) ); - - Layout7->addWidget( extraType, 1, 0 ); - - extraWidthL = new QLabel( tab_3, "extraWidthL" ); - extraWidthL->setText( tr( "Width:" ) ); - extraWidthL->setEnabled( FALSE ); - - Layout7->addWidget( extraWidthL, 0, 1 ); - - tabLayout_3->addLayout( Layout7, 0, 0 ); - - minipageOptions = new QGroupBox( tab_3, "minipageOptions" ); - minipageOptions->setTitle( tr( "Minipage options" ) ); - minipageOptions->setEnabled( FALSE ); - minipageOptions->setColumnLayout(0, Qt::Vertical ); - minipageOptions->layout()->setSpacing( 0 ); - minipageOptions->layout()->setMargin( 0 ); - minipageOptionsLayout = new QVBoxLayout( minipageOptions->layout() ); - minipageOptionsLayout->setAlignment( Qt::AlignTop ); - minipageOptionsLayout->setSpacing( 6 ); - minipageOptionsLayout->setMargin( 11 ); - - minipageStart = new QCheckBox( minipageOptions, "minipageStart" ); - minipageStart->setText( tr( "Start new minipage" ) ); - minipageStart->setEnabled( TRUE ); - minipageOptionsLayout->addWidget( minipageStart ); - - minipageHfill = new QCheckBox( minipageOptions, "minipageHfill" ); - minipageHfill->setText( tr( "HFill between minipage paragraphs" ) ); - minipageHfill->setEnabled( TRUE ); - minipageOptionsLayout->addWidget( minipageHfill ); - - Layout15 = new QHBoxLayout; - Layout15->setSpacing( 6 ); - Layout15->setMargin( 0 ); - - minipageValignL = new QLabel( minipageOptions, "minipageValignL" ); - minipageValignL->setText( tr( "Vertical Alignment:" ) ); - Layout15->addWidget( minipageValignL ); - - minipageValign = new QComboBox( FALSE, minipageOptions, "minipageValign" ); - minipageValign->insertItem( tr( "Top" ) ); - minipageValign->insertItem( tr( "Middle" ) ); - minipageValign->insertItem( tr( "Bottom" ) ); - Layout15->addWidget( minipageValign ); - QSpacerItem* spacer_9 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - Layout15->addItem( spacer_9 ); - minipageOptionsLayout->addLayout( Layout15 ); - - tabLayout_3->addWidget( minipageOptions, 1, 0 ); - QSpacerItem* spacer_10 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); - tabLayout_3->addItem( spacer_10, 2, 0 ); - TabsParagraph->insertTab( tab_3, tr( "&Extra options" ) ); - ParagraphDlgLayout->addWidget( TabsParagraph ); - - Layout1 = new QHBoxLayout; - Layout1->setSpacing( 6 ); - Layout1->setMargin( 0 ); - - defaultsPB = new QPushButton( this, "defaultsPB" ); - defaultsPB->setText( tr( "&Restore" ) ); - Layout1->addWidget( defaultsPB ); - QSpacerItem* spacer_11 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - Layout1->addItem( spacer_11 ); - - applyPB = new QPushButton( this, "applyPB" ); - applyPB->setText( tr( "&Apply" ) ); - Layout1->addWidget( applyPB ); - - okPB = new QPushButton( this, "okPB" ); - okPB->setText( tr( "&OK" ) ); - okPB->setFlat( FALSE ); - okPB->setDefault( FALSE ); - Layout1->addWidget( okPB ); - - cancelPB = new QPushButton( this, "cancelPB" ); - cancelPB->setText( tr( "&Cancel" ) ); - cancelPB->setDefault( TRUE ); - Layout1->addWidget( cancelPB ); - ParagraphDlgLayout->addLayout( Layout1 ); - - // signals and slots connections - connect( defaultsPB, SIGNAL( clicked() ), this, SLOT( restore_adaptor() ) ); - connect( applyPB, SIGNAL( clicked() ), this, SLOT( apply_adaptor() ) ); - connect( cancelPB, SIGNAL( clicked() ), this, SLOT( cancel_adaptor() ) ); - connect( okPB, SIGNAL( clicked() ), this, SLOT( ok_adaptor() ) ); - connect( spacingAbove, SIGNAL( activated(int) ), this, SLOT( enable_spacingAbove(int) ) ); - connect( spacingBelow, SIGNAL( activated(int) ), this, SLOT( enable_spacingBelow(int) ) ); - connect( extraType, SIGNAL( activated(int) ), this, SLOT( enable_minipageOptions(int) ) ); - connect( extraType, SIGNAL( activated(int) ), this, SLOT( enable_extraOptions(int) ) ); - - // tab order - setTabOrder( TabsParagraph, alignment ); - setTabOrder( alignment, noIndent ); - setTabOrder( noIndent, spacingAbove ); - setTabOrder( spacingAbove, spacingAboveValue ); - setTabOrder( spacingAboveValue, spacingAbovePlus ); - setTabOrder( spacingAbovePlus, spacingAboveMinus ); - setTabOrder( spacingAboveMinus, spacingAboveKeep ); - setTabOrder( spacingAboveKeep, spacingAboveValueUnit ); - setTabOrder( spacingAboveValueUnit, spacingAbovePlusUnit ); - setTabOrder( spacingAbovePlusUnit, spacingAboveMinusUnit ); - setTabOrder( spacingAboveMinusUnit, spacingBelow ); - setTabOrder( spacingBelow, spacingBelowValue ); - setTabOrder( spacingBelowValue, spacingBelowPlus ); - setTabOrder( spacingBelowPlus, spacingBelowMinus ); - setTabOrder( spacingBelowMinus, spacingBelowKeep ); - setTabOrder( spacingBelowKeep, spacingBelowValueUnit ); - setTabOrder( spacingBelowValueUnit, spacingBelowPlusUnit ); - setTabOrder( spacingBelowPlusUnit, spacingBelowMinusUnit ); - setTabOrder( spacingBelowMinusUnit, labelWidth ); - setTabOrder( labelWidth, lineAbove ); - setTabOrder( lineAbove, lineBelow ); - setTabOrder( lineBelow, pagebreakAbove ); - setTabOrder( pagebreakAbove, pagebreakBelow ); - setTabOrder( pagebreakBelow, extraType ); - setTabOrder( extraType, extraWidth ); - setTabOrder( extraWidth, extraUnit ); - setTabOrder( extraUnit, minipageStart ); - setTabOrder( minipageStart, minipageHfill ); - setTabOrder( minipageHfill, minipageValign ); - setTabOrder( minipageValign, cancelPB ); - setTabOrder( cancelPB, okPB ); - setTabOrder( okPB, applyPB ); - setTabOrder( applyPB, defaultsPB ); -} - -/* - * Destroys the object and frees any allocated resources - */ -ParagraphDlg::~ParagraphDlg() -{ - // no need to delete child widgets, Qt does it all for us -} - -void ParagraphDlg::apply_adaptor() -{ - qWarning( "ParagraphDlg::apply_adaptor(): Not implemented yet!" ); -} - -void ParagraphDlg::cancel_adaptor() -{ - qWarning( "ParagraphDlg::cancel_adaptor(): Not implemented yet!" ); -} - -void ParagraphDlg::enable_extraOptions(int) -{ - qWarning( "ParagraphDlg::enable_extraOptions(int): Not implemented yet!" ); -} - -void ParagraphDlg::enable_minipageOptions(int) -{ - qWarning( "ParagraphDlg::enable_minipageOptions(int): Not implemented yet!" ); -} - -void ParagraphDlg::enable_spacingAbove(int) -{ - qWarning( "ParagraphDlg::enable_spacingAbove(int): Not implemented yet!" ); -} - -void ParagraphDlg::enable_spacingBelow(int) -{ - qWarning( "ParagraphDlg::enable_spacingBelow(int): Not implemented yet!" ); -} - -void ParagraphDlg::ok_adaptor() -{ - qWarning( "ParagraphDlg::ok_adaptor(): Not implemented yet!" ); -} - -void ParagraphDlg::restore_adaptor() -{ - qWarning( "ParagraphDlg::restore_adaptor(): Not implemented yet!" ); -} - diff --git a/src/frontends/qt2/paragraphdlg.h b/src/frontends/qt2/paragraphdlg.h deleted file mode 100644 index a155220698..0000000000 --- a/src/frontends/qt2/paragraphdlg.h +++ /dev/null @@ -1,117 +0,0 @@ -/**************************************************************************** -** Form interface generated from reading ui file 'paragraphdlg.ui' -** -** Created: Fri Mar 9 13:08:44 2001 -** by: The User Interface Compiler (uic) -** -** WARNING! All changes made in this file will be lost! -****************************************************************************/ -#ifndef PARAGRAPHDLG_H -#define PARAGRAPHDLG_H - -#include -#include -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QCheckBox; -class QComboBox; -class QGroupBox; -class QLabel; -class QLineEdit; -class QPushButton; -class QTabWidget; -class QWidget; - -class ParagraphDlg : public QDialog -{ - Q_OBJECT - -public: - ParagraphDlg( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); - ~ParagraphDlg(); - - QTabWidget* TabsParagraph; - QWidget* tab; - QLabel* alignmentL; - QComboBox* alignment; - QCheckBox* noIndent; - QGroupBox* spacingOptions; - QComboBox* spacingBelowValueUnit; - QComboBox* spacingBelowPlusUnit; - QComboBox* spacingBelowMinusUnit; - QComboBox* spacingAbovePlusUnit; - QComboBox* spacingAboveValueUnit; - QLineEdit* spacingBelowValue; - QLineEdit* spacingBelowPlus; - QComboBox* spacingAboveMinusUnit; - QLineEdit* spacingAboveValue; - QLineEdit* spacingAbovePlus; - QLineEdit* spacingAboveMinus; - QLineEdit* spacingBelowMinus; - QLabel* spacingBelowUnitsL; - QLabel* spacingAboveUnitsL; - QLabel* spacingValueL; - QLabel* spacingPlusL; - QLabel* spacingMinusL; - QComboBox* spacingAbove; - QLabel* spacingAboveL; - QLabel* spacingBelowL; - QComboBox* spacingBelow; - QCheckBox* spacingAboveKeep; - QCheckBox* spacingBelowKeep; - QGroupBox* listOptions; - QLabel* labelWidthL; - QLineEdit* labelWidth; - QWidget* tab_2; - QGroupBox* pagebreakOptions; - QCheckBox* pagebreakAbove; - QCheckBox* pagebreakBelow; - QGroupBox* lineOptions; - QCheckBox* lineAbove; - QCheckBox* lineBelow; - QWidget* tab_3; - QLabel* extraUnitL; - QComboBox* extraUnit; - QLineEdit* extraWidth; - QComboBox* extraType; - QLabel* extraWidthL; - QGroupBox* minipageOptions; - QCheckBox* minipageStart; - QCheckBox* minipageHfill; - QLabel* minipageValignL; - QComboBox* minipageValign; - QPushButton* defaultsPB; - QPushButton* applyPB; - QPushButton* okPB; - QPushButton* cancelPB; - -protected slots: - virtual void apply_adaptor(); - virtual void cancel_adaptor(); - virtual void enable_extraOptions(int); - virtual void enable_minipageOptions(int); - virtual void enable_spacingAbove(int); - virtual void enable_spacingBelow(int); - virtual void ok_adaptor(); - virtual void restore_adaptor(); - -protected: - QVBoxLayout* ParagraphDlgLayout; - QVBoxLayout* tabLayout; - QHBoxLayout* Layout6; - QGridLayout* spacingOptionsLayout; - QHBoxLayout* Layout2_1; - QHBoxLayout* Layout2_1_2; - QHBoxLayout* listOptionsLayout; - QGridLayout* tabLayout_2; - QVBoxLayout* pagebreakOptionsLayout; - QVBoxLayout* lineOptionsLayout; - QGridLayout* tabLayout_3; - QGridLayout* Layout7; - QVBoxLayout* minipageOptionsLayout; - QHBoxLayout* Layout15; - QHBoxLayout* Layout1; -}; - -#endif // PARAGRAPHDLG_H diff --git a/src/frontends/qt2/printdlg.C b/src/frontends/qt2/printdlg.C deleted file mode 100644 index 83f34ea656..0000000000 --- a/src/frontends/qt2/printdlg.C +++ /dev/null @@ -1,223 +0,0 @@ -/**************************************************************************** -** Form implementation generated from reading ui file 'printdlg.ui' -** -** Created: Sun Feb 4 23:02:20 2001 -** by: The User Interface Compiler (uic) -** -** WARNING! All changes made in this file will be lost! -****************************************************************************/ -#include "printdlg.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* - * Constructs a PrintDlg which is a child of 'parent', with the - * name 'name' and widget flags set to 'f' - * - * The dialog will by default be modeless, unless you set 'modal' to - * TRUE to construct a modal dialog. - */ -PrintDlg::PrintDlg( QWidget* parent, const char* name, bool modal, WFlags fl ) - : QDialog( parent, name, modal, fl ) -{ - if ( !name ) - setName( "PrintDlg" ); - resize( 363, 342 ); - setCaption( tr( "Form1" ) ); - PrintDlgLayout = new QVBoxLayout( this ); - PrintDlgLayout->setSpacing( 6 ); - PrintDlgLayout->setMargin( 11 ); - - ButtonGroup1 = new QButtonGroup( this, "ButtonGroup1" ); - ButtonGroup1->setTitle( tr( "Print Destination" ) ); - ButtonGroup1->setColumnLayout(0, Qt::Vertical ); - ButtonGroup1->layout()->setSpacing( 0 ); - ButtonGroup1->layout()->setMargin( 0 ); - ButtonGroup1Layout = new QGridLayout( ButtonGroup1->layout() ); - ButtonGroup1Layout->setAlignment( Qt::AlignTop ); - ButtonGroup1Layout->setSpacing( 3 ); - ButtonGroup1Layout->setMargin( 11 ); - - toPrinter = new QRadioButton( ButtonGroup1, "toPrinter" ); - toPrinter->setText( tr( "&Printer" ) ); - toPrinter->setChecked( TRUE ); - - ButtonGroup1Layout->addWidget( toPrinter, 0, 0 ); - - toFile = new QRadioButton( ButtonGroup1, "toFile" ); - toFile->setText( tr( "&File" ) ); - - ButtonGroup1Layout->addWidget( toFile, 1, 0 ); - - printerName = new QLineEdit( ButtonGroup1, "printerName" ); - - ButtonGroup1Layout->addWidget( printerName, 0, 1 ); - - fileName = new QLineEdit( ButtonGroup1, "fileName" ); - fileName->setEnabled( FALSE ); - - ButtonGroup1Layout->addWidget( fileName, 1, 1 ); - - browsePB = new QPushButton( ButtonGroup1, "browsePB" ); - browsePB->setText( tr( "&Browse..." ) ); - browsePB->setEnabled( FALSE ); - - ButtonGroup1Layout->addWidget( browsePB, 1, 2 ); - PrintDlgLayout->addWidget( ButtonGroup1 ); - - ButtonGroup3 = new QButtonGroup( this, "ButtonGroup3" ); - ButtonGroup3->setTitle( tr( "Pages" ) ); - ButtonGroup3->setColumnLayout(0, Qt::Vertical ); - ButtonGroup3->layout()->setSpacing( 0 ); - ButtonGroup3->layout()->setMargin( 0 ); - ButtonGroup3Layout = new QGridLayout( ButtonGroup3->layout() ); - ButtonGroup3Layout->setAlignment( Qt::AlignTop ); - ButtonGroup3Layout->setSpacing( 3 ); - ButtonGroup3Layout->setMargin( 11 ); - - allPages = new QRadioButton( ButtonGroup3, "allPages" ); - allPages->setText( tr( "All" ) ); - allPages->setChecked( TRUE ); - - ButtonGroup3Layout->addWidget( allPages, 0, 0 ); - - oddPages = new QRadioButton( ButtonGroup3, "oddPages" ); - oddPages->setText( tr( "Odd" ) ); - - ButtonGroup3Layout->addWidget( oddPages, 1, 0 ); - - evenPages = new QRadioButton( ButtonGroup3, "evenPages" ); - evenPages->setText( tr( "Even" ) ); - - ButtonGroup3Layout->addWidget( evenPages, 2, 0 ); - - fromPageL = new QLabel( ButtonGroup3, "fromPageL" ); - fromPageL->setText( tr( "Starting range:" ) ); - fromPageL->setEnabled( FALSE ); - - ButtonGroup3Layout->addWidget( fromPageL, 3, 1 ); - - toPageL = new QLabel( ButtonGroup3, "toPageL" ); - toPageL->setText( tr( "Last page:" ) ); - toPageL->setEnabled( FALSE ); - - ButtonGroup3Layout->addWidget( toPageL, 3, 2 ); - - toPage = new QLineEdit( ButtonGroup3, "toPage" ); - toPage->setEnabled( FALSE ); - - ButtonGroup3Layout->addWidget( toPage, 4, 2 ); - - reverse = new QCheckBox( ButtonGroup3, "reverse" ); - reverse->setText( tr( "&Reverse order" ) ); - - ButtonGroup3Layout->addWidget( reverse, 0, 2 ); - - fromPage = new QLineEdit( ButtonGroup3, "fromPage" ); - fromPage->setEnabled( FALSE ); - - ButtonGroup3Layout->addWidget( fromPage, 4, 1 ); - - customPages = new QRadioButton( ButtonGroup3, "customPages" ); - customPages->setText( tr( "Pages:" ) ); - - ButtonGroup3Layout->addWidget( customPages, 4, 0 ); - PrintDlgLayout->addWidget( ButtonGroup3 ); - - GroupBox3 = new QGroupBox( this, "GroupBox3" ); - GroupBox3->setTitle( tr( "Copies" ) ); - GroupBox3->setColumnLayout(0, Qt::Vertical ); - GroupBox3->layout()->setSpacing( 0 ); - GroupBox3->layout()->setMargin( 0 ); - GroupBox3Layout = new QHBoxLayout( GroupBox3->layout() ); - GroupBox3Layout->setAlignment( Qt::AlignTop ); - GroupBox3Layout->setSpacing( 6 ); - GroupBox3Layout->setMargin( 11 ); - - copies = new QSpinBox( GroupBox3, "copies" ); - copies->setMinValue( 1 ); - copies->setValue( 1 ); - GroupBox3Layout->addWidget( copies ); - - collate = new QCheckBox( GroupBox3, "collate" ); - collate->setText( tr( "Co&llate" ) ); - collate->setEnabled( FALSE ); - GroupBox3Layout->addWidget( collate ); - QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - GroupBox3Layout->addItem( spacer ); - PrintDlgLayout->addWidget( GroupBox3 ); - - Layout1 = new QHBoxLayout; - Layout1->setSpacing( 6 ); - Layout1->setMargin( 0 ); - QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - Layout1->addItem( spacer_2 ); - - printPB = new QPushButton( this, "printPB" ); - printPB->setText( tr( "&Print" ) ); - Layout1->addWidget( printPB ); - - cancelPB = new QPushButton( this, "cancelPB" ); - cancelPB->setText( tr( "&Cancel" ) ); - cancelPB->setDefault( TRUE ); - Layout1->addWidget( cancelPB ); - PrintDlgLayout->addLayout( Layout1 ); - - // signals and slots connections - connect( toFile, SIGNAL( toggled(bool) ), browsePB, SLOT( setEnabled(bool) ) ); - connect( toFile, SIGNAL( toggled(bool) ), fileName, SLOT( setEnabled(bool) ) ); - connect( toFile, SIGNAL( toggled(bool) ), printerName, SLOT( setDisabled(bool) ) ); - connect( printPB, SIGNAL( clicked() ), this, SLOT( print() ) ); - connect( cancelPB, SIGNAL( clicked() ), this, SLOT( cancel_adaptor() ) ); - connect( copies, SIGNAL( valueChanged(int) ), this, SLOT( set_collate(int) ) ); - connect( browsePB, SIGNAL( clicked() ), this, SLOT( browse_file() ) ); - connect( customPages, SIGNAL( toggled(bool) ), fromPage, SLOT( setEnabled(bool) ) ); - connect( customPages, SIGNAL( toggled(bool) ), fromPageL, SLOT( setEnabled(bool) ) ); - connect( customPages, SIGNAL( toggled(bool) ), toPage, SLOT( setEnabled(bool) ) ); - connect( customPages, SIGNAL( toggled(bool) ), toPageL, SLOT( setEnabled(bool) ) ); -} - -/* - * Destroys the object and frees any allocated resources - */ -PrintDlg::~PrintDlg() -{ - // no need to delete child widgets, Qt does it all for us -} - -void PrintDlg::cancel_adaptor() -{ - qWarning( "PrintDlg::cancel_adaptor(): Not implemented yet!" ); -} - -void PrintDlg::enable_pagerange(int) -{ - qWarning( "PrintDlg::enable_pagerange(int): Not implemented yet!" ); -} - -void PrintDlg::browse_file() -{ - qWarning( "PrintDlg::browse_file(): Not implemented yet!" ); -} - -void PrintDlg::print() -{ - qWarning( "PrintDlg::print(): Not implemented yet!" ); -} - -void PrintDlg::set_collate(int) -{ - qWarning( "PrintDlg::set_collate(int): Not implemented yet!" ); -} - diff --git a/src/frontends/qt2/printdlg.h b/src/frontends/qt2/printdlg.h deleted file mode 100644 index d31d4e75d2..0000000000 --- a/src/frontends/qt2/printdlg.h +++ /dev/null @@ -1,71 +0,0 @@ -/**************************************************************************** -** Form interface generated from reading ui file 'printdlg.ui' -** -** Created: Sun Feb 4 23:02:16 2001 -** by: The User Interface Compiler (uic) -** -** WARNING! All changes made in this file will be lost! -****************************************************************************/ -#ifndef PRINTDLG_H -#define PRINTDLG_H - -#include -#include -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QButtonGroup; -class QCheckBox; -class QGroupBox; -class QLabel; -class QLineEdit; -class QPushButton; -class QRadioButton; -class QSpinBox; - -class PrintDlg : public QDialog -{ - Q_OBJECT - -public: - PrintDlg( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); - ~PrintDlg(); - - QButtonGroup* ButtonGroup1; - QRadioButton* toPrinter; - QRadioButton* toFile; - QLineEdit* printerName; - QLineEdit* fileName; - QPushButton* browsePB; - QButtonGroup* ButtonGroup3; - QRadioButton* allPages; - QRadioButton* oddPages; - QRadioButton* evenPages; - QLabel* fromPageL; - QLabel* toPageL; - QLineEdit* toPage; - QCheckBox* reverse; - QLineEdit* fromPage; - QRadioButton* customPages; - QGroupBox* GroupBox3; - QSpinBox* copies; - QCheckBox* collate; - QPushButton* printPB; - QPushButton* cancelPB; - -protected slots: - virtual void cancel_adaptor(); - virtual void enable_pagerange(int); - virtual void browse_file(); - virtual void print(); - virtual void set_collate(int); - -protected: - QVBoxLayout* PrintDlgLayout; - QGridLayout* ButtonGroup1Layout; - QGridLayout* ButtonGroup3Layout; - QHBoxLayout* GroupBox3Layout; - QHBoxLayout* Layout1; -}; - -#endif // PRINTDLG_H diff --git a/src/frontends/qt2/qt2BC.h b/src/frontends/qt2/qt2BC.h index 832a8c9984..31ea65801d 100644 --- a/src/frontends/qt2/qt2BC.h +++ b/src/frontends/qt2/qt2BC.h @@ -1,14 +1,9 @@ // -*- C++ -*- -/* This file is part of - * ====================================================== - * - * LyX, The Document Processor - * - * Copyright 2000-2001 The LyX Team. - * - * ====================================================== - * +/** * \file qt2BC.h + * Copyright 2001 the LyX Team + * Read the file COPYING + * * \author Allan Rae, rae@lyx.org * \author Angus Leeming, a.leeming@ic.ac.uk * \author Baruch Even, baruch.even@writeme.com diff --git a/src/frontends/qt2/searchdlg.C b/src/frontends/qt2/searchdlg.C deleted file mode 100644 index ac2ac088ef..0000000000 --- a/src/frontends/qt2/searchdlg.C +++ /dev/null @@ -1,149 +0,0 @@ -/**************************************************************************** -** Form implementation generated from reading ui file 'searchdlg.ui' -** -** Created: Mon Mar 26 21:50:02 2001 -** by: The User Interface Compiler (uic) -** -** WARNING! All changes made in this file will be lost! -****************************************************************************/ -#include "searchdlg.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* - * Constructs a SearchDlg which is a child of 'parent', with the - * name 'name' and widget flags set to 'f' - * - * The dialog will by default be modeless, unless you set 'modal' to - * TRUE to construct a modal dialog. - */ -SearchDlg::SearchDlg( QWidget* parent, const char* name, bool modal, WFlags fl ) - : QDialog( parent, name, modal, fl ) -{ - if ( !name ) - setName( "SearchDlg" ); - resize( 388, 168 ); - setCaption( tr( "Form1" ) ); - setSizeGripEnabled( TRUE ); - SearchDlgLayout = new QGridLayout( this ); - SearchDlgLayout->setSpacing( 6 ); - SearchDlgLayout->setMargin( 11 ); - - findStrLabel = new QLabel( this, "findStrLabel" ); - findStrLabel->setText( tr( "Find:" ) ); - - SearchDlgLayout->addWidget( findStrLabel, 0, 0 ); - - find = new QComboBox( FALSE, this, "find" ); - find->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, find->sizePolicy().hasHeightForWidth() ) ); - find->setFocusPolicy( QComboBox::StrongFocus ); - find->setEditable( TRUE ); - find->setDuplicatesEnabled( TRUE ); - - SearchDlgLayout->addMultiCellWidget( find, 0, 0, 1, 2 ); - - replaceLabel = new QLabel( this, "replaceLabel" ); - replaceLabel->setText( tr( "Replace with:" ) ); - - SearchDlgLayout->addWidget( replaceLabel, 1, 0 ); - - replace = new QComboBox( FALSE, this, "replace" ); - replace->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, replace->sizePolicy().hasHeightForWidth() ) ); - replace->setEditable( TRUE ); - - SearchDlgLayout->addMultiCellWidget( replace, 1, 1, 1, 2 ); - - caseSensitive = new QCheckBox( this, "caseSensitive" ); - caseSensitive->setText( tr( "&Case sensitive" ) ); - - SearchDlgLayout->addMultiCellWidget( caseSensitive, 2, 2, 0, 1 ); - - matchWord = new QCheckBox( this, "matchWord" ); - matchWord->setText( tr( "Match whole words onl&y" ) ); - - SearchDlgLayout->addMultiCellWidget( matchWord, 3, 4, 0, 1 ); - QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - SearchDlgLayout->addItem( spacer, 2, 2 ); - QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); - SearchDlgLayout->addMultiCell( spacer_2, 6, 6, 0, 1 ); - QSpacerItem* spacer_3 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); - SearchDlgLayout->addItem( spacer_3, 6, 3 ); - - findPB = new QPushButton( this, "findPB" ); - findPB->setText( tr( "Find &Next" ) ); - - SearchDlgLayout->addWidget( findPB, 0, 3 ); - - replacePB = new QPushButton( this, "replacePB" ); - replacePB->setText( tr( "&Replace" ) ); - - SearchDlgLayout->addWidget( replacePB, 1, 3 ); - - replaceAllPB = new QPushButton( this, "replaceAllPB" ); - replaceAllPB->setText( tr( "Replace &All " ) ); - - SearchDlgLayout->addMultiCellWidget( replaceAllPB, 2, 3, 3, 3 ); - - searchBack = new QCheckBox( this, "searchBack" ); - searchBack->setText( tr( "Search &backwards" ) ); - - SearchDlgLayout->addMultiCellWidget( searchBack, 5, 5, 0, 1 ); - - cancelPB = new QPushButton( this, "cancelPB" ); - cancelPB->setText( tr( "&Cancel" ) ); - - SearchDlgLayout->addMultiCellWidget( cancelPB, 4, 5, 3, 3 ); - - // signals and slots connections - connect( findPB, SIGNAL( clicked() ), this, SLOT( Find() ) ); - connect( replacePB, SIGNAL( clicked() ), this, SLOT( Replace() ) ); - connect( replaceAllPB, SIGNAL( clicked() ), this, SLOT( ReplaceAll() ) ); - connect( cancelPB, SIGNAL( clicked() ), this, SLOT( cancel_adaptor() ) ); - - // tab order - setTabOrder( find, replace ); - setTabOrder( replace, caseSensitive ); - setTabOrder( caseSensitive, matchWord ); - setTabOrder( matchWord, searchBack ); - setTabOrder( searchBack, findPB ); - setTabOrder( findPB, replacePB ); - setTabOrder( replacePB, replaceAllPB ); - setTabOrder( replaceAllPB, cancelPB ); -} - -/* - * Destroys the object and frees any allocated resources - */ -SearchDlg::~SearchDlg() -{ - // no need to delete child widgets, Qt does it all for us -} - -void SearchDlg::Find() -{ - qWarning( "SearchDlg::Find(): Not implemented yet!" ); -} - -void SearchDlg::Replace() -{ - qWarning( "SearchDlg::Replace(): Not implemented yet!" ); -} - -void SearchDlg::ReplaceAll() -{ - qWarning( "SearchDlg::ReplaceAll(): Not implemented yet!" ); -} - -void SearchDlg::cancel_adaptor() -{ - qWarning( "SearchDlg::cancel_adaptor(): Not implemented yet!" ); -} - diff --git a/src/frontends/qt2/searchdlg.h b/src/frontends/qt2/searchdlg.h deleted file mode 100644 index 82a50a0e8d..0000000000 --- a/src/frontends/qt2/searchdlg.h +++ /dev/null @@ -1,52 +0,0 @@ -/**************************************************************************** -** Form interface generated from reading ui file 'searchdlg.ui' -** -** Created: Mon Mar 26 21:48:19 2001 -** by: The User Interface Compiler (uic) -** -** WARNING! All changes made in this file will be lost! -****************************************************************************/ -#ifndef SEARCHDLG_H -#define SEARCHDLG_H - -#include -#include -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QCheckBox; -class QComboBox; -class QLabel; -class QPushButton; - -class SearchDlg : public QDialog -{ - Q_OBJECT - -public: - SearchDlg( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); - ~SearchDlg(); - - QLabel* findStrLabel; - QComboBox* find; - QLabel* replaceLabel; - QComboBox* replace; - QCheckBox* caseSensitive; - QCheckBox* matchWord; - QPushButton* findPB; - QPushButton* replacePB; - QPushButton* replaceAllPB; - QCheckBox* searchBack; - QPushButton* cancelPB; - -protected slots: - virtual void Find(); - virtual void Replace(); - virtual void ReplaceAll(); - virtual void cancel_adaptor(); - -protected: - QGridLayout* SearchDlgLayout; -}; - -#endif // SEARCHDLG_H diff --git a/src/frontends/qt2/searchdlgimpl.h b/src/frontends/qt2/searchdlgimpl.h deleted file mode 100644 index 4351f72b45..0000000000 --- a/src/frontends/qt2/searchdlgimpl.h +++ /dev/null @@ -1,51 +0,0 @@ -#ifndef SEARCHDLGIMPL_H -#define SEARCHDLGIMPL_H - -#include - -#include "searchdlg.h" -#include "FormSearch.h" - -class QCloseEvent; - -class SearchDlgImpl : public SearchDlg -{ - Q_OBJECT - -public: - SearchDlgImpl(FormSearch * form, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); - - ~SearchDlgImpl(); - - void setReadOnly(bool); - - void Replace(bool replaceall = false); - -protected: - - void closeEvent(QCloseEvent * e); - -private: - - FormSearch * form_; - -protected slots: - - void Find(); - - void Replace() { - Replace(false); - }; - - void ReplaceAll() { - Replace(true); - }; - - void cancel_adaptor() { - form_->close(); - hide(); - } - -}; - -#endif // SEARCHDLGIMPL_H diff --git a/src/frontends/qt2/tabularcreatedlg.C b/src/frontends/qt2/tabularcreatedlg.C deleted file mode 100644 index 0c4f864e4c..0000000000 --- a/src/frontends/qt2/tabularcreatedlg.C +++ /dev/null @@ -1,108 +0,0 @@ -/**************************************************************************** -** Form implementation generated from reading ui file 'tabularcreatedlg.ui' -** -** Created: Tue Feb 6 01:41:28 2001 -** by: The User Interface Compiler (uic) -** -** WARNING! All changes made in this file will be lost! -****************************************************************************/ -#include "tabularcreatedlg.h" - -#include -#include -#include -#include "emptytable.h" -#include -#include -#include -#include - -/* - * Constructs a InsertTabularDlg which is a child of 'parent', with the - * name 'name' and widget flags set to 'f' - * - * The dialog will by default be modeless, unless you set 'modal' to - * TRUE to construct a modal dialog. - */ -InsertTabularDlg::InsertTabularDlg( QWidget* parent, const char* name, bool modal, WFlags fl ) - : QDialog( parent, name, modal, fl ) -{ - if ( !name ) - setName( "InsertTabularDlg" ); - resize( 245, 235 ); - setSizeGripEnabled( TRUE ); - setCaption( tr( "Form1" ) ); - InsertTabularDlgLayout = new QVBoxLayout( this ); - InsertTabularDlgLayout->setSpacing( 6 ); - InsertTabularDlgLayout->setMargin( 11 ); - - Layout1 = new QHBoxLayout; - Layout1->setSpacing( 6 ); - Layout1->setMargin( 0 ); - - rowsL = new QLabel( this, "rowsL" ); - rowsL->setText( tr( "Rows:" ) ); - Layout1->addWidget( rowsL ); - - rows = new QSpinBox( this, "rows" ); - rows->setMinValue( 1 ); - rows->setMaxValue( 511 ); - Layout1->addWidget( rows ); - - columnsL = new QLabel( this, "columnsL" ); - columnsL->setText( tr( "Columns:" ) ); - Layout1->addWidget( columnsL ); - - columns = new QSpinBox( this, "columns" ); - columns->setMinValue( 1 ); - columns->setMaxValue( 511 ); - Layout1->addWidget( columns ); - QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - Layout1->addItem( spacer ); - InsertTabularDlgLayout->addLayout( Layout1 ); - - table = new EmptyTable( this, "table" ); - InsertTabularDlgLayout->addWidget( table ); - - Layout2 = new QHBoxLayout; - Layout2->setSpacing( 6 ); - Layout2->setMargin( 0 ); - QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - Layout2->addItem( spacer_2 ); - - insertPB = new QPushButton( this, "insertPB" ); - insertPB->setText( tr( "&Insert" ) ); - Layout2->addWidget( insertPB ); - - cancelPB = new QPushButton( this, "cancelPB" ); - cancelPB->setText( tr( "&Cancel" ) ); - Layout2->addWidget( cancelPB ); - InsertTabularDlgLayout->addLayout( Layout2 ); - - // signals and slots connections - connect( table, SIGNAL( rowsChanged(int) ), rows, SLOT( setValue(int) ) ); - connect( table, SIGNAL( colsChanged(int) ), columns, SLOT( setValue(int) ) ); - connect( rows, SIGNAL( valueChanged(int) ), table, SLOT( setNumberRows(int) ) ); - connect( columns, SIGNAL( valueChanged(int) ), table, SLOT( setNumberColumns(int) ) ); - connect( insertPB, SIGNAL( clicked() ), this, SLOT( insert_tabular() ) ); - connect( cancelPB, SIGNAL( clicked() ), this, SLOT( cancel_adaptor() ) ); -} - -/* - * Destroys the object and frees any allocated resources - */ -InsertTabularDlg::~InsertTabularDlg() -{ - // no need to delete child widgets, Qt does it all for us -} - -void InsertTabularDlg::insert_tabular() -{ - qWarning( "InsertTabularDlg::insert_tabular(): Not implemented yet!" ); -} - -void InsertTabularDlg::cancel_adaptor() -{ - qWarning( "InsertTabularDlg::cancel_adaptor(): Not implemented yet!" ); -} - diff --git a/src/frontends/qt2/tabularcreatedlg.h b/src/frontends/qt2/tabularcreatedlg.h deleted file mode 100644 index b4046f5b4e..0000000000 --- a/src/frontends/qt2/tabularcreatedlg.h +++ /dev/null @@ -1,48 +0,0 @@ -/**************************************************************************** -** Form interface generated from reading ui file 'tabularcreatedlg.ui' -** -** Created: Tue Feb 6 01:41:06 2001 -** by: The User Interface Compiler (uic) -** -** WARNING! All changes made in this file will be lost! -****************************************************************************/ -#ifndef INSERTTABULARDLG_H -#define INSERTTABULARDLG_H - -#include -#include -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class EmptyTable; -class QLabel; -class QPushButton; -class QSpinBox; - -class InsertTabularDlg : public QDialog -{ - Q_OBJECT - -public: - InsertTabularDlg( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); - ~InsertTabularDlg(); - - QLabel* rowsL; - QSpinBox* rows; - QLabel* columnsL; - QSpinBox* columns; - EmptyTable* table; - QPushButton* insertPB; - QPushButton* cancelPB; - -protected slots: - virtual void insert_tabular(); - virtual void cancel_adaptor(); - -protected: - QVBoxLayout* InsertTabularDlgLayout; - QHBoxLayout* Layout1; - QHBoxLayout* Layout2; -}; - -#endif // INSERTTABULARDLG_H diff --git a/src/frontends/qt2/tabularcreatedlgimpl.C b/src/frontends/qt2/tabularcreatedlgimpl.C deleted file mode 100644 index 893e62a6c3..0000000000 --- a/src/frontends/qt2/tabularcreatedlgimpl.C +++ /dev/null @@ -1,65 +0,0 @@ -/** - * \file tabularcreatedlgimpl.C - * Copyright 2001 LyX Team - * see the file COPYING - * - * \author John Levon, moz@compsoc.man.ac.uk - * \author Edwin Leuven, leuven@fee.uva.nl - */ - -#include "tabularcreatedlg.h" - -#include -#include -#include - -#include "tabularcreatedlgimpl.h" -#include "FormTabularCreate.h" -#include "support/lstrings.h" - -#include "qpushbutton.h" -#include "qspinbox.h" -#include "emptytable.h" -#include "qpainter.h" -#include "qtableview.h" -#include "qtooltip.h" - -TabularCreateDlgImpl::TabularCreateDlgImpl(FormTabularCreate* form, QWidget* parent, const char* name, bool modal, WFlags fl ) - : InsertTabularDlg( parent, name, modal, fl ), form_(form) -{ - setCaption(name); - table->setMinimumSize(100,100); - rows->setValue(5); - columns->setValue(5); - QToolTip::add(table, _("Drag with left mouse button to resize")); -} - -TabularCreateDlgImpl::~TabularCreateDlgImpl() -{ - // no need to delete child widgets, Qt does it all for us -} - -void TabularCreateDlgImpl::insert_tabular() -{ - form_->apply((rows->text()).toInt(), (columns->text()).toInt()); - form_->close(); - hide(); -} - -void TabularCreateDlgImpl::cancel_adaptor() -{ - form_->close(); - hide(); -} - -void TabularCreateDlgImpl::colsChanged(int nr_cols) -{ - if (nr_cols != (columns->text()).toInt()) - columns->setValue(nr_cols); -} - -void TabularCreateDlgImpl::rowsChanged(int nr_rows) -{ - if (nr_rows != (rows->text()).toInt()) - rows->setValue(nr_rows); -} diff --git a/src/frontends/qt2/tabularcreatedlgimpl.h b/src/frontends/qt2/tabularcreatedlgimpl.h deleted file mode 100644 index 73526db1ed..0000000000 --- a/src/frontends/qt2/tabularcreatedlgimpl.h +++ /dev/null @@ -1,34 +0,0 @@ -/** - * \file tabularcreatedlgimpl.h - * Copyright 2001 LyX Team - * see the file COPYING - * - * \author John Levon, moz@compsoc.man.ac.uk - * \author Edwin Leuven, leuven@fee.uva.nl - */ - -#ifndef TABULARCREATEDLGIMPL_H -#define TABULARCREATEDLGIMPL_H -#include "tabularcreatedlg.h" - -class FormTabularCreate; - -class TabularCreateDlgImpl : public InsertTabularDlg -{ - Q_OBJECT - -public: - TabularCreateDlgImpl(FormTabularCreate *form, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); - ~TabularCreateDlgImpl(); - -protected slots: - void insert_tabular(); - void cancel_adaptor(); - virtual void colsChanged(int); - virtual void rowsChanged(int); - -private: - FormTabularCreate * form_; -}; - -#endif // TABULARCREATEDLGIMPL_H diff --git a/src/frontends/qt2/ui/.cvsignore b/src/frontends/qt2/ui/.cvsignore new file mode 100644 index 0000000000..3791089855 --- /dev/null +++ b/src/frontends/qt2/ui/.cvsignore @@ -0,0 +1,10 @@ +Makefile.in +Makefile +*.deps +*.lo +.libs +libqt2ui.la +moc_*.C +*_moc.C +*.C +*.h diff --git a/src/frontends/qt2/ui/Makefile.am b/src/frontends/qt2/ui/Makefile.am new file mode 100644 index 0000000000..b0c410899f --- /dev/null +++ b/src/frontends/qt2/ui/Makefile.am @@ -0,0 +1,25 @@ +AUTOMAKE_OPTIONS = foreign 1.4 +DISTCLEANFILES= *.orig *.rej *~ *.bak core +MAINTAINERCLEANFILES = $(srcdir)/Makefile.in +noinst_LTLIBRARIES = libqt2ui.la +BOOST_INCLUDES = -I$(top_srcdir)/boost +INCLUDES = -I${top_srcdir}/src/ -I${top_srcdir}/src/frontends/ \ + ${SIGC_CFLAGS} ${FRONTEND_INCLUDES} $(BOOST_INCLUDES) \ + -I$(top_srcdir)/src/frontends/controllers +DEFINES += -DQT_CLEAN_NAMESPACE +ETAGS_ARGS = --lang=c++ +SUBDIRS=. moc + +include ../Makefile.dialogs + +DISTCLEANFILES = $(UIDIALOGS) *.orig *.rej *~ *.bak core + +libqt2ui_la_DEPENDENCIES = moc/libqt2uimoc.la +libqt2ui_la_OBJADD = moc/libqt2uimoc.la + +libqt2ui_la_SOURCES = $(UIDIALOGS) + +%Base.h: %.ui + $(UIC) $< -o $@ +%Base.C: %Base.h %.ui + $(UIC) -impl $^ -o $@ diff --git a/src/frontends/qt2/FormCopyrightDialog.ui b/src/frontends/qt2/ui/QAboutDialog.ui similarity index 92% rename from src/frontends/qt2/FormCopyrightDialog.ui rename to src/frontends/qt2/ui/QAboutDialog.ui index a66e57e6ff..5c33605f2d 100644 --- a/src/frontends/qt2/FormCopyrightDialog.ui +++ b/src/frontends/qt2/ui/QAboutDialog.ui @@ -1,23 +1,23 @@ -FormCopyrightDialog +QAboutDialogBase QDialog name - FormCopyrightDialog + AboutDialog geometry 0 0 - 468 + 464 454 caption - Copyright and Warranty + About LyX @@ -48,7 +48,7 @@ text - KLyX is Copyright (C) 1995 by Matthias Ettrich, + LyX is Copyright (C) 1995 by Matthias Ettrich, 1995-2001 by LyX Team @@ -68,8 +68,8 @@ sizePolicy - 1 - 1 + 5 + 5 @@ -133,7 +133,7 @@ text - KLyX is distributed in the hope that it will be + LyX is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A @@ -161,6 +161,10 @@ if not, write to the Free Software Foundation, Inc., name closePB + + text + &Close + sizePolicy @@ -168,10 +172,6 @@ if not, write to the Free Software Foundation, Inc., 0 - - text - &Close - default true @@ -183,7 +183,7 @@ if not, write to the Free Software Foundation, Inc., closePB clicked() - FormCopyrightDialog + AboutDialog reject() diff --git a/src/frontends/qt2/chardlg.ui b/src/frontends/qt2/ui/QCharacterDialog.ui similarity index 98% rename from src/frontends/qt2/chardlg.ui rename to src/frontends/qt2/ui/QCharacterDialog.ui index 3c9eea2c7e..ab6c127193 100644 --- a/src/frontends/qt2/chardlg.ui +++ b/src/frontends/qt2/ui/QCharacterDialog.ui @@ -1,18 +1,18 @@ -CharDlg +QCharacterDialogBase QDialog name - CharDlg + QCharacterDialogBase geometry 0 0 - 341 - 249 + 412 + 291 @@ -248,6 +248,10 @@ name charGB + + title + Character + sizePolicy @@ -255,10 +259,6 @@ 5 - - title - Character - layoutMargin @@ -669,19 +669,19 @@ cancelPB clicked() - CharDlg + QCharacterDialogBase cancel_adaptor() okPB clicked() - CharDlg + QCharacterDialogBase close_adaptor() applyPB clicked() - CharDlg + QCharacterDialogBase apply_adaptor() apply_adaptor() diff --git a/src/frontends/qt2/FormCitationDialog.ui b/src/frontends/qt2/ui/QCitationDialog.ui similarity index 79% rename from src/frontends/qt2/FormCitationDialog.ui rename to src/frontends/qt2/ui/QCitationDialog.ui index 07a925aaf3..deef689c91 100644 --- a/src/frontends/qt2/FormCitationDialog.ui +++ b/src/frontends/qt2/ui/QCitationDialog.ui @@ -1,18 +1,18 @@ -FormCitationDialog +QCitationDialogBase QDialog name - FormCitationDialog + QCitationDialogBase geometry 0 0 - 369 - 525 + 487 + 585 @@ -64,6 +64,10 @@ name addPB + + text + + sizePolicy @@ -71,10 +75,6 @@ 0 - - text - - pixmap image0 @@ -86,6 +86,10 @@ name delPB + + text + + sizePolicy @@ -93,10 +97,6 @@ 0 - - text - - pixmap image1 @@ -108,6 +108,10 @@ name upPB + + text + + sizePolicy @@ -115,10 +119,6 @@ 0 - - text - - pixmap image2 @@ -130,6 +130,10 @@ name downPB + + text + + sizePolicy @@ -137,10 +141,6 @@ 0 - - text - - pixmap image3 @@ -655,92 +655,92 @@ image0 - 789cad95c76e24371086ef7a8a81ea2618b54d363bc1d88372d64a1bb56bf8d04c8aa3388a86dfddd45f9c3eac6478163038d2e013ff228b95f46e6174b8bf3b5a7837773be927276ee48efb9bd182bf1b8f9ffef8f3fd5f73f35a8fd2471566a4e77f9b9b3f988cdc68eff222bc00df26a0a22c8aa27c61da19d880b706aea13fc9ac8b16fb4f99cba2c3fe24b3297a700f36c9be827e25b3291cf62f325785c7fe7666abe00f3b70359cff2db353f08736320725fe5c648e4af48be05a2925e7bbcc5ae1fd7499b95411fc98b9d20af6bb996b8de0f157709358e2739fb9d772ff4366ab713fdd815be535ee6702bbd255b0672d6c0b077bfe9159b9067c30b0bc673573e5103f12f629808837f9ccba92fdabcc5525ef7bce5cd7057833b3ab25bf9db02de53e1a8383f1b5dcdf0857ba96f8ad678e8d052f0bd75d8b7cf397ccbe95f3a43e42d37772df4de6d089ff92afd0aa4ef21532b7bdc4fb3ab3ed111f5acaec84b91d58f27124dca58861bf14b6dac97de7e058bb56e25f674e27607f4db8295ae917233cd89fbdb02a9ab2937aa984fbca4abc8fc1aa319dd48f1276d64b3cd04f4a4fede934b3c9e77d07979db1922f16b6c14b7fa09f94712af33eb872da4bbc223885cb497e106fd55993ebad0007df798937ea536baf3cf48c7ad6a5f55efcc77cd0668887057795aaa5be512fda4ef3cda837edaaae91f8239ea51afcfd084e022ff93b049baa6fa43e96857d29fef1077095e227fea1ffca66ca847956b64107f117fd5cfade3bb9ffb3f0b4df08f3c914a10c122fbcc7986082e8913fd34eeb81517f26d8d6c9fb31af2a9ff221fd8c7aad55133bf1ef13d824ffc47ff4671d7b6de53ce42765bbcbf5b997d959793fe647d375e94630eaa3717dca0818f3abf1c379e8c7267a1764fea23fda7278ffb9b08d5e784b38bd1ff5ca98076d1b4c44bd31e66bdb0d8c79d27a9f2cc098ffcec5228a7fe8371f6219e5fde88f18a38b51fef9ccbefe3f3d13f7b3eb93dab29b559fd49ec3acfaa48e7cc4c77c328b3ea94ff98ccf79cc17ffad4feacba4bee26bbee1db44d3f5a63efdfd0eea7b7ee0c7f4fd94e82cfd7ee6c5d7faa45e827a99577895d7789d377893b7789b7778f7677d52efa5575ef107dee783b456f9237fc2facc5ff8eb2bfd373ee4effc830b56acd32ad9e45571fdfafc64b1c80db7dcbd5810a71fa29e2cecdfd41f4cc891a74031a9141dd1319dd0299dd1398de9e2ed78d2255dd135ddd02d4de88eeeb11ee8919efe2d5fe98e675aa4255aa695d9ea2159acd21aadcf560fb0d8485e6dceae477489b666d7a73bb669e757f46faf5fd6fffdfbdc3f05fcbfcc + 789cadd4c96edb301006e0bb9f42086f413191a895287ac8be3b71f6a4e88112a57889b33a7116f4dd4bcd8c18a0755119a8193bf8cc9f22458ebcb4e85d1cee7b8b4b9da7899e0c0aafe8eb476fd13c8fc76fdf7f7cfbe82c48e9d9bf34f5e4c297ce426fe2155ef7eeb6ac01da42f8f84217ce197acc8ec862c4ce02ca1fb00b76e64ce3a7e4c0676fb1238979c1f3059954e81c9d05051904392c625c3c04e4c88f355ab123b2308d13cc8b21bb2043ea4ce3cfc8b14f1603b64973f43539515988f92edb64d4df27a7015bb3958a307fcf36aac0fe929c0564906ca5312f2ab621c3b933e523b23239f51f917359c4e81d67835e6627eca476e0a701af2f66c7ec1e59c57cfd53b28e731a7f41ce4b43f3bd930bc93e616b83f52500fd397fc8d6ec63b2e13c6cd6967eb39ff04476f35d928de43cd68b54cdf9c10b5ba5745e37e4e6bce0b07618b8fe15b25bff2e3b613fb29bf5bd91ddfc13b4d225efff3eb9d97f21c8a52c13ecbfaa1d05ce3e3b61633d45daadf78eecf66ba376acdd7e603d25b2a92fd823bbf5e2f390681df0f9617da5a1527cbedbeca69e1ed0b935e50764377e956cca92aeff5a3b0bddfd8fc86e7deb647bbf94bf45e7a6b9ff35729954e4e7da85a96455a1f1f933a5333ecf15bee8c7ac7dfb7f7910a0dbe76d3a87a26ddea60d946df3365dc135f4dbe56d7a004318c10d8cff9de7f42ddcc13d68aba68d67e5edf70f987e842798d8ffcf5643fbf902d33ff336fd8ae93778876558815558b36d1d366013b67ecfdbf4b6bdcbfadaefb063db32ecc21eb67de8cec81fc021f4e0088ee104f39fed7456de8e98c2199cdbfe7ac4857d5fc215f8a899791c118084d0a64e208218127c772185ec2ffb390505d26ea0105ae4a2a0065bcdd9cd38afa930a21495b86e735ecdaa445f0ce6a8b70c9418b6cfe3eece55ffbd8918cd979fdde6cefffcdaf90529306585 image1 - 789c959459531a411485dff91594f366a5ae3d5bf74ca5f2e0be44c10db7541e8659141557543495ff9edbe736132068923950c5479f7b397da78785f9e6c9ee4e737ea1f138c806bdbc995f640fcdf9e2a9df7ffdf6fdcb8fc65c1034f9a5753398fbd498db1b34f366ebf6a6b440e70c9ec205f62cfba5ca5406d6e0aae623cb81aa3973dc555df005b85495aac05dcb61e4f305beb31c9741160857969354ab58fc4370ae4a25f93a96d35c452edf8be5ac5281c266e8d67257456514810fc189d24afaa7605b2febcfc23a8c257f1b5c04dad7e0185cfa912ffe75cbb91f56a1ac3f09ebd4e51d80439d69f9bd081c457924ecd72c791fc1b12e740c6e81751c44e8ef61feb9318529b0fe004e8dd209780d9cc57c81cf1c5771080e84799e293871ecbbfd1a701e17b1ec6fd571e9faed804b1db8fa125c7559e015cb85d23a96fb1d0a1b63e4fedc80fd3aff3238d0a99bcf1238e2fdcb3cb71d97da8095b0c98cece7181c334bbe03b031a196f3f1159c30cbeff585139348bf45706a022d79f7c119e7953c5be06ecd6fe09ce72dfe0d70c1f539f8c4716e247f2e9c7413f1bf0aa72a91f95d3b0e13a9dfb55caabafe4a38d509e6eb9170c1c2fa1e38309591fbb7090e99a5ff25d8a4452af3b907a76995cafe0bcb5552b2c0a7e0a26203b807c6257f0effae693f79944dea233f7529a7624c255574fe9e9f2ed8dda34bd6155db3fa7443b774375ef1dbefdcf7f4c07aa4013db19ee98586e315233f92f4e895de588bb444cbb442abb446eb9315e2e75d4aef0d568f36698bbed236edf0e716b5c72b9c3fe3bd5dd22ef7ee417bb44f07ee738b0ea933e53f82ff98936c3ad709bf4ff97dc689fef4dbfe57a438f716f7eed53a237fa6dff6bf66ff32e7de476fab80b3b43ef0873c93ed3ab755c4ee78865fb3ff86e76e30139b3b71156d4a67e5f788fdcfdc6d94bbc5bd471533f2781edff9175eb3153e76d966f5d86bdd53f3e78a73fe66880a518c24ed49f7c4f919551c4ea833fbfc8c557426347cef7cd615d37af7fcbb8a297dfc3cfeeff3fb57ffcfcf8d5fe8202a15 + 789c75d25b6fda301407f0773e45046f68a2498843a2690f40c325e5d6945693a63d247602e65eee61da779f8f8fbd02dd0e28ca8fbf8f6d9c3c948defa3be517e28ecf6f19e53834ee3ad516687e532fff1f3dbaf42d1b60df125a66115bf148a15831a83f52a85fb89b82f99b28025a0e599e2038c81b6a93995f44d8a4c8055cb322dd9bb0192d8f66cc933d04bf4e00ce95a24060e803e351d5cf7048ca9dec61a98380e75e486fb924c0f1e232d07d70d91b6e211a9170a80945469554e1521f5cc5d24319107a4eb63ef5ed3b5813b45867c43d6582d013e4a3242884c9b8a0cd941ea5d6d9135cb954c91499a306003c8884b70705d516de3a2a8b6d143eaa95e1449ad0a1c2afac895a2da732e99eadeb6a2ea1d2932e412e9114f922afa9e9c6a81f42de4133075756feb2f653a47fa0407cf1499ef005f91cc6604f82e99ea9401b32c8d53f9023f23b338cb805c314356fe591f492956759f2494c94ab3c96d32a57c369b2f16cbd57a33b94e44f0beddeef687c3f174c6089384f2459ee7977aa3f918a8482625d191e7bcd5ce2f1dde0d319249cc664f39e722ea896bb73fb84e86794bfc38e2cfbc19dc24f3e1a50d11e7cde836590ceb797b24824eb77b97bc342e3dd91305e3aba4c456db6647acd11151d8bfee795d1d0358a31bc9e82a795b9fc280475110865cb47cfc9fca64733e85a2c6613f54813e3788fa58839b7393d100eb7c7bd610e9ba7b3e22d2f5e969ffff3df894fcfe5af8036ac14b55 image2 - 789cc595494f24471085effc8a167143564c65d69ab27c60df06066665c6f2a17283665f9aad2dff7767bfc86e812c0f7db14cc1e1a35f6444bc88ac7eb734383ad81b2cbd5bb81bf5a3a11bb893fe76b0e4ef2f2e9e7fffe3b73f1716b51ea45f559403bdf8cbc2e2e168e006fb57976102c409a8288ba228c16733aec0a7336ec07d665d74e0ddcc6561c09b99aba2070fc1557a1cd866ae0b3f613699ad92fc04aea7e7719fd929e4e7bdcc4149fe9dcc5189de831ba5949c3fccac15fae5ebcca58a88dfc85c6b05decadc689845dbe036b1f87193b9d7927f9cd96ae9ff04dc29af25bff4e34a57239ee57c670b8778bec8ac5c0bde9cb1f4f33173ede01fbf07fb6420fce5abccba96cf1f32d735fae3d5cc4d5380bbccae113f47c2b6947cb40e0e956f24bff4136add887f6de6d85a7023dc98ae46fc6a66df497c2ddcf646f215998391fa657f42a78cf8759fb9ebc5af95ccb6177fbe6476992f672c7e56c22639062e85ad76b28fcfe0d8b84ee6b796399d00fd57e1b6e8e47e04e1593cea53455b1ad99727e1beb6b24fc760d55606fbc3636167bdf88bfd537a167f97b91266892f4d65655e9f846df0b81f8c7d55955399d18faa9df6e2d73238d9e5643eb81fcad82aef9be40bde78f84d71c25a7be5457f082eadf7b2fff05f57533ff81bd8d4aa9179fd00dbe9bc09f9b5ab4d2bfeeb09976a5a2fe17e9649e0657e0e5cd57d2bfbf124ec4ba98f6fc175f24feac37e96ed8c3f83bba083f8adc0bef74ef6f151787adf08f7a52a4219c42fdcefaa0a55907abf83bbd93e1c8083ed9cec03ee57edd33c24fe68c28d6aa3413d847d6caa549fd4bf0f8ebdb6721ef62d4ddbe4fdb4999d95fef1be6d8d4919c1a8bf757d9a0818ef9fd64fcf23f8d746ef82dc27ec6b574efbe70fc2367af163249cfa977d85bf5d17aa887d23bc8f3a33653e077b9f22f039d8b95844a90ffbe3432ca3cc03df1f314617a37cd9ccfffc5f7a26eee7d727b565c77e3e7d52078e7ccc273c7c5b9fd4a77cc6e77cc1977cc5d73fd727f50dd4b77cc723bee787d7395eeb93fa11ea277ee6718a58e6155e7d19f1529fd46b50aff3066ff2568ad8e61ddee5f7bcf74f7d52efa72e3ff0011ff247e83fa588cffc85bfa6aafad7faa4fec647fc9d7f70c18a758a2893bae29a1b6eb94b9f9b977a629afcf46489f99c1c790a14e9984e6898fedbd3299dfd9b9f744e177499f457744d3773f87f46b7133d6fd3dd9cfa11f477743f8f3ed5f3408ff4c4637aa6f11cfa655aa1555a4bcf3a6dbca5a74df6b445dbe96f8b7668f72dfdcf9fff5cffd7af0b7f0351a5bebb + 789cc5d4c96edb301006e0bb9f42086f413191686d44d143f67ddf53f4409192b7388be3c4498abe7ba99911112768e34b5133877ce63f143779613eb838d80de6175a0f633dee99c074f52898b78fc3e1cbf71fdf7eb6e6a40cdc5f960572ee4b6bee701c9860eff6a6ac01a18308f1838ebc73b464c7ec2b761e515eb30d7bc59bf2961c85643160c712f3a260e752613e43e791610b72db243879b821c761a2d16376cc7e699c52fe926dc8a2ef4df92e3909d9176c9b15e87372aaf236d677d836a7fe5d7216b1cfd84ac5e823b65506bd4cce23f6035b69caefb02d7be84df953b2b205f55f930b6912f4c8dba237d92959e079456116f1fc5276c2ee905542e38b8aac9382c6db2217a5a5e73d918d644fd8dad2fd5a42fbe7c3335bb3efc996f3a2575b867e3f37c8fe7909d94a1e7f0fad9af3135db6caf0bce090eccfcbd46e47beff84ece71fb353f61dbb59cf23d93fff18ad7449fb2f4ab2dfff6d7229cb14fbf13ec751635864a7ec03b4f6f35d2737fb25f07d4ab4df8ffddaa96cee9700b29fef2a5aeb88cfefb576d6568aef4fc16eee13ee7f563853fe96ecebdb645b96343eae376f37eb873572333f61c86ebd94c7f73f2f6cb37e452ed38a9cd736b6925585c6fb674b6f7c7f2bfcd08fd9eced7fe541809e3defd20518b0b3e55dba840a3ad0fd58f131efd23de8c300ae610837ef2bdee75dfa16d377700f237880f174c574dea71fe10926aee2d955bcbcad789b77e9571efbc98d3d72158bb004cb6e562b1ff32ebdea56b906ebb0019b98df7215dbb003bb6e567a3aefd27bb00f07700847700c2758318153388373b8804bd77f35950f21c226dd7f036843ecf209a490b96feaef4308ffb89f3928013012426851ccb0ff7dcabbd5a6b3e585c1fcfd8ce3e7c28a525430119d59f2a22b7a2e59b7be187c9a9760c5801aac40f459feefed9fe77f7d6dfd06af616644 image3 - 789ca5d3496f22311005e03bbfa295dcd068d2edde359a0359c8beef19cdc12e97034908244dc8a6f9efd3f50c8144dcd2e2d09f9e8d9f29b1d40c2e0e7683e652a31aea619702eae8c7a0699f7abdd73f7f7fbf3716940aea4f9a07d1c28fc6c2cf8082bdfe3dcb3bd7ef8b611c86612c1c819a9455c23e684c415678fc41ec3d19d3782e8214539a082b4f135221bc1a5391168663a644c233d02659160ab73c4b674ae1a6a77116fdf7414e6c86b4e599e725aeb03d6651a2c6f398bacc84a79e656190be09a330e7125fb503aa8c0b94bcf5cc9312e70ec0829ccd85bb609925053aef813a0b73dc2802a9ee8c5616b445a2b1f81174145bd4d8102a658cbfe03d18536253e11148f550b0f8521847f55ea443d05a63318535611ae98230410d26ba24d458053f86b20e5aca2cee7b21ccd82ac6de5761aec8315a2d83b1d1165778f024667005cc26e993e7646fcfd3469e4a581436655ce106e409dbc232b19a51b203e69356d7a0b6b95fdc15ead43a36c27390d839cce84568981387568742526c1cf61e8075e6709011d6150b87839c904397380c9484f5d2d4e1bf70073a47cee13f35f7f966b2387ee624da10d5139f93b8eb4ef7e6765e72d7bbef0fe6270f8fd5707ef234aa86cf9f135feae575540dde18cf24e1d6f2caea5a7b7da3dadcdaded9dddbff48eae8c01db68f8eabea6430383de39973b8757e71d9bfaaaad1d007d3067534eacf0433dd240aa7c16ceb3a8aa6c1a7df9a5b6a1a7c9e02b7a6c197f9f034f8ee4cbf26ff7e35fe03191b46e7 + 789ca5d2cb6ee2301480e13d4f11c10e8da6101293a89a45e9fd02a59745a5aa0bc7760ab4909424b4a1eabbd7e71c9b409559d562914fbf8d4dcc5edb79180f9df65e23cb793e158e98f0a5d396c57c5e3e3efdfb6c345dd7d11f2f70bacd3f8de65f4738a364a1e059e9e7560707b0850c7ac27781d744cf63c80b43c138b024f6fdd003ae0c43e288188611f2c45046129811235720ef0c193131e4c46343257d6041142ef114d8ed301944c017a23dd587a10c05f01c19b06e1f279f19fa410f288981cf71ed3dd1eebb24da7d5343538f806e27e2c4055130e21019dab5b7c05ed7324786924bbc140ef45dce05d60324b7efea90a8bf1927df001997ae62c035b0dfb3c778230a45754eb49367c020928c3801869ead0343ae70a367a4b093a740ee4945758cd4fbc458df8191548c780514bee2c44b62ecc6313002ca4d8d81b092aa00c61bbe2271e09fb976fcb2b4cca8293c1242ffae9a123f4fa6b397baf23a5f24697d795b66f97f4a91e5abdd42877ad725fd50386c51e57a7dc0078747d9f1c9eaf4ecfc625374ba8caf06c324cb92341d5dabad7d5439beb9d5212b720ad509742a92adb07536487755d83eb54ef755d879d7aa9c5561f7165459851ff7a3aaf0db3bfd59bef61bdf12452a24 addPB clicked() - FormCitationDialog + QCitationDialogBase slotAddClicked() delPB clicked() - FormCitationDialog + QCitationDialogBase slotDelClicked() downPB clicked() - FormCitationDialog + QCitationDialogBase slotDownClicked() restorePB clicked() - FormCitationDialog + QCitationDialogBase slotRestoreClicked() previousPB clicked() - FormCitationDialog + QCitationDialogBase slotPreviousClicked() nextPB clicked() - FormCitationDialog + QCitationDialogBase slotNextClicked() citationStyleCO activated(int) - FormCitationDialog + QCitationDialogBase slotCitationStyleSelected(int) textBeforeED returnPressed() - FormCitationDialog + QCitationDialogBase slotTextBeforeReturn() textAfterED returnPressed() - FormCitationDialog + QCitationDialogBase slotTextAfterReturn() bibLB highlighted(int) - FormCitationDialog + QCitationDialogBase slotBibSelected(int) citeLB highlighted(int) - FormCitationDialog + QCitationDialogBase slotCiteSelected(int) upPB clicked() - FormCitationDialog + QCitationDialogBase slotUpClicked() slotAddClicked() diff --git a/src/frontends/qt2/FormDocumentDialog.ui b/src/frontends/qt2/ui/QDocumentDialog.ui similarity index 94% rename from src/frontends/qt2/FormDocumentDialog.ui rename to src/frontends/qt2/ui/QDocumentDialog.ui index 7c4d4018d4..73c0ea4043 100644 --- a/src/frontends/qt2/FormDocumentDialog.ui +++ b/src/frontends/qt2/ui/QDocumentDialog.ui @@ -1,10 +1,10 @@ -FormDocumentDialog +QDocumentDialogBase QDialog name - FormDocumentDialog + QDocumentDialogBase geometry @@ -2398,10 +2398,6 @@ toggleButton true - - toggleButton - true - QToolButton @@ -2417,10 +2413,6 @@ toggleButton true - - toggleButton - true - QToolButton @@ -2436,10 +2428,6 @@ toggleButton true - - toggleButton - true - QToolButton @@ -2455,10 +2443,6 @@ toggleButton true - - toggleButton - true - @@ -2529,14 +2513,14 @@ name bulletTypeBG - - frameShape - NoFrame - title + + frameShape + NoFrame + radioButtonExclusive false @@ -2549,6 +2533,15 @@ name Spacer26 + + geometry + + 0 + 0 + 20 + 20 + + orientation Horizontal @@ -2580,6 +2573,10 @@ 22 + + text + + sizePolicy @@ -2587,14 +2584,6 @@ 0 - - text - - - - toggleButton - true - toggleButton true @@ -2615,6 +2604,10 @@ 22 + + text + + sizePolicy @@ -2622,14 +2615,6 @@ 0 - - text - - - - toggleButton - true - toggleButton true @@ -2650,6 +2635,10 @@ 22 + + text + + sizePolicy @@ -2657,14 +2646,6 @@ 0 - - text - - - - toggleButton - true - toggleButton true @@ -2685,6 +2666,10 @@ 22 + + text + + sizePolicy @@ -2692,14 +2677,6 @@ 0 - - text - - - - toggleButton - true - toggleButton true @@ -2720,6 +2697,10 @@ 22 + + text + + sizePolicy @@ -2727,14 +2708,6 @@ 0 - - text - - - - toggleButton - true - toggleButton true @@ -2755,6 +2728,10 @@ 22 + + text + + sizePolicy @@ -2762,14 +2739,6 @@ 0 - - text - - - - toggleButton - true - toggleButton true @@ -2790,6 +2759,10 @@ 22 + + text + + sizePolicy @@ -2797,14 +2770,6 @@ 0 - - text - - - - toggleButton - true - toggleButton true @@ -2825,6 +2790,10 @@ 22 + + text + + sizePolicy @@ -2832,14 +2801,6 @@ 0 - - text - - - - toggleButton - true - toggleButton true @@ -2860,6 +2821,10 @@ 22 + + text + + sizePolicy @@ -2867,14 +2832,6 @@ 0 - - text - - - - toggleButton - true - toggleButton true @@ -2895,6 +2852,10 @@ 22 + + text + + sizePolicy @@ -2902,14 +2863,6 @@ 0 - - text - - - - toggleButton - true - toggleButton true @@ -2930,6 +2883,10 @@ 22 + + text + + sizePolicy @@ -2937,14 +2894,6 @@ 0 - - text - - - - toggleButton - true - toggleButton true @@ -2965,6 +2914,10 @@ 22 + + text + + sizePolicy @@ -2972,14 +2925,6 @@ 0 - - text - - - - toggleButton - true - toggleButton true @@ -3000,6 +2945,10 @@ 22 + + text + + sizePolicy @@ -3007,14 +2956,6 @@ 0 - - text - - - - toggleButton - true - toggleButton true @@ -3035,6 +2976,10 @@ 22 + + text + + sizePolicy @@ -3042,14 +2987,6 @@ 0 - - text - - - - toggleButton - true - toggleButton true @@ -3070,6 +3007,10 @@ 22 + + text + + sizePolicy @@ -3077,14 +3018,6 @@ 0 - - text - - - - toggleButton - true - toggleButton true @@ -3105,6 +3038,10 @@ 22 + + text + + sizePolicy @@ -3112,14 +3049,6 @@ 0 - - text - - - - toggleButton - true - toggleButton true @@ -3140,6 +3069,10 @@ 22 + + text + + sizePolicy @@ -3147,14 +3080,6 @@ 0 - - text - - - - toggleButton - true - toggleButton true @@ -3175,6 +3100,10 @@ 22 + + text + + sizePolicy @@ -3182,14 +3111,6 @@ 0 - - text - - - - toggleButton - true - toggleButton true @@ -3210,6 +3131,10 @@ 22 + + text + + sizePolicy @@ -3217,14 +3142,6 @@ 0 - - text - - - - toggleButton - true - toggleButton true @@ -3245,6 +3162,10 @@ 22 + + text + + sizePolicy @@ -3252,14 +3173,6 @@ 0 - - text - - - - toggleButton - true - toggleButton true @@ -3280,6 +3193,10 @@ 22 + + text + + sizePolicy @@ -3287,14 +3204,6 @@ 0 - - text - - - - toggleButton - true - toggleButton true @@ -3315,6 +3224,10 @@ 22 + + text + + sizePolicy @@ -3322,14 +3235,6 @@ 0 - - text - - - - toggleButton - true - toggleButton true @@ -3350,6 +3255,10 @@ 22 + + text + + sizePolicy @@ -3357,14 +3266,6 @@ 0 - - text - - - - toggleButton - true - toggleButton true @@ -3385,6 +3286,10 @@ 22 + + text + + sizePolicy @@ -3392,14 +3297,6 @@ 0 - - text - - - - toggleButton - true - toggleButton true @@ -3420,6 +3317,10 @@ 22 + + text + + sizePolicy @@ -3427,14 +3328,6 @@ 0 - - text - - - - toggleButton - true - toggleButton true @@ -3455,6 +3348,10 @@ 22 + + text + + sizePolicy @@ -3462,14 +3359,6 @@ 0 - - text - - - - toggleButton - true - toggleButton true @@ -3490,6 +3379,10 @@ 22 + + text + + sizePolicy @@ -3497,14 +3390,6 @@ 0 - - text - - - - toggleButton - true - toggleButton true @@ -3525,6 +3410,10 @@ 22 + + text + + sizePolicy @@ -3532,14 +3421,6 @@ 0 - - text - - - - toggleButton - true - toggleButton true @@ -3560,6 +3441,10 @@ 22 + + text + + sizePolicy @@ -3567,14 +3452,6 @@ 0 - - text - - - - toggleButton - true - toggleButton true @@ -3603,10 +3480,6 @@ toggleButton true - - toggleButton - true - QToolButton @@ -3631,10 +3504,6 @@ toggleButton true - - toggleButton - true - QToolButton @@ -3659,10 +3528,6 @@ toggleButton true - - toggleButton - true - QToolButton @@ -3687,10 +3552,6 @@ toggleButton true - - toggleButton - true - QToolButton @@ -3715,10 +3576,6 @@ toggleButton true - - toggleButton - true - QToolButton @@ -3755,6 +3612,10 @@ 22 + + text + + sizePolicy @@ -3762,14 +3623,6 @@ 0 - - text - - - - toggleButton - true - toggleButton true @@ -3790,6 +3643,10 @@ 22 + + text + + sizePolicy @@ -3797,14 +3654,6 @@ 0 - - text - - - - toggleButton - true - toggleButton true @@ -3825,6 +3674,10 @@ 22 + + text + + sizePolicy @@ -3832,14 +3685,6 @@ 0 - - text - - - - toggleButton - true - toggleButton true @@ -3860,6 +3705,10 @@ 22 + + text + + sizePolicy @@ -3867,14 +3716,6 @@ 0 - - text - - - - toggleButton - true - toggleButton true @@ -3895,6 +3736,10 @@ 22 + + text + + sizePolicy @@ -3902,14 +3747,6 @@ 0 - - text - - - - toggleButton - true - toggleButton true @@ -3930,6 +3767,10 @@ 22 + + text + + sizePolicy @@ -3937,14 +3778,6 @@ 0 - - text - - - - toggleButton - true - toggleButton true @@ -3965,6 +3798,10 @@ 22 + + text + + sizePolicy @@ -3972,14 +3809,6 @@ 0 - - text - - - - toggleButton - true - toggleButton true @@ -4472,307 +4301,307 @@ okPB clicked() - FormDocumentDialog + QDocumentDialogBase slotOK() restorePB clicked() - FormDocumentDialog + QDocumentDialogBase slotRestore() paperPackageCO activated(int) - FormDocumentDialog + QDocumentDialogBase slotSpecialPaperPackage(int) orientationBG clicked(int) - FormDocumentDialog + QDocumentDialogBase slotOrientation(int) papersize2CO activated(int) - FormDocumentDialog + QDocumentDialogBase slotPapersize(int) useGeometryCB toggled(bool) - FormDocumentDialog + QDocumentDialogBase slotUseGeometryPackage(bool) customWidthED textChanged(const QString&) - FormDocumentDialog + QDocumentDialogBase slotWidth(const QString&) customHeightED textChanged(const QString&) - FormDocumentDialog + QDocumentDialogBase slotHeight(const QString&) topMarginED textChanged(const QString&) - FormDocumentDialog + QDocumentDialogBase slotMarginTop(const QString&) bottomMarginED textChanged(const QString&) - FormDocumentDialog + QDocumentDialogBase slotMarginBottom(const QString&) leftMarginED textChanged(const QString&) - FormDocumentDialog + QDocumentDialogBase slotMarginLeft(const QString&) rightMarginED textChanged(const QString&) - FormDocumentDialog + QDocumentDialogBase slotMarginRight(const QString&) headHeightED textChanged(const QString&) - FormDocumentDialog + QDocumentDialogBase slotHeadheight(const QString&) headSepED textChanged(const QString&) - FormDocumentDialog + QDocumentDialogBase slotHeadsep(const QString&) footSkipED textChanged(const QString&) - FormDocumentDialog + QDocumentDialogBase slotFootskip(const QString&) docClassCO activated(int) - FormDocumentDialog + QDocumentDialogBase slotClass(int) docPagestyleCO activated(int) - FormDocumentDialog + QDocumentDialogBase slotPageStyle(int) docFontsCO activated(int) - FormDocumentDialog + QDocumentDialogBase slotFont(int) docFontSizeCO activated(int) - FormDocumentDialog + QDocumentDialogBase slotFontSize(int) docExtraED textChanged(const QString&) - FormDocumentDialog + QDocumentDialogBase slotExtraOptions(const QString&) docSkipCO activated(int) - FormDocumentDialog + QDocumentDialogBase slotDefaultSkip(int) docSkipED textChanged(const QString&) - FormDocumentDialog + QDocumentDialogBase slotDefaultSkip(const QString&) docSpacingCO activated(int) - FormDocumentDialog + QDocumentDialogBase slotSpacing(int) docSpacingED textChanged(const QString&) - FormDocumentDialog + QDocumentDialogBase slotSpacing(const QString&) sidesBG clicked(int) - FormDocumentDialog + QDocumentDialogBase slotSides(int) columnsBG clicked(int) - FormDocumentDialog + QDocumentDialogBase slotColumns(int) separationBG clicked(int) - FormDocumentDialog + QDocumentDialogBase slotSeparation(int) languageCO activated(int) - FormDocumentDialog + QDocumentDialogBase slotLanguage(int) inputEncCO activated(int) - FormDocumentDialog + QDocumentDialogBase slotEncoding(int) quotesLanguageCO activated(int) - FormDocumentDialog + QDocumentDialogBase slotQuoteStyle(int) quoteStyleBG clicked(int) - FormDocumentDialog + QDocumentDialogBase slotQuoteStyle(int) floatPlacementED textChanged(const QString&) - FormDocumentDialog + QDocumentDialogBase slotFloatPlacement(const QString&) secNumDepthSB valueChanged(int) - FormDocumentDialog + QDocumentDialogBase slotSectionNumberDepth(int) tocDepthSB valueChanged(int) - FormDocumentDialog + QDocumentDialogBase slotTOCDepth(int) postscriptDriverCO activated(int) - FormDocumentDialog + QDocumentDialogBase slotPSDriver(int) useAmsMathCB toggled(bool) - FormDocumentDialog + QDocumentDialogBase slotAMSMath(bool) applyPB clicked() - FormDocumentDialog + QDocumentDialogBase slotApply() cancelPB clicked() - FormDocumentDialog + QDocumentDialogBase slotClose() latexED textChanged(const QString&) - FormDocumentDialog + QDocumentDialogBase slotBulletLaTeX(const QString&) bulletPanelStandardPB clicked() - FormDocumentDialog + QDocumentDialogBase slotBulletStandard() bulletPanelMathsPB clicked() - FormDocumentDialog + QDocumentDialogBase slotBulletMaths() bulletPanelDing1PB clicked() - FormDocumentDialog + QDocumentDialogBase slotBulletDing1() bulletPanelDing2PB clicked() - FormDocumentDialog + QDocumentDialogBase slotBulletDing2() bulletPanelDing3PB clicked() - FormDocumentDialog + QDocumentDialogBase slotBulletDing3() bulletDing4PB clicked() - FormDocumentDialog + QDocumentDialogBase slotBulletDing4() bulletTypeBG clicked(int) - FormDocumentDialog + QDocumentDialogBase slotBulletSymbol(int) bulletSizeCO activated(int) - FormDocumentDialog + QDocumentDialogBase slotBulletSize(int) bulletDepth1PB clicked() - FormDocumentDialog + QDocumentDialogBase slotBulletDepth1() bulletDepth2PB clicked() - FormDocumentDialog + QDocumentDialogBase slotBulletDepth2() bulletDepth3PB clicked() - FormDocumentDialog + QDocumentDialogBase slotBulletDing3() bulletDepth4PB clicked() - FormDocumentDialog + QDocumentDialogBase slotBulletDepth4() slotAMSMath(bool) diff --git a/src/frontends/qt2/FormIndexDialogBase.ui b/src/frontends/qt2/ui/QIndexDialog.ui similarity index 96% rename from src/frontends/qt2/FormIndexDialogBase.ui rename to src/frontends/qt2/ui/QIndexDialog.ui index 408cd1e008..e26fa3dc00 100644 --- a/src/frontends/qt2/FormIndexDialogBase.ui +++ b/src/frontends/qt2/ui/QIndexDialog.ui @@ -1,17 +1,17 @@ -FormIndexDialogBase +QIndexDialogBase QDialog name - FormIndexDialogBase + QIndexDialogBase geometry 0 0 - 216 + 212 82 @@ -145,13 +145,13 @@ okPB clicked() - FormIndexDialogBase + QIndexDialogBase apply_adaptor() cancelPB clicked() - FormIndexDialogBase + QIndexDialogBase close_adaptor() apply_adaptor() diff --git a/src/frontends/qt2/paragraphdlg.ui b/src/frontends/qt2/ui/QParagraphDialog.ui similarity index 99% rename from src/frontends/qt2/paragraphdlg.ui rename to src/frontends/qt2/ui/QParagraphDialog.ui index 6de2b8596b..f6500fff29 100644 --- a/src/frontends/qt2/paragraphdlg.ui +++ b/src/frontends/qt2/ui/QParagraphDialog.ui @@ -1,17 +1,17 @@ -ParagraphDlg +QParagraphDialogBase QDialog name - ParagraphDlg + QParagraphDialogBase geometry 0 0 - 559 + 567 387 @@ -1667,7 +1667,7 @@ enabled - true + false @@ -1682,7 +1682,7 @@ enabled - true + false @@ -1885,49 +1885,49 @@ defaultsPB clicked() - ParagraphDlg + QParagraphDialogBase restore_adaptor() applyPB clicked() - ParagraphDlg + QParagraphDialogBase apply_adaptor() cancelPB clicked() - ParagraphDlg + QParagraphDialogBase cancel_adaptor() okPB clicked() - ParagraphDlg + QParagraphDialogBase ok_adaptor() spacingAbove activated(int) - ParagraphDlg + QParagraphDialogBase enable_spacingAbove(int) spacingBelow activated(int) - ParagraphDlg + QParagraphDialogBase enable_spacingBelow(int) extraType activated(int) - ParagraphDlg + QParagraphDialogBase enable_minipageOptions(int) extraType activated(int) - ParagraphDlg + QParagraphDialogBase enable_extraOptions(int) apply_adaptor() diff --git a/src/frontends/qt2/printdlg.ui b/src/frontends/qt2/ui/QPrintDialog.ui similarity index 98% rename from src/frontends/qt2/printdlg.ui rename to src/frontends/qt2/ui/QPrintDialog.ui index b68743bd62..5646bcc829 100644 --- a/src/frontends/qt2/printdlg.ui +++ b/src/frontends/qt2/ui/QPrintDialog.ui @@ -1,17 +1,17 @@ -PrintDlg +QPrintDialogBase QDialog name - PrintDlg + QPrintDialogBase geometry 0 0 - 363 + 359 342 @@ -406,25 +406,25 @@ printPB clicked() - PrintDlg + QPrintDialogBase print() cancelPB clicked() - PrintDlg + QPrintDialogBase cancel_adaptor() copies valueChanged(int) - PrintDlg + QPrintDialogBase set_collate(int) browsePB clicked() - PrintDlg + QPrintDialogBase browse_file() diff --git a/src/frontends/qt2/FormRefDialogBase.ui b/src/frontends/qt2/ui/QRefDialog.ui similarity index 97% rename from src/frontends/qt2/FormRefDialogBase.ui rename to src/frontends/qt2/ui/QRefDialog.ui index f1fb2f2479..353c17c6af 100644 --- a/src/frontends/qt2/FormRefDialogBase.ui +++ b/src/frontends/qt2/ui/QRefDialog.ui @@ -1,17 +1,17 @@ -FormReferenceDialogBase +QRefDialogBase QDialog name - FormReferenceDialogBase + QRefDialogBase geometry 0 0 - 421 + 417 277 @@ -456,43 +456,43 @@ refsLB highlighted(const QString&) - FormReferenceDialogBase + QRefDialogBase highlight_adaptor(const QString&) refsLB selected(const QString&) - FormReferenceDialogBase + QRefDialogBase select_adaptor(const QString&) sortCB toggled(bool) - FormReferenceDialogBase + QRefDialogBase sort_adaptor(bool) updatePB clicked() - FormReferenceDialogBase + QRefDialogBase update_adaptor() okPB clicked() - FormReferenceDialogBase + QRefDialogBase apply_adaptor() cancelPB clicked() - FormReferenceDialogBase + QRefDialogBase close_adaptor() gotoPB clicked() - FormReferenceDialogBase + QRefDialogBase goto_adaptor() apply_adaptor() diff --git a/src/frontends/qt2/searchdlg.ui b/src/frontends/qt2/ui/QSearchDialog.ui similarity index 96% rename from src/frontends/qt2/searchdlg.ui rename to src/frontends/qt2/ui/QSearchDialog.ui index 37f43a6b11..58b9c499f9 100644 --- a/src/frontends/qt2/searchdlg.ui +++ b/src/frontends/qt2/ui/QSearchDialog.ui @@ -1,18 +1,18 @@ -SearchDlg +QSearchDialogBase config.h QDialog name - SearchDlg + QSearchDialogBase geometry 0 0 - 388 + 384 168 @@ -251,25 +251,25 @@ findPB clicked() - SearchDlg + QSearchDialogBase Find() replacePB clicked() - SearchDlg + QSearchDialogBase Replace() replaceAllPB clicked() - SearchDlg + QSearchDialogBase ReplaceAll() cancelPB clicked() - SearchDlg + QSearchDialogBase cancel_adaptor() Find() diff --git a/src/frontends/qt2/tabularcreatedlg.ui b/src/frontends/qt2/ui/QTabularCreateDialog.ui similarity index 97% rename from src/frontends/qt2/tabularcreatedlg.ui rename to src/frontends/qt2/ui/QTabularCreateDialog.ui index f9a02e4f30..50d4d9eb74 100644 --- a/src/frontends/qt2/tabularcreatedlg.ui +++ b/src/frontends/qt2/ui/QTabularCreateDialog.ui @@ -1,10 +1,10 @@ -InsertTabularDlg +QTabularCreateDialogBase QDialog name - InsertTabularDlg + QTabularCreateDialogBase geometry @@ -194,7 +194,7 @@ EmptyTable -
emptytable.h
+
../emptytable.h
-1 -1 @@ -245,13 +245,13 @@ insertPB clicked() - InsertTabularDlg + QTabularCreateDialogBase insert_tabular() cancelPB clicked() - InsertTabularDlg + QTabularCreateDialogBase cancel_adaptor() insert_tabular() diff --git a/src/frontends/qt2/FormTocDialogBase.ui b/src/frontends/qt2/ui/QTocDialog.ui similarity index 92% rename from src/frontends/qt2/FormTocDialogBase.ui rename to src/frontends/qt2/ui/QTocDialog.ui index 24dd5628f3..98249dec22 100644 --- a/src/frontends/qt2/FormTocDialogBase.ui +++ b/src/frontends/qt2/ui/QTocDialog.ui @@ -1,17 +1,17 @@ -FormTocDialogBase +QTocDialogBase QDialog name - FormTocDialogBase + QTocDialogBase geometry 0 0 - 358 + 369 313 @@ -103,13 +103,6 @@ 20
- - sizeHint - - 20 - 20 - - QLabel @@ -191,31 +184,31 @@ tocLV selectionChanged(QListViewItem*) - FormTocDialogBase + QTocDialogBase select_adaptor(QListViewItem*) typeCO activated(int) - FormTocDialogBase + QTocDialogBase activate_adaptor(int) updatePB clicked() - FormTocDialogBase + QTocDialogBase update_adaptor() closePB clicked() - FormTocDialogBase + QTocDialogBase close_adaptor() depthSL valueChanged(int) - FormTocDialogBase + QTocDialogBase depth_adaptor(int) activate_adaptor(int) diff --git a/src/frontends/qt2/FormUrlDialogBase.ui b/src/frontends/qt2/ui/QURLDialog.ui similarity index 97% rename from src/frontends/qt2/FormUrlDialogBase.ui rename to src/frontends/qt2/ui/QURLDialog.ui index ccbae13fb6..6d7cb119ed 100644 --- a/src/frontends/qt2/FormUrlDialogBase.ui +++ b/src/frontends/qt2/ui/QURLDialog.ui @@ -1,10 +1,10 @@ -FormUrlDialogBase +QURLDialogBase QDialog name - FormUrlDialogBase + QURLDialogBase geometry @@ -12,7 +12,7 @@ 0 0 325 - 112 + 113 @@ -186,13 +186,13 @@ okPB clicked() - FormUrlDialogBase + QURLDialogBase apply_adaptor() cancelPB clicked() - FormUrlDialogBase + QURLDialogBase close_adaptor() apply_adaptor() diff --git a/src/frontends/qt2/ui/moc/.cvsignore b/src/frontends/qt2/ui/moc/.cvsignore new file mode 100644 index 0000000000..5baf140a2b --- /dev/null +++ b/src/frontends/qt2/ui/moc/.cvsignore @@ -0,0 +1,10 @@ +Makefile.in +Makefile +*.deps +*.lo +.libs +libqt2uimoc.la +moc_*.C +*_moc.C +*.C +*.h diff --git a/src/frontends/qt2/ui/moc/Makefile.am b/src/frontends/qt2/ui/moc/Makefile.am new file mode 100644 index 0000000000..e57788cfe6 --- /dev/null +++ b/src/frontends/qt2/ui/moc/Makefile.am @@ -0,0 +1,23 @@ +AUTOMAKE_OPTIONS = foreign 1.4 +MAINTAINERCLEANFILES = $(srcdir)/Makefile.in +noinst_LTLIBRARIES = libqt2uimoc.la +BOOST_INCLUDES = -I$(top_srcdir)/boost +INCLUDES = -I${top_srcdir}/src/ \ + -I${top_srcdir}/src/frontends/ \ + -I${top_srcdir}/src/frontends/controllers \ + ${SIGC_CFLAGS} \ + ${FRONTEND_INCLUDES} \ + $(BOOST_INCLUDES) + +include ../../Makefile.dialogs + +libqt2uimoc_la_SOURCES := $(UIMOCDIALOGS) + #$(patsubst, %, %Dialog_moc.C, $(DIALOGS)) + +DISTCLEANFILES = $(libqt2uimoc_la_SOURCES) *.orig *.rej *~ *.bak core + +ETAGS_ARGS = --lang=c++ + +%_moc.C: ../%.h + $(MOC) -o $@ $< + -- 2.39.2