mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-11 03:03:06 +00:00
Minimal fix needed to give Qt a label dialog again.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6350 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
40d00da985
commit
ca067e952a
@ -1,3 +1,10 @@
|
||||
2003-03-05 Angus Leeming <leeming@lyx.org>
|
||||
|
||||
* QIndex.[Ch]: minimal changes needed to use this dialog
|
||||
for both the Index and the Label dialogs.
|
||||
|
||||
* Dialogs3.C: add label dialog.
|
||||
|
||||
2003-03-03 Dekel Tsur <dekelts@tau.ac.il>
|
||||
|
||||
* qfont_loader.C (available): Rewrite as the old version did not
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include "ControlError.h"
|
||||
#include "ControlERT.h"
|
||||
#include "ControlIndex.h"
|
||||
#include "ControlLabel.h"
|
||||
#include "ControlRef.h"
|
||||
#include "ControlToc.h"
|
||||
#include "ControlUrl.h"
|
||||
@ -48,6 +49,7 @@
|
||||
|
||||
#include "Qt2BC.h"
|
||||
#include "ButtonController.h"
|
||||
#include "qt_helpers.h"
|
||||
|
||||
|
||||
typedef ButtonController<OkCancelPolicy, Qt2BC>
|
||||
@ -63,7 +65,7 @@ typedef ButtonController<NoRepeatedApplyReadOnlyPolicy, Qt2BC>
|
||||
namespace {
|
||||
|
||||
char const * const dialognames[] = { "bibitem", "bibtex", "citation",
|
||||
"error", "ert", "index", "ref",
|
||||
"error", "ert", "index", "label", "ref",
|
||||
"toc", "url" };
|
||||
|
||||
char const * const * const end_dialognames =
|
||||
@ -118,7 +120,15 @@ Dialog * Dialogs::build(string const & name)
|
||||
dialog->setButtonController(new NoRepeatedApplyReadOnlyBC);
|
||||
} else if (name == "index") {
|
||||
dialog->setController(new ControlIndex(*dialog));
|
||||
dialog->setView(new QIndex(*dialog));
|
||||
dialog->setView(new QIndex(*dialog,
|
||||
qt_("LyX: Insert Index Entry"),
|
||||
qt_("&Keyword")));
|
||||
dialog->setButtonController(new NoRepeatedApplyReadOnlyBC);
|
||||
} else if (name == "label") {
|
||||
dialog->setController(new ControlLabel(*dialog));
|
||||
dialog->setView(new QIndex(*dialog,
|
||||
qt_("LyX: Insert Label"),
|
||||
qt_("&Label")));
|
||||
dialog->setButtonController(new NoRepeatedApplyReadOnlyBC);
|
||||
} else if (name == "ref") {
|
||||
dialog->setController(new ControlRef(*dialog));
|
||||
|
@ -17,14 +17,15 @@
|
||||
#include "QIndexDialog.h"
|
||||
#include "QIndex.h"
|
||||
#include "Qt2BC.h"
|
||||
#include <qlabel.h>
|
||||
#include <qlineedit.h>
|
||||
#include <qpushbutton.h>
|
||||
|
||||
typedef QController<ControlIndex, QView<QIndexDialog> > base_class;
|
||||
typedef QController<ControlCommand, QView<QIndexDialog> > base_class;
|
||||
|
||||
|
||||
QIndex::QIndex(Dialog & parent)
|
||||
: base_class(parent, qt_("LyX: Insert Index Entry"))
|
||||
QIndex::QIndex(Dialog & parent, QString const & title, QString const & label)
|
||||
: base_class(parent, title), label_(label)
|
||||
{
|
||||
}
|
||||
|
||||
@ -33,6 +34,8 @@ void QIndex::build_dialog()
|
||||
{
|
||||
dialog_.reset(new QIndexDialog(this));
|
||||
|
||||
dialog_->keywordLA->setText(label_);
|
||||
|
||||
bc().setOK(dialog_->okPB);
|
||||
bc().setCancel(dialog_->closePB);
|
||||
bc().addReadOnly(dialog_->keywordED);
|
||||
|
@ -16,17 +16,17 @@
|
||||
|
||||
#include "QDialogView.h"
|
||||
|
||||
class ControlIndex;
|
||||
class ControlCommand;
|
||||
class QIndexDialog;
|
||||
|
||||
|
||||
class QIndex :
|
||||
public QController<ControlIndex, QView<QIndexDialog> >
|
||||
public QController<ControlCommand, QView<QIndexDialog> >
|
||||
{
|
||||
public:
|
||||
friend class QIndexDialog;
|
||||
|
||||
QIndex(Dialog &);
|
||||
QIndex(Dialog &, QString const & title, QString const & label);
|
||||
protected:
|
||||
virtual bool isValid();
|
||||
private:
|
||||
@ -36,6 +36,9 @@ private:
|
||||
virtual void update_contents();
|
||||
/// build the dialog
|
||||
virtual void build_dialog();
|
||||
|
||||
///
|
||||
QString const label_;
|
||||
};
|
||||
|
||||
#endif // QINDEX_H
|
||||
|
Loading…
Reference in New Issue
Block a user