+2003-05-21 Alfredo Braunstein <abraunst@libero.it>
+
+ * ViewBase.h:
+ * Dialog.h (setTitle): added
+
2003-05-20 Alfredo Braunstein <abraunst@libero.it>
- ControlErrorList.[Ch]: small bugs fixed, use ErrorList
+ * ControlErrorList.[Ch]: small bugs fixed, use ErrorList
2003-05-13 André Pönitz <poenitz@gmx.net>
}
+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());
*/
class Dialog::View : boost::noncopyable {
public:
- View(Dialog & parent) : p_(parent) {}
+ View(Dialog & parent, string title) : p_(parent), title_(title) {}
virtual ~View() {}
//@{
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(); }
private:
///
Dialog & p_;
+ ///
+ string title_;
};
#include "support/LAssert.h"
-ViewBase::ViewBase()
- : controller_ptr_(0)
+ViewBase::ViewBase(string const & t)
+ : controller_ptr_(0), title_(t)
{}
}
+void ViewBase::setTitle(string const & newtitle)
+{
+ title_ = newtitle;
+}
+
+
+string const & ViewBase::getTitle() const
+{
+ return title_;
+}
+
+
ControlButtons & ViewBase::getController()
{
lyx::Assert(controller_ptr_);
class ViewBase : boost::noncopyable {
public:
///
- ViewBase();
+ ViewBase(string const &);
///
virtual ~ViewBase() {}
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
+2003-05-21 Alfredo Braunstein <abraunst@libero.it>
+
+ * 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 <lasgouttes@lyx.org>
* QErrorListDialog.C: remove include for <qtextedit.h>
QAbout::QAbout(Dialog & parent)
- : base_class(parent, qt_("About LyX"))
+ : base_class(parent, _("About LyX"))
{
}
QBibitem::QBibitem(Dialog & parent)
- : base_class(parent, qt_("LyX: Bibliography Item Settings"))
+ : base_class(parent, _("LyX: Bibliography Item Settings"))
{
}
QBibtex::QBibtex(Dialog & parent)
- : base_class(parent, qt_("BibTeX"))
+ : base_class(parent, _("BibTeX"))
{
}
QChanges::QChanges(Dialog & parent)
- : base_class(parent, qt_("LyX: Merge Changes"))
+ : base_class(parent, _("LyX: Merge Changes"))
{
}
QCharacter::QCharacter(Dialog & parent)
- : base_class(parent, qt_("LyX: Change Text Style"))
+ : base_class(parent, _("LyX: Change Text Style"))
{
}
QCitation::QCitation(Dialog & parent)
- : base_class(parent, qt_("LyX: Citation Reference"))
+ : base_class(parent, _("LyX: Citation Reference"))
{}
#include <qapplication.h>
#include "debug.h"
+#include "qt_helpers.h"
#include "QtLyXView.h"
#include "QDialogView.h"
#include "Qt2BC.h"
#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)
{}
update(); // make sure its up-to-date
+ form()->setCaption(toqstr(getTitle()));
+
if (form()->isVisible()) {
form()->raise();
} else {
- form()->setCaption(title_);
form()->show();
}
}
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;
private:
/// Pointer to the actual instantiation of the Qt dialog
virtual QDialog * form() const = 0;
-
-private:
- /// dialog title, displayed by WM.
- QString title_;
};
QERT::QERT(Dialog & parent)
- : base_class(parent, qt_("LyX: TeX Code Settings"))
+ : base_class(parent, _("LyX: TeX Code Settings"))
{
}
QError::QError(Dialog & parent)
- : base_class(parent, qt_("LyX: LaTeX Error"))
+ : base_class(parent, _("LyX: LaTeX Error"))
{
}
void QErrorList::update_contents()
{
- dialog_->setCaption(toqstr(controller().name()));
+ setTitle(controller().name());
dialog_->errorsLB->clear();
dialog_->descriptionTB->setText(QString());
QExternal::QExternal(Dialog & parent)
- : base_class(parent, qt_("LyX: External Material"))
+ : base_class(parent, _("LyX: External Material"))
{
}
QFloat::QFloat(Dialog & parent)
- : base_class(parent, qt_("LyX: Float Settings"))
+ : base_class(parent, _("LyX: Float Settings"))
{
}
QGraphics::QGraphics(Dialog & parent)
- : base_class(parent, qt_("LyX: Graphics"))
+ : base_class(parent, _("LyX: Graphics"))
{
}
QInclude::QInclude(Dialog & parent)
- : base_class(parent, qt_("LyX: Child Document"))
+ : base_class(parent, _("LyX: Child Document"))
{}
typedef QController<ControlLog, QView<QLogDialog> > base_class;
QLog::QLog(Dialog & parent)
- : base_class(parent, qt_("LyX: LaTeX Log"))
+ : base_class(parent, _("LyX: LaTeX Log"))
{
}
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("");
QMinipage::QMinipage(Dialog & parent)
- : base_class(parent, qt_("LyX: Minipage Settings"))
+ : base_class(parent, _("LyX: Minipage Settings"))
{
}
QParagraph::QParagraph(Dialog & parent)
- : base_class(parent, qt_("LyX: Paragraph Settings"))
+ : base_class(parent, _("LyX: Paragraph Settings"))
{}
QRef::QRef(Dialog & parent)
- : base_class(parent, qt_("LyX: Cross-reference")),
+ : base_class(parent, _("LyX: Cross-reference")),
sort_(false), at_ref_(false)
{
}
QShowFile::QShowFile(Dialog & parent)
- : base_class(parent, qt_("LyX: Show File"))
+ : base_class(parent, _("LyX: Show File"))
{
}
typedef QController<ControlTabular, QView<QTabularDialog> > base_class;
QTabular::QTabular(Dialog & parent)
- : base_class(parent, qt_("LyX: Table Settings"))
+ : base_class(parent, _("LyX: Table Settings"))
{
}
QTabularCreate::QTabularCreate(Dialog & parent)
- : base_class(parent, qt_("LyX: Insert Table"))
+ : base_class(parent, _("LyX: Insert Table"))
{
}
QThesaurus::QThesaurus(Dialog & parent)
- : base_class(parent, qt_("LyX: Thesaurus"))
+ : base_class(parent, _("LyX: Thesaurus"))
{
}
typedef QController<ControlToc, QView<QTocDialog> > 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)
{}
dialog_->typeCO->insertItem(toqstr(*it));
if (*it == type) {
dialog_->typeCO->setCurrentItem(it - choice.begin());
- dialog_->setCaption(toqstr(type));
+ setTitle(type);
}
}
}
typedef QController<ControlCommand, QView<QURLDialog> > base_class;
QURL::QURL(Dialog & parent)
- : base_class(parent, qt_("LyX: URL"))
+ : base_class(parent, _("LyX: URL"))
{
}
#include "Lsstream.h"
#include "qt_helpers.h"
+#include "support/lstrings.h"
#include "LyXView.h"
#include "ControlVCLog.h"
QVCLog::QVCLog(Dialog & parent)
- : base_class(parent, qt_("LyX: Version Control Log"))
+ : base_class(parent, _("LyX: Version Control Log"))
{
}
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;
QWrap::QWrap(Dialog & parent)
- : base_class(parent, qt_("LyX: Text Wrap Settings"))
+ : base_class(parent, _("LyX: Text Wrap Settings"))
{
}
#include <qapplication.h>
#include "debug.h"
+#include "qt_helpers.h"
#include "QtLyXView.h"
#include "Qt2Base.h"
#include "Qt2BC.h"
#include "support/LAssert.h"
-Qt2Base::Qt2Base(QString const & t)
- : ViewBase(), updating_(false), title_(t)
+Qt2Base::Qt2Base(string const & t)
+ : ViewBase(t), updating_(false)
{}
update(); // make sure its up-to-date
+ form()->setCaption(toqstr(getTitle()));
+
if (form()->isVisible()) {
form()->raise();
} else {
- form()->setCaption(title_);
form()->show();
}
}
Q_OBJECT
public:
///
- Qt2Base(QString const &);
+ Qt2Base(string const &);
///
virtual ~Qt2Base() {}
protected:
private:
/// Pointer to the actual instantiation of the Qt dialog
virtual QDialog * form() const = 0;
-
-private:
- /// dialog title, displayed by WM.
- QString title_;
};
+2003-05-21 Alfredo Braunstein <abraunst@libero.it>
+
+ * FormBase.[Ch]:
+ * FormDialogView.[Ch] (setTitle): added
+ * FormErrorList.C:
+ * FormLog.C:
+ * FormShowFile.C: use setTitle
+
2003-05-20 Alfredo Braunstein <abraunst@libero.it>
* FormErrorList.[Ch]: small bugs fixed
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())
{}
// 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");
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;
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_;
///
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())
{}
// 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");
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;
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_;
///
void FormErrorList::update()
{
- fl_set_form_title(dialog_->form, controller().name().c_str());
+ setTitle(controller().name());
updateContents();
}
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,
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())