#include "GuiFontLoader.h"
#include "GuiKeySymbol.h"
#include "qt_helpers.h"
+#include "Validator.h"
#include "Author.h"
#include "BufferList.h"
: PrefModule(qt_(catOutput), qt_("General"), form)
{
setupUi(this);
+
DateED->setValidator(new StrftimeValidator(DateED));
+ dviCB->setValidator(new NoNewLineValidator(dviCB));
+ pdfCB->setValidator(new NoNewLineValidator(pdfCB));
+
connect(DateED, SIGNAL(textChanged(QString)),
this, SIGNAL(changed()));
connect(plaintextLinelengthSB, SIGNAL(valueChanged(int)),
this, SIGNAL(changed()));
connect(cursorTextCB, SIGNAL(clicked()),
this, SIGNAL(changed()));
+ connect(minlengthSB, SIGNAL(valueChanged(int)),
+ this, SIGNAL(changed()));
}
rc.completion_cursor_text = cursorTextCB->isChecked();
rc.completion_popup_after_complete =
popupAfterCompleteCB->isChecked();
+ rc.completion_minlength = minlengthSB->value();
}
cursorTextCB->setChecked(rc.completion_cursor_text);
popupAfterCompleteCB->setChecked(rc.completion_popup_after_complete);
enableCB();
+ minlengthSB->setValue(rc.completion_minlength);
}
: PrefModule(qt_(catOutput), qt_("LaTeX"), form)
{
setupUi(this);
+
+ latexEncodingED->setValidator(new NoNewLineValidator(latexEncodingED));
+ latexDviPaperED->setValidator(new NoNewLineValidator(latexDviPaperED));
+ latexBibtexED->setValidator(new NoNewLineValidator(latexBibtexED));
+ latexJBibtexED->setValidator(new NoNewLineValidator(latexJBibtexED));
+ latexIndexED->setValidator(new NoNewLineValidator(latexIndexED));
+ latexJIndexED->setValidator(new NoNewLineValidator(latexJIndexED));
+ latexNomenclED->setValidator(new NoNewLineValidator(latexNomenclED));
+ latexChecktexED->setValidator(new NoNewLineValidator(latexChecktexED));
+
connect(latexEncodingCB, SIGNAL(clicked()),
this, SIGNAL(changed()));
connect(latexEncodingED, SIGNAL(textChanged(QString)),
this, SIGNAL(changed()));
connect(latexDviPaperED, SIGNAL(textChanged(QString)),
this, SIGNAL(changed()));
- connect(latexPaperSizeCO, SIGNAL(activated(int)),
+ connect(latexNomenclED, SIGNAL(textChanged(QString)),
this, SIGNAL(changed()));
#if defined(__CYGWIN__) || defined(_WIN32)
rc.nomencl_command = fromqstr(latexNomenclED->text());
rc.auto_reset_options = latexAutoresetCB->isChecked();
rc.view_dvi_paper_option = fromqstr(latexDviPaperED->text());
- rc.default_papersize =
- form_->toPaperSize(latexPaperSizeCO->currentIndex());
#if defined(__CYGWIN__) || defined(_WIN32)
rc.windows_style_tex_paths = pathCB->isChecked();
#endif
latexNomenclED->setText(toqstr(rc.nomencl_command));
latexAutoresetCB->setChecked(rc.auto_reset_options);
latexDviPaperED->setText(toqstr(rc.view_dvi_paper_option));
- latexPaperSizeCO->setCurrentIndex(
- form_->fromPaperSize(rc.default_papersize));
#if defined(__CYGWIN__) || defined(_WIN32)
pathCB->setChecked(rc.windows_style_tex_paths);
#endif
connect(texinputsPrefixED, SIGNAL(textChanged(QString)),
this, SIGNAL(changed()));
+
+ pathPrefixED->setValidator(new NoNewLineValidator(pathPrefixED));
+ texinputsPrefixED->setValidator(new NoNewLineValidator(texinputsPrefixED));
}
this, SIGNAL(changed()));
connect(spellcheckNotesCB, SIGNAL(clicked()),
this, SIGNAL(changed()));
+
+ altLanguageED->setValidator(new NoNewLineValidator(altLanguageED));
+ escapeCharactersED->setValidator(new NoNewLineValidator(escapeCharactersED));
#else
spellcheckerCB->setEnabled(false);
altLanguageED->setEnabled(false);
connect(maxAgeLE, SIGNAL(textEdited(QString)),
this, SIGNAL(changed()));
+ converterED->setValidator(new NoNewLineValidator(converterED));
+ converterFlagED->setValidator(new NoNewLineValidator(converterFlagED));
maxAgeLE->setValidator(new QDoubleValidator(maxAgeLE));
//converterDefGB->setFocusProxy(convertersLW);
}
: PrefModule(qt_(catFiles), qt_("File Formats"), form)
{
setupUi(this);
+
formatED->setValidator(new FormatNameValidator(formatsCB, form_->formats()));
formatsCB->setValidator(new FormatPrettynameValidator(formatsCB, form_->formats()));
+ extensionsED->setValidator(new NoNewLineValidator(extensionsED));
+ shortcutED->setValidator(new NoNewLineValidator(shortcutED));
+ editorED->setValidator(new NoNewLineValidator(editorED));
+ viewerED->setValidator(new NoNewLineValidator(viewerED));
+ copierED->setValidator(new NoNewLineValidator(copierED));
connect(documentCB, SIGNAL(clicked()),
this, SLOT(setFlags()));
formatED->setText(toqstr(f.name()));
copierED->setText(toqstr(form_->movers().command(f.name())));
- extensionED->setText(toqstr(f.extension()));
+ extensionsED->setText(toqstr(f.extensions()));
shortcutED->setText(
toqstr(l10n_shortcut(f.prettyname(), f.shortcut())));
documentCB->setChecked((f.documentFormat()));
}
-void PrefFileformats::on_extensionED_textEdited(const QString & s)
+void PrefFileformats::on_extensionsED_textEdited(const QString & s)
{
- currentFormat().setExtension(fromqstr(s));
+ currentFormat().setExtensions(fromqstr(s));
changed();
}
+
void PrefFileformats::on_viewerED_textEdited(const QString & s)
{
currentFormat().setViewer(fromqstr(s));
this, SIGNAL(changed()));
connect(defaultDecimalPointLE, SIGNAL(textChanged(QString)),
this, SIGNAL(changed()));
+ connect(defaultLengthUnitCO, SIGNAL(activated(int)),
+ this, SIGNAL(changed()));
+
+ languagePackageED->setValidator(new NoNewLineValidator(languagePackageED));
+ startCommandED->setValidator(new NoNewLineValidator(startCommandED));
+ endCommandED->setValidator(new NoNewLineValidator(endCommandED));
uiLanguageCO->clear();
defaultDecimalPointLE->setInputMask("X; ");
defaultDecimalPointLE->setMaxLength(1);
+ defaultLengthUnitCO->addItem(lyx::qt_(unit_name_gui[Length::CM]), Length::CM);
+ defaultLengthUnitCO->addItem(lyx::qt_(unit_name_gui[Length::IN]), Length::IN);
+
set<string> added;
uiLanguageCO->blockSignals(true);
uiLanguageCO->addItem(qt_("Default"), toqstr("auto"));
rc.gui_language = fromqstr(
uiLanguageCO->itemData(uiLanguageCO->currentIndex()).toString());
rc.default_decimal_point = fromqstr(defaultDecimalPointLE->text());
+ rc.default_length_unit = (Length::UNIT) defaultLengthUnitCO->itemData(defaultLengthUnitCO->currentIndex()).toInt();
}
startCommandED->setText(toqstr(rc.language_command_begin));
endCommandED->setText(toqstr(rc.language_command_end));
defaultDecimalPointLE->setText(toqstr(rc.default_decimal_point));
+ int pos = defaultLengthUnitCO->findData(int(rc.default_length_unit));
+ defaultLengthUnitCO->setCurrentIndex(pos);
- int pos = uiLanguageCO->findData(toqstr(rc.gui_language));
+ pos = uiLanguageCO->findData(toqstr(rc.gui_language));
uiLanguageCO->blockSignals(true);
uiLanguageCO->setCurrentIndex(pos);
uiLanguageCO->blockSignals(false);
this, SIGNAL(changed()));
connect(printerPaperSizeED, SIGNAL(textChanged(QString)),
this, SIGNAL(changed()));
+
+ printerNameED->setValidator(new NoNewLineValidator(printerNameED));
+ printerCommandED->setValidator(new NoNewLineValidator(printerCommandED));
+ printerEvenED->setValidator(new NoNewLineValidator(printerEvenED));
+ printerPageRangeED->setValidator(new NoNewLineValidator(printerPageRangeED));
+ printerCopiesED->setValidator(new NoNewLineValidator(printerCopiesED));
+ printerReverseED->setValidator(new NoNewLineValidator(printerReverseED));
+ printerToFileED->setValidator(new NoNewLineValidator(printerToFileED));
+ printerPaperTypeED->setValidator(new NoNewLineValidator(printerPaperTypeED));
+ printerExtraED->setValidator(new NoNewLineValidator(printerExtraED));
+ printerOddED->setValidator(new NoNewLineValidator(printerOddED));
+ printerCollatedED->setValidator(new NoNewLineValidator(printerCollatedED));
+ printerLandscapeED->setValidator(new NoNewLineValidator(printerLandscapeED));
+ printerToPrinterED->setValidator(new NoNewLineValidator(printerToPrinterED));
+ printerExtensionED->setValidator(new NoNewLineValidator(printerExtensionED));
+ printerPaperSizeED->setValidator(new NoNewLineValidator(printerPaperSizeED));
+ printerSpoolCommandED->setValidator(new NoNewLineValidator(printerSpoolCommandED));
+ printerSpoolPrefixED->setValidator(new NoNewLineValidator(printerSpoolPrefixED));
}
this, SIGNAL(changed()));
connect(emailED, SIGNAL(textChanged(QString)),
this, SIGNAL(changed()));
+
+ nameED->setValidator(new NoNewLineValidator(nameED));
+ emailED->setValidator(new NoNewLineValidator(emailED));
}
}
-// We support less paper sizes than the document dialog
-// Therefore this adjustment is needed.
-PAPER_SIZE GuiPreferences::toPaperSize(int i) const
-{
- switch (i) {
- case 0:
- return PAPER_DEFAULT;
- case 1:
- return PAPER_USLETTER;
- case 2:
- return PAPER_USLEGAL;
- case 3:
- return PAPER_USEXECUTIVE;
- case 4:
- return PAPER_A3;
- case 5:
- return PAPER_A4;
- case 6:
- return PAPER_A5;
- case 7:
- return PAPER_B5;
- default:
- // should not happen
- return PAPER_DEFAULT;
- }
-}
-
-
-int GuiPreferences::fromPaperSize(PAPER_SIZE papersize) const
-{
- switch (papersize) {
- case PAPER_DEFAULT:
- return 0;
- case PAPER_USLETTER:
- return 1;
- case PAPER_USLEGAL:
- return 2;
- case PAPER_USEXECUTIVE:
- return 3;
- case PAPER_A3:
- return 4;
- case PAPER_A4:
- return 5;
- case PAPER_A5:
- return 6;
- case PAPER_B5:
- return 7;
- default:
- // should not happen
- return 0;
- }
-}
-
-
Dialog * createGuiPreferences(GuiView & lv) { return new GuiPreferences(lv); }