From e7a64fb3e478968521ace4ea0b3bb8adf8c005da Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Mon, 9 Oct 2006 13:28:32 +0000 Subject: [PATCH] even more unicode work... qt3 and gtk not guaranted to compile nor work. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15288 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/controllers/BCView.h | 11 ++++++----- src/frontends/controllers/BCView.tmpl | 2 +- src/frontends/gtk/GBC.C | 8 ++++---- src/frontends/gtk/GBC.h | 6 +++--- src/frontends/qt3/Qt2BC.C | 6 +++--- src/frontends/qt3/Qt2BC.h | 6 +++--- src/frontends/qt4/Qt2BC.C | 6 +++--- src/frontends/qt4/Qt2BC.h | 6 +++--- 8 files changed, 26 insertions(+), 25 deletions(-) diff --git a/src/frontends/controllers/BCView.h b/src/frontends/controllers/BCView.h index 00f9d4a153..c90f66ec5b 100644 --- a/src/frontends/controllers/BCView.h +++ b/src/frontends/controllers/BCView.h @@ -14,9 +14,10 @@ #ifndef BCVIEW_H #define BCVIEW_H +#include "support/docstring.h" + #include #include -#include namespace lyx { namespace frontend { @@ -94,7 +95,7 @@ class GuiBC : public BCView { public: /// GuiBC(ButtonController const & parent, - std::string const & cancel, std::string const & close); + lyx::docstring const & cancel, lyx::docstring const & close); //@{ /** Store pointers to these widgets. The pointers are _not_ @@ -123,10 +124,10 @@ private: /// Enable/Disable a button virtual void setButtonEnabled(Button * obj, bool enable) const = 0; /// Set the Label on the button - virtual void setButtonLabel(Button * obj, std::string const & label) const = 0; + virtual void setButtonLabel(Button * obj, lyx::docstring const & label) const = 0; - std::string const cancel_label_; - std::string const close_label_; + lyx::docstring const cancel_label_; + lyx::docstring const close_label_; Button * okay_; Button * apply_; diff --git a/src/frontends/controllers/BCView.tmpl b/src/frontends/controllers/BCView.tmpl index cb7f895fc3..c8567f01d4 100644 --- a/src/frontends/controllers/BCView.tmpl +++ b/src/frontends/controllers/BCView.tmpl @@ -23,7 +23,7 @@ namespace frontend { template GuiBC::GuiBC(ButtonController const & parent, - std::string const & cancel, std::string const & close) + lyx::docstring const & cancel, lyx::docstring const & close) : BCView(parent), cancel_label_(cancel), close_label_(close), okay_(0), apply_(0), cancel_(0), restore_(0) diff --git a/src/frontends/gtk/GBC.C b/src/frontends/gtk/GBC.C index 8f238db659..6860583081 100644 --- a/src/frontends/gtk/GBC.C +++ b/src/frontends/gtk/GBC.C @@ -20,13 +20,13 @@ #include "GBC.h" -using std::string; +using lyx::docstring; namespace lyx { namespace frontend { GBC::GBC(ButtonController const & parent, - string const & cancel, string const & close) + docstring const & cancel, docstring const & close) : GuiBC(parent, cancel, close) { } @@ -44,11 +44,11 @@ void GBC::setWidgetEnabled(Gtk::Widget * widget, bool enabled) const } -void GBC::setButtonLabel(Gtk::Button * btn, string const & label) const +void GBC::setButtonLabel(Gtk::Button * btn, docstring const & label) const { // GTK+ Stock buttons take precedence if (!btn->get_use_stock()) - btn->set_label(Glib::locale_to_utf8(label)); + btn->set_label(label); } } // namespace frontend diff --git a/src/frontends/gtk/GBC.h b/src/frontends/gtk/GBC.h index 9990830275..a852795013 100644 --- a/src/frontends/gtk/GBC.h +++ b/src/frontends/gtk/GBC.h @@ -24,8 +24,8 @@ namespace frontend { class GBC : public GuiBC { public: GBC(ButtonController const & parent, - std::string const & cancel = lyx::to_utf8(_("Cancel")), - std::string const & close = lyx::to_utf8(_("Close"))); + lyx::docstring const & cancel = _("Cancel"), + lyx::docstring const & close = _("Close")); private: /// Updates the button sensitivity (enabled/disabled) void setButtonEnabled(Gtk::Button *, bool enabled) const; @@ -34,7 +34,7 @@ private: void setWidgetEnabled(Gtk::Widget *, bool enabled) const; /// Set the label on the button - void setButtonLabel(Gtk::Button *, std::string const & label) const; + void setButtonLabel(Gtk::Button *, lyx::docstring const & label) const; }; } // namespace frontend diff --git a/src/frontends/qt3/Qt2BC.C b/src/frontends/qt3/Qt2BC.C index 3902338784..e290042ae3 100644 --- a/src/frontends/qt3/Qt2BC.C +++ b/src/frontends/qt3/Qt2BC.C @@ -17,13 +17,13 @@ #include #include -using std::string; +using lyx::docstring; namespace lyx { namespace frontend { Qt2BC::Qt2BC(ButtonController const & parent, - string const & cancel, string const & close) + docstring const & cancel, docstring const & close) : GuiBC(parent, cancel, close) {} @@ -50,7 +50,7 @@ void Qt2BC::setWidgetEnabled(QWidget * obj, bool enabled) const } -void Qt2BC::setButtonLabel(QButton * obj, string const & label) const +void Qt2BC::setButtonLabel(QButton * obj, docstring const & label) const { obj->setText(toqstr(label)); } diff --git a/src/frontends/qt3/Qt2BC.h b/src/frontends/qt3/Qt2BC.h index 8b838e7ee1..7a140868f3 100644 --- a/src/frontends/qt3/Qt2BC.h +++ b/src/frontends/qt3/Qt2BC.h @@ -33,8 +33,8 @@ class Qt2BC : public GuiBC { public: /// Qt2BC(ButtonController const &, - std::string const & = lyx::to_utf8(_("Cancel")), - std::string const & = lyx::to_utf8(_("Close"))); + lyx::docstring const & = _("Cancel"), + lyx::docstring const & = _("Close")); private: /// Updates the button sensitivity (enabled/disabled) void setButtonEnabled(QButton *, bool enabled) const; @@ -43,7 +43,7 @@ private: void setWidgetEnabled(QWidget *, bool enabled) const; /// Set the label on the button - void setButtonLabel(QButton *, std::string const & label) const; + void setButtonLabel(QButton *, lyx::docstring const & label) const; }; } // namespace frontend diff --git a/src/frontends/qt4/Qt2BC.C b/src/frontends/qt4/Qt2BC.C index d38fdf3be0..be3c9b722e 100644 --- a/src/frontends/qt4/Qt2BC.C +++ b/src/frontends/qt4/Qt2BC.C @@ -17,13 +17,13 @@ #include #include -using std::string; +using lyx::docstring; namespace lyx { namespace frontend { Qt2BC::Qt2BC(ButtonController const & parent, - string const & cancel, string const & close) + docstring const & cancel, docstring const & close) : GuiBC(parent, cancel, close) {} @@ -50,7 +50,7 @@ void Qt2BC::setWidgetEnabled(QWidget * obj, bool enabled) const } -void Qt2BC::setButtonLabel(QPushButton * obj, string const & label) const +void Qt2BC::setButtonLabel(QPushButton * obj, docstring const & label) const { obj->setText(toqstr(label)); } diff --git a/src/frontends/qt4/Qt2BC.h b/src/frontends/qt4/Qt2BC.h index a851a118f1..e71a16a1cf 100644 --- a/src/frontends/qt4/Qt2BC.h +++ b/src/frontends/qt4/Qt2BC.h @@ -33,8 +33,8 @@ class Qt2BC : public GuiBC { public: /// Qt2BC(ButtonController const &, - std::string const & = lyx::to_utf8(_("Cancel")), - std::string const & = lyx::to_utf8(_("Close"))); + lyx::docstring const & = _("Cancel"), + lyx::docstring const & = _("Close")); private: /// Updates the button sensitivity (enabled/disabled) void setButtonEnabled(QPushButton *, bool enabled) const; @@ -43,7 +43,7 @@ private: void setWidgetEnabled(QWidget *, bool enabled) const; /// Set the label on the button - void setButtonLabel(QPushButton *, std::string const & label) const; + void setButtonLabel(QPushButton *, lyx::docstring const & label) const; }; } // namespace frontend -- 2.39.2