2006-03-05 17:24:44 +00:00
|
|
|
/**
|
2007-08-31 05:53:55 +00:00
|
|
|
* \file GuiCharacter.cpp
|
2006-03-05 17:24:44 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
2007-10-06 11:17:57 +00:00
|
|
|
* \author Angus Leeming
|
2006-03-05 17:24:44 +00:00
|
|
|
* \author Edwin Leuven
|
|
|
|
* \author John Levon
|
2018-05-04 19:34:09 +02:00
|
|
|
* \author Jürgen Spitzmüller
|
2006-03-05 17:24:44 +00:00
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
#include "GuiCharacter.h"
|
2007-09-05 20:33:29 +00:00
|
|
|
|
2008-05-14 11:27:33 +00:00
|
|
|
#include "GuiApplication.h"
|
2006-03-05 17:24:44 +00:00
|
|
|
#include "qt_helpers.h"
|
2008-05-14 11:27:33 +00:00
|
|
|
|
2007-09-11 21:27:57 +00:00
|
|
|
#include "Font.h"
|
2007-10-06 11:17:57 +00:00
|
|
|
#include "Buffer.h"
|
|
|
|
#include "BufferParams.h"
|
2008-05-07 18:53:48 +00:00
|
|
|
#include "BufferView.h"
|
2015-05-14 22:23:44 +02:00
|
|
|
#include "Color.h"
|
|
|
|
#include "ColorCache.h"
|
2015-05-18 11:11:45 +02:00
|
|
|
#include "ColorSet.h"
|
2008-05-07 18:53:48 +00:00
|
|
|
#include "Cursor.h"
|
2007-10-06 11:17:57 +00:00
|
|
|
#include "FuncRequest.h"
|
|
|
|
#include "Language.h"
|
2008-05-07 18:53:48 +00:00
|
|
|
#include "Paragraph.h"
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2015-05-17 17:15:01 +02:00
|
|
|
#include "support/gettext.h"
|
2015-05-18 11:11:45 +02:00
|
|
|
#include "support/lstrings.h"
|
2015-05-17 17:15:01 +02:00
|
|
|
|
2008-05-14 11:27:33 +00:00
|
|
|
#include <QAbstractItemModel>
|
2018-12-17 12:59:40 +01:00
|
|
|
#include <QPushButton>
|
2015-05-14 22:23:44 +02:00
|
|
|
#include <QComboBox>
|
2018-12-21 12:31:25 +01:00
|
|
|
#include <QMenu>
|
2008-05-14 11:27:33 +00:00
|
|
|
#include <QModelIndex>
|
2008-05-14 12:03:12 +00:00
|
|
|
#include <QSettings>
|
2008-05-14 11:27:33 +00:00
|
|
|
#include <QVariant>
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2007-12-12 10:16:00 +00:00
|
|
|
using namespace std;
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
namespace lyx {
|
|
|
|
namespace frontend {
|
|
|
|
|
2008-03-08 07:59:47 +00:00
|
|
|
static QList<ShapePair> shapeData()
|
2007-09-11 21:27:57 +00:00
|
|
|
{
|
2008-03-08 07:59:47 +00:00
|
|
|
QList<ShapePair> shapes;
|
|
|
|
shapes << ShapePair(qt_("No change"), IGNORE_SHAPE);
|
2018-05-07 09:03:45 +02:00
|
|
|
shapes << ShapePair(qt_("Default"), INHERIT_SHAPE);
|
2008-03-08 07:59:47 +00:00
|
|
|
shapes << ShapePair(qt_("Upright"), UP_SHAPE);
|
|
|
|
shapes << ShapePair(qt_("Italic"), ITALIC_SHAPE);
|
|
|
|
shapes << ShapePair(qt_("Slanted"), SLANTED_SHAPE);
|
|
|
|
shapes << ShapePair(qt_("Small Caps"), SMALLCAPS_SHAPE);
|
|
|
|
return shapes;
|
2007-09-11 21:27:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-03-08 07:59:47 +00:00
|
|
|
static QList<SizePair> sizeData()
|
2007-09-11 21:27:57 +00:00
|
|
|
{
|
2008-03-08 07:59:47 +00:00
|
|
|
QList<SizePair> sizes;
|
2019-06-14 16:42:02 +02:00
|
|
|
sizes << SizePair(qt_("No change"), IGNORE_SIZE);
|
|
|
|
sizes << SizePair(qt_("Default"), INHERIT_SIZE);
|
|
|
|
sizes << SizePair(qt_("Tiny"), TINY_SIZE);
|
|
|
|
sizes << SizePair(qt_("Smallest"), SCRIPT_SIZE);
|
|
|
|
sizes << SizePair(qt_("Smaller"), FOOTNOTE_SIZE);
|
|
|
|
sizes << SizePair(qt_("Small"), SMALL_SIZE);
|
|
|
|
sizes << SizePair(qt_("Normal"), NORMAL_SIZE);
|
|
|
|
sizes << SizePair(qt_("Large"), LARGE_SIZE);
|
|
|
|
sizes << SizePair(qt_("Larger"), LARGER_SIZE);
|
|
|
|
sizes << SizePair(qt_("Largest"), LARGEST_SIZE);
|
|
|
|
sizes << SizePair(qt_("Huge"), HUGE_SIZE);
|
|
|
|
sizes << SizePair(qt_("Huger"), HUGER_SIZE);
|
|
|
|
sizes << SizePair(qt_("Increase"), INCREASE_SIZE);
|
|
|
|
sizes << SizePair(qt_("Decrease"), DECREASE_SIZE);
|
2008-03-08 07:59:47 +00:00
|
|
|
return sizes;
|
2007-09-11 21:27:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-03-08 07:59:47 +00:00
|
|
|
static QList<BarPair> barData()
|
2007-09-11 21:27:57 +00:00
|
|
|
{
|
2008-03-08 07:59:47 +00:00
|
|
|
QList<BarPair> bars;
|
|
|
|
bars << BarPair(qt_("No change"), IGNORE);
|
2018-05-07 09:03:45 +02:00
|
|
|
bars << BarPair(qt_("Default"), INHERIT);
|
2018-05-04 19:34:09 +02:00
|
|
|
bars << BarPair(qt_("(Without)[[underlining]]"), NONE);
|
2018-05-05 10:04:46 +02:00
|
|
|
bars << BarPair(qt_("Single[[underlining]]"), UNDERBAR);
|
|
|
|
bars << BarPair(qt_("Double[[underlining]]"), UULINE);
|
2018-05-04 19:34:09 +02:00
|
|
|
bars << BarPair(qt_("Wavy"), UWAVE);
|
2008-03-08 07:59:47 +00:00
|
|
|
return bars;
|
2007-09-11 21:27:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-05-04 19:34:09 +02:00
|
|
|
static QList<BarPair> strikeData()
|
|
|
|
{
|
|
|
|
QList<BarPair> strike;
|
|
|
|
strike << BarPair(qt_("No change"), IGNORE);
|
2018-05-07 09:03:45 +02:00
|
|
|
strike << BarPair(qt_("Default"), INHERIT);
|
2018-05-04 19:34:09 +02:00
|
|
|
strike << BarPair(qt_("(Without)[[strikethrough]]"), NONE);
|
2018-05-05 10:04:46 +02:00
|
|
|
strike << BarPair(qt_("Single[[strikethrough]]"), STRIKEOUT);
|
2018-05-04 19:34:09 +02:00
|
|
|
strike << BarPair(qt_("With /"), XOUT);
|
|
|
|
return strike;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-05-17 17:15:01 +02:00
|
|
|
static QList<ColorCode> colorData()
|
2007-09-11 21:27:57 +00:00
|
|
|
{
|
2015-05-17 17:15:01 +02:00
|
|
|
QList<ColorCode> colors;
|
|
|
|
colors << Color_black;
|
|
|
|
colors << Color_blue;
|
|
|
|
colors << Color_brown;
|
|
|
|
colors << Color_cyan;
|
|
|
|
colors << Color_darkgray;
|
|
|
|
colors << Color_gray;
|
|
|
|
colors << Color_green;
|
|
|
|
colors << Color_lightgray;
|
|
|
|
colors << Color_lime;
|
|
|
|
colors << Color_magenta;
|
|
|
|
colors << Color_olive;
|
|
|
|
colors << Color_orange;
|
|
|
|
colors << Color_pink;
|
|
|
|
colors << Color_purple;
|
|
|
|
colors << Color_red;
|
|
|
|
colors << Color_teal;
|
|
|
|
colors << Color_violet;
|
|
|
|
colors << Color_white;
|
|
|
|
colors << Color_yellow;
|
2008-03-08 07:59:47 +00:00
|
|
|
return colors;
|
2007-09-11 21:27:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-03-08 07:59:47 +00:00
|
|
|
static QList<SeriesPair> seriesData()
|
2007-09-11 21:27:57 +00:00
|
|
|
{
|
2008-03-08 07:59:47 +00:00
|
|
|
QList<SeriesPair> series;
|
|
|
|
series << SeriesPair(qt_("No change"), IGNORE_SERIES);
|
2018-05-07 09:03:45 +02:00
|
|
|
series << SeriesPair(qt_("Default"), INHERIT_SERIES);
|
2008-03-08 07:59:47 +00:00
|
|
|
series << SeriesPair(qt_("Medium"), MEDIUM_SERIES);
|
|
|
|
series << SeriesPair(qt_("Bold"), BOLD_SERIES);
|
2007-09-11 21:27:57 +00:00
|
|
|
return series;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-03-08 07:59:47 +00:00
|
|
|
static QList<FamilyPair> familyData()
|
2007-09-11 21:27:57 +00:00
|
|
|
{
|
2008-03-08 07:59:47 +00:00
|
|
|
QList<FamilyPair> families;
|
|
|
|
families << FamilyPair(qt_("No change"), IGNORE_FAMILY);
|
2018-05-07 09:03:45 +02:00
|
|
|
families << FamilyPair(qt_("Default"), INHERIT_FAMILY);
|
2008-03-08 07:59:47 +00:00
|
|
|
families << FamilyPair(qt_("Roman"), ROMAN_FAMILY);
|
|
|
|
families << FamilyPair(qt_("Sans Serif"), SANS_FAMILY);
|
|
|
|
families << FamilyPair(qt_("Typewriter"), TYPEWRITER_FAMILY);
|
|
|
|
return families;
|
2007-09-11 21:27:57 +00:00
|
|
|
}
|
|
|
|
|
2008-05-07 22:42:44 +00:00
|
|
|
|
|
|
|
static QList<LanguagePair> languageData()
|
|
|
|
{
|
|
|
|
QList<LanguagePair> list;
|
2008-05-14 11:27:33 +00:00
|
|
|
// FIXME (Abdel 14/05/2008): it would be nice if we could use this model
|
|
|
|
// directly in the language combo; but, as we need also the 'No Change' and
|
2018-05-07 09:03:45 +02:00
|
|
|
// 'Default' items, this is not possible right now. Separating those two
|
2008-05-14 11:27:33 +00:00
|
|
|
// entries in radio buttons would be a better GUI IMHO.
|
|
|
|
QAbstractItemModel * language_model = guiApp->languageModel();
|
|
|
|
// Make sure the items are sorted.
|
|
|
|
language_model->sort(0);
|
|
|
|
|
|
|
|
for (int i = 0; i != language_model->rowCount(); ++i) {
|
|
|
|
QModelIndex index = language_model->index(i, 0);
|
|
|
|
list << LanguagePair(index.data(Qt::DisplayRole).toString(),
|
|
|
|
index.data(Qt::UserRole).toString());
|
2008-05-07 22:42:44 +00:00
|
|
|
}
|
|
|
|
return list;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-05-07 18:53:48 +00:00
|
|
|
namespace {
|
|
|
|
|
2008-05-07 21:05:04 +00:00
|
|
|
template<typename T>
|
2008-05-07 22:42:44 +00:00
|
|
|
void fillCombo(QComboBox * combo, QList<T> const & list)
|
2008-05-07 18:53:48 +00:00
|
|
|
{
|
2008-05-07 21:05:04 +00:00
|
|
|
typename QList<T>::const_iterator cit = list.begin();
|
2008-05-07 18:53:48 +00:00
|
|
|
for (; cit != list.end(); ++cit)
|
|
|
|
combo->addItem(cit->first);
|
|
|
|
}
|
|
|
|
|
2015-05-14 22:23:44 +02:00
|
|
|
template<typename T>
|
|
|
|
void fillComboColor(QComboBox * combo, QList<T> const & list)
|
|
|
|
{
|
|
|
|
// at first add the 2 colors "No change" and "No color"
|
2015-05-17 17:15:01 +02:00
|
|
|
combo->addItem(qt_("No change"), "ignore");
|
2018-05-07 09:03:45 +02:00
|
|
|
combo->addItem(qt_("Default"), "inherit");
|
2018-05-05 10:04:46 +02:00
|
|
|
combo->addItem(qt_("(Without)[[color]]"), "none");
|
2015-05-14 22:23:44 +02:00
|
|
|
// now add the real colors
|
|
|
|
QPixmap coloritem(32, 32);
|
|
|
|
QColor color;
|
2015-05-17 17:15:01 +02:00
|
|
|
QList<ColorCode>::const_iterator cit = list.begin();
|
|
|
|
for (; cit != list.end(); ++cit) {
|
|
|
|
QString const lyxname = toqstr(lcolor.getLyXName(*cit));
|
|
|
|
QString const guiname = toqstr(translateIfPossible(lcolor.getGUIName(*cit)));
|
|
|
|
color = QColor(guiApp->colorCache().get(*cit, false));
|
2015-05-14 22:23:44 +02:00
|
|
|
coloritem.fill(color);
|
2015-05-17 17:15:01 +02:00
|
|
|
combo->addItem(QIcon(coloritem), guiname, lyxname);
|
2015-05-14 22:23:44 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-07-23 13:11:54 +02:00
|
|
|
} // namespace
|
2007-09-11 21:27:57 +00:00
|
|
|
|
2007-11-23 09:44:02 +00:00
|
|
|
GuiCharacter::GuiCharacter(GuiView & lv)
|
2018-05-08 07:46:53 +02:00
|
|
|
: GuiDialog(lv, "character", qt_("Text Properties")),
|
2018-05-29 15:08:38 +02:00
|
|
|
font_(ignore_font, ignore_language),
|
|
|
|
emph_(false), noun_(false), nospellcheck_(false)
|
2007-04-25 10:57:54 +00:00
|
|
|
{
|
|
|
|
setupUi(this);
|
2007-09-05 20:33:29 +00:00
|
|
|
|
2018-12-24 16:18:54 +01:00
|
|
|
// fix height to minimum
|
|
|
|
setFixedHeight(sizeHint().height());
|
|
|
|
|
2018-07-08 16:35:38 +02:00
|
|
|
connect(buttonBox, SIGNAL(clicked(QAbstractButton *)),
|
|
|
|
this, SLOT(slotButtonBox(QAbstractButton *)));
|
2009-01-18 14:41:12 +00:00
|
|
|
connect(autoapplyCB, SIGNAL(stateChanged(int)), this,
|
|
|
|
SLOT(slotAutoApply()));
|
2007-04-25 10:57:54 +00:00
|
|
|
|
2020-08-07 16:13:48 +02:00
|
|
|
connect(ulineCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
|
|
|
|
connect(strikeCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
|
|
|
|
connect(sizeCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
|
|
|
|
connect(familyCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
|
|
|
|
connect(seriesCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
|
|
|
|
connect(shapeCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
|
|
|
|
connect(colorCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
|
|
|
|
connect(langCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2008-03-08 07:59:47 +00:00
|
|
|
family = familyData();
|
|
|
|
series = seriesData();
|
|
|
|
shape = shapeData();
|
|
|
|
size = sizeData();
|
|
|
|
bar = barData();
|
2018-05-04 19:34:09 +02:00
|
|
|
strike = strikeData();
|
2008-03-08 07:59:47 +00:00
|
|
|
color = colorData();
|
Fix deprecation warnings from use of qSort()
This commit replaces qSort with std::sort to fix warnings from compiling with
Qt 5.14.1. Below is one of the warnings:
error: ‘void qSort(RandomAccessIterator, RandomAccessIterator, LessThan) [with RandomAccessIterator = QList<lyx::ColorCode>::iterator; LessT$
an = bool (*)(lyx::ColorCode, lyx::ColorCode)]’ is deprecated: Use std::sort [-Werror=deprecated-declarations]
qSort() has been deprecated since Qt 5.2. Quoting from the ChangeLog [1]:
With STL no longer being optional for building and using Qt, a number of
parts of QtAlgorithms no longer make sense, and have therefore been
deprecated. Replacements are available in the STL, and generally have
much better performance
There are some cases that require more than just a trivial substitution, but
our code does not appear to use any of those cases.
For some discussion on the differences in speed of std::sort() and
qSort(), see the following:
https://phabricator.kde.org/D10857
These are just warnings now, but will likely be errors with Qt 6:
https://bugreports.qt.io/browse/QTBUG-73048
I tested that LyX can still be built against Qt 4.8.7 with this commit.
This commit follows 24926b2e, which also fixes some deprecation warnings.
[1]
https://code.qt.io/cgit/qt/qtbase.git/tree/dist/changes-5.2.0/?h=v5.2.0
2020-03-05 11:35:49 -05:00
|
|
|
sort(color.begin(), color.end(), ColorSorter);
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2008-05-07 18:53:48 +00:00
|
|
|
language = languageData();
|
2018-05-07 09:03:45 +02:00
|
|
|
language.prepend(LanguagePair(qt_("Default"), "reset"));
|
2008-05-07 18:53:48 +00:00
|
|
|
language.prepend(LanguagePair(qt_("No change"), "ignore"));
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2008-05-07 18:53:48 +00:00
|
|
|
fillCombo(familyCO, family);
|
|
|
|
fillCombo(seriesCO, series);
|
|
|
|
fillCombo(sizeCO, size);
|
|
|
|
fillCombo(shapeCO, shape);
|
2018-05-04 19:34:09 +02:00
|
|
|
fillCombo(ulineCO, bar);
|
|
|
|
fillCombo(strikeCO, strike);
|
2015-05-14 22:23:44 +02:00
|
|
|
fillComboColor(colorCO, color);
|
2008-05-07 18:53:48 +00:00
|
|
|
fillCombo(langCO, language);
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2009-01-18 14:41:12 +00:00
|
|
|
bc().setPolicy(ButtonPolicy::OkApplyCancelAutoReadOnlyPolicy);
|
2018-07-08 16:35:38 +02:00
|
|
|
bc().setOK(buttonBox->button(QDialogButtonBox::Ok));
|
|
|
|
bc().setApply(buttonBox->button(QDialogButtonBox::Apply));
|
|
|
|
bc().setCancel(buttonBox->button(QDialogButtonBox::Cancel));
|
2018-12-17 12:59:40 +01:00
|
|
|
bc().setRestore(buttonBox->button(QDialogButtonBox::Reset));
|
2009-01-18 14:41:12 +00:00
|
|
|
bc().setAutoApply(autoapplyCB);
|
2007-09-05 20:33:29 +00:00
|
|
|
bc().addReadOnly(familyCO);
|
|
|
|
bc().addReadOnly(seriesCO);
|
|
|
|
bc().addReadOnly(sizeCO);
|
|
|
|
bc().addReadOnly(shapeCO);
|
2018-05-04 19:34:09 +02:00
|
|
|
bc().addReadOnly(ulineCO);
|
|
|
|
bc().addReadOnly(strikeCO);
|
|
|
|
bc().addReadOnly(nounCB);
|
|
|
|
bc().addReadOnly(emphCB);
|
2018-05-06 19:48:21 +02:00
|
|
|
bc().addReadOnly(nospellcheckCB);
|
2007-09-05 20:33:29 +00:00
|
|
|
bc().addReadOnly(langCO);
|
|
|
|
bc().addReadOnly(colorCO);
|
|
|
|
bc().addReadOnly(autoapplyCB);
|
2006-12-24 11:38:19 +00:00
|
|
|
|
2018-12-21 12:31:25 +01:00
|
|
|
// Add button menu to restore button to reset
|
|
|
|
// all widgets to "Defaults" or "No Change"
|
|
|
|
resetdefault_ = new QAction(qt_("Reset All To &Default"), this);
|
|
|
|
resetnochange_ = new QAction(qt_("Reset All To No Chan&ge"), this);
|
|
|
|
QMenu * resetmenu = new QMenu();
|
|
|
|
resetmenu->addAction(resetdefault_);
|
|
|
|
resetmenu->addAction(resetnochange_);
|
|
|
|
buttonBox->button(QDialogButtonBox::RestoreDefaults)->setMenu(resetmenu);
|
|
|
|
buttonBox->button(QDialogButtonBox::RestoreDefaults)->setText(qt_("&Reset All Fields"));
|
|
|
|
connect(resetdefault_, SIGNAL(triggered()), this, SLOT(resetToDefault()));
|
|
|
|
connect(resetnochange_, SIGNAL(triggered()), this, SLOT(resetToNoChange()));
|
|
|
|
|
2014-08-25 20:08:59 +02:00
|
|
|
#ifdef Q_OS_MAC
|
2008-05-22 15:20:43 +00:00
|
|
|
// On Mac it's common to have tool windows which are always in the
|
|
|
|
// foreground and are hidden when the main window is not focused.
|
|
|
|
setWindowFlags(Qt::Tool);
|
|
|
|
autoapplyCB->setChecked(true);
|
|
|
|
#endif
|
2006-03-05 17:24:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-05-04 19:34:09 +02:00
|
|
|
void GuiCharacter::on_emphCB_clicked()
|
|
|
|
{
|
|
|
|
// skip intermediate state at user click
|
|
|
|
if (!emph_) {
|
|
|
|
emphCB->setCheckState(Qt::Checked);
|
|
|
|
emph_ = true;
|
|
|
|
}
|
|
|
|
change_adaptor();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void GuiCharacter::on_nounCB_clicked()
|
|
|
|
{
|
|
|
|
// skip intermediate state at user click
|
|
|
|
if (!noun_) {
|
|
|
|
nounCB->setCheckState(Qt::Checked);
|
|
|
|
noun_ = true;
|
|
|
|
}
|
|
|
|
change_adaptor();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-05-06 19:48:21 +02:00
|
|
|
void GuiCharacter::on_nospellcheckCB_clicked()
|
|
|
|
{
|
|
|
|
// skip intermediate state at user click
|
|
|
|
if (!nospellcheck_) {
|
|
|
|
nospellcheckCB->setCheckState(Qt::Checked);
|
|
|
|
nospellcheck_ = true;
|
|
|
|
}
|
|
|
|
change_adaptor();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-12-21 12:31:25 +01:00
|
|
|
void GuiCharacter::resetToDefault()
|
2007-09-05 20:33:29 +00:00
|
|
|
{
|
2018-12-17 12:59:40 +01:00
|
|
|
Font font(inherit_font);
|
|
|
|
font.setLanguage(reset_language);
|
|
|
|
paramsToDialog(font);
|
|
|
|
change_adaptor();
|
2007-09-05 20:33:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-12-21 12:31:25 +01:00
|
|
|
void GuiCharacter::resetToNoChange()
|
|
|
|
{
|
|
|
|
Font font(ignore_font);
|
|
|
|
font.setLanguage(ignore_language);
|
|
|
|
paramsToDialog(font);
|
|
|
|
change_adaptor();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-04-20 20:32:00 +00:00
|
|
|
template<class P, class B>
|
|
|
|
static int findPos2nd(QList<P> const & vec, B const & val)
|
2006-03-05 17:24:44 +00:00
|
|
|
{
|
2008-03-08 07:59:47 +00:00
|
|
|
for (int i = 0; i != vec.size(); ++i)
|
|
|
|
if (vec[i].second == val)
|
|
|
|
return i;
|
2006-03-05 17:24:44 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-05-04 19:34:09 +02:00
|
|
|
namespace{
|
2018-12-21 12:14:11 +01:00
|
|
|
FontDeco getBar(FontInfo const & fi)
|
2007-10-06 11:17:57 +00:00
|
|
|
{
|
2018-05-04 19:34:09 +02:00
|
|
|
if (fi.underbar() == FONT_ON)
|
|
|
|
return UNDERBAR;
|
2008-05-07 18:53:48 +00:00
|
|
|
|
2018-05-04 19:34:09 +02:00
|
|
|
if (fi.uuline() == FONT_ON)
|
|
|
|
return UULINE;
|
|
|
|
|
|
|
|
if (fi.uwave() == FONT_ON)
|
|
|
|
return UWAVE;
|
|
|
|
|
|
|
|
if (fi.underbar() == FONT_IGNORE)
|
|
|
|
return IGNORE;
|
|
|
|
|
2018-12-17 10:12:02 +01:00
|
|
|
if (fi.underbar() == FONT_INHERIT)
|
|
|
|
return INHERIT;
|
|
|
|
|
2018-05-04 19:34:09 +02:00
|
|
|
return NONE;
|
2007-10-06 11:17:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-12-21 12:14:11 +01:00
|
|
|
FontDeco getStrike(FontInfo const & fi)
|
2007-10-06 11:17:57 +00:00
|
|
|
{
|
2018-05-04 19:34:09 +02:00
|
|
|
if (fi.strikeout() == FONT_ON)
|
|
|
|
return STRIKEOUT;
|
2007-10-06 11:17:57 +00:00
|
|
|
|
2018-05-04 19:34:09 +02:00
|
|
|
if (fi.xout() == FONT_ON)
|
|
|
|
return XOUT;
|
2007-10-06 11:17:57 +00:00
|
|
|
|
2018-05-04 19:34:09 +02:00
|
|
|
if (fi.strikeout() == FONT_IGNORE)
|
|
|
|
return IGNORE;
|
2009-05-03 22:45:14 +00:00
|
|
|
|
2018-12-17 10:12:02 +01:00
|
|
|
if (fi.strikeout() == FONT_INHERIT)
|
|
|
|
return INHERIT;
|
|
|
|
|
2018-05-04 19:34:09 +02:00
|
|
|
return NONE;
|
|
|
|
}
|
2017-04-05 00:01:19 +02:00
|
|
|
|
2009-05-05 09:26:28 +00:00
|
|
|
|
2018-05-04 19:34:09 +02:00
|
|
|
Qt::CheckState getMarkupState(lyx::FontState fs)
|
|
|
|
{
|
|
|
|
switch (fs) {
|
2018-12-17 10:37:14 +01:00
|
|
|
case FONT_INHERIT:
|
2018-05-04 19:34:09 +02:00
|
|
|
case FONT_OFF:
|
|
|
|
return Qt::Unchecked;
|
|
|
|
case FONT_ON:
|
|
|
|
return Qt::Checked;
|
|
|
|
case FONT_TOGGLE:
|
|
|
|
case FONT_IGNORE:
|
|
|
|
default:
|
|
|
|
return Qt::PartiallyChecked;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
lyx::FontState setMarkupState(Qt::CheckState cs)
|
|
|
|
{
|
|
|
|
switch (cs) {
|
|
|
|
case Qt::Unchecked:
|
|
|
|
return FONT_OFF;
|
|
|
|
case Qt::Checked:
|
|
|
|
return FONT_ON;
|
|
|
|
case Qt::PartiallyChecked:
|
|
|
|
default:
|
|
|
|
return FONT_IGNORE;
|
|
|
|
}
|
|
|
|
}
|
2009-05-05 09:26:28 +00:00
|
|
|
|
2018-05-04 19:34:09 +02:00
|
|
|
} // end namespace anon
|
2007-10-06 11:17:57 +00:00
|
|
|
|
|
|
|
|
2018-12-17 12:59:40 +01:00
|
|
|
void GuiCharacter::change_adaptor()
|
|
|
|
{
|
|
|
|
changed();
|
|
|
|
|
|
|
|
checkRestoreDefaults();
|
|
|
|
|
|
|
|
if (!autoapplyCB->isChecked())
|
|
|
|
return;
|
|
|
|
|
|
|
|
// to be really good here, we should set the combos to the values of
|
|
|
|
// the current text, and make it appear as "no change" if the values
|
Run codespell on src/frontends
Command was:
codespell -w -i 3 -S Makefile.in -L mathed,afe,tthe,ue,fro,uint,larg,alph,te,thes,alle,Claus,pres,pass-thru src/frontends/
2020-06-26 00:04:31 +02:00
|
|
|
// stay the same between applies. Might be difficult though wrt to a
|
2018-12-17 12:59:40 +01:00
|
|
|
// moved cursor - jbl
|
|
|
|
slotApply();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void GuiCharacter::checkRestoreDefaults()
|
|
|
|
{
|
2018-12-21 12:31:25 +01:00
|
|
|
if (familyCO->currentIndex() == -1 || seriesCO->currentIndex() == -1
|
|
|
|
|| shapeCO->currentIndex() == -1 || sizeCO->currentIndex() == -1
|
|
|
|
|| ulineCO->currentIndex() == -1 || strikeCO->currentIndex() == -1
|
|
|
|
|| colorCO->currentIndex() == -1 || langCO->currentIndex() == -1)
|
|
|
|
// dialog not yet built
|
|
|
|
return;
|
|
|
|
|
|
|
|
// (De)Activate Restore Defaults menu items
|
|
|
|
resetdefault_->setEnabled(
|
2018-12-17 12:59:40 +01:00
|
|
|
family[familyCO->currentIndex()].second != INHERIT_FAMILY
|
|
|
|
|| series[seriesCO->currentIndex()].second != INHERIT_SERIES
|
|
|
|
|| shape[shapeCO->currentIndex()].second != INHERIT_SHAPE
|
2019-06-14 16:42:02 +02:00
|
|
|
|| size[sizeCO->currentIndex()].second != INHERIT_SIZE
|
2018-12-17 12:59:40 +01:00
|
|
|
|| setMarkupState(emphCB->checkState()) != FONT_OFF
|
|
|
|
|| setMarkupState(nounCB->checkState()) != FONT_OFF
|
|
|
|
|| setMarkupState(nospellcheckCB->checkState()) != FONT_OFF
|
|
|
|
|| bar[ulineCO->currentIndex()].second != INHERIT
|
|
|
|
|| strike[strikeCO->currentIndex()].second != INHERIT
|
|
|
|
|| lcolor.getFromLyXName(fromqstr(colorCO->itemData(colorCO->currentIndex()).toString())) != Color_inherit
|
|
|
|
|| languages.getLanguage(fromqstr(language[langCO->currentIndex()].second)) != reset_language);
|
2018-12-21 12:31:25 +01:00
|
|
|
|
|
|
|
resetnochange_->setEnabled(
|
|
|
|
family[familyCO->currentIndex()].second != IGNORE_FAMILY
|
|
|
|
|| series[seriesCO->currentIndex()].second != IGNORE_SERIES
|
|
|
|
|| shape[shapeCO->currentIndex()].second != IGNORE_SHAPE
|
2019-06-14 16:42:02 +02:00
|
|
|
|| size[sizeCO->currentIndex()].second != IGNORE_SIZE
|
2018-12-21 12:31:25 +01:00
|
|
|
|| setMarkupState(emphCB->checkState()) != FONT_IGNORE
|
|
|
|
|| setMarkupState(nounCB->checkState()) != FONT_IGNORE
|
|
|
|
|| setMarkupState(nospellcheckCB->checkState()) != FONT_IGNORE
|
|
|
|
|| bar[ulineCO->currentIndex()].second != IGNORE
|
|
|
|
|| strike[strikeCO->currentIndex()].second != IGNORE
|
|
|
|
|| lcolor.getFromLyXName(fromqstr(colorCO->itemData(colorCO->currentIndex()).toString())) != Color_ignore
|
|
|
|
|| languages.getLanguage(fromqstr(language[langCO->currentIndex()].second)) != ignore_language);
|
2018-12-17 12:59:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-05-04 19:34:09 +02:00
|
|
|
void GuiCharacter::updateContents()
|
|
|
|
{
|
|
|
|
if (bufferview()->cursor().selection()) {
|
2018-12-16 12:29:15 +01:00
|
|
|
Font font = bufferview()->cursor().current_font;
|
2018-05-04 19:34:09 +02:00
|
|
|
FontInfo fi = font.fontInfo();
|
2018-05-04 15:42:01 -04:00
|
|
|
BufferParams const & bp = buffer().masterParams();
|
2018-05-04 19:34:09 +02:00
|
|
|
|
|
|
|
// Check if each font attribute is constant for the selection range.
|
2018-05-04 15:42:01 -04:00
|
|
|
DocIterator const from = bufferview()->cursor().selectionBegin();
|
|
|
|
DocIterator const to = bufferview()->cursor().selectionEnd();
|
2018-05-04 19:34:09 +02:00
|
|
|
for (DocIterator dit = from ; dit != to && !dit.atEnd(); ) {
|
|
|
|
if (!dit.inTexted()) {
|
|
|
|
dit.forwardPos();
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
Paragraph const & par = dit.paragraph();
|
|
|
|
pos_type const pos = dit.pos();
|
2018-12-17 09:03:46 +01:00
|
|
|
Font tmp = par.getFontSettings(bp, pos);
|
2018-05-04 19:34:09 +02:00
|
|
|
if (font.language() != tmp.language())
|
|
|
|
font.setLanguage(ignore_language);
|
|
|
|
if (fi.family() != tmp.fontInfo().family())
|
|
|
|
font.fontInfo().setFamily(IGNORE_FAMILY);
|
|
|
|
if (fi.series() != tmp.fontInfo().series())
|
|
|
|
font.fontInfo().setSeries(IGNORE_SERIES);
|
|
|
|
if (fi.shape() != tmp.fontInfo().shape())
|
|
|
|
font.fontInfo().setShape(IGNORE_SHAPE);
|
|
|
|
if (fi.size() != tmp.fontInfo().size())
|
2019-06-14 16:42:02 +02:00
|
|
|
font.fontInfo().setSize(IGNORE_SIZE);
|
2018-05-04 19:34:09 +02:00
|
|
|
if (fi.emph() != tmp.fontInfo().emph())
|
|
|
|
font.fontInfo().setEmph(FONT_IGNORE);
|
|
|
|
if (fi.noun() != tmp.fontInfo().noun())
|
|
|
|
font.fontInfo().setNoun(FONT_IGNORE);
|
2018-05-06 19:48:21 +02:00
|
|
|
if (fi.nospellcheck() != tmp.fontInfo().nospellcheck())
|
|
|
|
font.fontInfo().setNoSpellcheck(FONT_IGNORE);
|
2018-05-04 19:34:09 +02:00
|
|
|
if (fi.color() != tmp.fontInfo().color())
|
|
|
|
font.fontInfo().setColor(Color_ignore);
|
|
|
|
if (fi.underbar() != tmp.fontInfo().underbar()
|
|
|
|
|| fi.uuline() != tmp.fontInfo().uuline()
|
|
|
|
|| fi.uwave() != tmp.fontInfo().uwave())
|
|
|
|
setBar(font.fontInfo(), IGNORE);
|
|
|
|
if (fi.strikeout() != tmp.fontInfo().strikeout()
|
|
|
|
|| fi.xout() != tmp.fontInfo().xout())
|
|
|
|
setStrike(font.fontInfo(), IGNORE);
|
|
|
|
dit.forwardPos();
|
|
|
|
}
|
|
|
|
font_ = font;
|
|
|
|
} else
|
2018-12-16 12:29:15 +01:00
|
|
|
font_ = bufferview()->cursor().current_font;
|
2018-05-04 19:34:09 +02:00
|
|
|
|
2018-12-17 10:12:02 +01:00
|
|
|
// If we use the buffer language, display "Default"
|
|
|
|
if (font_.language() == buffer().params().language)
|
|
|
|
font_.setLanguage(reset_language);
|
|
|
|
|
2018-05-04 19:34:09 +02:00
|
|
|
paramsToDialog(font_);
|
2018-12-17 12:59:40 +01:00
|
|
|
|
|
|
|
checkRestoreDefaults();
|
2007-10-06 11:17:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-12-21 12:14:11 +01:00
|
|
|
void GuiCharacter::setBar(FontInfo & fi, FontDeco val)
|
2007-10-06 11:17:57 +00:00
|
|
|
{
|
|
|
|
switch (val) {
|
|
|
|
case IGNORE:
|
2008-05-07 18:53:48 +00:00
|
|
|
fi.setUnderbar(FONT_IGNORE);
|
2013-07-17 08:30:42 +02:00
|
|
|
fi.setUuline(FONT_IGNORE);
|
|
|
|
fi.setUwave(FONT_IGNORE);
|
2007-10-06 11:17:57 +00:00
|
|
|
break;
|
2018-05-04 19:34:09 +02:00
|
|
|
case UNDERBAR:
|
|
|
|
setBar(fi, NONE);
|
|
|
|
fi.setUnderbar(FONT_ON);
|
2007-10-06 11:17:57 +00:00
|
|
|
break;
|
2018-05-04 19:34:09 +02:00
|
|
|
case UULINE:
|
|
|
|
setBar(fi, NONE);
|
|
|
|
fi.setUuline(FONT_ON);
|
2007-10-06 11:17:57 +00:00
|
|
|
break;
|
2018-05-04 19:34:09 +02:00
|
|
|
case UWAVE:
|
|
|
|
setBar(fi, NONE);
|
|
|
|
fi.setUwave(FONT_ON);
|
2009-05-03 22:45:14 +00:00
|
|
|
break;
|
2018-05-04 19:34:09 +02:00
|
|
|
case INHERIT:
|
|
|
|
fi.setUnderbar(FONT_INHERIT);
|
|
|
|
fi.setUuline(FONT_INHERIT);
|
|
|
|
fi.setUwave(FONT_INHERIT);
|
2017-04-05 00:01:19 +02:00
|
|
|
break;
|
2018-05-04 19:34:09 +02:00
|
|
|
case NONE:
|
|
|
|
fi.setUnderbar(FONT_OFF);
|
|
|
|
fi.setUuline(FONT_OFF);
|
|
|
|
fi.setUwave(FONT_OFF);
|
2009-05-05 09:26:28 +00:00
|
|
|
break;
|
2018-05-04 19:34:09 +02:00
|
|
|
case XOUT:
|
|
|
|
case STRIKEOUT:
|
|
|
|
default:
|
2009-05-05 09:26:28 +00:00
|
|
|
break;
|
2018-05-04 19:34:09 +02:00
|
|
|
}
|
|
|
|
}
|
2009-05-05 09:26:28 +00:00
|
|
|
|
2007-10-06 11:17:57 +00:00
|
|
|
|
2018-12-21 12:14:11 +01:00
|
|
|
void GuiCharacter::setStrike(FontInfo & fi, FontDeco val)
|
2018-05-04 19:34:09 +02:00
|
|
|
{
|
|
|
|
switch (val) {
|
|
|
|
case IGNORE:
|
|
|
|
fi.setStrikeout(FONT_IGNORE);
|
|
|
|
fi.setXout(FONT_IGNORE);
|
|
|
|
break;
|
|
|
|
case STRIKEOUT:
|
|
|
|
setStrike(fi, NONE);
|
|
|
|
fi.setStrikeout(FONT_ON);
|
|
|
|
break;
|
|
|
|
case XOUT:
|
|
|
|
setStrike(fi, NONE);
|
|
|
|
fi.setXout(FONT_ON);
|
|
|
|
break;
|
2007-10-06 11:17:57 +00:00
|
|
|
case INHERIT:
|
2009-05-03 22:45:14 +00:00
|
|
|
fi.setStrikeout(FONT_INHERIT);
|
2017-04-05 00:01:19 +02:00
|
|
|
fi.setXout(FONT_INHERIT);
|
2018-05-04 19:34:09 +02:00
|
|
|
break;
|
|
|
|
case NONE:
|
|
|
|
fi.setStrikeout(FONT_OFF);
|
|
|
|
fi.setXout(FONT_OFF);
|
|
|
|
break;
|
|
|
|
case UNDERBAR:
|
|
|
|
case UWAVE:
|
|
|
|
case UULINE:
|
|
|
|
default:
|
2007-10-06 11:17:57 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
|
2008-05-07 18:53:48 +00:00
|
|
|
void GuiCharacter::paramsToDialog(Font const & font)
|
2007-10-06 11:17:57 +00:00
|
|
|
{
|
2008-05-07 18:53:48 +00:00
|
|
|
FontInfo const & fi = font.fontInfo();
|
|
|
|
familyCO->setCurrentIndex(findPos2nd(family, fi.family()));
|
|
|
|
seriesCO->setCurrentIndex(findPos2nd(series, fi.series()));
|
|
|
|
shapeCO->setCurrentIndex(findPos2nd(shape, fi.shape()));
|
|
|
|
sizeCO->setCurrentIndex(findPos2nd(size, fi.size()));
|
2018-05-04 19:34:09 +02:00
|
|
|
ulineCO->setCurrentIndex(findPos2nd(bar, getBar(fi)));
|
|
|
|
strikeCO->setCurrentIndex(findPos2nd(strike, getStrike(fi)));
|
2015-05-17 17:15:01 +02:00
|
|
|
colorCO->setCurrentIndex(colorCO->findData(toqstr(lcolor.getLyXName(fi.color()))));
|
2018-05-04 19:34:09 +02:00
|
|
|
emphCB->setCheckState(getMarkupState(fi.emph()));
|
|
|
|
nounCB->setCheckState(getMarkupState(fi.noun()));
|
2018-05-06 19:48:21 +02:00
|
|
|
nospellcheckCB->setCheckState(getMarkupState(fi.nospellcheck()));
|
2018-05-04 19:34:09 +02:00
|
|
|
emph_ = emphCB->checkState() == Qt::Checked;
|
|
|
|
noun_ = nounCB->checkState() == Qt::Checked;
|
2018-05-06 19:48:21 +02:00
|
|
|
nospellcheck_ = nospellcheckCB->checkState() == Qt::Checked;
|
2008-05-07 18:53:48 +00:00
|
|
|
|
2008-05-07 23:33:56 +00:00
|
|
|
// reset_language is a null pointer.
|
|
|
|
QString const lang = (font.language() == reset_language)
|
|
|
|
? "reset" : toqstr(font.language()->lang());
|
2008-05-07 18:53:48 +00:00
|
|
|
langCO->setCurrentIndex(findPos2nd(language, lang));
|
2006-03-05 17:24:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-05-07 18:53:48 +00:00
|
|
|
void GuiCharacter::applyView()
|
2006-03-05 17:24:44 +00:00
|
|
|
{
|
2008-05-07 18:53:48 +00:00
|
|
|
FontInfo & fi = font_.fontInfo();
|
|
|
|
fi.setFamily(family[familyCO->currentIndex()].second);
|
|
|
|
fi.setSeries(series[seriesCO->currentIndex()].second);
|
|
|
|
fi.setShape(shape[shapeCO->currentIndex()].second);
|
|
|
|
fi.setSize(size[sizeCO->currentIndex()].second);
|
2018-05-04 19:34:09 +02:00
|
|
|
fi.setEmph(setMarkupState(emphCB->checkState()));
|
|
|
|
fi.setNoun(setMarkupState(nounCB->checkState()));
|
2018-05-06 19:48:21 +02:00
|
|
|
fi.setNoSpellcheck(setMarkupState(nospellcheckCB->checkState()));
|
2018-05-04 19:34:09 +02:00
|
|
|
setBar(fi, bar[ulineCO->currentIndex()].second);
|
|
|
|
setStrike(fi, strike[strikeCO->currentIndex()].second);
|
2015-05-17 17:15:01 +02:00
|
|
|
fi.setColor(lcolor.getFromLyXName(fromqstr(colorCO->itemData(colorCO->currentIndex()).toString())));
|
2008-05-07 18:53:48 +00:00
|
|
|
|
|
|
|
font_.setLanguage(languages.getLanguage(
|
|
|
|
fromqstr(language[langCO->currentIndex()].second)));
|
2007-10-06 11:17:57 +00:00
|
|
|
}
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
|
2008-05-07 18:53:48 +00:00
|
|
|
bool GuiCharacter::initialiseParams(string const &)
|
2007-10-06 11:17:57 +00:00
|
|
|
{
|
2008-05-07 23:33:56 +00:00
|
|
|
if (autoapplyCB->isChecked())
|
|
|
|
return true;
|
|
|
|
|
2008-05-07 18:53:48 +00:00
|
|
|
FontInfo & fi = font_.fontInfo();
|
|
|
|
|
|
|
|
// so that the user can press Ok
|
|
|
|
if (fi.family() != IGNORE_FAMILY
|
|
|
|
|| fi.series() != IGNORE_SERIES
|
|
|
|
|| fi.shape() != IGNORE_SHAPE
|
2019-06-14 16:42:02 +02:00
|
|
|
|| fi.size() != IGNORE_SIZE
|
2008-05-07 18:53:48 +00:00
|
|
|
|| getBar(fi) != IGNORE
|
|
|
|
|| fi.color() != Color_ignore
|
|
|
|
|| font_.language() != ignore_language)
|
|
|
|
setButtonsValid(true);
|
|
|
|
|
|
|
|
paramsToDialog(font_);
|
2018-05-05 17:24:09 +02:00
|
|
|
// Make sure that the bc is in the INITIAL state
|
|
|
|
if (bc().policy().buttonStatus(ButtonPolicy::OKAY))
|
|
|
|
bc().restore();
|
2008-05-07 18:53:48 +00:00
|
|
|
return true;
|
2006-03-05 17:24:44 +00:00
|
|
|
}
|
|
|
|
|
2007-10-06 11:17:57 +00:00
|
|
|
|
2008-05-07 18:53:48 +00:00
|
|
|
void GuiCharacter::dispatchParams()
|
2007-10-06 11:17:57 +00:00
|
|
|
{
|
2018-05-04 19:34:09 +02:00
|
|
|
dispatch(FuncRequest(getLfun(), font_.toString(false)));
|
2007-10-06 11:17:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-10-18 13:12:20 +02:00
|
|
|
void GuiCharacter::saveSession(QSettings & settings) const
|
2008-05-14 12:03:12 +00:00
|
|
|
{
|
2017-10-18 13:12:20 +02:00
|
|
|
Dialog::saveSession(settings);
|
2008-05-14 12:03:12 +00:00
|
|
|
settings.setValue(sessionKey() + "/autoapply", autoapplyCB->isChecked());
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void GuiCharacter::restoreSession()
|
|
|
|
{
|
|
|
|
Dialog::restoreSession();
|
|
|
|
QSettings settings;
|
|
|
|
autoapplyCB->setChecked(
|
|
|
|
settings.value(sessionKey() + "/autoapply").toBool());
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-11-23 09:44:02 +00:00
|
|
|
Dialog * createGuiCharacter(GuiView & lv) { return new GuiCharacter(lv); }
|
2007-10-06 11:17:57 +00:00
|
|
|
|
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|
2007-04-25 10:57:54 +00:00
|
|
|
|
2008-11-14 14:28:50 +00:00
|
|
|
#include "moc_GuiCharacter.cpp"
|