X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt%2FGuiPrefs.cpp;h=a5f4014874772d747b61ddaa73e0c1b974705b66;hb=5cb80b867f4a59c3253487652ba74a29ad5b3f0f;hp=70fe86aeb3102ede87fa903d6c31f04d8e7caa01;hpb=bfab8f943554d97ecb60e3a3f3702397aff43863;p=lyx.git diff --git a/src/frontends/qt/GuiPrefs.cpp b/src/frontends/qt/GuiPrefs.cpp index 70fe86aeb3..a5f4014874 100644 --- a/src/frontends/qt/GuiPrefs.cpp +++ b/src/frontends/qt/GuiPrefs.cpp @@ -189,11 +189,7 @@ QString browseRelToSub(QString const & filename, QString const & relpath, toqstr(makeRelPath(qstring_to_ucs4(outname), qstring_to_ucs4(relpath))); QString testname = reloutname; -#if QT_VERSION < 0x060000 - testname.remove(QRegExp("^(\\.\\./)+")); -#else testname.remove(QRegularExpression("^(\\.\\./)+")); -#endif if (testname.contains("/")) return outname; @@ -1890,7 +1886,7 @@ void PrefConverters::on_needauthCB_toggled(bool checked) } int ret = frontend::Alert::prompt( - _("SECURITY WARNING!"), _("Unchecking this option has the effect that potentially harmful converters would be run without asking your permission first. This is UNSAFE and NOT recommended, unless you know what you are doing. Are you sure you would like to proceed ? The recommended and safe answer is NO!"), + _("SECURITY WARNING!"), _("Unchecking this option has the effect that potentially harmful converters would be run without asking your permission first. This is UNSAFE and NOT recommended, unless you know what you are doing. Are you sure you would like to proceed? The recommended and safe answer is NO!"), 0, 0, _("&No"), _("&Yes")); if (ret == 1) changed(); @@ -2469,11 +2465,7 @@ PrefLanguage::PrefLanguage(GuiPreferences * form) startCommandED->setValidator(new NoNewLineValidator(startCommandED)); endCommandED->setValidator(new NoNewLineValidator(endCommandED)); -#if QT_VERSION < 0x060000 - defaultDecimalSepED->setValidator(new QRegExpValidator(QRegExp("\\S"), this)); -#else defaultDecimalSepED->setValidator(new QRegularExpressionValidator(QRegularExpression("\\S"), this)); -#endif defaultDecimalSepED->setMaxLength(1); defaultLengthUnitCO->addItem(lyx::qt_(unit_name_gui[Length::CM]), Length::CM); @@ -2627,6 +2619,16 @@ PrefUserInterface::PrefUserInterface(GuiPreferences * form) this, SIGNAL(changed())); connect(tooltipCB, SIGNAL(toggled(bool)), this, SIGNAL(changed())); + connect(toggleTabbarCB, SIGNAL(toggled(bool)), + this, SIGNAL(changed())); + connect(toggleMenubarCB, SIGNAL(toggled(bool)), + this, SIGNAL(changed())); + connect(toggleScrollbarCB, SIGNAL(toggled(bool)), + this, SIGNAL(changed())); + connect(toggleStatusbarCB, SIGNAL(toggled(bool)), + this, SIGNAL(changed())); + connect(toggleToolbarsCB, SIGNAL(toggled(bool)), + this, SIGNAL(changed())); lastfilesSB->setMaximum(maxlastfiles); iconSetCO->addItem(qt_("Default"), QString()); @@ -2648,6 +2650,11 @@ void PrefUserInterface::applyRC(LyXRC & rc) const rc.use_system_theme_icons = useSystemThemeIconsCB->isChecked(); rc.num_lastfiles = lastfilesSB->value(); rc.use_tooltip = tooltipCB->isChecked(); + rc.full_screen_toolbars = toggleToolbarsCB->isChecked(); + rc.full_screen_scrollbar = toggleScrollbarCB->isChecked(); + rc.full_screen_statusbar = toggleStatusbarCB->isChecked(); + rc.full_screen_tabbar = toggleTabbarCB->isChecked(); + rc.full_screen_menubar = toggleMenubarCB->isChecked(); } @@ -2661,6 +2668,11 @@ void PrefUserInterface::updateRC(LyXRC const & rc) uiFileED->setText(toqstr(external_path(rc.ui_file))); lastfilesSB->setValue(rc.num_lastfiles); tooltipCB->setChecked(rc.use_tooltip); + toggleScrollbarCB->setChecked(rc.full_screen_scrollbar); + toggleStatusbarCB->setChecked(rc.full_screen_statusbar); + toggleToolbarsCB->setChecked(rc.full_screen_toolbars); + toggleTabbarCB->setChecked(rc.full_screen_tabbar); + toggleMenubarCB->setChecked(rc.full_screen_menubar); } @@ -2779,7 +2791,7 @@ void PrefDocHandling::updateRC(LyXRC const & rc) docstring const tip = bformat(_("If this is checked, a backup of the document is created " "in the backup directory (%1$s). " "The backup file has the full original path and name as file name " - "and the suffix \'.lyx~\' (e.g., mydir!filename.lyx~). " + "and the suffix \'.lyx~\' (e.g., !mydir!filename.lyx~). " "Note that these files are hidden by default by some file managers."), FileName(rc.backupdir_path).absoluteFilePath()); backupCB->setToolTip(toqstr(tip)); @@ -2827,16 +2839,6 @@ PrefEdit::PrefEdit(GuiPreferences * form) this, SIGNAL(changed())); connect(screenWidthUnitCO, SIGNAL(selectionChanged(lyx::Length::UNIT)), this, SIGNAL(changed())); - connect(toggleTabbarCB, SIGNAL(toggled(bool)), - this, SIGNAL(changed())); - connect(toggleMenubarCB, SIGNAL(toggled(bool)), - this, SIGNAL(changed())); - connect(toggleScrollbarCB, SIGNAL(toggled(bool)), - this, SIGNAL(changed())); - connect(toggleStatusbarCB, SIGNAL(toggled(bool)), - this, SIGNAL(changed())); - connect(toggleToolbarsCB, SIGNAL(toggled(bool)), - this, SIGNAL(changed())); } @@ -2872,11 +2874,6 @@ void PrefEdit::applyRC(LyXRC & rc) const rc.cursor_width = cursorWidthSB->value(); rc.citation_search = citationSearchCB->isChecked(); rc.citation_search_pattern = fromqstr(citationSearchLE->text()); - rc.full_screen_toolbars = toggleToolbarsCB->isChecked(); - rc.full_screen_scrollbar = toggleScrollbarCB->isChecked(); - rc.full_screen_statusbar = toggleStatusbarCB->isChecked(); - rc.full_screen_tabbar = toggleTabbarCB->isChecked(); - rc.full_screen_menubar = toggleMenubarCB->isChecked(); rc.screen_width = Length(widgetsToLength(screenWidthLE, screenWidthUnitCO)); rc.screen_limit = screenLimitCB->isChecked(); } @@ -2896,11 +2893,6 @@ void PrefEdit::updateRC(LyXRC const & rc) citationSearchLE->setText(toqstr(rc.citation_search_pattern)); citationSearchLE->setEnabled(rc.citation_search); citationSearchLA->setEnabled(rc.citation_search); - toggleScrollbarCB->setChecked(rc.full_screen_scrollbar); - toggleStatusbarCB->setChecked(rc.full_screen_statusbar); - toggleToolbarsCB->setChecked(rc.full_screen_toolbars); - toggleTabbarCB->setChecked(rc.full_screen_tabbar); - toggleMenubarCB->setChecked(rc.full_screen_menubar); lengthToWidgets(screenWidthLE, screenWidthUnitCO, rc.screen_width, Length::defaultUnit()); screenWidthUnitCO->setEnabled(rc.screen_limit); screenLimitCB->setChecked(rc.screen_limit); @@ -3416,6 +3408,23 @@ bool PrefShortcuts::validateNewShortcut(FuncRequest const & func, // nothing to change return false; + // Check whether the key sequence is a prefix for other shortcuts. + if (oldBinding == FuncRequest::prefix) { + docstring const new_action_string = makeCmdString(func); + docstring const text = bformat(_("Shortcut `%1$s' is already a prefix for other commands.\n" + "Are you sure you want to unbind these commands and bind it to %2$s?"), + k.print(KeySequence::ForGui), new_action_string); + int ret = Alert::prompt(_("Redefine shortcut?"), + text, 0, 1, _("&Redefine"), _("&Cancel")); + if (ret != 0) + return false; + QString const sequence_text = toqstr(k.print(KeySequence::ForGui)); + QList items = shortcutsTW->findItems(sequence_text, + Qt::MatchFlags(Qt::MatchStartsWith | Qt::MatchRecursive), 1); + deactivateShortcuts(items); + return true; + } + // make sure this key isn't already bound---and, if so, prompt user // (exclude the lfun the user already wants to modify) docstring const action_string = makeCmdString(oldBinding);