From: Edwin Leuven Date: Tue, 29 Jan 2002 10:05:09 +0000 (+0000) Subject: add showfile dialog to qt2 frontend X-Git-Tag: 1.6.10~19947 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=76ff845d19eaadf86f878f7c757dfd5a7dc89344;p=features.git add showfile dialog to qt2 frontend git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3448 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index e6cea762c9..459c1f6d36 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,3 +1,15 @@ +2002-01-29 Edwin Leuven + + * Makefile.am: + * Dialogs.C: + * Makefile.dialogs: + * QShowFile.h: + * QShowFile.C: + * QShowFileDialog.h: + * QShowFileDialog.C: + * ui/QShowFileDialog.ui: add showfile dialog + * ui/QCitationDialog.ui: minor layout tweaks + 2002-01-25 Angus Leeming * Dialogs.C: removed now redundant #include "QParagraph.h". diff --git a/src/frontends/qt2/Dialogs.C b/src/frontends/qt2/Dialogs.C index 30880a9066..c4a0c7dea9 100644 --- a/src/frontends/qt2/Dialogs.C +++ b/src/frontends/qt2/Dialogs.C @@ -30,6 +30,7 @@ #include "QPrintDialog.h" #include "QRefDialog.h" #include "QSearchDialog.h" +#include "QShowFileDialog.h" #include "QSpellcheckerDialog.h" #include "QTabularCreateDialog.h" #include "QTexinfoDialog.h" @@ -56,6 +57,7 @@ #include "QPrint.h" #include "QRef.h" #include "QSearch.h" +#include "QShowFile.h" #include "QSpellchecker.h" #include "QTabularCreate.h" #include "QTexinfo.h" @@ -71,11 +73,9 @@ #include "Qt2BC.h" // xforms stuff -#include "xforms/FormBrowser.h" -#include "xforms/form_browser.h" -#include "xforms/FormDocument.h" +//#include "xforms/FormDocument.h" #include "xforms/FormMathsPanel.h" -#include "xforms/FormParagraph.h" +//#include "xforms/FormParagraph.h" #include "xforms/FormPreferences.h" #include "xforms/FormShowFile.h" #include "xforms/FormTabular.h" @@ -107,6 +107,7 @@ Dialogs::Dialogs(LyXView * lv) add(new GUIPrint(*lv, *this)); add(new GUIRef(*lv, *this)); add(new GUISearch(*lv, *this)); + add(new GUIShowFile(*lv, *this)); add(new GUISpellchecker(*lv, *this)); add(new GUITabularCreate(*lv, *this)); add(new GUITexinfo(*lv, *this)); @@ -115,13 +116,10 @@ Dialogs::Dialogs(LyXView * lv) add(new GUIUrl(*lv, *this)); add(new GUIVCLog(*lv, *this)); - // dialogs not yet converted - add(new GUIShowFile(*lv, *this)); - // dialogs not yet MVCd - add(new FormDocument(lv, this)); +// add(new FormDocument(lv, this)); add(new FormMathsPanel(lv, this)); - add(new FormParagraph(lv, this)); +// add(new FormParagraph(lv, this)); add(new FormPreferences(lv, this)); add(new FormTabular(lv, this)); diff --git a/src/frontends/qt2/Makefile.am b/src/frontends/qt2/Makefile.am index 6d2572b328..65ab5d7b73 100644 --- a/src/frontends/qt2/Makefile.am +++ b/src/frontends/qt2/Makefile.am @@ -24,7 +24,6 @@ libqt2_la_LIBADD = \ ../xforms/DropDown.lo \ ../xforms/FormBase.lo \ ../xforms/FormBaseDeprecated.lo \ - ../xforms/FormBrowser.lo \ ../xforms/FormMathsBitmap.lo \ ../xforms/FormMathsDeco.lo \ ../xforms/FormMathsDelim.lo \ @@ -32,19 +31,14 @@ libqt2_la_LIBADD = \ ../xforms/FormMathsPanel.lo \ ../xforms/FormMathsStyle.lo \ ../xforms/FormMathsSpace.lo \ - ../xforms/FormParagraph.lo \ ../xforms/FormPreferences.lo \ - ../xforms/FormShowFile.lo \ ../xforms/FormTabular.lo \ - ../xforms/FormDocument.lo \ ../xforms/FormInset.lo \ ../xforms/MathsSymbols.lo \ ../xforms/Menubar_pimpl.lo \ ../xforms/RadioButtonGroup.lo \ ../xforms/Toolbar_pimpl.lo \ ../xforms/bmtable.lo \ - ../xforms/form_browser.lo \ - ../xforms/form_document.lo \ ../xforms/form_preferences.lo \ ../xforms/form_tabular.lo \ ../xforms/form_maths_deco.lo \ @@ -53,7 +47,6 @@ libqt2_la_LIBADD = \ ../xforms/form_maths_panel.lo \ ../xforms/form_maths_space.lo \ ../xforms/form_maths_style.lo \ - ../xforms/form_paragraph.lo \ ../xforms/input_validators.lo \ ../xforms/xformsBC.lo \ ../xforms/xforms_helpers.lo \ diff --git a/src/frontends/qt2/Makefile.dialogs b/src/frontends/qt2/Makefile.dialogs index 468fc246f6..bedd976d50 100644 --- a/src/frontends/qt2/Makefile.dialogs +++ b/src/frontends/qt2/Makefile.dialogs @@ -19,6 +19,7 @@ DIALOGS = \ QPrint \ QRef \ QSearch \ + QShowFile \ QSpellchecker \ QTabularCreate \ QTexinfo \ @@ -64,6 +65,8 @@ DIALOGSOURCES = \ QRef.C QRefDialog.C \ QSearch.h QSearchDialog.h \ QSearch.C QSearchDialog.C \ + QShowFile.h QShowFileDialog.h \ + QShowFile.C QShowFileDialog.C \ QSpellchecker.h QSpellcheckerDialog.h \ QSpellchecker.C QSpellcheckerDialog.C \ QTabularCreate.h QTabularCreateDialog.h \ @@ -98,6 +101,7 @@ MOCDIALOGS = \ QPrintDialog_moc.C \ QRefDialog_moc.C \ QSearchDialog_moc.C \ + QShowFileDialog_moc.C \ QSpellcheckerDialog_moc.C \ QTabularCreateDialog_moc.C \ QTexinfoDialog_moc.C \ @@ -143,6 +147,8 @@ UIDIALOGS = \ QRefDialogBase.C \ QSearchDialogBase.h \ QSearchDialogBase.C \ + QShowFileDialogBase.h \ + QShowFileDialogBase.C \ QSpellcheckerDialogBase.h \ QSpellcheckerDialogBase.C \ QTabularCreateDialogBase.h \ @@ -177,6 +183,7 @@ UIMOCDIALOGS = \ QPrintDialogBase_moc.C \ QRefDialogBase_moc.C \ QSearchDialogBase_moc.C \ + QShowFileDialogBase_moc.C \ QSpellcheckerDialogBase_moc.C \ QTabularCreateDialogBase_moc.C \ QTexinfoDialogBase_moc.C \ diff --git a/src/frontends/qt2/QShowFile.C b/src/frontends/qt2/QShowFile.C new file mode 100644 index 0000000000..fc944dc022 --- /dev/null +++ b/src/frontends/qt2/QShowFile.C @@ -0,0 +1,48 @@ +/** + * \file QShowFile.C + * Copyright 2001 the LyX Team + * Read the file COPYING + * + * \author John Levon + */ + +#include + +#include "QShowFileDialog.h" +#include "ControlShowFile.h" +#include "QShowFile.h" +#include "Qt2BC.h" +#include "gettext.h" + +#include +#include + +typedef Qt2CB > base_class; + +QShowFile::QShowFile(ControlShowFile & c) + : base_class(c, _("ShowFile")) +{ +} + + +void QShowFile::build_dialog() +{ + dialog_.reset(new QShowFileDialog(this)); + + bc().setCancel(dialog_->closePB); +} + + +void QShowFile::update_contents() +{ + dialog_->setName(controller().getFileName().c_str()); + + string contents = controller().getFileContents(); + if (contents.empty()) { + contents = "Error -> Cannot load file!"; + } + + dialog_->text->setText(contents.c_str()); +} + + diff --git a/src/frontends/qt2/QShowFile.h b/src/frontends/qt2/QShowFile.h new file mode 100644 index 0000000000..8838f44cc4 --- /dev/null +++ b/src/frontends/qt2/QShowFile.h @@ -0,0 +1,35 @@ +// -*- C++ -*- +/** + * \file QShowFile.h + * Copyright 2001 the LyX Team + * Read the file COPYING + * + * \author John Levon + */ + +#ifndef QSHOWFILE_H +#define QSHOWFILE_H + +#include "Qt2Base.h" + +class ControlShowFile; +class QShowFileDialog; + +class QShowFile : + public Qt2CB > +{ + friend class QShowFileDialog; + +public: + QShowFile(ControlShowFile &); + +private: + /// Apply changes + virtual void apply() {}; + /// update + virtual void update_contents(); + /// build the dialog + virtual void build_dialog(); +}; + +#endif // QSHOWFILE_H diff --git a/src/frontends/qt2/QShowFileDialog.C b/src/frontends/qt2/QShowFileDialog.C new file mode 100644 index 0000000000..2d64f7b034 --- /dev/null +++ b/src/frontends/qt2/QShowFileDialog.C @@ -0,0 +1,29 @@ +/** + * \file QShowFileDialog.C + * Copyright 2001 the LyX Team + * Read the file COPYING + * + * \author John Levon + */ + +#include "QShowFileDialog.h" +#include "Dialogs.h" +#include "QShowFile.h" + +#include +#include + +QShowFileDialog::QShowFileDialog(QShowFile * form) + : QShowFileDialogBase(0, 0, false, 0), + form_(form) +{ + connect(closePB, SIGNAL(clicked()), + form, SLOT(slotClose())); +} + + +void QShowFileDialog::closeEvent(QCloseEvent * e) +{ + form_->slotWMHide(); + e->accept(); +} diff --git a/src/frontends/qt2/QShowFileDialog.h b/src/frontends/qt2/QShowFileDialog.h new file mode 100644 index 0000000000..517f85d021 --- /dev/null +++ b/src/frontends/qt2/QShowFileDialog.h @@ -0,0 +1,31 @@ +/** + * \file QShowFileDialog.h + * Copyright 2001 the LyX Team + * Read the file COPYING + * + * \author John Levon + */ + +#ifndef QSHOWFILEDIALOG_H +#define QSHOWFILEDIALOG_H + +#include + +#include "ui/QShowFileDialogBase.h" + +class QShowFile; + +class QShowFileDialog : public QShowFileDialogBase +{ Q_OBJECT + +public: + QShowFileDialog(QShowFile * form); + +protected: + virtual void closeEvent(QCloseEvent * e); + +private: + QShowFile * form_; +}; + +#endif // QSHOWFILEDIALOG_H diff --git a/src/frontends/qt2/ui/QCitationDialog.ui b/src/frontends/qt2/ui/QCitationDialog.ui index c51a9a501d..a423d474a5 100644 --- a/src/frontends/qt2/ui/QCitationDialog.ui +++ b/src/frontends/qt2/ui/QCitationDialog.ui @@ -13,15 +13,15 @@ 0 0 - 522 - 365 + 509 + 351 caption Citation - + margin 11 @@ -30,13 +30,154 @@ spacing 6 - + QLayoutWidget name - Layout17 + Layout6 + + margin + 0 + + + spacing + 6 + + + QPushButton + + name + restorePB + + + text + &Restore + + + + + name + Spacer4 + + + orientation + Horizontal + + + sizeType + Expanding + + + sizeHint + + 20 + 20 + + + + + QPushButton + + name + okPB + + + text + OK + + + autoDefault + true + + + default + false + + + + QPushButton + + name + applyPB + + + text + &Apply + + + + QPushButton + + name + closePB + + + text + Cancel + + + + + + QLabel + + name + textAfterLA + + + text + Text after + + + + QLabel + + name + citationStyleLA + + + text + Citation style + + + + QComboBox + + name + citationStyleCO + + + sizePolicy + + 3 + 0 + + + + toolTip + Natbib citation style to use + + + + QLabel + + name + textBeforeLA + + + text + Text before + + + + QLayoutWidget + + name + Layout16 + + margin 0 @@ -49,9 +190,9 @@ QLayoutWidget name - Layout24 + Layout13 - + margin 0 @@ -60,211 +201,79 @@ spacing 6 - - QLayoutWidget - - name - Layout1 - - - - margin - 0 - - - spacing - 6 - - - QPushButton - - name - addPB - - - sizePolicy - - 0 - 0 - - - - text - - - - pixmap - image0 - - - toolTip - Add the selected citation - - - - QPushButton - - name - delPB - - - sizePolicy - - 0 - 0 - - - - text - - - - pixmap - image1 - - - toolTip - Remove the selected citation - - - - QPushButton - - name - upPB - - - sizePolicy - - 0 - 0 - - - - text - - - - pixmap - image2 - - - toolTip - Move the selected citation up - - - - QPushButton - - name - downPB - - - sizePolicy - - 0 - 0 - - - - text - - - - pixmap - image3 - - - toolTip - Move the selected citation down - - - - - + QLabel name - bibliographyKeysLA + infoLA text - Bibliography keys + Info - - QLabel + + QMultiLineEdit name - insetKeysLA - - - text - Inset keys + infoML - - - QListBox - - - text - New Item - - - name - bibLB - - - toolTip - Available citation keys + focusPolicy + NoFocus - - - QListBox - - - text - New Item - - - name - citeLB + wordWrap + WidgetWidth - selectionMode - Single + readOnly + true toolTip - Citations currently selected + Citation entry - + - QLayoutWidget + QGroupBox name - Layout16 + GroupBox4 + + + title + Search margin - 0 + 11 spacing 6 + + QLineEdit + + name + searchED + + + toolTip + Search the available citations + + QLayoutWidget name - Layout13 + Layout37 - + margin 0 @@ -274,212 +283,129 @@ 6 - QLabel + QCheckBox name - infoLA + searchTypeCB text - Info + Regular E&xpression + + + toolTip + Interpret search entry as a regular expression - - QMultiLineEdit - + + name - infoML + Spacer2_2 - focusPolicy - NoFocus + orientation + Horizontal - wordWrap - WidgetWidth + sizeType + Expanding + + sizeHint + + 20 + 20 + + + + + QPushButton - readOnly - true + name + previousPB - - toolTip - Citation entry + + text + &Previous - + - QGroupBox + QLayoutWidget name - GroupBox4 + Layout38 - - title - Search - - + margin - 11 + 0 spacing 6 - QLineEdit + QCheckBox name - searchED + searchCaseCB + + + text + &Case sensitive toolTip - Search the available citations + Make the search case-sensitive - - QLayoutWidget - + + name - Layout37 + Spacer3_2 - - - margin - 0 - - - spacing - 6 - - - QCheckBox - - name - searchTypeCB - - - text - Regular E&xpression - - - toolTip - Interpret search entry as a regular expression - - - - - name - Spacer2_2 - - - orientation - Horizontal - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - QPushButton - - name - previousPB - - - text - &Previous - - - - + + orientation + Horizontal + + + sizeType + Expanding + + + sizeHint + + 20 + 20 + + + - QLayoutWidget + QPushButton name - Layout38 + nextPB + + + text + &Next - - - margin - 0 - - - spacing - 6 - - - QCheckBox - - name - searchCaseCB - - - text - &Case sensitive - - - toolTip - Make the search case-sensitive - - - - - name - Spacer3_2 - - - orientation - Horizontal - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - QPushButton - - name - nextPB - - - text - &Next - - - - + - + - + QLayoutWidget name - Layout18 + Layout24 - + margin 0 @@ -488,11 +414,11 @@ spacing 6 - + QLayoutWidget name - Layout19 + Layout1 @@ -504,186 +430,196 @@ 6 - QLabel + QPushButton name - citationStyleLA + addPB + + + sizePolicy + + 0 + 0 + text - Citation style + + + + pixmap + image0 + + + toolTip + Add the selected citation - QComboBox + QPushButton name - citationStyleCO + delPB sizePolicy - 3 + 0 0 + + text + + + + pixmap + image1 + toolTip - Natbib citation style to use + Remove the selected citation - - - - - name - Spacer16 - - - orientation - Horizontal - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - QLayoutWidget - - name - Layout17 - - - - margin - 0 - - - spacing - 6 - - QCheckBox + QPushButton name - fulllistCB + upPB + + + sizePolicy + + 0 + 0 + text - &Full author list + + + + pixmap + image2 toolTip - List all authors + Move the selected citation up - QCheckBox + QPushButton name - forceuppercaseCB + downPB + + + sizePolicy + + 0 + 0 + text - Force &upper case + + + + pixmap + image3 toolTip - Force upper case in citation + Move the selected citation down - - - - QLayoutWidget - - name - Layout14 - - - - margin - 0 - - - spacing - 6 - - - QLineEdit + + QLabel name - textAfterED + bibliographyKeysLA - sizePolicy - - 7 - 0 - - - - toolTip - Text to place after citation + text + Available - + QLabel name - textAfterLA + insetKeysLA text - Text after + Selected - - QLineEdit + + QListBox + + + text + New Item + + name - textBeforeED - - - sizePolicy - - 7 - 0 - + bibLB toolTip - Text to place before citation + Available citation keys - - QLabel + + QListBox + + + text + New Item + + name - textBeforeLA + citeLB - text - Text before + selectionMode + Single + + + toolTip + Citations currently selected - + + QLineEdit + + name + textAfterED + + + sizePolicy + + 7 + 0 + + + + toolTip + Text to place after citation + + + QLayoutWidget name - Layout6 + Layout15 @@ -694,21 +630,10 @@ spacing 6 - - QPushButton - - name - restorePB - - - text - &Restore - - name - Spacer4 + Spacer8 orientation @@ -727,49 +652,56 @@ - QPushButton + QCheckBox name - okPB + fulllistCB text - OK - - - autoDefault - true + &Full author list - - default - false + + toolTip + List all authors - QPushButton + QCheckBox name - applyPB + forceuppercaseCB text - &Apply - - - - QPushButton - - name - closePB + Force &upper case - - text - Cancel + + toolTip + Force upper case in citation - + + QLineEdit + + name + textBeforeED + + + sizePolicy + + 7 + 0 + + + + toolTip + Text to place before citation + + + diff --git a/src/frontends/qt2/ui/QShowFileDialog.ui b/src/frontends/qt2/ui/QShowFileDialog.ui new file mode 100644 index 0000000000..4036299798 --- /dev/null +++ b/src/frontends/qt2/ui/QShowFileDialog.ui @@ -0,0 +1,102 @@ + +QShowFileDialogBase +config.h +gettext.h + + QDialog + + name + QShowFileDialogBase + + + geometry + + 0 + 0 + 305 + 259 + + + + caption + File: + + + + margin + 11 + + + spacing + 6 + + + QTextView + + name + text + + + toolTip + + + + + QLayoutWidget + + name + Layout3 + + + + margin + 0 + + + spacing + 6 + + + + name + Spacer3 + + + orientation + Horizontal + + + sizeType + Expanding + + + sizeHint + + 20 + 20 + + + + + QPushButton + + name + closePB + + + text + &Close + + + default + true + + + + + + + + change_adaptor() + +