#include <boost/bind.hpp>
-using lyx::docstring;
-
using std::string;
using std::endl;
namespace lyx {
-
namespace frontend {
void Action::update()
{
- FuncStatus const status = lyx::getStatus(func_);
+ FuncStatus const status = getStatus(func_);
if (status.onoff(true)) {
setCheckable(true);
#include <QAction>
-//class FuncRequest;
-
-//class string;
-
namespace lyx {
namespace frontend {
*
* Action can be used in LyX menubar and/or toolbars.
*/
-class Action: public QAction {
+class Action : public QAction {
Q_OBJECT
public:
- Action(GuiView & lyxView, lyx::docstring const & text,
- FuncRequest const & func, lyx::docstring const & tooltip = lyx::docstring());
+ Action(GuiView & lyxView, docstring const & text,
+ FuncRequest const & func, docstring const & tooltip = docstring());
- Action(GuiView & lyxView, std::string const & icon, lyx::docstring const & text,
- FuncRequest const & func, lyx::docstring const & tooltip = lyx::docstring());
+ Action(GuiView & lyxView, std::string const & icon, docstring const & text,
+ FuncRequest const & func, docstring const & tooltip = docstring());
void update();
using std::pair;
using std::make_pair;
+using lyx::support::bformat;
namespace lyx {
-using lyx::support::bformat;
-using lyx::docstring;
-
namespace {
class MessageBox: public QMessageBox
{
public:
- MessageBox(QWidget * parent = 0): QMessageBox(parent)
+ MessageBox(QWidget * parent = 0) : QMessageBox(parent)
{
setAttribute(Qt::WA_DeleteOnClose, true);
setAttribute(Qt::WA_QuitOnClose, false);
bool ok;
QString text = QInputDialog::getText(qApp->focusWidget(),
toqstr(title),
- toqstr(lyx::char_type('&') + msg),
+ toqstr(char_type('&') + msg),
QLineEdit::Normal,
toqstr(dflt), &ok);
namespace lyx {
-using lyx::support::libFileSearch;
+using support::libFileSearch;
using std::string;
{
setupUi(this);
- for (int iter = 0; iter < 4; ++iter) {
+ for (int iter = 0; iter < 4; ++iter)
bullets_[iter] = ITEMIZE_DEFAULTS[iter];
- }
+
current_font_ = -1;
current_char_ = 0;
setupPanel(new QListWidget(bulletpaneSW), qt_("Dings 3"), "psnfss3");
setupPanel(new QListWidget(bulletpaneSW), qt_("Dings 4"), "psnfss4");
- connect(levelLW, SIGNAL(currentRowChanged(int)), this, SLOT(showLevel(int)));
- connect(bulletpaneCO, SIGNAL(activated(int)), bulletpaneSW, SLOT(setCurrentIndex(int)));
+ connect(levelLW, SIGNAL(currentRowChanged(int)),
+ this, SLOT(showLevel(int)));
+ connect(bulletpaneCO, SIGNAL(activated(int)), bulletpaneSW,
+ SLOT(setCurrentIndex(int)));
}
-BulletsModule::~BulletsModule()
-{
-}
-
-
-void BulletsModule::setupPanel(QListWidget * lw, QString panelname, std::string fname)
+void BulletsModule::setupPanel(QListWidget * lw, QString const & panelname,
+ std::string const & fname)
{
connect(lw, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)),
this, SLOT(bulletSelected(QListWidgetItem *, QListWidgetItem*)));
return bullets_[level];
}
-
} // namespace lyx
#include "BulletsModule_moc.cpp"
-
-
class BulletsModule : public QWidget, public Ui::BulletsUi {
Q_OBJECT
public:
-
+ ///
BulletsModule(QWidget * parent = 0, const char * name = 0, Qt::WFlags fl = 0);
- ~BulletsModule();
-
/// set a bullet
void setBullet(int level, Bullet const & bullet);
/// get bullet setting
void on_bulletsizeCO_activated(int level);
void on_customCB_clicked(bool);
void on_customLE_textEdited(const QString &);
- void bulletSelected(QListWidgetItem *, QListWidgetItem*);
+ void bulletSelected(QListWidgetItem *, QListWidgetItem *);
void showLevel(int);
private:
void selectItem(int font, int character, bool select);
- void setupPanel(QListWidget * lw, QString panelname, std::string fname);
+ void setupPanel(QListWidget * lw, QString const & panelname,
+ std::string const & fname);
/// store results
boost::array<Bullet, 4> bullets_;
const QColor grey90(0xe5, 0xe5, 0xe5);
const QColor none = Qt::black;
-
-ColorCache::ColorCache()
-{
-}
-
QColor const & ColorCache::get(LColor_color col) const
{
lcolor_map::const_iterator cit = colormap.find(col);
}
-QColor const rgb2qcolor(lyx::RGBColor const & rgb)
+QColor const rgb2qcolor(RGBColor const & rgb)
{
return QColor(rgb.r, rgb.g, rgb.b);
}
*/
class ColorCache {
public:
- ColorCache();
+ ColorCache() {}
/// get the given color
QColor const & get(LColor_color color) const;
};
///
-QColor const rgb2qcolor(lyx::RGBColor const &);
+QColor const rgb2qcolor(RGBColor const &);
} // namespace lyx
#include <QHBoxLayout>
using lyx::support::split;
-using lyx::docstring;
-
using std::string;
-
-namespace {
+namespace lyx {
/// return the Qt form of the label
-docstring const getLabel(docstring const & ucs4str) {
+static docstring const getLabel(docstring const & ucs4str) {
// FIXME UNICODE
- string str = lyx::to_utf8(ucs4str);
+ string str = to_utf8(ucs4str);
string label;
string sc(split(str, label, '|'));
if (sc.length() < 2)
- return lyx::from_utf8(label);
+ return from_utf8(label);
string::size_type pos = label.find(sc[1]);
if (pos == string::npos)
- return lyx::from_utf8(label);
+ return from_utf8(label);
label.insert(pos, 1, '&');
- return lyx::from_utf8(label);
+ return from_utf8(label);
}
-} // namespace anon
-
-
-namespace lyx {
LyXFileDialog::LyXFileDialog(docstring const & t,
docstring const & p,
- lyx::support::FileFilterList const & filters,
+ support::FileFilterList const & filters,
FileDialog::Button const & b1,
FileDialog::Button const & b2)
// FIXME replace that with theApp->gui()->currentView()
{
Q_OBJECT
public:
- LyXFileDialog(lyx::docstring const & title,
- lyx::docstring const & path,
- lyx::support::FileFilterList const & filters,
+ LyXFileDialog(docstring const & title,
+ docstring const & path,
+ support::FileFilterList const & filters,
FileDialog::Button const & b1,
FileDialog::Button const & b2);
public Q_SLOTS:
void buttonClicked();
private:
QToolButton * b1_;
- lyx::docstring b1_dir_;
+ docstring b1_dir_;
QToolButton * b2_;
- lyx::docstring b2_dir_;
+ docstring b2_dir_;
};
} // namespace lyx
guiApp = this;
}
+
Clipboard& GuiApplication::clipboard()
{
return clipboard_;
bool GuiApplication::getRgbColor(LColor_color col,
- lyx::RGBColor & rgbcol)
+ RGBColor & rgbcol)
{
QColor const & qcol = color_cache_.get(col);
if (!qcol.isValid()) {
virtual std::string const romanFontName();
virtual std::string const sansFontName();
virtual std::string const typewriterFontName();
- virtual bool getRgbColor(LColor_color col, lyx::RGBColor & rgbcol);
+ virtual bool getRgbColor(LColor_color col, RGBColor & rgbcol);
virtual std::string const hexName(LColor_color col);
virtual void updateColor(LColor_color col);
virtual void registerSocketCallback(
using std::endl;
using std::string;
-
-namespace {
-
-char const * const mime_type = "application/x-lyx";
-
-}
+static char const * const mime_type = "application/x-lyx";
namespace lyx {
namespace lyx {
namespace frontend {
-GuiFontLoader::~GuiFontLoader() {
-}
-
namespace {
struct symbol_font {
/// Hold info about a particular font
-class GuiFontLoader: public FontLoader
+class GuiFontLoader : public FontLoader
{
public:
///
GuiFontLoader();
/// Destructor
- virtual ~GuiFontLoader();
+ virtual ~GuiFontLoader() {}
virtual void update();
virtual bool available(LyXFont const & f);
void GuiSelection::put(docstring const & str)
{
- LYXERR(Debug::ACTION) << "GuiSelection::put: " << lyx::to_utf8(str) << endl;
+ LYXERR(Debug::ACTION) << "GuiSelection::put: " << to_utf8(str) << endl;
qApp->clipboard()->setText(toqstr(externalLineEnding(str)),
QClipboard::Selection);
/**
* The Qt4 version of the Selection.
*/
-class GuiSelection: public Selection
+class GuiSelection : public Selection
{
public:
virtual ~GuiSelection() {}
/// add toolbar, if newline==true, add a toolbar break before the toolbar
Toolbars::ToolbarPtr makeToolbar(ToolbarInfo const & tbinfo, bool newline);
virtual void updateStatusBar();
- virtual void message(lyx::docstring const & str);
+ virtual void message(docstring const & str);
virtual void clearMessage();
virtual bool hasFocus() const;
* @param t main window title
* @param it iconified (short) title
*/
- virtual void setWindowTitle(lyx::docstring const & t, lyx::docstring const & it);
+ virtual void setWindowTitle(docstring const & t, docstring const & it);
/// in order to catch Tab key press.
bool event(QEvent * e);
rLength = 0;
}
- int const right_margin = lyx::rightMargin();
+ int const right_margin = rightMargin();
Painter::preedit_style ps;
// Most often there would be only one line:
preedit_lines_ = 1;
void InsertTableWidget::updateParent()
{
- bool status = lyx::getStatus(FuncRequest(LFUN_TABULAR_INSERT)).enabled();
+ bool status = getStatus(FuncRequest(LFUN_TABULAR_INSERT)).enabled();
parentWidget()->setEnabled(status);
}
controller().params()["options"] = "bibtotoc," + bibstyle;
} else if (bibtotoc) {
// bibtotoc and no style
- controller().params()["options"] = lyx::from_ascii("bibtotoc");
+ controller().params()["options"] = from_ascii("bibtotoc");
} else {
// only style. An empty one is valid, because some
// documentclasses have an own \bibliographystyle{}
switch (btp) {
case 0:
- controller().params()["btprint"] = lyx::from_ascii("btPrintCited");
+ controller().params()["btprint"] = from_ascii("btPrintCited");
break;
case 1:
- controller().params()["btprint"] = lyx::from_ascii("btPrintNotCited");
+ controller().params()["btprint"] = from_ascii("btPrintNotCited");
break;
case 2:
- controller().params()["btprint"] = lyx::from_ascii("btPrintAll");
+ controller().params()["btprint"] = from_ascii("btPrintAll");
break;
}
connect(widthED, SIGNAL(textChanged(const QString &)),
this, SLOT(change_adaptor()));
- connect(widthUnitsLC, SIGNAL(selectionChanged(lyx::LyXLength::UNIT)),
+ connect(widthUnitsLC, SIGNAL(selectionChanged(LyXLength::UNIT)),
this, SLOT(change_adaptor()));
connect(valignCO, SIGNAL(highlighted(const QString &)),
this, SLOT(change_adaptor()));
connect(heightED, SIGNAL(textChanged(const QString &)),
this, SLOT(change_adaptor()));
- connect(heightUnitsLC, SIGNAL(selectionChanged(lyx::LyXLength::UNIT) ),
+ connect(heightUnitsLC, SIGNAL(selectionChanged(LyXLength::UNIT) ),
this, SLOT(change_adaptor()));
connect(restorePB, SIGNAL(clicked()), this, SLOT(restoreClicked()));
connect(typeCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
-/**
+/*
* \file QCitation.C
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
using std::string;
-namespace {
-
template<typename String> static QStringList to_qstring_list(vector<String> const & v)
{
QStringList qlist;
- for (size_t i=0; i != v.size(); ++i) {
+ for (size_t i = 0; i != v.size(); ++i) {
if (v[i].empty())
continue;
qlist.append(lyx::toqstr(v[i]));
}
-vector<string> const to_string_vector(QStringList const & qlist)
+static vector<string> const to_string_vector(QStringList const & qlist)
{
vector<string> v;
for (int i = 0; i != qlist.size(); ++i) {
return v;
}
-}
-
namespace lyx {
namespace frontend {
#include "controllers/ButtonController.h"
-using lyx::docstring;
namespace lyx {
namespace frontend {
latexModule->classCO->addItem(toqstr(cit->description()));
} else {
docstring item =
- bformat(_("Unavailable: %1$s"), lyx::from_utf8(cit->description()));
+ bformat(_("Unavailable: %1$s"), from_utf8(cit->description()));
latexModule->classCO->addItem(toqstr(item));
}
}
ControlDocument & cntrl = form_->controller();
BufferParams & params = cntrl.params();
- lyx::textclass_type const tc = latexModule->classCO->currentIndex();
+ textclass_type const tc = latexModule->classCO->currentIndex();
if (form_->controller().loadTextclass(tc)) {
params.textclass = tc;
ErrorListBase;
QErrorList::QErrorList(Dialog & parent)
- : ErrorListBase(parent, lyx::docstring())
+ : ErrorListBase(parent, docstring())
{}
void QErrorList::update_contents()
{
- setTitle(lyx::from_utf8(controller().name()));
+ setTitle(from_utf8(controller().name()));
dialog_->errorsLW->clear();
dialog_->descriptionTB->setPlainText(QString());
: form_(form)
{
setupUi(this);
- connect(okPB, SIGNAL(clicked()),
- form, SLOT(slotOK()));
- connect(applyPB, SIGNAL(clicked()),
- form, SLOT(slotApply()));
- connect(closePB, SIGNAL(clicked()),
- form, SLOT(slotClose()));
-
- connect( displayCB, SIGNAL( toggled(bool) ), showCO, SLOT( setEnabled(bool) ) );
- connect( displayCB, SIGNAL( toggled(bool) ), displayscaleED, SLOT( setEnabled(bool) ) );
- connect( showCO, SIGNAL( activated(const QString&) ), this, SLOT( change_adaptor() ) );
- connect( originCO, SIGNAL( activated(int) ), this, SLOT( change_adaptor() ) );
- connect( aspectratioCB, SIGNAL( stateChanged(int) ), this, SLOT( change_adaptor() ) );
- connect( browsePB, SIGNAL( clicked() ), this, SLOT( browseClicked() ) );
- connect( editPB, SIGNAL( clicked() ), this, SLOT( editClicked() ) );
- connect( externalCO, SIGNAL( activated(const QString&) ), this, SLOT( templateChanged() ) );
- connect( extraED, SIGNAL( textChanged(const QString&) ), this, SLOT( extraChanged(const QString&) ) );
- connect( extraFormatCO, SIGNAL( activated(const QString&) ), this, SLOT( formatChanged(const QString&) ) );
- connect( widthUnitCO, SIGNAL( activated(int) ), this, SLOT( widthUnitChanged() ) );
- connect( heightUnitCO, SIGNAL( selectionChanged(lyx::LyXLength::UNIT) ), this, SLOT( change_adaptor() ) );
- connect( displayCB, SIGNAL( stateChanged(int) ), this, SLOT( change_adaptor() ) );
- connect( displayscaleED, SIGNAL( textChanged(const QString&) ), this, SLOT( change_adaptor() ) );
- connect( angleED, SIGNAL( textChanged(const QString&) ), this, SLOT( change_adaptor() ) );
- connect( widthED, SIGNAL( textChanged(const QString&) ), this, SLOT( sizeChanged() ) );
- connect( heightED, SIGNAL( textChanged(const QString&) ), this, SLOT( sizeChanged() ) );
- connect( fileED, SIGNAL( textChanged(const QString&) ), this, SLOT( change_adaptor() ) );
- connect( clipCB, SIGNAL( stateChanged(int) ), this, SLOT( change_adaptor() ) );
- connect( getbbPB, SIGNAL( clicked() ), this, SLOT( getbbClicked() ) );
- connect( xrED, SIGNAL( textChanged(const QString&) ), this, SLOT( bbChanged() ) );
- connect( ytED, SIGNAL( textChanged(const QString&) ), this, SLOT( bbChanged() ) );
- connect( xlED, SIGNAL( textChanged(const QString&) ), this, SLOT( bbChanged() ) );
- connect( ybED, SIGNAL( textChanged(const QString&) ), this, SLOT( bbChanged() ) );
- connect( draftCB, SIGNAL( clicked() ), this, SLOT( change_adaptor() ) );
+ connect(okPB, SIGNAL(clicked()), form, SLOT(slotOK()));
+ connect(applyPB, SIGNAL(clicked()), form, SLOT(slotApply()));
+ connect(closePB, SIGNAL(clicked()), form, SLOT(slotClose()));
+
+ connect(displayCB, SIGNAL(toggled(bool)),
+ showCO, SLOT(setEnabled(bool)));
+ connect(displayCB, SIGNAL(toggled(bool)),
+ displayscaleED, SLOT(setEnabled(bool)));
+ connect(showCO, SIGNAL(activated(const QString&)),
+ this, SLOT(change_adaptor()));
+ connect(originCO, SIGNAL(activated(int)),
+ this, SLOT(change_adaptor()));
+ connect(aspectratioCB, SIGNAL(stateChanged(int)),
+ this, SLOT(change_adaptor()));
+ connect(browsePB, SIGNAL(clicked()),
+ this, SLOT(browseClicked()));
+ connect(editPB, SIGNAL(clicked()),
+ this, SLOT(editClicked()));
+ connect(externalCO, SIGNAL(activated(const QString&)),
+ this, SLOT(templateChanged()));
+ connect(extraED, SIGNAL(textChanged(const QString&)),
+ this, SLOT(extraChanged(const QString&)));
+ connect(extraFormatCO, SIGNAL(activated(const QString&)),
+ this, SLOT(formatChanged(const QString&)));
+ connect(widthUnitCO, SIGNAL(activated(int)),
+ this, SLOT(widthUnitChanged()));
+ connect(heightUnitCO, SIGNAL(selectionChanged(LyXLength::UNIT)),
+ this, SLOT(change_adaptor()));
+ connect(displayCB, SIGNAL(stateChanged(int)),
+ this, SLOT(change_adaptor()));
+ connect(displayscaleED, SIGNAL(textChanged(const QString&)),
+ this, SLOT(change_adaptor()));
+ connect(angleED, SIGNAL(textChanged(const QString&)),
+ this, SLOT(change_adaptor()));
+ connect(widthED, SIGNAL(textChanged(const QString&)),
+ this, SLOT(sizeChanged()));
+ connect(heightED, SIGNAL(textChanged(const QString&)),
+ this, SLOT(sizeChanged()));
+ connect(fileED, SIGNAL(textChanged(const QString&)),
+ this, SLOT(change_adaptor()));
+ connect(clipCB, SIGNAL(stateChanged(int)),
+ this, SLOT(change_adaptor()));
+ connect(getbbPB, SIGNAL(clicked()), this, SLOT(getbbClicked()));
+ connect(xrED, SIGNAL(textChanged(const QString&)), this, SLOT(bbChanged()));
+ connect(ytED, SIGNAL(textChanged(const QString&)), this, SLOT(bbChanged()));
+ connect(xlED, SIGNAL(textChanged(const QString&)), this, SLOT(bbChanged()));
+ connect(ybED, SIGNAL(textChanged(const QString&)), this, SLOT(bbChanged()));
+ connect(draftCB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
QIntValidator * validator = new QIntValidator(displayscaleED);
validator->setBottom(1);
{
int const choice = externalCO->currentIndex();
docstring const template_name =
- lyx::from_utf8(form_->controller().getTemplate(choice).lyxName);
+ from_utf8(form_->controller().getTemplate(choice).lyxName);
docstring const str =
form_->controller().browse(qstring_to_ucs4(fileED->text()),
template_name);
{
setupUi(this);
//main buttons
- connect(okPB, SIGNAL( clicked() ),
- form, SLOT( slotOK() ) );
- connect(applyPB, SIGNAL( clicked() ),
- form, SLOT( slotApply() ) );
- connect(closePB, SIGNAL( clicked() ),
- form, SLOT( slotClose() ) );
- connect(restorePB, SIGNAL( clicked() ),
- form, SLOT( slotRestore() ) );
+ connect(okPB, SIGNAL(clicked()),
+ form, SLOT(slotOK()));
+ connect(applyPB, SIGNAL(clicked()),
+ form, SLOT(slotApply()));
+ connect(closePB, SIGNAL(clicked()),
+ form, SLOT(slotClose()));
+ connect(restorePB, SIGNAL(clicked()),
+ form, SLOT(slotRestore()));
//graphics pane
- connect(filename, SIGNAL( textChanged(const QString&) ),
- this, SLOT( change_adaptor() ) );
- connect(WidthCB, SIGNAL( clicked() ),
- this, SLOT( change_adaptor() ) );
- connect(HeightCB, SIGNAL( clicked() ),
- this, SLOT( change_adaptor() ) );
- connect(Width, SIGNAL( textChanged(const QString&) ),
- this, SLOT( change_adaptor() ) );
- connect(Height, SIGNAL( textChanged(const QString&) ),
- this, SLOT( change_adaptor() ) );
- connect(heightUnit, SIGNAL( selectionChanged(lyx::LyXLength::UNIT) ),
- this, SLOT( change_adaptor() ) );
- connect(widthUnit, SIGNAL( selectionChanged(lyx::LyXLength::UNIT) ),
- this, SLOT( change_adaptor() ) );
- connect(aspectratio, SIGNAL( stateChanged(int) ),
- this, SLOT( change_adaptor() ) );
- connect(angle, SIGNAL( textChanged(const QString&) ),
- this, SLOT( change_adaptor() ) );
- connect(origin, SIGNAL( activated(int) ),
- this, SLOT( change_adaptor() ) );
- connect(scaleCB, SIGNAL( clicked() ),
- this, SLOT(change_adaptor()) );
- connect(Scale, SIGNAL( textChanged(const QString&) ),
- this, SLOT( change_adaptor() ) );
+ connect(filename, SIGNAL(textChanged(const QString&)),
+ this, SLOT(change_adaptor()));
+ connect(WidthCB, SIGNAL( clicked()),
+ this, SLOT(change_adaptor()));
+ connect(HeightCB, SIGNAL( clicked()),
+ this, SLOT(change_adaptor()));
+ connect(Width, SIGNAL(textChanged(const QString&)),
+ this, SLOT(change_adaptor()));
+ connect(Height, SIGNAL(textChanged(const QString&)),
+ this, SLOT(change_adaptor()));
+ connect(heightUnit, SIGNAL(selectionChanged(LyXLength::UNIT)),
+ this, SLOT(change_adaptor()));
+ connect(widthUnit, SIGNAL(selectionChanged(lyx::LyXLength::UNIT)),
+ this, SLOT(change_adaptor()));
+ connect(aspectratio, SIGNAL(stateChanged(int)),
+ this, SLOT(change_adaptor()));
+ connect(angle, SIGNAL(textChanged(const QString&)),
+ this, SLOT(change_adaptor()));
+ connect(origin, SIGNAL(activated(int)),
+ this, SLOT(change_adaptor()));
+ connect(scaleCB, SIGNAL(clicked()),
+ this, SLOT(change_adaptor()));
+ connect(Scale, SIGNAL(textChanged(const QString&)),
+ this, SLOT(change_adaptor()));
filename->setValidator(new PathValidator(true, filename));
setFocusProxy(filename);
angle->setValidator(new QDoubleValidator(-360, 360, 2, angle));
//clipping pane
- connect(clip, SIGNAL( stateChanged(int) ),
- this, SLOT( change_adaptor() ) );
- connect(lbY, SIGNAL( textChanged(const QString&) ),
- this, SLOT( change_bb() ) );
- connect(lbYunit, SIGNAL( activated(int) ),
- this, SLOT( change_bb() ) );
- connect(rtY, SIGNAL( textChanged(const QString&) ),
- this, SLOT( change_bb() ) );
- connect(rtYunit, SIGNAL( activated(int) ),
- this, SLOT( change_bb() ) );
- connect(lbX, SIGNAL( textChanged(const QString&) ),
- this, SLOT( change_bb() ) );
- connect(lbXunit, SIGNAL( activated(int) ),
- this, SLOT( change_bb() ) );
- connect(rtX, SIGNAL( textChanged(const QString&) ),
- this, SLOT( change_bb() ) );
- connect(rtXunit, SIGNAL( activated(int) ),
- this, SLOT( change_bb() ) );
- connect(getPB, SIGNAL( clicked() ),
- this, SLOT( change_adaptor() ) );
+ connect(clip, SIGNAL(stateChanged(int)),
+ this, SLOT(change_adaptor()));
+ connect(lbY, SIGNAL(textChanged(const QString&)),
+ this, SLOT(change_bb()));
+ connect(lbYunit, SIGNAL(activated(int)),
+ this, SLOT(change_bb()));
+ connect(rtY, SIGNAL(textChanged(const QString&)),
+ this, SLOT(change_bb()));
+ connect(rtYunit, SIGNAL(activated(int)),
+ this, SLOT(change_bb()));
+ connect(lbX, SIGNAL(textChanged(const QString&)),
+ this, SLOT(change_bb()));
+ connect(lbXunit, SIGNAL(activated(int)),
+ this, SLOT(change_bb()));
+ connect(rtX, SIGNAL(textChanged(const QString&)),
+ this, SLOT(change_bb()));
+ connect(rtXunit, SIGNAL(activated(int)),
+ this, SLOT(change_bb()));
+ connect(getPB, SIGNAL(clicked()),
+ this, SLOT(change_adaptor()));
lbX->setValidator(new QDoubleValidator(lbX));
lbY->setValidator(new QDoubleValidator(lbY));
rtY->setValidator(new QDoubleValidator(rtY));
//extra options pane
- connect(latexoptions, SIGNAL( textChanged(const QString&) ),
- this, SLOT( change_adaptor() ) );
- connect(draftCB, SIGNAL( stateChanged(int) ),
- this, SLOT( change_adaptor() ) );
- connect(unzipCB, SIGNAL( stateChanged(int) ),
- this, SLOT( change_adaptor() ) );
+ connect(latexoptions, SIGNAL(textChanged(const QString&)),
+ this, SLOT(change_adaptor()));
+ connect(draftCB, SIGNAL(stateChanged(int)),
+ this, SLOT(change_adaptor()));
+ connect(unzipCB, SIGNAL(stateChanged(int)),
+ this, SLOT(change_adaptor()));
// FIXME: we should connect to clicked() when we move to Qt 4.2 because
// the toggled(bool) signal is also trigged when we update the widgets
// (rgh-4/07) this isn't as much or a problem as it was, because we're now
// setChecked(). Note, too, that clicked() would get called whenever it
// is clicked, even right clicked (I think), not just whenever it is
// toggled.
- connect(subfigure, SIGNAL( toggled(bool) ),
- this, SLOT( change_adaptor() ) );
- connect(subcaption, SIGNAL( textChanged(const QString&) ),
- this, SLOT( change_adaptor() ) );
- connect(displayGB, SIGNAL( toggled(bool) ),
- this, SLOT( change_adaptor() ) );
- connect(showCB, SIGNAL( currentIndexChanged(int) ),
- this, SLOT( change_adaptor() ) );
- connect(displayscale, SIGNAL( textChanged(const QString&) ),
- this, SLOT( change_adaptor() ) );
+ connect(subfigure, SIGNAL(toggled(bool)),
+ this, SLOT(change_adaptor()));
+ connect(subcaption, SIGNAL(textChanged(const QString&)),
+ this, SLOT(change_adaptor()));
+ connect(displayGB, SIGNAL(toggled(bool)),
+ this, SLOT(change_adaptor()));
+ connect(showCB, SIGNAL(currentIndexChanged(int)),
+ this, SLOT(change_adaptor()));
+ connect(displayscale, SIGNAL(textChanged(const QString&)),
+ this, SLOT(change_adaptor()));
displayscale->setValidator(new QIntValidator(displayscale));
}
QIndex * form_;
};
+
class ControlCommand;
class QIndex :
public:
friend class QIndexDialog;
- QIndex(Dialog &, lyx::docstring const & title, QString const & label);
+ QIndex(Dialog &, docstring const & title, QString const & label);
protected:
virtual bool isValid();
private:
using std::string;
using std::endl;
-namespace {
-
-} // namespace anon
-
namespace lyx {
-
-
namespace frontend {
// MacOSX specific stuff is at the end.
{
macxMenuBarInit();
- LYXERR(Debug::GUI) << "populating menu bar" << lyx::to_utf8(menubackend_.getMenubar().name()) << endl;
+ LYXERR(Debug::GUI) << "populating menu bar" << to_utf8(menubackend_.getMenubar().name()) << endl;
if (menubackend_.getMenubar().size() == 0) {
- LYXERR(Debug::GUI) << "\tERROR: empty menu bar" << lyx::to_utf8(menubackend_.getMenubar().name()) << endl;
+ LYXERR(Debug::GUI) << "\tERROR: empty menu bar"
+ << to_utf8(menubackend_.getMenubar().name()) << endl;
return;
// continue;
}
else {
- LYXERR(Debug::GUI) << "menu bar entries " << menubackend_.getMenubar().size();
+ LYXERR(Debug::GUI) << "menu bar entries "
+ << menubackend_.getMenubar().size();
}
- // for (; m != end; ++m) {
Menu menu;
menubackend_.expand(menubackend_.getMenubar(), menu, owner_->buffer());
for (; m != end; ++m) {
if (m->kind() != MenuItem::Submenu) {
- LYXERR(Debug::GUI) << "\tERROR: not a submenu " << lyx::to_utf8(m->label()) << endl;
+ LYXERR(Debug::GUI) << "\tERROR: not a submenu "
+ << to_utf8(m->label()) << endl;
continue;
}
- LYXERR(Debug::GUI) << "menu bar item " << lyx::to_utf8(m->label()) << " is a submenu named " << lyx::to_utf8(m->submenuname()) << endl;
+ LYXERR(Debug::GUI) << "menu bar item " << to_utf8(m->label())
+ << " is a submenu named " << to_utf8(m->submenuname()) << endl;
docstring name = m->submenuname();
if (!menubackend_.hasMenu(name)) {
- LYXERR(Debug::GUI) << "\tERROR: " << lyx::to_utf8(name) << " submenu has no menu!" << endl;
+ LYXERR(Debug::GUI) << "\tERROR: " << to_utf8(name)
+ << " submenu has no menu!" << endl;
continue;
}
pair<NameMap::iterator, bool> I = name_map_.insert(make_pair(name, qMenu));
if (!I.second) {
- LYXERR(Debug::GUI) << "\tERROR: " << lyx::to_utf8(name) << " submenu is already there!" << endl;
+ LYXERR(Debug::GUI) << "\tERROR: " << to_utf8(name)
+ << " submenu is already there!" << endl;
}
/*
QObject::connect(qMenu, SIGNAL(aboutToShow()), this, SLOT(update()));
class MenuItem;
namespace lyx {
-
-
namespace frontend {
class GuiView;
QLMenubar(LyXView *, MenuBackend &);
/// opens a top-level submenu given its name
- void openByName(lyx::docstring const &);
+ void openByName(docstring const &);
/// return the owning view
GuiView * view();
/// menu controller
MenuBackend & menubackend_;
- typedef std::map<lyx::docstring, QLPopupMenu *> NameMap;
+ typedef std::map<docstring, QLPopupMenu *> NameMap;
/// name to menu for openByName
NameMap name_map_;
/// draw a string at position x, y (y is the baseline)
virtual int text(int x, int y,
- lyx::docstring const & str, LyXFont const & f);
+ docstring const & str, LyXFont const & f);
/// draw a char at position x, y (y is the baseline)
- virtual int text(int x, int y,
- lyx::char_type c, LyXFont const & f);
+ virtual int text(int x, int y, char_type c, LyXFont const & f);
private:
/// draw small caps text
using std::pair;
using std::endl;
-namespace {
-
-} // namespace anon
namespace lyx {
-
namespace frontend {
-
QLPopupMenu::QLPopupMenu(QLMenubar * owner,
MenuItem const & mi, bool topLevelMenu)
: owner_(owner)
}
-
void QLPopupMenu::update()
{
LYXERR(Debug::GUI) << BOOST_CURRENT_FUNCTION << endl;
- LYXERR(Debug::GUI) << "\tTriggered menu: " << lyx::to_utf8(name_) << endl;
+ LYXERR(Debug::GUI) << "\tTriggered menu: " << to_utf8(name_) << endl;
clear();
owner_->backend().expand(fromLyxMenu, topLevelMenu_, owner_->view()->buffer());
if (!owner_->backend().hasMenu(topLevelMenu_.name())) {
- LYXERR(Debug::GUI) << "\tWARNING: menu seems empty" << lyx::to_utf8(topLevelMenu_.name()) << endl;
+ LYXERR(Debug::GUI) << "\tWARNING: menu seems empty"
+ << to_utf8(topLevelMenu_.name()) << endl;
}
populate(this, &topLevelMenu_);
}
void QLPopupMenu::populate(QMenu* qMenu, Menu * menu)
{
- LYXERR(Debug::GUI) << "populating menu " << lyx::to_utf8(menu->name()) ;
+ LYXERR(Debug::GUI) << "populating menu " << to_utf8(menu->name()) ;
if (menu->size() == 0) {
- LYXERR(Debug::GUI) << "\tERROR: empty menu " << lyx::to_utf8(menu->name()) << endl;
+ LYXERR(Debug::GUI) << "\tERROR: empty menu "
+ << to_utf8(menu->name()) << endl;
return;
}
else {
} else if (m->kind() == MenuItem::Submenu) {
- LYXERR(Debug::GUI) << "** creating New Sub-Menu " << lyx::to_utf8(getLabel(*m)) << endl;
+ LYXERR(Debug::GUI) << "** creating New Sub-Menu "
+ << to_utf8(getLabel(*m)) << endl;
QMenu * subMenu = qMenu->addMenu(toqstr(getLabel(*m)));
populate(subMenu, m->submenu());
} else { // we have a MenuItem::Command
- LYXERR(Debug::GUI) << "creating Menu Item " << lyx::to_utf8(m->label()) << endl;
+ LYXERR(Debug::GUI) << "creating Menu Item "
+ << to_utf8(m->label()) << endl;
docstring label = getLabel(*m);
addBinding(label, *m);
}
}
+
docstring const QLPopupMenu::getLabel(MenuItem const & mi)
{
docstring const shortcut = mi.shortcut();
docstring label = support::subst(mi.label(),
- lyx::from_ascii("&"),
- lyx::from_ascii("&&"));
+ from_ascii("&"), from_ascii("&&"));
if (!shortcut.empty()) {
docstring::size_type pos = label.find(shortcut);
QLMenubar * owner_;
/// the name of this menu
- lyx::docstring name_;
+ docstring name_;
private:
/// Get a Menu item label from the menu backend
- lyx::docstring const getLabel(MenuItem const & mi);
+ docstring const getLabel(MenuItem const & mi);
/// add binding keys a the menu item label.
- void addBinding(lyx::docstring & label, MenuItem const & mi);
+ void addBinding(docstring & label, MenuItem const & mi);
/// Top Level Menu
Menu topLevelMenu_;
ToolbarInfo::item_iterator it = tbinfo.items.begin();
ToolbarInfo::item_iterator const end = tbinfo.items.end();
for (; it != end; ++it)
- if (!lyx::getStatus(it->func_).unknown()) {
+ if (!getStatus(it->func_).unknown()) {
Action * action = new Action(owner_,
getIcon(it->func_),
it->label_,
ToolbarInfo::item_iterator it = tbinfo.items.begin();
ToolbarInfo::item_iterator const end = tbinfo.items.end();
for (; it != end; ++it)
- if (!lyx::getStatus(it->func_).unknown()) {
+ if (!getStatus(it->func_).unknown()) {
Action * action = new Action(owner_,
getIcon(it->func_, false),
it->label_,
break;
}
case ToolbarItem::COMMAND: {
- if (lyx::getStatus(item.func_).unknown())
+ if (getStatus(item.func_).unknown())
break;
Action * action = new Action(owner_,
typedef QController<ControlLog, QView<QLogDialog> > LogBase;
QLog::QLog(Dialog & parent)
- : LogBase(parent, lyx::docstring())
+ : LogBase(parent, docstring())
{}
public:
SamePrettyName(string const & n) : pretty_name_(n) {}
- bool operator()(lyx::Format const & fmt) const {
+ bool operator()(Format const & fmt) const {
return fmt.prettyname() == pretty_name_;
}
Format const * getFormat(std::string const & prettyname)
{
- Formats::const_iterator it = lyx::formats.begin();
- Formats::const_iterator const end = lyx::formats.end();
+ Formats::const_iterator it = formats.begin();
+ Formats::const_iterator const end = formats.end();
it = std::find_if(it, end, SamePrettyName(prettyname));
return it == end ? 0 : &*it;
}
defaultLanguageCO->clear();
// store the lang identifiers for later
- std::vector<LanguagePair> const langs =
- lyx::frontend::getLanguageData(false);
+ std::vector<LanguagePair> const langs = frontend::getLanguageData(false);
lang_ = getSecond(langs);
std::vector<LanguagePair>::const_iterator lit = langs.begin();
int restored_buffer_;
/// the references
- std::vector<lyx::docstring> refs_;
+ std::vector<docstring> refs_;
};
} // namespace frontend
connect(topspaceED, SIGNAL(returnPressed()),
this, SLOT(topspace_changed()));
- connect(topspaceUnit, SIGNAL(selectionChanged(lyx::LyXLength::UNIT)),
+ connect(topspaceUnit, SIGNAL(selectionChanged(LyXLength::UNIT)),
this, SLOT(topspace_changed()));
connect(topspaceCO, SIGNAL(activated(int)), this, SLOT(topspace_changed()));
connect(bottomspaceED, SIGNAL(returnPressed()),
this, SLOT(bottomspace_changed()));
- connect(bottomspaceUnit, SIGNAL(selectionChanged(lyx::LyXLength::UNIT)),
+ connect(bottomspaceUnit, SIGNAL(selectionChanged(LyXLength::UNIT)),
this, SLOT(bottomspace_changed()));
connect(bottomspaceCO, SIGNAL(activated(int)), this, SLOT(bottomspace_changed()));
connect(interlinespaceED, SIGNAL(returnPressed()),
this, SLOT(interlinespace_changed()));
- connect(interlinespaceUnit, SIGNAL(selectionChanged(lyx::LyXLength::UNIT)),
+ connect(interlinespaceUnit, SIGNAL(selectionChanged(LyXLength::UNIT)),
this, SLOT(interlinespace_changed()));
connect(interlinespaceCO, SIGNAL(activated(int)), this, SLOT(interlinespace_changed()));
connect(booktabsRB, SIGNAL(clicked(bool)), this, SLOT(booktabsChanged(bool)));
connect(lastfooterNoContentsCB, SIGNAL(clicked()), this, SLOT(ltLastFooterEmpty_clicked()));
connect(specialAlignmentED, SIGNAL(returnPressed()), this, SLOT(specialAlignment_changed()));
connect(widthED, SIGNAL(returnPressed()), this, SLOT(width_changed()));
- connect(widthUnit, SIGNAL(selectionChanged(lyx::LyXLength::UNIT)), this, SLOT(width_changed()));
+ connect(widthUnit, SIGNAL(selectionChanged(LyXLength::UNIT)), this, SLOT(width_changed()));
connect(closePB, SIGNAL(clicked()), this, SLOT(close_clicked()));
connect(borders, SIGNAL(topSet(bool)), this, SLOT(topBorder_changed()));
connect(borders, SIGNAL(bottomSet(bool)), this, SLOT(bottomBorder_changed()));
TocIterator const it = toc_models_[type]->tocIterator(index);
- LYXERR(Debug::GUI)
- << "QToc::goTo " << lyx::to_utf8(it->str())
- << endl;
+ LYXERR(Debug::GUI) << "QToc::goTo " << to_utf8(it->str()) << endl;
ControlToc::goTo(*it);
}
this, SLOT(enableCustom(int)));
connect(keepCB, SIGNAL(clicked()),
this, SLOT(change_adaptor()));
- connect(unitCO, SIGNAL(selectionChanged(lyx::LyXLength::UNIT)),
+ connect(unitCO, SIGNAL(selectionChanged(LyXLength::UNIT)),
this, SLOT(change_adaptor()));
valueLE->setValidator(unsignedLengthValidator(valueLE));
#include <QPushButton>
#include <QLineEdit>
-using lyx::docstring;
-
namespace lyx {
namespace frontend {
void Qt2BC::setWidgetEnabled(QWidget * obj, bool enabled) const
{
// yuck, rtti, but the user comes first
- if (obj->inherits("QLineEdit")) {
- QLineEdit * le(static_cast<QLineEdit*>(obj));
+ if (QLineEdit * le = qobject_cast<QLineEdit*>(obj))
le->setReadOnly(!enabled);
- } else {
+ else
obj->setEnabled(enabled);
- }
- Qt::FocusPolicy const p =
- (enabled) ? Qt::StrongFocus : Qt::NoFocus;
- obj->setFocusPolicy(p);
+ obj->setFocusPolicy(enabled ? Qt::StrongFocus : Qt::NoFocus);
}
public:
///
Qt2BC(ButtonController const &,
- lyx::docstring const & = _("Cancel"),
- lyx::docstring const & = _("Close"));
+ docstring const & = _("Cancel"),
+ docstring const & = _("Close"));
private:
/// Updates the button sensitivity (enabled/disabled)
void setButtonEnabled(QPushButton *, bool enabled) const;
void setWidgetEnabled(QWidget *, bool enabled) const;
/// Set the label on the button
- void setButtonLabel(QPushButton *, lyx::docstring const & label) const;
+ void setButtonLabel(QPushButton *, docstring const & label) const;
};
} // namespace frontend
LYXERR(Debug::GUI)
<< "Toc: at depth " << iter->depth()
- << ", added item " << lyx::to_utf8(iter->str())
+ << ", added item " << to_utf8(iter->str())
<< endl;
populate(iter, end, top_level_item);
void PanelStack::addCategory(docstring const & n, docstring const & parent)
{
- QTreeWidgetItem * item;
+ QTreeWidgetItem * item = 0;
+ QString const name = toqstr(n);
- QString const name(toqstr(n));
-
- LYXERR(Debug::GUI) << "addCategory n= " << lyx::to_utf8(n) << " parent= " << endl;
+ LYXERR(Debug::GUI) << "addCategory n= " << to_utf8(n) << " parent= " << endl;
int depth = 1;
#include <QWidget>
#include <map>
-#include <string>
-
class QTreeWidget;
class QTreeWidgetItem;
PanelStack(QWidget * parent = 0);
/// add a category with no associated panel
- void addCategory(lyx::docstring const & name,
- lyx::docstring const & parent = lyx::docstring());
+ void addCategory(docstring const & name,
+ docstring const & parent = docstring());
/// add a widget panel with a given name, under the given parent
- void addPanel(QWidget * panel, lyx::docstring const & name,
- lyx::docstring const & parent = lyx::docstring());
+ void addPanel(QWidget * panel, docstring const & name,
+ docstring const & parent = docstring());
/// set current panel by logical name
- void setCurrentPanel(lyx::docstring const &);
+ void setCurrentPanel(docstring const &);
virtual QSize sizeHint() const;
+
public Q_SLOTS:
/// set current panel from an item
- void switchPanel(QTreeWidgetItem * i, QTreeWidgetItem* previous=0);
+ void switchPanel(QTreeWidgetItem * it, QTreeWidgetItem * previous = 0);
private:
- typedef std::map<lyx::docstring, QTreeWidgetItem *> PanelMap;
+ typedef std::map<docstring, QTreeWidgetItem *> PanelMap;
PanelMap panel_map_;
LengthCombo * lengthCombo)
{
if (!checkBox->isChecked())
- lengthToWidgets(lineEdit, lengthCombo, "auto", lengthCombo->currentLengthItem());
+ lengthToWidgets(lineEdit, lengthCombo,
+ "auto", lengthCombo->currentLengthItem());
else if (lineEdit->text() == "auto")
- lengthToWidgets(lineEdit, lengthCombo, string(""), lengthCombo->currentLengthItem());
+ lengthToWidgets(lineEdit, lengthCombo, string(),
+ lengthCombo->currentLengthItem());
}
nxtpos2 < nxtpos1);
docstring const line_plus_word =
- line.empty() ? word : line + lyx::char_type(' ') + word;
+ line.empty() ? word : line + char_type(' ') + word;
// FIXME: make w be size_t
if (int(line_plus_word.length()) >= w) {
- sout += line + lyx::char_type('\n');
+ sout += line + char_type('\n');
if (newline) {
- sout += word + lyx::char_type('\n');
+ sout += word + char_type('\n');
line.erase();
} else {
line = word;
}
} else if (newline) {
- sout += line_plus_word + lyx::char_type('\n');
+ sout += line_plus_word + char_type('\n');
line.erase();
} else {
if (!line.empty())
- line += lyx::char_type(' ');
+ line += char_type(' ');
line += word;
}
#include <sstream>
using lyx::support::isStrDbl;
-using lyx::docstring;
-
using std::string;
{}
-namespace {
-
-docstring const printable_list(docstring const & invalid_chars)
+static docstring const printable_list(docstring const & invalid_chars)
{
docstring s;
docstring::const_iterator const begin = invalid_chars.begin();
return s;
}
-} // namespace anon
-
QValidator::State PathValidator::validate(QString & qtext, int &) const
{