From 0062cd3408121cbc81f1edc80f4accc457c37116 Mon Sep 17 00:00:00 2001 From: Alfredo Braunstein Date: Thu, 22 May 2003 15:42:50 +0000 Subject: [PATCH] move the title_ string to the base class Dialog::View git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7003 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/controllers/ChangeLog | 7 +++++- src/frontends/controllers/Dialog.C | 12 ++++++++++ src/frontends/controllers/Dialog.h | 9 +++++++- src/frontends/controllers/ViewBase.C | 16 ++++++++++++-- src/frontends/controllers/ViewBase.h | 11 ++++++++- src/frontends/qt2/ChangeLog | 32 +++++++++++++++++++++++++++ src/frontends/qt2/QAbout.C | 2 +- src/frontends/qt2/QBibitem.C | 2 +- src/frontends/qt2/QBibtex.C | 2 +- src/frontends/qt2/QChanges.C | 2 +- src/frontends/qt2/QCharacter.C | 2 +- src/frontends/qt2/QCitation.C | 2 +- src/frontends/qt2/QDialogView.C | 8 ++++--- src/frontends/qt2/QDialogView.h | 7 +----- src/frontends/qt2/QERT.C | 2 +- src/frontends/qt2/QError.C | 2 +- src/frontends/qt2/QErrorList.C | 2 +- src/frontends/qt2/QExternal.C | 2 +- src/frontends/qt2/QFloat.C | 2 +- src/frontends/qt2/QGraphics.C | 2 +- src/frontends/qt2/QInclude.C | 2 +- src/frontends/qt2/QLog.C | 6 ++--- src/frontends/qt2/QMinipage.C | 2 +- src/frontends/qt2/QParagraph.C | 2 +- src/frontends/qt2/QRef.C | 2 +- src/frontends/qt2/QShowFile.C | 2 +- src/frontends/qt2/QTabular.C | 2 +- src/frontends/qt2/QTabularCreate.C | 2 +- src/frontends/qt2/QThesaurus.C | 2 +- src/frontends/qt2/QToc.C | 4 ++-- src/frontends/qt2/QURL.C | 2 +- src/frontends/qt2/QVCLog.C | 11 +++++---- src/frontends/qt2/QWrap.C | 2 +- src/frontends/qt2/Qt2Base.C | 8 ++++--- src/frontends/qt2/Qt2Base.h | 6 +---- src/frontends/xforms/ChangeLog | 8 +++++++ src/frontends/xforms/FormBase.C | 8 +++---- src/frontends/xforms/FormBase.h | 2 -- src/frontends/xforms/FormDialogView.C | 8 +++---- src/frontends/xforms/FormDialogView.h | 2 -- src/frontends/xforms/FormErrorList.C | 2 +- src/frontends/xforms/FormLog.C | 2 +- src/frontends/xforms/FormShowFile.C | 2 +- 43 files changed, 145 insertions(+), 70 deletions(-) diff --git a/src/frontends/controllers/ChangeLog b/src/frontends/controllers/ChangeLog index bbf08e3cd6..94e167e1cc 100644 --- a/src/frontends/controllers/ChangeLog +++ b/src/frontends/controllers/ChangeLog @@ -1,6 +1,11 @@ +2003-05-21 Alfredo Braunstein + + * ViewBase.h: + * Dialog.h (setTitle): added + 2003-05-20 Alfredo Braunstein - ControlErrorList.[Ch]: small bugs fixed, use ErrorList + * ControlErrorList.[Ch]: small bugs fixed, use ErrorList 2003-05-13 André Pönitz diff --git a/src/frontends/controllers/Dialog.C b/src/frontends/controllers/Dialog.C index 708c3c0862..3873dbe208 100644 --- a/src/frontends/controllers/Dialog.C +++ b/src/frontends/controllers/Dialog.C @@ -162,6 +162,18 @@ Dialog::View & Dialog::view() const } +void Dialog::View::setTitle(string const & newtitle) +{ + title_ = newtitle; +} + + +string const & Dialog::View::getTitle() const +{ + return title_; +} + + void Dialog::setController(Controller * i) { lyx::Assert(i && !controller_ptr_.get()); diff --git a/src/frontends/controllers/Dialog.h b/src/frontends/controllers/Dialog.h index 88e6719d0e..53e1b5ad74 100644 --- a/src/frontends/controllers/Dialog.h +++ b/src/frontends/controllers/Dialog.h @@ -179,7 +179,7 @@ private: */ class Dialog::View : boost::noncopyable { public: - View(Dialog & parent) : p_(parent) {} + View(Dialog & parent, string title) : p_(parent), title_(title) {} virtual ~View() {} //@{ @@ -225,6 +225,11 @@ public: Dialog & dialog() { return p_; } Dialog const & dialog() const { return p_; } + /// sets the title of the dialog (window caption) + void setTitle(string const &); + /// gets the title of the dialog (window caption) + string const & getTitle() const; + protected: Kernel & kernel() { return p_.kernel(); } Kernel const & kernel() const { return p_.kernel(); } @@ -239,6 +244,8 @@ protected: private: /// Dialog & p_; + /// + string title_; }; diff --git a/src/frontends/controllers/ViewBase.C b/src/frontends/controllers/ViewBase.C index a4cfa84b0c..d4745470a1 100644 --- a/src/frontends/controllers/ViewBase.C +++ b/src/frontends/controllers/ViewBase.C @@ -15,8 +15,8 @@ #include "support/LAssert.h" -ViewBase::ViewBase() - : controller_ptr_(0) +ViewBase::ViewBase(string const & t) + : controller_ptr_(0), title_(t) {} @@ -26,6 +26,18 @@ void ViewBase::setController(ControlButtons & c) } +void ViewBase::setTitle(string const & newtitle) +{ + title_ = newtitle; +} + + +string const & ViewBase::getTitle() const +{ + return title_; +} + + ControlButtons & ViewBase::getController() { lyx::Assert(controller_ptr_); diff --git a/src/frontends/controllers/ViewBase.h b/src/frontends/controllers/ViewBase.h index dd5994e556..50781ae6ba 100644 --- a/src/frontends/controllers/ViewBase.h +++ b/src/frontends/controllers/ViewBase.h @@ -20,7 +20,7 @@ class ButtonController; class ViewBase : boost::noncopyable { public: /// - ViewBase(); + ViewBase(string const &); /// virtual ~ViewBase() {} @@ -56,9 +56,18 @@ public: ControlButtons const & getController() const; /// ButtonController & bc(); + /// sets the title of the dialog (window caption) + void setTitle(string const &); + /// gets the title of the dialog + string const & getTitle() const; + protected: /// We don't own this. ControlButtons * controller_ptr_; + +private: + string title_; + }; #endif // VIEWBASE_H diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index 5d66d55370..d8045e09ae 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,3 +1,35 @@ +2003-05-21 Alfredo Braunstein + + * Qt2Base.[Ch]: + * QDialogView.[Ch] (setTitle): added + * QAbout.C: + * QBibitem.C: + * QBibtex.C: + * QChanges.C: + * QCharacter.C: + * QCitation.C: + * QERT.C: + * QError.C: + * QErrorList.C: + * QErrorListDialog.C: + * QExternal.C: + * QFloat.C: + * QGraphics.C: + * QInclude.C: + * QLog.C: + * QMinipage.C: + * QParagraph.C: + * QRef.C: + * QShowFile.C: + * QTabular.C: + * QTabularCreate.C: + * QThesaurus.C: + * QToc.C: + * QURL.C: + * QVCLog.C: + * QWrap.C: the argument to Dialog::View ctor is now a string. use + setTitle instead of setCaption when appropriate + 2003-05-22 Jean-Marc Lasgouttes * QErrorListDialog.C: remove include for diff --git a/src/frontends/qt2/QAbout.C b/src/frontends/qt2/QAbout.C index a336c620ad..0bf9ab2b8d 100644 --- a/src/frontends/qt2/QAbout.C +++ b/src/frontends/qt2/QAbout.C @@ -33,7 +33,7 @@ typedef QController > base_class; QAbout::QAbout(Dialog & parent) - : base_class(parent, qt_("About LyX")) + : base_class(parent, _("About LyX")) { } diff --git a/src/frontends/qt2/QBibitem.C b/src/frontends/qt2/QBibitem.C index 6cbf93ccb6..a49091811d 100644 --- a/src/frontends/qt2/QBibitem.C +++ b/src/frontends/qt2/QBibitem.C @@ -28,7 +28,7 @@ typedef QController > base_class; QBibitem::QBibitem(Dialog & parent) - : base_class(parent, qt_("LyX: Bibliography Item Settings")) + : base_class(parent, _("LyX: Bibliography Item Settings")) { } diff --git a/src/frontends/qt2/QBibtex.C b/src/frontends/qt2/QBibtex.C index 185eb4aeeb..c5fa14bb11 100644 --- a/src/frontends/qt2/QBibtex.C +++ b/src/frontends/qt2/QBibtex.C @@ -38,7 +38,7 @@ typedef QController > base_class; QBibtex::QBibtex(Dialog & parent) - : base_class(parent, qt_("BibTeX")) + : base_class(parent, _("BibTeX")) { } diff --git a/src/frontends/qt2/QChanges.C b/src/frontends/qt2/QChanges.C index 98e2e3f4a6..d1f18cbd0d 100644 --- a/src/frontends/qt2/QChanges.C +++ b/src/frontends/qt2/QChanges.C @@ -24,7 +24,7 @@ typedef QController > base_class; QChanges::QChanges(Dialog & parent) - : base_class(parent, qt_("LyX: Merge Changes")) + : base_class(parent, _("LyX: Merge Changes")) { } diff --git a/src/frontends/qt2/QCharacter.C b/src/frontends/qt2/QCharacter.C index 8632e984a9..0151c248a6 100644 --- a/src/frontends/qt2/QCharacter.C +++ b/src/frontends/qt2/QCharacter.C @@ -33,7 +33,7 @@ typedef QController > base_class; QCharacter::QCharacter(Dialog & parent) - : base_class(parent, qt_("LyX: Change Text Style")) + : base_class(parent, _("LyX: Change Text Style")) { } diff --git a/src/frontends/qt2/QCitation.C b/src/frontends/qt2/QCitation.C index ae19e33cea..5f1aadf060 100644 --- a/src/frontends/qt2/QCitation.C +++ b/src/frontends/qt2/QCitation.C @@ -43,7 +43,7 @@ typedef QController > base_class; QCitation::QCitation(Dialog & parent) - : base_class(parent, qt_("LyX: Citation Reference")) + : base_class(parent, _("LyX: Citation Reference")) {} diff --git a/src/frontends/qt2/QDialogView.C b/src/frontends/qt2/QDialogView.C index cbb3e117b2..ab50ead138 100644 --- a/src/frontends/qt2/QDialogView.C +++ b/src/frontends/qt2/QDialogView.C @@ -15,6 +15,7 @@ #include #include "debug.h" +#include "qt_helpers.h" #include "QtLyXView.h" #include "QDialogView.h" #include "Qt2BC.h" @@ -22,8 +23,8 @@ #include "support/LAssert.h" -QDialogView::QDialogView(Dialog & parent, QString const & t) - : Dialog::View(parent), updating_(false), title_(t) +QDialogView::QDialogView(Dialog & parent, string const & t) + : Dialog::View(parent,t), updating_(false) {} @@ -55,10 +56,11 @@ void QDialogView::show() update(); // make sure its up-to-date + form()->setCaption(toqstr(getTitle())); + if (form()->isVisible()) { form()->raise(); } else { - form()->setCaption(title_); form()->show(); } } diff --git a/src/frontends/qt2/QDialogView.h b/src/frontends/qt2/QDialogView.h index c2ab533e46..103078b895 100644 --- a/src/frontends/qt2/QDialogView.h +++ b/src/frontends/qt2/QDialogView.h @@ -29,12 +29,11 @@ class QDialogView : public QObject, public Dialog::View { Q_OBJECT public: /// - QDialogView(Dialog &, QString const &); + QDialogView(Dialog &, string const &); /// virtual ~QDialogView() {} /// bool readOnly() const; - protected: /// build the actual dialog virtual void build_dialog() = 0; @@ -78,10 +77,6 @@ protected slots: private: /// Pointer to the actual instantiation of the Qt dialog virtual QDialog * form() const = 0; - -private: - /// dialog title, displayed by WM. - QString title_; }; diff --git a/src/frontends/qt2/QERT.C b/src/frontends/qt2/QERT.C index b556a2d407..2356a15578 100644 --- a/src/frontends/qt2/QERT.C +++ b/src/frontends/qt2/QERT.C @@ -25,7 +25,7 @@ typedef QController > base_class; QERT::QERT(Dialog & parent) - : base_class(parent, qt_("LyX: TeX Code Settings")) + : base_class(parent, _("LyX: TeX Code Settings")) { } diff --git a/src/frontends/qt2/QError.C b/src/frontends/qt2/QError.C index 09e9b65d4d..12a2dac3e0 100644 --- a/src/frontends/qt2/QError.C +++ b/src/frontends/qt2/QError.C @@ -25,7 +25,7 @@ typedef QController > base_class; QError::QError(Dialog & parent) - : base_class(parent, qt_("LyX: LaTeX Error")) + : base_class(parent, _("LyX: LaTeX Error")) { } diff --git a/src/frontends/qt2/QErrorList.C b/src/frontends/qt2/QErrorList.C index 76c7a09ced..41864abba6 100644 --- a/src/frontends/qt2/QErrorList.C +++ b/src/frontends/qt2/QErrorList.C @@ -48,7 +48,7 @@ void QErrorList::select(int item) void QErrorList::update_contents() { - dialog_->setCaption(toqstr(controller().name())); + setTitle(controller().name()); dialog_->errorsLB->clear(); dialog_->descriptionTB->setText(QString()); diff --git a/src/frontends/qt2/QExternal.C b/src/frontends/qt2/QExternal.C index 9923290032..e998ebaf14 100644 --- a/src/frontends/qt2/QExternal.C +++ b/src/frontends/qt2/QExternal.C @@ -29,7 +29,7 @@ typedef QController > base_class; QExternal::QExternal(Dialog & parent) - : base_class(parent, qt_("LyX: External Material")) + : base_class(parent, _("LyX: External Material")) { } diff --git a/src/frontends/qt2/QFloat.C b/src/frontends/qt2/QFloat.C index af279acf5c..c60f3df3da 100644 --- a/src/frontends/qt2/QFloat.C +++ b/src/frontends/qt2/QFloat.C @@ -27,7 +27,7 @@ typedef QController > base_class; QFloat::QFloat(Dialog & parent) - : base_class(parent, qt_("LyX: Float Settings")) + : base_class(parent, _("LyX: Float Settings")) { } diff --git a/src/frontends/qt2/QGraphics.C b/src/frontends/qt2/QGraphics.C index a82da94863..b33169037e 100644 --- a/src/frontends/qt2/QGraphics.C +++ b/src/frontends/qt2/QGraphics.C @@ -47,7 +47,7 @@ typedef QController > base_class; QGraphics::QGraphics(Dialog & parent) - : base_class(parent, qt_("LyX: Graphics")) + : base_class(parent, _("LyX: Graphics")) { } diff --git a/src/frontends/qt2/QInclude.C b/src/frontends/qt2/QInclude.C index caf5e2ffff..450f3d46d2 100644 --- a/src/frontends/qt2/QInclude.C +++ b/src/frontends/qt2/QInclude.C @@ -29,7 +29,7 @@ typedef QController > base_class; QInclude::QInclude(Dialog & parent) - : base_class(parent, qt_("LyX: Child Document")) + : base_class(parent, _("LyX: Child Document")) {} diff --git a/src/frontends/qt2/QLog.C b/src/frontends/qt2/QLog.C index 9ea5a027f5..a3189cf84a 100644 --- a/src/frontends/qt2/QLog.C +++ b/src/frontends/qt2/QLog.C @@ -31,7 +31,7 @@ using std::getline; typedef QController > base_class; QLog::QLog(Dialog & parent) - : base_class(parent, qt_("LyX: LaTeX Log")) + : base_class(parent, _("LyX: LaTeX Log")) { } @@ -50,9 +50,9 @@ void QLog::update_contents() controller().logfile(); if (logfile.first == Buffer::buildlog) - dialog_->setCaption(qt_("Build log")); + setTitle(_("Build log")); else - dialog_->setCaption(qt_("LaTeX log")); + setTitle(_("LaTeX log")); dialog_->logTV->setText(""); diff --git a/src/frontends/qt2/QMinipage.C b/src/frontends/qt2/QMinipage.C index b0f1020ad6..08a41c076e 100644 --- a/src/frontends/qt2/QMinipage.C +++ b/src/frontends/qt2/QMinipage.C @@ -30,7 +30,7 @@ typedef QController > base_class; QMinipage::QMinipage(Dialog & parent) - : base_class(parent, qt_("LyX: Minipage Settings")) + : base_class(parent, _("LyX: Minipage Settings")) { } diff --git a/src/frontends/qt2/QParagraph.C b/src/frontends/qt2/QParagraph.C index 4484f4750c..74cce8bc11 100644 --- a/src/frontends/qt2/QParagraph.C +++ b/src/frontends/qt2/QParagraph.C @@ -43,7 +43,7 @@ typedef QController > base_class; QParagraph::QParagraph(Dialog & parent) - : base_class(parent, qt_("LyX: Paragraph Settings")) + : base_class(parent, _("LyX: Paragraph Settings")) {} diff --git a/src/frontends/qt2/QRef.C b/src/frontends/qt2/QRef.C index 553595c7bb..9f3b296826 100644 --- a/src/frontends/qt2/QRef.C +++ b/src/frontends/qt2/QRef.C @@ -39,7 +39,7 @@ typedef QController > base_class; QRef::QRef(Dialog & parent) - : base_class(parent, qt_("LyX: Cross-reference")), + : base_class(parent, _("LyX: Cross-reference")), sort_(false), at_ref_(false) { } diff --git a/src/frontends/qt2/QShowFile.C b/src/frontends/qt2/QShowFile.C index a79e0525d0..b68386c679 100644 --- a/src/frontends/qt2/QShowFile.C +++ b/src/frontends/qt2/QShowFile.C @@ -25,7 +25,7 @@ typedef QController > base_class; QShowFile::QShowFile(Dialog & parent) - : base_class(parent, qt_("LyX: Show File")) + : base_class(parent, _("LyX: Show File")) { } diff --git a/src/frontends/qt2/QTabular.C b/src/frontends/qt2/QTabular.C index 85bc870654..bbf8d31627 100644 --- a/src/frontends/qt2/QTabular.C +++ b/src/frontends/qt2/QTabular.C @@ -34,7 +34,7 @@ typedef QController > base_class; QTabular::QTabular(Dialog & parent) - : base_class(parent, qt_("LyX: Table Settings")) + : base_class(parent, _("LyX: Table Settings")) { } diff --git a/src/frontends/qt2/QTabularCreate.C b/src/frontends/qt2/QTabularCreate.C index 866dfddb8e..84d6c6dac5 100644 --- a/src/frontends/qt2/QTabularCreate.C +++ b/src/frontends/qt2/QTabularCreate.C @@ -25,7 +25,7 @@ typedef QController > base_cla QTabularCreate::QTabularCreate(Dialog & parent) - : base_class(parent, qt_("LyX: Insert Table")) + : base_class(parent, _("LyX: Insert Table")) { } diff --git a/src/frontends/qt2/QThesaurus.C b/src/frontends/qt2/QThesaurus.C index 81453baea0..e440ba640b 100644 --- a/src/frontends/qt2/QThesaurus.C +++ b/src/frontends/qt2/QThesaurus.C @@ -25,7 +25,7 @@ typedef QController > base_class; QThesaurus::QThesaurus(Dialog & parent) - : base_class(parent, qt_("LyX: Thesaurus")) + : base_class(parent, _("LyX: Thesaurus")) { } diff --git a/src/frontends/qt2/QToc.C b/src/frontends/qt2/QToc.C index d0fc232b48..64eeba91f9 100644 --- a/src/frontends/qt2/QToc.C +++ b/src/frontends/qt2/QToc.C @@ -36,7 +36,7 @@ using std::vector; typedef QController > base_class; QToc::QToc(Dialog & parent) - : base_class(parent, qt_("LyX: Table of Contents")), depth_(1) + : base_class(parent, _("LyX: Table of Contents")), depth_(1) {} @@ -61,7 +61,7 @@ void QToc::updateType() dialog_->typeCO->insertItem(toqstr(*it)); if (*it == type) { dialog_->typeCO->setCurrentItem(it - choice.begin()); - dialog_->setCaption(toqstr(type)); + setTitle(type); } } } diff --git a/src/frontends/qt2/QURL.C b/src/frontends/qt2/QURL.C index daba1de69e..5f83af9b6a 100644 --- a/src/frontends/qt2/QURL.C +++ b/src/frontends/qt2/QURL.C @@ -26,7 +26,7 @@ typedef QController > base_class; QURL::QURL(Dialog & parent) - : base_class(parent, qt_("LyX: URL")) + : base_class(parent, _("LyX: URL")) { } diff --git a/src/frontends/qt2/QVCLog.C b/src/frontends/qt2/QVCLog.C index 50507e3dae..5769148bb8 100644 --- a/src/frontends/qt2/QVCLog.C +++ b/src/frontends/qt2/QVCLog.C @@ -13,6 +13,7 @@ #include "Lsstream.h" #include "qt_helpers.h" +#include "support/lstrings.h" #include "LyXView.h" #include "ControlVCLog.h" @@ -29,7 +30,7 @@ typedef QController > base_class; QVCLog::QVCLog(Dialog & parent) - : base_class(parent, qt_("LyX: Version Control Log")) + : base_class(parent, _("LyX: Version Control Log")) { } @@ -44,11 +45,9 @@ void QVCLog::build_dialog() void QVCLog::update_contents() { -#if USE_BOOST_FORMAT - dialog_->setCaption(toqstr(boost::io::str(boost::format(_("Version control log for %1$s")) % controller().getBufferFileName()))); -#else - dialog_->setCaption(toqstr(string(_("Version control log for ")) + controller().getBufferFileName())); -#endif + setTitle(bformat(_("Version control log for %1$s"), + controller().getBufferFileName())); + dialog_->vclogTV->setText(""); ostringstream ss; diff --git a/src/frontends/qt2/QWrap.C b/src/frontends/qt2/QWrap.C index 279ec8dc4a..0780f285c8 100644 --- a/src/frontends/qt2/QWrap.C +++ b/src/frontends/qt2/QWrap.C @@ -33,7 +33,7 @@ typedef QController > base_class; QWrap::QWrap(Dialog & parent) - : base_class(parent, qt_("LyX: Text Wrap Settings")) + : base_class(parent, _("LyX: Text Wrap Settings")) { } diff --git a/src/frontends/qt2/Qt2Base.C b/src/frontends/qt2/Qt2Base.C index 25aadf019e..704ac24ba6 100644 --- a/src/frontends/qt2/Qt2Base.C +++ b/src/frontends/qt2/Qt2Base.C @@ -14,6 +14,7 @@ #include #include "debug.h" +#include "qt_helpers.h" #include "QtLyXView.h" #include "Qt2Base.h" #include "Qt2BC.h" @@ -22,8 +23,8 @@ #include "support/LAssert.h" -Qt2Base::Qt2Base(QString const & t) - : ViewBase(), updating_(false), title_(t) +Qt2Base::Qt2Base(string const & t) + : ViewBase(t), updating_(false) {} @@ -50,10 +51,11 @@ void Qt2Base::show() update(); // make sure its up-to-date + form()->setCaption(toqstr(getTitle())); + if (form()->isVisible()) { form()->raise(); } else { - form()->setCaption(title_); form()->show(); } } diff --git a/src/frontends/qt2/Qt2Base.h b/src/frontends/qt2/Qt2Base.h index e9f573b155..2c88f595c7 100644 --- a/src/frontends/qt2/Qt2Base.h +++ b/src/frontends/qt2/Qt2Base.h @@ -29,7 +29,7 @@ class Qt2Base : public QObject, public ViewBase { Q_OBJECT public: /// - Qt2Base(QString const &); + Qt2Base(string const &); /// virtual ~Qt2Base() {} protected: @@ -73,10 +73,6 @@ protected slots: private: /// Pointer to the actual instantiation of the Qt dialog virtual QDialog * form() const = 0; - -private: - /// dialog title, displayed by WM. - QString title_; }; diff --git a/src/frontends/xforms/ChangeLog b/src/frontends/xforms/ChangeLog index 7b021bd9ec..fe0fef9663 100644 --- a/src/frontends/xforms/ChangeLog +++ b/src/frontends/xforms/ChangeLog @@ -1,3 +1,11 @@ +2003-05-21 Alfredo Braunstein + + * FormBase.[Ch]: + * FormDialogView.[Ch] (setTitle): added + * FormErrorList.C: + * FormLog.C: + * FormShowFile.C: use setTitle + 2003-05-20 Alfredo Braunstein * FormErrorList.[Ch]: small bugs fixed diff --git a/src/frontends/xforms/FormBase.C b/src/frontends/xforms/FormBase.C index 04440a220c..aa75144166 100644 --- a/src/frontends/xforms/FormBase.C +++ b/src/frontends/xforms/FormBase.C @@ -46,10 +46,10 @@ static int C_PrehandlerCB(FL_OBJECT *, int, FL_Coord, FL_Coord, int, void *); FormBase::FormBase(string const & t, bool allowResize) - : ViewBase(), + : ViewBase(t), warning_posted_(false), message_widget_(0), minw_(0), minh_(0), allow_resize_(allowResize), - title_(t), icon_pixmap_(0), icon_mask_(0), + icon_pixmap_(0), icon_mask_(0), tooltips_(new Tooltips()) {} @@ -102,7 +102,7 @@ void FormBase::prepare_to_show() // set the title for the minimized form if (!getController().IconifyWithMain()) - fl_winicontitle(form()->window, title_.c_str()); + fl_winicontitle(form()->window, getTitle().c_str()); // assign an icon to the form string const iconname = LibFileSearch("images", "lyx", "xpm"); @@ -155,7 +155,7 @@ void FormBase::show() if (!allow_resize_) fl_set_form_maxsize(form(), minw_, minh_); - string const maximize_title = "LyX: " + title_; + string const maximize_title = "LyX: " + getTitle(); int const iconify_policy = getController().IconifyWithMain() ? FL_TRANSIENT : 0; diff --git a/src/frontends/xforms/FormBase.h b/src/frontends/xforms/FormBase.h index bf5b9d4a71..bb0d481cad 100644 --- a/src/frontends/xforms/FormBase.h +++ b/src/frontends/xforms/FormBase.h @@ -124,8 +124,6 @@ private: int minh_; /// Can the dialog be resized after it has been created? bool allow_resize_; - /// dialog title, displayed by the window manager. - string title_; /// Passed to the window manager to give a pretty little symbol ;-) Pixmap icon_pixmap_; /// diff --git a/src/frontends/xforms/FormDialogView.C b/src/frontends/xforms/FormDialogView.C index 87b3b533df..78389477f9 100644 --- a/src/frontends/xforms/FormDialogView.C +++ b/src/frontends/xforms/FormDialogView.C @@ -48,10 +48,10 @@ static int C_PrehandlerCB(FL_OBJECT *, int, FL_Coord, FL_Coord, int, void *); FormDialogView::FormDialogView(Dialog & parent, string const & t, bool allowResize) - : Dialog::View(parent), + : Dialog::View(parent, t), warning_posted_(false), message_widget_(0), minw_(0), minh_(0), allow_resize_(allowResize), - title_(t), icon_pixmap_(0), icon_mask_(0), + icon_pixmap_(0), icon_mask_(0), tooltips_(new Tooltips()) {} @@ -104,7 +104,7 @@ void FormDialogView::prepare_to_show() // set the title for the minimized form if (!lyxrc.dialogs_iconify_with_main) - fl_winicontitle(form()->window, title_.c_str()); + fl_winicontitle(form()->window, getTitle().c_str()); // assign an icon to the form string const iconname = LibFileSearch("images", "lyx", "xpm"); @@ -157,7 +157,7 @@ void FormDialogView::show() if (!allow_resize_) fl_set_form_maxsize(form(), minw_, minh_); - string const maximize_title = "LyX: " + title_; + string const maximize_title = "LyX: " + getTitle(); int const iconify_policy = lyxrc.dialogs_iconify_with_main ? FL_TRANSIENT : 0; diff --git a/src/frontends/xforms/FormDialogView.h b/src/frontends/xforms/FormDialogView.h index 7a34894d55..30383241c4 100644 --- a/src/frontends/xforms/FormDialogView.h +++ b/src/frontends/xforms/FormDialogView.h @@ -123,8 +123,6 @@ private: int minh_; /// Can the dialog be resized after it has been created? bool allow_resize_; - /// dialog title, displayed by the window manager. - string title_; /// Passed to the window manager to give a pretty little symbol ;-) Pixmap icon_pixmap_; /// diff --git a/src/frontends/xforms/FormErrorList.C b/src/frontends/xforms/FormErrorList.C index afb0b723b3..dea9ead658 100644 --- a/src/frontends/xforms/FormErrorList.C +++ b/src/frontends/xforms/FormErrorList.C @@ -39,7 +39,7 @@ void FormErrorList::build() void FormErrorList::update() { - fl_set_form_title(dialog_->form, controller().name().c_str()); + setTitle(controller().name()); updateContents(); } diff --git a/src/frontends/xforms/FormLog.C b/src/frontends/xforms/FormLog.C index 04b43386bc..b16c14307b 100644 --- a/src/frontends/xforms/FormLog.C +++ b/src/frontends/xforms/FormLog.C @@ -30,7 +30,7 @@ void FormLog::update() string const title = buildlog ? _("LyX: LaTeX Log") : _("LyX: Literate Programming Build Log"); - fl_set_form_title(dialog_->form, title.c_str()); + setTitle(title); fl_clear_browser(dialog_->browser); int const valid = fl_load_browser(dialog_->browser, diff --git a/src/frontends/xforms/FormShowFile.C b/src/frontends/xforms/FormShowFile.C index cfd1139703..c1b8bb5ad0 100644 --- a/src/frontends/xforms/FormShowFile.C +++ b/src/frontends/xforms/FormShowFile.C @@ -33,7 +33,7 @@ void FormShowFile::update() fl_set_browser_fontstyle(dialog_->browser,FL_FIXED_STYLE); string const title = "LyX: " + controller().getFileName(); - fl_set_form_title(dialog_->form, title.c_str()); + setTitle(title); string const contents = controller().getFileContents(); if (contents.empty())