#include "GuiFontExample.h"
#include "GuiFontLoader.h"
#include "GuiKeySymbol.h"
+#include "GuiLyXFiles.h"
+#include "GuiView.h"
#include "qt_helpers.h"
#include "Validator.h"
#include <QHeaderView>
#include <QLineEdit>
#include <QMessageBox>
-#include <QPixmapCache>
#include <QPushButton>
#include <QSpinBox>
#include <QString>
lastPath = fallback_dir;
FileDialog dlg(title);
- dlg.setButton2(label1, dir1);
+ dlg.setButton1(label1, dir1);
dlg.setButton2(label2, dir2);
FileDialog::Result result;
}
-/** Wrapper around browseFile which tries to provide a filename
-* relative to the user or system directory. The dir, name and ext
-* parameters have the same meaning as in the
-* support::LibFileSearch function.
-*/
-QString browseLibFile(QString const & dir,
- QString const & name,
- QString const & ext,
- QString const & title,
- QStringList const & filters)
-{
- // FIXME UNICODE
- QString const label1 = qt_("&System files");
- QString const dir1 =
- toqstr(addName(package().system_support().absFileName(), fromqstr(dir)));
-
- QString const label2 = qt_("&User files");
- QString const dir2 =
- toqstr(addName(package().user_support().absFileName(), fromqstr(dir)));
-
- QString const result = browseFile(toqstr(
- libFileSearch(dir, name, ext).absFileName()),
- title, filters, false, dir1, dir2, QString(), QString(), dir1);
-
- // remove the extension if it is the default one
- QString noextresult;
- if (getExtension(result) == ext)
- noextresult = removeExtension(result);
- else
- noextresult = result;
-
- // remove the directory, if it is the default one
- QString const file = onlyFileName(noextresult);
- if (toqstr(libFileSearch(dir, file, ext).absFileName()) == result)
- return file;
- else
- return noextresult;
-}
-
-
/** Launch a file dialog and return the chosen directory.
pathname: a suggested pathname.
title: the title of the dialog.
// We count in reverse in order to prefer the Xft foundry
for (int i = cb->count(); --i >= 0;) {
- string name, foundry;
- parseFontName(cb->itemText(i), name, foundry);
+ string name, fnt_foundry;
+ parseFontName(cb->itemText(i), name, fnt_foundry);
if (compare_ascii_no_case(name, family) == 0) {
cb->setCurrentIndex(i);
return;
// We count in reverse in order to prefer the Xft foundry
for (int i = cb->count(); --i >= 0; ) {
- string name, foundry;
- parseFontName(cb->itemText(i), name, foundry);
- if (compare_ascii_no_case(name, foundry) == 0) {
+ string name, fnt_foundry;
+ parseFontName(cb->itemText(i), name, fnt_foundry);
+ if (compare_ascii_no_case(name, fnt_foundry) == 0) {
cb->setCurrentIndex(i);
return;
}
}
-/////////////////////////////////////////////////////////////////////
-//
-// StrftimeValidator
-//
-/////////////////////////////////////////////////////////////////////
-
-class StrftimeValidator : public QValidator
-{
-public:
- StrftimeValidator(QWidget *);
- QValidator::State validate(QString & input, int & pos) const;
-};
-
-
-StrftimeValidator::StrftimeValidator(QWidget * parent)
- : QValidator(parent)
-{
-}
-
-
-QValidator::State StrftimeValidator::validate(QString & input, int & /*pos*/) const
-{
- if (is_valid_strftime(fromqstr(input)))
- return QValidator::Acceptable;
- else
- return QValidator::Intermediate;
-}
-
-
/////////////////////////////////////////////////////////////////////
//
// PrefOutput
{
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(overwriteCO, SIGNAL(activated(int)),
}
-void PrefOutput::on_DateED_textChanged(const QString &)
-{
- QString t = DateED->text();
- int p = 0;
- bool valid = DateED->validator()->validate(t, p)
- == QValidator::Acceptable;
- setValid(DateLA, valid);
-}
-
-
void PrefOutput::applyRC(LyXRC & rc) const
{
- rc.date_insert_format = fromqstr(DateED->text());
rc.plaintext_linelen = plaintextLinelengthSB->value();
rc.forward_search_dvi = fromqstr(dviCB->currentText());
rc.forward_search_pdf = fromqstr(pdfCB->currentText());
void PrefOutput::updateRC(LyXRC const & rc)
{
- DateED->setText(toqstr(rc.date_insert_format));
plaintextLinelengthSB->setValue(rc.plaintext_linelen);
dviCB->setEditText(toqstr(rc.forward_search_dvi));
pdfCB->setEditText(toqstr(rc.forward_search_pdf));
{
setupUi(this);
- latexEncodingED->setValidator(new NoNewLineValidator(latexEncodingED));
latexDviPaperED->setValidator(new NoNewLineValidator(latexDviPaperED));
latexBibtexED->setValidator(new NoNewLineValidator(latexBibtexED));
latexJBibtexED->setValidator(new NoNewLineValidator(latexJBibtexED));
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(latexChecktexED, SIGNAL(textChanged(QString)),
this, SIGNAL(changed()));
connect(latexBibtexCO, SIGNAL(activated(int)),
}
-void PrefLatex::on_latexEncodingCB_stateChanged(int state)
-{
- latexEncodingED->setEnabled(state == Qt::Checked);
-}
-
-
void PrefLatex::on_latexBibtexCO_activated(int n)
{
QString const bibtex = latexBibtexCO->itemData(n).toString();
else
rc.index_command = fromqstr(index) + " " + fromqstr(idxopt);
- if (latexEncodingCB->isChecked())
- rc.fontenc = fromqstr(latexEncodingED->text());
- else
- rc.fontenc = "default";
rc.chktex_command = fromqstr(latexChecktexED->text());
rc.jindex_command = fromqstr(latexJIndexED->text());
rc.nomencl_command = fromqstr(latexNomenclED->text());
latexIndexOptionsLA->setText(qt_("Co&mmand:"));
}
- if (rc.fontenc == "default") {
- latexEncodingCB->setChecked(false);
- latexEncodingED->setEnabled(false);
- } else {
- latexEncodingCB->setChecked(true);
- latexEncodingED->setEnabled(true);
- latexEncodingED->setText(toqstr(rc.fontenc));
- }
latexChecktexED->setText(toqstr(rc.chktex_command));
latexJIndexED->setText(toqstr(rc.jindex_command));
latexNomenclED->setText(toqstr(rc.nomencl_command));
this, SIGNAL(changed()));
connect(screenHugerED, SIGNAL(textChanged(QString)),
this, SIGNAL(changed()));
- connect(pixmapCacheCB, SIGNAL(toggled(bool)),
- this, SIGNAL(changed()));
screenTinyED->setValidator(new QDoubleValidator(screenTinyED));
screenSmallestED->setValidator(new QDoubleValidator(screenSmallestED));
rc.typewriter_font_name, rc.typewriter_font_foundry);
rc.defaultZoom = screenZoomSB->value();
- rc.font_sizes[FONT_SIZE_TINY] = widgetToDoubleStr(screenTinyED);
- rc.font_sizes[FONT_SIZE_SCRIPT] = widgetToDoubleStr(screenSmallestED);
- rc.font_sizes[FONT_SIZE_FOOTNOTE] = widgetToDoubleStr(screenSmallerED);
- rc.font_sizes[FONT_SIZE_SMALL] = widgetToDoubleStr(screenSmallED);
- rc.font_sizes[FONT_SIZE_NORMAL] = widgetToDoubleStr(screenNormalED);
- rc.font_sizes[FONT_SIZE_LARGE] = widgetToDoubleStr(screenLargeED);
- rc.font_sizes[FONT_SIZE_LARGER] = widgetToDoubleStr(screenLargerED);
- rc.font_sizes[FONT_SIZE_LARGEST] = widgetToDoubleStr(screenLargestED);
- rc.font_sizes[FONT_SIZE_HUGE] = widgetToDoubleStr(screenHugeED);
- rc.font_sizes[FONT_SIZE_HUGER] = widgetToDoubleStr(screenHugerED);
- rc.use_pixmap_cache = pixmapCacheCB->isChecked();
-
- if (rc.font_sizes != oldrc.font_sizes
- || rc.roman_font_name != oldrc.roman_font_name
- || rc.sans_font_name != oldrc.sans_font_name
- || rc.typewriter_font_name != oldrc.typewriter_font_name
- || rc.defaultZoom != oldrc.defaultZoom) {
- // The global QPixmapCache is used in GuiPainter to cache text
- // painting so we must reset it in case any of the above
- // parameter is changed.
- QPixmapCache::clear();
- guiApp->fontLoader().update();
- form_->updateScreenFonts();
- }
+ rc.font_sizes[TINY_SIZE] = widgetToDoubleStr(screenTinyED);
+ rc.font_sizes[SCRIPT_SIZE] = widgetToDoubleStr(screenSmallestED);
+ rc.font_sizes[FOOTNOTE_SIZE] = widgetToDoubleStr(screenSmallerED);
+ rc.font_sizes[SMALL_SIZE] = widgetToDoubleStr(screenSmallED);
+ rc.font_sizes[NORMAL_SIZE] = widgetToDoubleStr(screenNormalED);
+ rc.font_sizes[LARGE_SIZE] = widgetToDoubleStr(screenLargeED);
+ rc.font_sizes[LARGER_SIZE] = widgetToDoubleStr(screenLargerED);
+ rc.font_sizes[LARGEST_SIZE] = widgetToDoubleStr(screenLargestED);
+ rc.font_sizes[HUGE_SIZE] = widgetToDoubleStr(screenHugeED);
+ rc.font_sizes[HUGER_SIZE] = widgetToDoubleStr(screenHugerED);
}
screenZoomSB->setValue(rc.defaultZoom);
updateScreenFontSizes(rc);
-
- pixmapCacheCB->setChecked(rc.use_pixmap_cache);
-#if defined(Q_WS_X11) || defined(QPA_XCB)
- pixmapCacheCB->setEnabled(false);
-#endif
-
}
void PrefScreenFonts::updateScreenFontSizes(LyXRC const & rc)
{
- doubleToWidget(screenTinyED, rc.font_sizes[FONT_SIZE_TINY]);
- doubleToWidget(screenSmallestED, rc.font_sizes[FONT_SIZE_SCRIPT]);
- doubleToWidget(screenSmallerED, rc.font_sizes[FONT_SIZE_FOOTNOTE]);
- doubleToWidget(screenSmallED, rc.font_sizes[FONT_SIZE_SMALL]);
- doubleToWidget(screenNormalED, rc.font_sizes[FONT_SIZE_NORMAL]);
- doubleToWidget(screenLargeED, rc.font_sizes[FONT_SIZE_LARGE]);
- doubleToWidget(screenLargerED, rc.font_sizes[FONT_SIZE_LARGER]);
- doubleToWidget(screenLargestED, rc.font_sizes[FONT_SIZE_LARGEST]);
- doubleToWidget(screenHugeED, rc.font_sizes[FONT_SIZE_HUGE]);
- doubleToWidget(screenHugerED, rc.font_sizes[FONT_SIZE_HUGER]);
+ doubleToWidget(screenTinyED, rc.font_sizes[TINY_SIZE]);
+ doubleToWidget(screenSmallestED, rc.font_sizes[SCRIPT_SIZE]);
+ doubleToWidget(screenSmallerED, rc.font_sizes[FOOTNOTE_SIZE]);
+ doubleToWidget(screenSmallED, rc.font_sizes[SMALL_SIZE]);
+ doubleToWidget(screenNormalED, rc.font_sizes[NORMAL_SIZE]);
+ doubleToWidget(screenLargeED, rc.font_sizes[LARGE_SIZE]);
+ doubleToWidget(screenLargerED, rc.font_sizes[LARGER_SIZE]);
+ doubleToWidget(screenLargestED, rc.font_sizes[LARGEST_SIZE]);
+ doubleToWidget(screenHugeED, rc.font_sizes[HUGE_SIZE]);
+ doubleToWidget(screenHugerED, rc.font_sizes[HUGER_SIZE]);
}
connect(colorChangePB, SIGNAL(clicked()),
this, SLOT(changeColor()));
+ connect(colorResetPB, SIGNAL(clicked()),
+ this, SLOT(resetColor()));
+ connect(colorResetAllPB, SIGNAL(clicked()),
+ this, SLOT(resetAllColor()));
connect(lyxObjectsLW, SIGNAL(itemSelectionChanged()),
this, SLOT(changeLyxObjectsSelection()));
connect(lyxObjectsLW, SIGNAL(itemActivated(QListWidgetItem*)),
void PrefColors::updateRC(LyXRC const & rc)
{
- for (unsigned int i = 0; i < lcolors_.size(); ++i) {
+ for (size_type i = 0; i < lcolors_.size(); ++i) {
QColor color = QColor(guiApp->colorCache().get(lcolors_[i], false));
QPixmap coloritem(32, 32);
coloritem.fill(color);
- lyxObjectsLW->item(i)->setIcon(QIcon(coloritem));
+ lyxObjectsLW->item(int(i))->setIcon(QIcon(coloritem));
newcolors_[i] = curcolors_[i] = color.name();
}
syscolorsCB->setChecked(rc.use_system_colors);
changeLyxObjectsSelection();
+
+ setDisabledResets();
}
if (row < 0)
return;
- QString const color = newcolors_[row];
- QColor c = QColorDialog::getColor(QColor(color), qApp->focusWidget());
+ QString const color = newcolors_[size_t(row)];
+ QColor const c = QColorDialog::getColor(QColor(color), qApp->focusWidget());
- if (c.isValid() && c.name() != color) {
- newcolors_[row] = c.name();
- QPixmap coloritem(32, 32);
- coloritem.fill(c);
- lyxObjectsLW->currentItem()->setIcon(QIcon(coloritem));
+ if (setColor(row, c, color)) {
+ setDisabledResets();
// emit signal
changed();
}
}
+
+void PrefColors::resetColor()
+{
+ int const row = lyxObjectsLW->currentRow();
+
+ // just to be sure
+ if (row < 0)
+ return;
+
+ QString const color = newcolors_[size_t(row)];
+ QColor const c = getDefaultColorByRow(row);
+
+ if (setColor(row, c, color)) {
+ setDisabledResets();
+ // emit signal
+ changed();
+ }
+}
+
+
+void PrefColors::resetAllColor()
+{
+ bool isChanged = false;
+
+ colorResetAllPB->setDisabled(true);
+
+ for (int irow = 0, count = lyxObjectsLW->count(); irow < count; ++irow) {
+ QString const color = newcolors_[size_t(irow)];
+ QColor const c = getDefaultColorByRow(irow);
+
+ if (setColor(irow, c, color))
+ isChanged = true;
+ }
+
+ if (isChanged) {
+ setDisabledResets();
+ // emit signal
+ changed();
+ }
+}
+
+
+bool PrefColors::setColor(int const row, QColor const new_color,
+ QString const old_color)
+{
+ if (new_color.isValid() && new_color.name() != old_color) {
+ newcolors_[size_t(row)] = new_color.name();
+ QPixmap coloritem(32, 32);
+ coloritem.fill(new_color);
+ lyxObjectsLW->item(row)->setIcon(QIcon(coloritem));
+ return true;
+ }
+ return false;
+}
+
+
+void PrefColors::setDisabledResets()
+{
+ int const row = lyxObjectsLW->currentRow();
+ // set disable reset buttons ...
+ if (row >= 0)
+ colorResetPB->setDisabled(isDefaultColor(row, newcolors_[size_t(row)]));
+
+ colorResetAllPB->setDisabled(true);
+
+ // ... in between process qt events to give quicker visual feedback to the user ...
+ guiApp->processEvents();
+
+ // ... set disable Reset All button
+ for (int irow = 0, count = lyxObjectsLW->count(); irow < count; ++irow) {
+ if (!isDefaultColor(irow, newcolors_[size_t(irow)])) {
+ colorResetAllPB->setDisabled(false);
+ // the break condition might hide performance issues
+ // if a non-default color is at the top of the list
+ break;
+ }
+ }
+}
+
+
+bool PrefColors::isDefaultColor(int const row, QString const color)
+{
+ return color == getDefaultColorByRow(row).name();
+}
+
+
+QColor PrefColors::getDefaultColorByRow(int const row)
+{
+ ColorSet const defaultcolor;
+ return defaultcolor.getX11Name(lcolors_[size_t(row)]).c_str();
+}
+
+
void PrefColors::changeSysColor()
{
for (int row = 0 ; row < lyxObjectsLW->count() ; ++row) {
// skip colors that are taken from system palette
bool const disable = syscolorsCB->isChecked()
- && guiApp->colorCache().isSystem(lcolors_[row]);
+ && guiApp->colorCache().isSystem(lcolors_[size_t(row)]);
QListWidgetItem * const item = lyxObjectsLW->item(row);
Qt::ItemFlags const flags = item->flags();
}
}
+
void PrefColors::changeLyxObjectsSelection()
{
- colorChangePB->setDisabled(lyxObjectsLW->currentRow() < 0);
+ int currentRow = lyxObjectsLW->currentRow();
+ colorChangePB->setDisabled(currentRow < 0);
+
+ if (currentRow < 0)
+ colorResetPB->setDisabled(true);
+ else
+ colorResetPB->setDisabled(
+ isDefaultColor(currentRow, newcolors_[size_t(currentRow)]));
}
rc.preview = LyXRC::PREVIEW_OFF;
break;
case 1:
- if (rc.preview != LyXRC::PREVIEW_NO_MATH) {
- rc.preview = LyXRC::PREVIEW_NO_MATH;
- form_->updatePreviews();
- }
+ rc.preview = LyXRC::PREVIEW_NO_MATH;
break;
case 2:
- if (rc.preview != LyXRC::PREVIEW_ON) {
- rc.preview = LyXRC::PREVIEW_ON;
- form_->updatePreviews();
- }
+ rc.preview = LyXRC::PREVIEW_ON;
break;
}
shortcut_ = new GuiShortcutDialog(this);
shortcut_bc_.setPolicy(ButtonPolicy::OkCancelPolicy);
- shortcut_bc_.setOK(shortcut_->okPB);
- shortcut_bc_.setCancel(shortcut_->cancelPB);
+ shortcut_bc_.setOK(shortcut_->buttonBox->button(QDialogButtonBox::Ok));
+ shortcut_bc_.setCancel(shortcut_->buttonBox->button(QDialogButtonBox::Cancel));
- connect(shortcut_->okPB, SIGNAL(clicked()),
+ connect(shortcut_->buttonBox, SIGNAL(accepted()),
this, SIGNAL(changed()));
- connect(shortcut_->cancelPB, SIGNAL(clicked()),
+ connect(shortcut_->buttonBox, SIGNAL(rejected()),
shortcut_, SLOT(reject()));
connect(shortcut_->clearPB, SIGNAL(clicked()),
this, SLOT(shortcutClearPressed()));
connect(shortcut_->removePB, SIGNAL(clicked()),
this, SLOT(shortcutRemovePressed()));
- connect(shortcut_->okPB, SIGNAL(clicked()),
+ connect(shortcut_->buttonBox, SIGNAL(accepted()),
this, SLOT(shortcutOkPressed()));
- connect(shortcut_->cancelPB, SIGNAL(clicked()),
+ connect(shortcut_->buttonBox, SIGNAL(rejected()),
this, SLOT(shortcutCancelPressed()));
}
/////////////////////////////////////////////////////////////////////
GuiPreferences::GuiPreferences(GuiView & lv)
- : GuiDialog(lv, "prefs", qt_("Preferences")), update_screen_font_(false),
- update_previews_(false)
+ : GuiDialog(lv, "prefs", qt_("Preferences"))
{
setupUi(this);
QDialog::setModal(false);
- connect(savePB, SIGNAL(clicked()), this, SLOT(slotOK()));
- connect(applyPB, SIGNAL(clicked()), this, SLOT(slotApply()));
- connect(closePB, SIGNAL(clicked()), this, SLOT(slotClose()));
- connect(restorePB, SIGNAL(clicked()), this, SLOT(slotRestore()));
+ connect(buttonBox, SIGNAL(clicked(QAbstractButton *)),
+ this, SLOT(slotButtonBox(QAbstractButton *)));
addModule(new PrefUserInterface(this));
addModule(new PrefDocHandling(this));
addModule(new PrefLanguage(this));
addModule(new PrefSpellchecker(this));
- //for strftime validator
PrefOutput * output = new PrefOutput(this);
addModule(output);
addModule(new PrefLatex(this));
#endif
bc().setPolicy(ButtonPolicy::PreferencesPolicy);
- bc().setOK(savePB);
- bc().setApply(applyPB);
- bc().setCancel(closePB);
- bc().setRestore(restorePB);
+ bc().setOK(buttonBox->button(QDialogButtonBox::Ok));
+ bc().setApply(buttonBox->button(QDialogButtonBox::Apply));
+ bc().setCancel(buttonBox->button(QDialogButtonBox::Cancel));
+ bc().setRestore(buttonBox->button(QDialogButtonBox::Reset));
- // initialize the strftime validator
- bc().addCheckedLineEdit(output->DateED);
+ guilyxfiles_ = new GuiLyXFiles(lv);
+ connect(guilyxfiles_, SIGNAL(fileSelected(QString)),
+ this, SLOT(slotFileSelected(QString)));
}
converters_.update(formats_);
movers_ = theMovers();
colors_.clear();
- update_screen_font_ = false;
- update_previews_ = false;
updateRC(rc_);
// Make sure that the bc is in the INITIAL state
theMovers() = movers_;
- vector<string>::const_iterator it = colors_.begin();
- vector<string>::const_iterator const end = colors_.end();
- for (; it != end; ++it)
- dispatch(FuncRequest(LFUN_SET_COLOR, *it));
+ for (string const & color : colors_)
+ dispatch(FuncRequest(LFUN_SET_COLOR, color));
colors_.clear();
- if (update_screen_font_) {
- dispatch(FuncRequest(LFUN_SCREEN_FONT_UPDATE));
- // resets flag in case second apply in same dialog
- update_screen_font_ = false;
- }
-
- if (update_previews_) {
- // resets flag in case second apply in same dialog
- theBufferList().updatePreviews();
- update_previews_ = false;
- }
-
- // The Save button has been pressed
- if (isClosing())
+ // Save permanently
+ if (!tempSaveCB->isChecked())
dispatch(FuncRequest(LFUN_PREFERENCES_SAVE));
}
}
-void GuiPreferences::updateScreenFonts()
+void GuiPreferences::slotFileSelected(QString const file)
{
- update_screen_font_ = true;
+ uifile_ = file;
}
-void GuiPreferences::updatePreviews()
+QString GuiPreferences::browseLibFile(QString const & dir,
+ QString const & name, QString const & ext)
{
- update_previews_ = true;
+ uifile_.clear();
+
+ guilyxfiles_->passParams(fromqstr(dir));
+ guilyxfiles_->selectItem(name);
+ guilyxfiles_->exec();
+
+ QString const result = uifile_;
+
+ // remove the extension if it is the default one
+ QString noextresult;
+ if (getExtension(result) == ext)
+ noextresult = removeExtension(result);
+ else
+ noextresult = result;
+
+ // remove the directory, if it is the default one
+ QString const file = onlyFileName(noextresult);
+ if (toqstr(libFileSearch(dir, file, ext).absFileName()) == result)
+ return file;
+ else
+ return noextresult;
}
-QString GuiPreferences::browsebind(QString const & file) const
+QString GuiPreferences::browsebind(QString const & file)
{
- return browseLibFile("bind", file, "bind", qt_("Choose bind file"),
- QStringList(qt_("LyX bind files (*.bind)")));
+ return browseLibFile("bind", file, "bind");
}
-QString GuiPreferences::browseUI(QString const & file) const
+QString GuiPreferences::browseUI(QString const & file)
{
- return browseLibFile("ui", file, "ui", qt_("Choose UI file"),
- QStringList(qt_("LyX UI files (*.ui)")));
+ return browseLibFile("ui", file, "ui");
}
-QString GuiPreferences::browsekbmap(QString const & file) const
+QString GuiPreferences::browsekbmap(QString const & file)
{
- return browseLibFile("kbd", file, "kmap", qt_("Choose keyboard map"),
- QStringList(qt_("LyX keyboard maps (*.kmap)")));
+ return browseLibFile("kbd", file, "kmap");
}