mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-08 20:32:49 +00:00
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
This commit is contained in:
parent
c594a2f9d8
commit
e7a64fb3e4
@ -14,9 +14,10 @@
|
|||||||
#ifndef BCVIEW_H
|
#ifndef BCVIEW_H
|
||||||
#define BCVIEW_H
|
#define BCVIEW_H
|
||||||
|
|
||||||
|
#include "support/docstring.h"
|
||||||
|
|
||||||
#include <boost/shared_ptr.hpp>
|
#include <boost/shared_ptr.hpp>
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace lyx {
|
namespace lyx {
|
||||||
namespace frontend {
|
namespace frontend {
|
||||||
@ -94,7 +95,7 @@ class GuiBC : public BCView {
|
|||||||
public:
|
public:
|
||||||
///
|
///
|
||||||
GuiBC(ButtonController const & parent,
|
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_
|
/** Store pointers to these widgets. The pointers are _not_
|
||||||
@ -123,10 +124,10 @@ private:
|
|||||||
/// Enable/Disable a button
|
/// Enable/Disable a button
|
||||||
virtual void setButtonEnabled(Button * obj, bool enable) const = 0;
|
virtual void setButtonEnabled(Button * obj, bool enable) const = 0;
|
||||||
/// Set the Label on the button
|
/// 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_;
|
lyx::docstring const cancel_label_;
|
||||||
std::string const close_label_;
|
lyx::docstring const close_label_;
|
||||||
|
|
||||||
Button * okay_;
|
Button * okay_;
|
||||||
Button * apply_;
|
Button * apply_;
|
||||||
|
@ -23,7 +23,7 @@ namespace frontend {
|
|||||||
|
|
||||||
template <class Button, class Widget>
|
template <class Button, class Widget>
|
||||||
GuiBC<Button, Widget>::GuiBC(ButtonController const & parent,
|
GuiBC<Button, Widget>::GuiBC(ButtonController const & parent,
|
||||||
std::string const & cancel, std::string const & close)
|
lyx::docstring const & cancel, lyx::docstring const & close)
|
||||||
: BCView(parent),
|
: BCView(parent),
|
||||||
cancel_label_(cancel), close_label_(close),
|
cancel_label_(cancel), close_label_(close),
|
||||||
okay_(0), apply_(0), cancel_(0), restore_(0)
|
okay_(0), apply_(0), cancel_(0), restore_(0)
|
||||||
|
@ -20,13 +20,13 @@
|
|||||||
|
|
||||||
#include "GBC.h"
|
#include "GBC.h"
|
||||||
|
|
||||||
using std::string;
|
using lyx::docstring;
|
||||||
|
|
||||||
namespace lyx {
|
namespace lyx {
|
||||||
namespace frontend {
|
namespace frontend {
|
||||||
|
|
||||||
GBC::GBC(ButtonController const & parent,
|
GBC::GBC(ButtonController const & parent,
|
||||||
string const & cancel, string const & close)
|
docstring const & cancel, docstring const & close)
|
||||||
: GuiBC<Gtk::Button, Gtk::Widget>(parent, cancel, close)
|
: GuiBC<Gtk::Button, Gtk::Widget>(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
|
// GTK+ Stock buttons take precedence
|
||||||
if (!btn->get_use_stock())
|
if (!btn->get_use_stock())
|
||||||
btn->set_label(Glib::locale_to_utf8(label));
|
btn->set_label(label);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace frontend
|
} // namespace frontend
|
||||||
|
@ -24,8 +24,8 @@ namespace frontend {
|
|||||||
class GBC : public GuiBC<Gtk::Button, Gtk::Widget> {
|
class GBC : public GuiBC<Gtk::Button, Gtk::Widget> {
|
||||||
public:
|
public:
|
||||||
GBC(ButtonController const & parent,
|
GBC(ButtonController const & parent,
|
||||||
std::string const & cancel = lyx::to_utf8(_("Cancel")),
|
lyx::docstring const & cancel = _("Cancel"),
|
||||||
std::string const & close = lyx::to_utf8(_("Close")));
|
lyx::docstring const & close = _("Close"));
|
||||||
private:
|
private:
|
||||||
/// Updates the button sensitivity (enabled/disabled)
|
/// Updates the button sensitivity (enabled/disabled)
|
||||||
void setButtonEnabled(Gtk::Button *, bool enabled) const;
|
void setButtonEnabled(Gtk::Button *, bool enabled) const;
|
||||||
@ -34,7 +34,7 @@ private:
|
|||||||
void setWidgetEnabled(Gtk::Widget *, bool enabled) const;
|
void setWidgetEnabled(Gtk::Widget *, bool enabled) const;
|
||||||
|
|
||||||
/// Set the label on the button
|
/// 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
|
} // namespace frontend
|
||||||
|
@ -17,13 +17,13 @@
|
|||||||
#include <qbutton.h>
|
#include <qbutton.h>
|
||||||
#include <qlineedit.h>
|
#include <qlineedit.h>
|
||||||
|
|
||||||
using std::string;
|
using lyx::docstring;
|
||||||
|
|
||||||
namespace lyx {
|
namespace lyx {
|
||||||
namespace frontend {
|
namespace frontend {
|
||||||
|
|
||||||
Qt2BC::Qt2BC(ButtonController const & parent,
|
Qt2BC::Qt2BC(ButtonController const & parent,
|
||||||
string const & cancel, string const & close)
|
docstring const & cancel, docstring const & close)
|
||||||
: GuiBC<QButton, QWidget>(parent, cancel, close)
|
: GuiBC<QButton, QWidget>(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));
|
obj->setText(toqstr(label));
|
||||||
}
|
}
|
||||||
|
@ -33,8 +33,8 @@ class Qt2BC : public GuiBC<QButton, QWidget> {
|
|||||||
public:
|
public:
|
||||||
///
|
///
|
||||||
Qt2BC(ButtonController const &,
|
Qt2BC(ButtonController const &,
|
||||||
std::string const & = lyx::to_utf8(_("Cancel")),
|
lyx::docstring const & = _("Cancel"),
|
||||||
std::string const & = lyx::to_utf8(_("Close")));
|
lyx::docstring const & = _("Close"));
|
||||||
private:
|
private:
|
||||||
/// Updates the button sensitivity (enabled/disabled)
|
/// Updates the button sensitivity (enabled/disabled)
|
||||||
void setButtonEnabled(QButton *, bool enabled) const;
|
void setButtonEnabled(QButton *, bool enabled) const;
|
||||||
@ -43,7 +43,7 @@ private:
|
|||||||
void setWidgetEnabled(QWidget *, bool enabled) const;
|
void setWidgetEnabled(QWidget *, bool enabled) const;
|
||||||
|
|
||||||
/// Set the label on the button
|
/// Set the label on the button
|
||||||
void setButtonLabel(QButton *, std::string const & label) const;
|
void setButtonLabel(QButton *, lyx::docstring const & label) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace frontend
|
} // namespace frontend
|
||||||
|
@ -17,13 +17,13 @@
|
|||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
#include <QLineEdit>
|
#include <QLineEdit>
|
||||||
|
|
||||||
using std::string;
|
using lyx::docstring;
|
||||||
|
|
||||||
namespace lyx {
|
namespace lyx {
|
||||||
namespace frontend {
|
namespace frontend {
|
||||||
|
|
||||||
Qt2BC::Qt2BC(ButtonController const & parent,
|
Qt2BC::Qt2BC(ButtonController const & parent,
|
||||||
string const & cancel, string const & close)
|
docstring const & cancel, docstring const & close)
|
||||||
: GuiBC<QPushButton, QWidget>(parent, cancel, close)
|
: GuiBC<QPushButton, QWidget>(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));
|
obj->setText(toqstr(label));
|
||||||
}
|
}
|
||||||
|
@ -33,8 +33,8 @@ class Qt2BC : public GuiBC<QPushButton, QWidget> {
|
|||||||
public:
|
public:
|
||||||
///
|
///
|
||||||
Qt2BC(ButtonController const &,
|
Qt2BC(ButtonController const &,
|
||||||
std::string const & = lyx::to_utf8(_("Cancel")),
|
lyx::docstring const & = _("Cancel"),
|
||||||
std::string const & = lyx::to_utf8(_("Close")));
|
lyx::docstring const & = _("Close"));
|
||||||
private:
|
private:
|
||||||
/// Updates the button sensitivity (enabled/disabled)
|
/// Updates the button sensitivity (enabled/disabled)
|
||||||
void setButtonEnabled(QPushButton *, bool enabled) const;
|
void setButtonEnabled(QPushButton *, bool enabled) const;
|
||||||
@ -43,7 +43,7 @@ private:
|
|||||||
void setWidgetEnabled(QWidget *, bool enabled) const;
|
void setWidgetEnabled(QWidget *, bool enabled) const;
|
||||||
|
|
||||||
/// Set the label on the button
|
/// Set the label on the button
|
||||||
void setButtonLabel(QPushButton *, std::string const & label) const;
|
void setButtonLabel(QPushButton *, lyx::docstring const & label) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace frontend
|
} // namespace frontend
|
||||||
|
Loading…
Reference in New Issue
Block a user