+2001-08-26 John Levon <moz@compsoc.man.ac.uk>
+
+ * Dialogs.C:
+ * Makefile.am:
+ * Makefile.dialogs:
+ * QBibitem.[Ch]:
+ * QBibitemDialog.[Ch]:
+ * ui/QBibitemDialog.ui: add Bibitem dialog
+
2001-08-26 John Levon <moz@compsoc.man.ac.uk>
* Dialogs.C:
// the dialog definitions
#include "QAboutDialog.h"
+#include "QBibitemDialog.h"
#include "QBibtexDialog.h"
#include "QCitationDialog.h"
#include "QIndexDialog.h"
#include "QURLDialog.h"
#include "QAbout.h"
+#include "QBibitem.h"
#include "QBibtex.h"
#include "QCharacter.h"
#include "QCitation.h"
// the controllers
#include "controllers/ControlAboutlyx.h"
+#include "controllers/ControlBibitem.h"
#include "controllers/ControlBibtex.h"
#include "controllers/ControlCitation.h"
#include "controllers/ControlIndex.h"
#include "controllers/ControlSplash.h"
#include "controllers/ControlUrl.h"
#if 0
-#include "controllers/ControlCopyright.h"
-#include "controllers/ControlCredits.h"
-#include "controllers/ControlBibitem.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"
// dialogs that have been converted to new scheme
add(new GUICitation<QCitation, Qt2BC>(*lv, *this));
add(new GUIAboutlyx<QAbout, Qt2BC>(*lv, *this));
+ add(new GUIBibitem<QBibitem, Qt2BC>(*lv, *this));
add(new GUIBibtex<QBibtex, Qt2BC>(*lv, *this));
add(new GUIIndex<QIndex, Qt2BC>(*lv, *this));
add(new GUIRef<QRef, Qt2BC>(*lv, *this));
../xforms/Color.lo \
../xforms/FloatMenuImpl.lo \
../xforms/FormBaseDeprecated.lo \
- ../xforms/FormBibitem.lo \
- ../xforms/FormBibtex.lo \
../xforms/FormBrowser.lo \
../xforms/FormDocument.lo \
../xforms/FormError.lo \
DIALOGS = \
QAbout \
+ QBibitem \
QBibtex \
QCharacter \
QCitation \
DIALOGSOURCES = \
QAbout.h QAboutDialog.h \
QAbout.C QAboutDialog.C \
+ QBibitem.h QBibitemDialog.h \
+ QBibitem.C QBibitemDialog.C \
QBibtex.h QBibtexDialog.h \
QBibtex.C QBibtexDialog.C \
QCharacter.h QCharacterDialog.h \
MOCDIALOGS = \
QAboutDialog_moc.C \
+ QBibitemDialog_moc.C \
QBibtexDialog_moc.C \
QCharacterDialog_moc.C \
QCitationDialog_moc.C \
UIDIALOGS = \
QAboutDialogBase.h \
QAboutDialogBase.C \
+ QBibitemDialogBase.h \
+ QBibitemDialogBase.C \
QBibtexDialogBase.h \
QBibtexDialogBase.C \
QCharacterDialogBase.h \
UIMOCDIALOGS = \
QAboutDialogBase_moc.C \
+ QBibitemDialogBase_moc.C \
QBibtexDialogBase_moc.C \
QCharacterDialogBase_moc.C \
QCitationDialogBase_moc.C \
--- /dev/null
+/**
+ * \file QBibitem.C
+ * Copyright 2001 the LyX Team
+ * Read the file COPYING
+ *
+ * \author John Levon <moz@compsoc.man.ac.uk>
+ */
+
+#include <config.h>
+
+#include "support/lstrings.h"
+
+#include "QBibitemDialog.h"
+#include "ControlBibitem.h"
+#include "QBibitem.h"
+#include "Qt2BC.h"
+#include "gettext.h"
+#include "debug.h"
+
+#include <qlineedit.h>
+#include <qpushbutton.h>
+
+typedef Qt2CB<ControlBibitem, Qt2DB<QBibitemDialog> > base_class;
+
+QBibitem::QBibitem(ControlBibitem & c)
+ : base_class(c, _("Bibliography Item"))
+{
+}
+
+
+void QBibitem::build_dialog()
+{
+ dialog_.reset(new QBibitemDialog(this));
+
+ bc().setOK(dialog_->okPB);
+ bc().setCancel(dialog_->closePB);
+ bc().addReadOnly(dialog_->keyED);
+ bc().addReadOnly(dialog_->labelED);
+}
+
+
+void QBibitem::update_contents()
+{
+ dialog_->keyED->setText(controller().params().getContents().c_str());
+ dialog_->labelED->setText(controller().params().getOptions().c_str());
+}
+
+
+void QBibitem::apply()
+{
+ controller().params().setContents(dialog_->keyED->text().latin1());
+ controller().params().setOptions(dialog_->labelED->text().latin1());
+}
+
+
+bool QBibitem::isValid()
+{
+ return !string(dialog_->keyED->text().latin1()).empty();
+}
--- /dev/null
+// -*- C++ -*-
+/**
+ * \file QBibitem.h
+ * Copyright 2001 the LyX Team
+ * Read the file COPYING
+ *
+ * \author John Levon <moz@compsoc.man.ac.uk>
+ */
+
+#ifndef QBIBITEM_H
+#define QBIBITEM_H
+
+#include "Qt2Base.h"
+
+class ControlBibitem;
+class QBibitemDialog;
+
+class QBibitem :
+ public Qt2CB<ControlBibitem, Qt2DB<QBibitemDialog> >
+{
+ friend class QBibitemDialog;
+
+public:
+ QBibitem(ControlBibitem &);
+
+protected:
+ virtual bool isValid();
+
+private:
+ /// Apply changes
+ virtual void apply();
+ /// update
+ virtual void update_contents();
+ /// build the dialog
+ virtual void build_dialog();
+};
+
+#endif // QBIBITEM_H
--- /dev/null
+/**
+ * \file QBibitemDialog.C
+ * Copyright 2001 the LyX Team
+ * Read the file COPYING
+ *
+ * \author John Levon <moz@compsoc.man.ac.uk>
+ */
+
+#include <qpushbutton.h>
+#include <qlineedit.h>
+
+#include "QBibitemDialog.h"
+#include "QBibitem.h"
+#include "Dialogs.h"
+#include "ControlBibitem.h"
+
+QBibitemDialog::QBibitemDialog(QBibitem * form)
+ : QBibitemDialogBase(0, 0, false, 0),
+ form_(form)
+{
+ connect(okPB, SIGNAL(clicked()),
+ form, SLOT(slotOK()));
+ connect(closePB, SIGNAL(clicked()),
+ form, SLOT(slotClose()));
+}
+
+
+void QBibitemDialog::change_adaptor()
+{
+ form_->changed();
+}
+
+
+void QBibitemDialog::closeEvent(QCloseEvent *e)
+{
+ form_->slotWMHide();
+ e->accept();
+}
--- /dev/null
+/**
+ * \file QBibitemDialog.h
+ * Copyright 2001 the LyX Team
+ * Read the file COPYING
+ *
+ * \author John Levon <moz@compsoc.man.ac.uk>
+ */
+
+#ifndef QBIBITEMDIALOG_H
+#define QBIBITEMDIALOG_H
+
+#include <config.h>
+
+#include "ui/QBibitemDialogBase.h"
+
+class QBibitem;
+
+class QBibitemDialog : public QBibitemDialogBase
+{ Q_OBJECT
+
+public:
+ QBibitemDialog(QBibitem * form);
+
+protected slots:
+ virtual void change_adaptor();
+
+
+protected:
+ virtual void closeEvent(QCloseEvent * e);
+
+private:
+ QBibitem * form_;
+};
+
+#endif // QBIBITEMDIALOG_H
}
-QBibtexDialog::~QBibtexDialog()
-{
-}
-
-
void QBibtexDialog::change_adaptor()
{
form_->changed();
public:
QBibtexDialog(QBibtex * form);
- ~QBibtexDialog();
protected slots:
virtual void change_adaptor();
--- /dev/null
+<!DOCTYPE UI><UI>
+<class>QBibitemDialogBase</class>
+<widget>
+ <class>QDialog</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>QBibitemDialogBase</cstring>
+ </property>
+ <property stdset="1">
+ <name>geometry</name>
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>197</width>
+ <height>134</height>
+ </rect>
+ </property>
+ <property stdset="1">
+ <name>caption</name>
+ <string>Index</string>
+ </property>
+ <vbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>11</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <widget>
+ <class>QLayoutWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Layout13</cstring>
+ </property>
+ <hbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <widget>
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>keyLA</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>&Key</string>
+ </property>
+ <property>
+ <name>buddy</name>
+ <cstring>keyED</cstring>
+ </property>
+ <property>
+ <name>toolTip</name>
+ <string>The citation key</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QLineEdit</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>keyED</cstring>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ </sizepolicy>
+ </property>
+ <property>
+ <name>toolTip</name>
+ <string>The citation key</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget>
+ <class>QLayoutWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Layout14</cstring>
+ </property>
+ <hbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <widget>
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>labelLA</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>&Label</string>
+ </property>
+ <property>
+ <name>buddy</name>
+ <cstring>labelED</cstring>
+ </property>
+ <property>
+ <name>toolTip</name>
+ <string>The label as it appears in the document</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QLineEdit</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>labelED</cstring>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ </sizepolicy>
+ </property>
+ <property>
+ <name>toolTip</name>
+ <string>The label as it appears in the document</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget>
+ <class>QLayoutWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Layout10</cstring>
+ </property>
+ <hbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <spacer>
+ <property>
+ <name>name</name>
+ <cstring>Spacer1</cstring>
+ </property>
+ <property stdset="1">
+ <name>orientation</name>
+ <enum>Horizontal</enum>
+ </property>
+ <property stdset="1">
+ <name>sizeType</name>
+ <enum>Expanding</enum>
+ </property>
+ <property>
+ <name>sizeHint</name>
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget>
+ <class>QPushButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>okPB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>&OK</string>
+ </property>
+ <property stdset="1">
+ <name>default</name>
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget>
+ <class>QPushButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>closePB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>&Close</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>keyED</sender>
+ <signal>textChanged(const QString&)</signal>
+ <receiver>QBibitemDialogBase</receiver>
+ <slot>change_adaptor()</slot>
+ </connection>
+ <connection>
+ <sender>labelED</sender>
+ <signal>textChanged(const QString&)</signal>
+ <receiver>QBibitemDialogBase</receiver>
+ <slot>change_adaptor()</slot>
+ </connection>
+ <slot access="public">change_adaptor()</slot>
+</connections>
+</UI>