#include "debug.h"
#include "qt_helpers.h"
-#include "lcolorcache.h"
+#include "ColorCache.h"
#include "Qt2BC.h"
#include "qt_helpers.h"
#include "gettext.h"
#include "LColor.h"
-#include "lcolorcache.h"
+#include "ColorCache.h"
#include "controllers/ControlPrefs.h"
{
setupUi(this);
connect(asciiLinelengthSB, SIGNAL(valueChanged(int)),
- this, SIGNAL(changed));
+ this, SIGNAL(changed()));
connect(asciiRoffED, SIGNAL(textChanged(const QString&)),
this, SIGNAL(changed()));
}
}
-void PrefKeyboard::on_firstKeymapED_clicked()
+void PrefKeyboard::on_firstKeymapPB_clicked(bool)
{
QString file = testKeymap(firstKeymapED->text());
if (!file.isEmpty())
}
-void PrefKeyboard::on_secondKeymapED_clicked()
+void PrefKeyboard::on_secondKeymapPB_clicked(bool)
{
QString file = testKeymap(secondKeymapED->text());
if (!file.isEmpty())
prefcolors_.push_back(color.name());
QPixmap coloritem(32, 32);
coloritem.fill(color);
- QListWidgetItem * newItem = new QListWidgetItem(QIcon(coloritem),
+ // This is not a memory leak:
+ /*QListWidgetItem * newItem =*/ new QListWidgetItem(QIcon(coloritem),
toqstr(lcolor.getGUIName(lc)), lyxObjectsLW);
}
newcolors_ = prefcolors_;
- connect(colorChangePB, SIGNAL(clicked()),
+ connect(colorChangePB, SIGNAL(clicked()),
this, SLOT(change_color()));
- connect(lyxObjectsLW, SIGNAL(itemActivated(QListWidgetItem*)),
+ connect(lyxObjectsLW, SIGNAL(itemActivated(QListWidgetItem*)),
this, SLOT(change_color()));
}
-void PrefColors::apply(LyXRC & rc) const
+void PrefColors::apply(LyXRC & /*rc*/) const
{
- for (int i = 0; i < lcolors_.size(); ++i) {
+ for (unsigned int i = 0; i < lcolors_.size(); ++i) {
if (prefcolors_[i]!=newcolors_[i])
form_->controller().setColor(lcolors_[i], fromqstr(newcolors_[i]));
}
}
-void PrefColors::update(LyXRC const & rc)
+void PrefColors::update(LyXRC const & /*rc*/)
{
}
{
int const row = lyxObjectsLW->currentRow();
QString color = newcolors_[row];
- QColor c(QColorDialog::getColor(QColor(color),
+ QColor c(QColorDialog::getColor(QColor(color),
qApp->focusWidget() ? qApp->focusWidget() : qApp->mainWidget()));
if (c.name()!=color) {
QPixmap coloritem(32, 32);
coloritem.fill(c);
lyxObjectsLW->currentItem()->setIcon(QIcon(coloritem));
- emit changed();
+ // emit signal
+ changed();
}
}
void PrefCygwinPath::apply(LyXRC & rc) const
{
- rc.cygwin_path_fix = pathCB->isChecked();
+ rc.windows_style_tex_paths = pathCB->isChecked();
}
void PrefCygwinPath::update(LyXRC const & rc)
{
- pathCB->setChecked(rc.cygwin_path_fix);
+ pathCB->setChecked(rc.windows_style_tex_paths);
}
{
setupUi(this);
- connect(converterNewPB, SIGNAL(clicked()),
+ connect(converterNewPB, SIGNAL(clicked()),
this, SLOT(new_converter()));
- connect(converterRemovePB, SIGNAL(clicked()),
+ connect(converterRemovePB, SIGNAL(clicked()),
this, SLOT(remove_converter()));
- connect(converterModifyPB, SIGNAL(clicked()),
+ connect(converterModifyPB, SIGNAL(clicked()),
this, SLOT(modify_converter()));
- connect(convertersLW, SIGNAL(currentRowChanged(int)),
+ connect(convertersLW, SIGNAL(currentRowChanged(int)),
this, SLOT(switch_converter(int)));
- connect(converterFromCO, SIGNAL(activated(const QString&)),
+ connect(converterFromCO, SIGNAL(activated(const QString&)),
this, SLOT(converter_changed()));
- connect(converterToCO, SIGNAL(activated(const QString&)),
+ connect(converterToCO, SIGNAL(activated(const QString&)),
this, SLOT(converter_changed()));
- connect(converterED, SIGNAL(textChanged(const QString&)),
+ connect(converterED, SIGNAL(textChanged(const QString&)),
this, SLOT(converter_changed()));
- connect(converterFlagED, SIGNAL(textChanged(const QString&)),
+ connect(converterFlagED, SIGNAL(textChanged(const QString&)),
this, SLOT(converter_changed()));
- connect(converterNewPB, SIGNAL(clicked()),
+ connect(converterNewPB, SIGNAL(clicked()),
this, SIGNAL(changed()));
- connect(converterRemovePB, SIGNAL(clicked()),
+ connect(converterRemovePB, SIGNAL(clicked()),
this, SIGNAL(changed()));
- connect(converterModifyPB, SIGNAL(clicked()),
+ connect(converterModifyPB, SIGNAL(clicked()),
this, SIGNAL(changed()));
}
-void PrefConverters::apply(LyXRC & rc) const
+void PrefConverters::apply(LyXRC & /*rc*/) const
{
}
-void PrefConverters::update(LyXRC const & rc)
+void PrefConverters::update(LyXRC const & /*rc*/)
{
updateGui();
}
// restore selection
if (!current.isEmpty()) {
- QList<QListWidgetItem *> const item =
+ QList<QListWidgetItem *> const item =
convertersLW->findItems(current, Qt::MatchExactly);
if (item.size()>0)
convertersLW->setCurrentItem(item.at(0));
connect(copierNewPB, SIGNAL(clicked()), this, SLOT(new_copier()));
connect(copierRemovePB, SIGNAL(clicked()), this, SLOT(remove_copier()));
connect(copierModifyPB, SIGNAL(clicked()), this, SLOT(modify_copier()));
- connect(AllCopiersLW, SIGNAL(currentRowChanged(int)),
+ connect(AllCopiersLW, SIGNAL(currentRowChanged(int)),
this, SLOT(switch_copierLB(int)));
connect(copierFormatCO, SIGNAL(activated(int)), this, SLOT(switch_copierCO(int)));
connect(copierNewPB, SIGNAL(clicked()),
}
-void PrefCopiers::apply(LyXRC & rc) const
+void PrefCopiers::apply(LyXRC & /*rc*/) const
{
}
-void PrefCopiers::update(LyXRC const & rc)
+void PrefCopiers::update(LyXRC const & /*rc*/)
{
update();
}
// restore selection
if (!current.isEmpty()) {
- QList<QListWidgetItem *> item =
+ QList<QListWidgetItem *> item =
AllCopiersLW->findItems(current, Qt::MatchExactly);
if (item.size()>0)
AllCopiersLW->setCurrentItem(item.at(0));
QString selected = copierFormatCO->currentText();
bool known = false;
- for (unsigned int i = 0; i != AllCopiersLW->count(); i++) {
+ for (int i = 0; i < AllCopiersLW->count(); ++i) {
if (AllCopiersLW->item(i)->text() == selected)
known = true;
}
connect(formatNewPB, SIGNAL(clicked()), this, SLOT(new_format()));
connect(formatRemovePB, SIGNAL(clicked()), this, SLOT(remove_format()));
connect(formatModifyPB, SIGNAL(clicked()), this, SLOT(modify_format()));
- connect(formatsLW, SIGNAL(currentRowChanged(int)),
+ connect(formatsLW, SIGNAL(currentRowChanged(int)),
this, SLOT(switch_format(int)));
connect(formatED, SIGNAL(textChanged(const QString&)), this, SLOT(fileformat_changed()));
connect(guiNameED, SIGNAL(textChanged(const QString&)), this, SLOT(fileformat_changed()));
connect(extensionED, SIGNAL(textChanged(const QString&)), this, SLOT(fileformat_changed()));
connect(viewerED, SIGNAL(textChanged(const QString&)), this, SLOT(fileformat_changed()));
connect(editorED, SIGNAL(textChanged(const QString&)), this, SLOT(fileformat_changed()));
+ connect(documentCB, SIGNAL(toggled(bool)), this, SLOT(fileformat_changed()));
connect(formatNewPB, SIGNAL(clicked()),
this, SIGNAL(changed()));
connect(formatRemovePB, SIGNAL(clicked()),
}
-void PrefFileformats::apply(LyXRC & rc) const
+void PrefFileformats::apply(LyXRC & /*rc*/) const
{
}
-void PrefFileformats::update(LyXRC const & rc)
+void PrefFileformats::update(LyXRC const & /*rc*/)
{
update();
}
shortcutED->setText(toqstr(f.shortcut()));
viewerED->setText(toqstr(f.viewer()));
editorED->setText(toqstr(f.editor()));
+ documentCB->setChecked((f.documentFormat()));
formatRemovePB->setEnabled(
!form_->converters().formatIsUsed(f.name()));
int const sel = form_->formats().getNumber(fromqstr(format));
bool gui_name_known = false;
int where = sel;
- for (unsigned int i = 0; i != formatsLW->count(); i++) {
+ for (int i = 0; i < formatsLW->count(); ++i) {
if (formatsLW->item(i)->text() == gui_name) {
gui_name_known = true;
where = formatsLW->item(i)->type();
string const old_extension(f.extension());
string const old_viewer(f.viewer());
string const old_editor(f.editor());
+ bool const old_document(f.documentFormat());
string const new_pretty(fromqstr(gui_name));
string const new_shortcut(fromqstr(shortcutED->text()));
string const new_extension(fromqstr(extensionED->text()));
string const new_viewer(fromqstr(viewerED->text()));
string const new_editor(fromqstr(editorED->text()));
+ bool const new_document(documentCB->isChecked());
bool modified = ((old_pretty != new_pretty) || (old_shortcut != new_shortcut)
|| (old_extension != new_extension) || (old_viewer != new_viewer)
- || (old_editor != new_editor));
+ || (old_editor != new_editor) || old_document != new_document);
formatModifyPB->setEnabled(
valid && known && modified && !known_otherwise);
string const shortcut = fromqstr(shortcutED->text());
string const viewer = fromqstr(viewerED->text());
string const editor = fromqstr(editorED->text());
+ bool const document = documentCB->isChecked();
- form_->formats().add(name, extension, prettyname, shortcut, viewer, editor);
+ form_->formats().add(name, extension, prettyname, shortcut, viewer,
+ editor, document);
form_->formats().sort();
update();
string const shortcut = fromqstr(shortcutED->text());
string const viewer = fromqstr(viewerED->text());
string const editor = fromqstr(editorED->text());
+ bool const document = documentCB->isChecked();
- form_->formats().add(name, extension, prettyname, shortcut, viewer, editor);
+ form_->formats().add(name, extension, prettyname, shortcut, viewer,
+ editor, document);
form_->formats().sort();
formatsLW->setUpdatesEnabled(false);
add(new PrefScreenFonts(form_));
add(new PrefColors(form_));
-#if defined(__CYGWIN__) || defined(__CYGWIN32__)
+#if defined(__CYGWIN__) || defined(_WIN32)
add(new PrefCygwinPath);
#endif
add(formats);
add(new PrefCopiers(form_));
-
+
add(new PrefLanguage);
add(new PrefPrinter);
add(new PrefUserInterface(form_));