]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiPrefs.cpp
On Linux show in crash message box the backtrace
[lyx.git] / src / frontends / qt4 / GuiPrefs.cpp
index 39f68412cd95b06e4337dcedf83951207498074b..6dfd337dcdd005f086eb6add84923f46861ae7a6 100644 (file)
@@ -46,6 +46,7 @@
 #include "support/gettext.h"
 #include "support/lassert.h"
 #include "support/lstrings.h"
+#include "support/Messages.h"
 #include "support/os.h"
 #include "support/Package.h"
 
@@ -111,7 +112,7 @@ QString browseFile(QString const & filename,
        else if(!fallback_dir.isEmpty())
                lastPath = fallback_dir;
 
-       FileDialog dlg(title, LFUN_SELECT_FILE_SYNC);
+       FileDialog dlg(title);
        dlg.setButton2(label1, dir1);
        dlg.setButton2(label2, dir2);
 
@@ -182,7 +183,7 @@ QString browseDir(QString const & pathname,
        if (!pathname.isEmpty())
                lastPath = onlyPath(pathname);
 
-       FileDialog dlg(title, LFUN_SELECT_FILE_SYNC);
+       FileDialog dlg(title);
        dlg.setButton1(label1, dir1);
        dlg.setButton2(label2, dir2);
 
@@ -248,11 +249,11 @@ QString browseRelToSub(QString const & filename, QString const & relpath,
 
 namespace frontend {
 
-string const catLookAndFeel = N_("Look & Feel");
-string const catEditing = N_("Editing");
-string const catLanguage = N_("Language Settings");
-string const catOutput = N_("Output");
-string const catFiles = N_("File Handling");
+QString const catLookAndFeel = N_("Look & Feel");
+QString const catEditing = N_("Editing");
+QString const catLanguage = N_("Language Settings");
+QString const catOutput = N_("Output");
+QString const catFiles = N_("File Handling");
 
 static void parseFontName(QString const & mangled0,
        string & name, string & foundry)
@@ -386,7 +387,7 @@ QValidator::State StrftimeValidator::validate(QString & input, int & /*pos*/) co
 /////////////////////////////////////////////////////////////////////
 
 PrefOutput::PrefOutput(GuiPreferences * form)
-       : PrefModule(qt_(catOutput), qt_("General"), form)
+       : PrefModule(catOutput, N_("General"), form)
 {
        setupUi(this);
 
@@ -407,13 +408,13 @@ PrefOutput::PrefOutput(GuiPreferences * form)
        dviCB->addItem("");
        dviCB->addItem("xdvi -sourceposition '$$n:\\ $$t' $$o");
        dviCB->addItem("yap -1 -s \"$$n $$t\" $$o");
-       dviCB->addItem("okular --unique \"file:$$o#src:$$n $$t\"");
+       dviCB->addItem("okular --unique \"$$o#src:$$n $$f\"");
        dviCB->addItem("synctex view -i $$n:0:$$t -o $$o -x \"evince -i %{page+1} $$o\"");
        pdfCB->addItem("");
        pdfCB->addItem("CMCDDE SUMATRA control [ForwardSearch(\\\"$$o\\\",\\\"$$t\\\",$$n,0,0,1)]");
        pdfCB->addItem("SumatraPDF -reuse-instance $$o -forward-search $$t $$n");
        pdfCB->addItem("synctex view -i $$n:0:$$t -o $$o -x \"xpdf -raise -remote $$t.tmp $$o %{page+1}\"");
-       pdfCB->addItem("okular --unique \"file:$$o#src:$$n $$t\"");
+       pdfCB->addItem("okular --unique \"$$o#src:$$n $$f\"");
        pdfCB->addItem("synctex view -i $$n:0:$$t -o $$o -x \"evince -i %{page+1} $$o\"");
        pdfCB->addItem("/Applications/Skim.app/Contents/SharedSupport/displayline $$n $$o $$t");
 }
@@ -478,7 +479,7 @@ void PrefOutput::update(LyXRC const & rc)
 /////////////////////////////////////////////////////////////////////
 
 PrefInput::PrefInput(GuiPreferences * form)
-       : PrefModule(qt_(catEditing), qt_("Keyboard/Mouse"), form)
+       : PrefModule(catEditing, N_("Keyboard/Mouse"), form)
 {
        setupUi(this);
 
@@ -608,7 +609,7 @@ void PrefInput::on_scrollzoomEnableCB_toggled(bool enabled)
 /////////////////////////////////////////////////////////////////////
 
 PrefCompletion::PrefCompletion(GuiPreferences * form)
-       : PrefModule(qt_(catEditing), qt_("Input Completion"), form)
+       : PrefModule(catEditing, N_("Input Completion"), form)
 {
        setupUi(this);
 
@@ -698,7 +699,7 @@ void PrefCompletion::update(LyXRC const & rc)
 /////////////////////////////////////////////////////////////////////
 
 PrefLatex::PrefLatex(GuiPreferences * form)
-       : PrefModule(qt_(catOutput), qt_("LaTeX"), form)
+       : PrefModule(catOutput, N_("LaTeX"), form)
 {
        setupUi(this);
 
@@ -927,7 +928,7 @@ void PrefLatex::update(LyXRC const & rc)
 /////////////////////////////////////////////////////////////////////
 
 PrefScreenFonts::PrefScreenFonts(GuiPreferences * form)
-       : PrefModule(qt_(catLookAndFeel), qt_("Screen Fonts"), form)
+       : PrefModule(catLookAndFeel, N_("Screen Fonts"), form)
 {
        setupUi(this);
 
@@ -1104,7 +1105,7 @@ struct ColorSorter
 } // namespace anon
 
 PrefColors::PrefColors(GuiPreferences * form)
-       : PrefModule(qt_(catLookAndFeel), qt_("Colors"), form)
+       : PrefModule(catLookAndFeel, N_("Colors"), form)
 {
        setupUi(this);
 
@@ -1226,7 +1227,7 @@ void PrefColors::changeLyxObjectsSelection()
 /////////////////////////////////////////////////////////////////////
 
 PrefDisplay::PrefDisplay(GuiPreferences * form)
-       : PrefModule(qt_(catLookAndFeel), qt_("Display"), form)
+       : PrefModule(catLookAndFeel, N_("Display"), form)
 {
        setupUi(this);
        connect(displayGraphicsCB, SIGNAL(toggled(bool)), this, SIGNAL(changed()));
@@ -1242,13 +1243,6 @@ void PrefDisplay::on_instantPreviewCO_currentIndexChanged(int index)
 }
 
 
-void PrefDisplay::on_displayGraphicsCB_toggled(bool on)
-{
-       instantPreviewCO->setEnabled(on);
-       previewSizeSB->setEnabled(on && instantPreviewCO->currentIndex() > 0);
-}
-
-
 void PrefDisplay::apply(LyXRC & rc) const
 {
        switch (instantPreviewCO->currentIndex()) {
@@ -1292,7 +1286,6 @@ void PrefDisplay::update(LyXRC const & rc)
        }
 
        displayGraphicsCB->setChecked(rc.display_graphics);
-       instantPreviewCO->setEnabled(rc.display_graphics);
        previewSizeSB->setValue(rc.preview_scale_factor);
        paragraphMarkerCB->setChecked(rc.paragraph_markers);
        previewSizeSB->setEnabled(
@@ -1308,7 +1301,7 @@ void PrefDisplay::update(LyXRC const & rc)
 /////////////////////////////////////////////////////////////////////
 
 PrefPaths::PrefPaths(GuiPreferences * form)
-       : PrefModule(QString(), qt_("Paths"), form)
+       : PrefModule(QString(), N_("Paths"), form)
 {
        setupUi(this);
 
@@ -1471,7 +1464,7 @@ void PrefPaths::selectLyxPipe()
 /////////////////////////////////////////////////////////////////////
 
 PrefSpellchecker::PrefSpellchecker(GuiPreferences * form)
-       : PrefModule(qt_(catLanguage), qt_("Spellchecker"), form)
+       : PrefModule(catLanguage, N_("Spellchecker"), form)
 {
        setupUi(this);
 
@@ -1562,7 +1555,7 @@ void PrefSpellchecker::on_spellcheckerCB_currentIndexChanged(int index)
 
 
 PrefConverters::PrefConverters(GuiPreferences * form)
-       : PrefModule(qt_(catFiles), qt_("Converters"), form)
+       : PrefModule(catFiles, N_("Converters"), form)
 {
        setupUi(this);
 
@@ -1685,7 +1678,7 @@ void PrefConverters::changeConverter()
 
 void PrefConverters::updateButtons()
 {
-       if (form_->formats().size() == 0)
+       if (form_->formats().empty())
                return;
        Format const & from = form_->formats().get(converterFromCO->currentIndex());
        Format const & to = form_->formats().get(converterToCO->currentIndex());
@@ -1876,7 +1869,7 @@ private:
 /////////////////////////////////////////////////////////////////////
 
 PrefFileformats::PrefFileformats(GuiPreferences * form)
-       : PrefModule(qt_(catFiles), qt_("File Formats"), form)
+       : PrefModule(catFiles, N_("File Formats"), form)
 {
        setupUi(this);
 
@@ -1900,6 +1893,8 @@ PrefFileformats::PrefFileformats(GuiPreferences * form)
                this, SIGNAL(changed()));
        connect(defaultFormatCB, SIGNAL(activated(QString)),
                this, SIGNAL(changed()));
+       connect(defaultOTFFormatCB, SIGNAL(activated(QString)),
+               this, SIGNAL(changed()));
        connect(viewerCO, SIGNAL(activated(int)),
                this, SIGNAL(changed()));
        connect(editorCO, SIGNAL(activated(int)),
@@ -1927,6 +1922,9 @@ void PrefFileformats::apply(LyXRC & rc) const
        QString const default_format = defaultFormatCB->itemData(
                defaultFormatCB->currentIndex()).toString();
        rc.default_view_format = fromqstr(default_format);
+       QString const default_otf_format = defaultOTFFormatCB->itemData(
+               defaultOTFFormatCB->currentIndex()).toString();
+       rc.default_otf_view_format = fromqstr(default_otf_format);
 }
 
 
@@ -1937,9 +1935,12 @@ void PrefFileformats::update(LyXRC const & rc)
        bool const init = defaultFormatCB->currentText().isEmpty();
        updateView();
        if (init) {
-               int const pos =
+               int pos =
                        defaultFormatCB->findData(toqstr(rc.default_view_format));
                defaultFormatCB->setCurrentIndex(pos);
+               pos = defaultOTFFormatCB->findData(toqstr(rc.default_otf_view_format));
+                               defaultOTFFormatCB->setCurrentIndex(pos);
+               defaultOTFFormatCB->setCurrentIndex(pos);
        }
 }
 
@@ -1948,41 +1949,54 @@ void PrefFileformats::updateView()
 {
        QString const current = formatsCB->currentText();
        QString const current_def = defaultFormatCB->currentText();
+       QString const current_def_otf = defaultOTFFormatCB->currentText();
 
        // update comboboxes with formats
        formatsCB->blockSignals(true);
        defaultFormatCB->blockSignals(true);
+       defaultOTFFormatCB->blockSignals(true);
        formatsCB->clear();
        defaultFormatCB->clear();
+       defaultOTFFormatCB->clear();
        form_->formats().sort();
        Formats::const_iterator cit = form_->formats().begin();
        Formats::const_iterator end = form_->formats().end();
        for (; cit != end; ++cit) {
                formatsCB->addItem(qt_(cit->prettyname()),
                                QVariant(form_->formats().getNumber(cit->name())));
-               if (form_->converters().isReachable("latex", cit->name())
+               if (cit->viewer().empty())
+                       continue;
+               if (form_->converters().isReachable("xhtml", cit->name())
                    || form_->converters().isReachable("dviluatex", cit->name())
-                   || form_->converters().isReachable("pdflatex", cit->name())
                    || form_->converters().isReachable("luatex", cit->name())
-                   || form_->converters().isReachable("xetex", cit->name()))
+                   || form_->converters().isReachable("xetex", cit->name())) {
+                       defaultFormatCB->addItem(qt_(cit->prettyname()),
+                                       QVariant(toqstr(cit->name())));
+                       defaultOTFFormatCB->addItem(qt_(cit->prettyname()),
+                                       QVariant(toqstr(cit->name())));
+               } else if (form_->converters().isReachable("latex", cit->name())
+                          || form_->converters().isReachable("pdflatex", cit->name()))
                        defaultFormatCB->addItem(qt_(cit->prettyname()),
                                        QVariant(toqstr(cit->name())));
        }
 
-       // restore selection
+       // restore selections
        int item = formatsCB->findText(current, Qt::MatchExactly);
        formatsCB->setCurrentIndex(item < 0 ? 0 : item);
        on_formatsCB_currentIndexChanged(item < 0 ? 0 : item);
        item = defaultFormatCB->findText(current_def, Qt::MatchExactly);
        defaultFormatCB->setCurrentIndex(item < 0 ? 0 : item);
+       item = defaultOTFFormatCB->findText(current_def_otf, Qt::MatchExactly);
+       defaultOTFFormatCB->setCurrentIndex(item < 0 ? 0 : item);
        formatsCB->blockSignals(false);
        defaultFormatCB->blockSignals(false);
+       defaultOTFFormatCB->blockSignals(false);
 }
 
 
 void PrefFileformats::on_formatsCB_currentIndexChanged(int i)
 {
-       if (form_->formats().size() == 0)
+       if (form_->formats().empty())
                return;
        int const nr = formatsCB->itemData(i).toInt();
        Format const f = form_->formats().get(nr);
@@ -2244,7 +2258,7 @@ void PrefFileformats::on_formatRemovePB_clicked()
 /////////////////////////////////////////////////////////////////////
 
 PrefLanguage::PrefLanguage(GuiPreferences * form)
-       : PrefModule(qt_(catLanguage), qt_("Language"), form)
+       : PrefModule(catLanguage, N_("Language"), form)
 {
        setupUi(this);
 
@@ -2301,9 +2315,13 @@ PrefLanguage::PrefLanguage(GuiPreferences * form)
                // each language code only once
                string const name = fromqstr(index.data(Qt::UserRole).toString());
                Language const * lang = languages.getLanguage(name);
+               if (!lang)
+                       continue;
                // never remove the currently selected language
-               if (lang && name != form->rc().gui_language && name != lyxrc.gui_language)
-                       if (!lang->translated() || added.find(lang->code()) != added.end())
+               if (name != form->rc().gui_language 
+                   && name != lyxrc.gui_language
+                   && (!Messages::available(lang->code())
+                       || added.find(lang->code()) != added.end()))
                                continue;
                added.insert(lang->code());
                uiLanguageCO->addItem(index.data(Qt::DisplayRole).toString(),
@@ -2390,7 +2408,7 @@ void PrefLanguage::update(LyXRC const & rc)
 /////////////////////////////////////////////////////////////////////
 
 PrefPrinter::PrefPrinter(GuiPreferences * form)
-       : PrefModule(qt_(catOutput), qt_("Printer"), form)
+       : PrefModule(catOutput, N_("Printer"), form)
 {
        setupUi(this);
 
@@ -2506,7 +2524,75 @@ void PrefPrinter::update(LyXRC const & rc)
 /////////////////////////////////////////////////////////////////////
 
 PrefUserInterface::PrefUserInterface(GuiPreferences * form)
-       : PrefModule(qt_(catLookAndFeel), qt_("User Interface"), form)
+       : PrefModule(catLookAndFeel, N_("User Interface"), form)
+{
+       setupUi(this);
+
+       connect(uiFilePB, SIGNAL(clicked()),
+               this, SLOT(selectUi()));
+       connect(uiFileED, SIGNAL(textChanged(QString)),
+               this, SIGNAL(changed()));
+       connect(iconSetCO, SIGNAL(activated(int)),
+               this, SIGNAL(changed()));
+       connect(useSystemThemeIconsCB, SIGNAL(clicked()),
+               this, SIGNAL(changed()));
+       connect(lastfilesSB, SIGNAL(valueChanged(int)),
+               this, SIGNAL(changed()));
+       connect(tooltipCB, SIGNAL(toggled(bool)),
+               this, SIGNAL(changed()));
+       lastfilesSB->setMaximum(maxlastfiles);
+
+       iconSetCO->addItem(qt_("Default"), QString());
+       iconSetCO->addItem(qt_("Classic"), "classic");
+       iconSetCO->addItem(qt_("Oxygen"), "oxygen");
+
+#if (!defined Q_WS_X11 || QT_VERSION < 0x040600)
+       useSystemThemeIconsCB->hide();
+#endif
+}
+
+
+void PrefUserInterface::apply(LyXRC & rc) const
+{
+       rc.icon_set = fromqstr(iconSetCO->itemData(
+               iconSetCO->currentIndex()).toString());
+
+       rc.ui_file = internal_path(fromqstr(uiFileED->text()));
+       rc.use_system_theme_icons = useSystemThemeIconsCB->isChecked();
+       rc.num_lastfiles = lastfilesSB->value();
+       rc.use_tooltip = tooltipCB->isChecked();
+}
+
+
+void PrefUserInterface::update(LyXRC const & rc)
+{
+       int iconset = iconSetCO->findData(toqstr(rc.icon_set));
+       if (iconset < 0)
+               iconset = 0;
+       iconSetCO->setCurrentIndex(iconset);
+       useSystemThemeIconsCB->setChecked(rc.use_system_theme_icons);
+       uiFileED->setText(toqstr(external_path(rc.ui_file)));
+       lastfilesSB->setValue(rc.num_lastfiles);
+       tooltipCB->setChecked(rc.use_tooltip);
+}
+
+
+void PrefUserInterface::selectUi()
+{
+       QString file = form_->browseUI(internalPath(uiFileED->text()));
+       if (!file.isEmpty())
+               uiFileED->setText(file);
+}
+
+
+/////////////////////////////////////////////////////////////////////
+//
+// PrefDocumentHandling
+//
+/////////////////////////////////////////////////////////////////////
+
+PrefDocHandling::PrefDocHandling(GuiPreferences * form)
+       : PrefModule(catLookAndFeel, N_("Document Handling"), form)
 {
        setupUi(this);
 
@@ -2518,16 +2604,9 @@ PrefUserInterface::PrefUserInterface(GuiPreferences * form)
                this, SIGNAL(changed()));
        connect(singleInstanceCB, SIGNAL(clicked()),
                this, SIGNAL(changed()));
-#if QT_VERSION < 0x040500
-       singleCloseTabButtonCB->setEnabled(false);
-#endif
        connect(singleCloseTabButtonCB, SIGNAL(clicked()),
                this, SIGNAL(changed()));
-       connect(uiFilePB, SIGNAL(clicked()),
-               this, SLOT(selectUi()));
-       connect(uiFileED, SIGNAL(textChanged(QString)),
-               this, SIGNAL(changed()));
-       connect(iconSetCO, SIGNAL(activated(int)),
+       connect(closeLastViewCO, SIGNAL(activated(int)),
                this, SIGNAL(changed()));
        connect(restoreCursorCB, SIGNAL(clicked()),
                this, SIGNAL(changed()));
@@ -2543,48 +2622,39 @@ PrefUserInterface::PrefUserInterface(GuiPreferences * form)
                this, SIGNAL(changed()));
        connect(saveCompressedCB, SIGNAL(clicked()),
                this, SIGNAL(changed()));
-       connect(lastfilesSB, SIGNAL(valueChanged(int)),
-               this, SIGNAL(changed()));
-       connect(tooltipCB, SIGNAL(toggled(bool)),
-               this, SIGNAL(changed()));
-       lastfilesSB->setMaximum(maxlastfiles);
-
-       iconSetCO->addItem(qt_("Default"), QString());
-       iconSetCO->addItem(qt_("Classic"), "classic");
-       iconSetCO->addItem(qt_("Oxygen"), "oxygen");
 }
 
 
-void PrefUserInterface::apply(LyXRC & rc) const
+void PrefDocHandling::apply(LyXRC & rc) const
 {
-       rc.icon_set = fromqstr(iconSetCO->itemData(
-               iconSetCO->currentIndex()).toString());
-
-       rc.ui_file = internal_path(fromqstr(uiFileED->text()));
        rc.use_lastfilepos = restoreCursorCB->isChecked();
        rc.load_session = loadSessionCB->isChecked();
        rc.allow_geometry_session = allowGeometrySessionCB->isChecked();
        rc.autosave = autoSaveCB->isChecked() ?  autoSaveSB->value() * 60 : 0;
        rc.make_backup = backupCB->isChecked();
        rc.save_compressed = saveCompressedCB->isChecked();
-       rc.num_lastfiles = lastfilesSB->value();
-       rc.use_tooltip = tooltipCB->isChecked();
        rc.open_buffers_in_tabs = openDocumentsInTabsCB->isChecked();
        rc.single_instance = singleInstanceCB->isChecked();
        rc.single_close_tab_button = singleCloseTabButtonCB->isChecked();
-#if QT_VERSION < 0x040500
-       rc.single_close_tab_button = true;
-#endif
+
+       switch (closeLastViewCO->currentIndex()) {
+       case 0:
+               rc.close_buffer_with_last_view = "yes";
+               break;
+       case 1:
+               rc.close_buffer_with_last_view = "no";
+               break;
+       case 2:
+               rc.close_buffer_with_last_view = "ask";
+               break;
+       default:
+               ;
+       }
 }
 
 
-void PrefUserInterface::update(LyXRC const & rc)
+void PrefDocHandling::update(LyXRC const & rc)
 {
-       int iconset = iconSetCO->findData(toqstr(rc.icon_set));
-       if (iconset < 0)
-               iconset = 0;
-       iconSetCO->setCurrentIndex(iconset);
-       uiFileED->setText(toqstr(external_path(rc.ui_file)));
        restoreCursorCB->setChecked(rc.use_lastfilepos);
        loadSessionCB->setChecked(rc.load_session);
        allowGeometrySessionCB->setChecked(rc.allow_geometry_session);
@@ -2598,24 +2668,20 @@ void PrefUserInterface::update(LyXRC const & rc)
        autoSaveSB->setEnabled(autosave);
        backupCB->setChecked(rc.make_backup);
        saveCompressedCB->setChecked(rc.save_compressed);
-       lastfilesSB->setValue(rc.num_lastfiles);
-       tooltipCB->setChecked(rc.use_tooltip);
        openDocumentsInTabsCB->setChecked(rc.open_buffers_in_tabs);
        singleInstanceCB->setChecked(rc.single_instance && !rc.lyxpipes.empty());
        singleInstanceCB->setEnabled(!rc.lyxpipes.empty());
        singleCloseTabButtonCB->setChecked(rc.single_close_tab_button);
+       if (rc.close_buffer_with_last_view == "yes")
+               closeLastViewCO->setCurrentIndex(0);
+       else if (rc.close_buffer_with_last_view == "no")
+               closeLastViewCO->setCurrentIndex(1);
+       else if (rc.close_buffer_with_last_view == "ask")
+               closeLastViewCO->setCurrentIndex(2);
 }
 
 
-void PrefUserInterface::selectUi()
-{
-       QString file = form_->browseUI(internalPath(uiFileED->text()));
-       if (!file.isEmpty())
-               uiFileED->setText(file);
-}
-
-
-void PrefUserInterface::on_clearSessionPB_clicked()
+void PrefDocHandling::on_clearSessionPB_clicked()
 {
        guiApp->clearSession();
 }
@@ -2629,7 +2695,7 @@ void PrefUserInterface::on_clearSessionPB_clicked()
 /////////////////////////////////////////////////////////////////////
 
 PrefEdit::PrefEdit(GuiPreferences * form)
-       : PrefModule(qt_(catEditing), qt_("Control"), form)
+       : PrefModule(catEditing, N_("Control"), form)
 {
        setupUi(this);
 
@@ -2637,7 +2703,7 @@ PrefEdit::PrefEdit(GuiPreferences * form)
                this, SIGNAL(changed()));
        connect(scrollBelowCB, SIGNAL(clicked()),
                this, SIGNAL(changed()));
-       connect(macLikeWordMovementCB, SIGNAL(clicked()),
+       connect(macLikeCursorMovementCB, SIGNAL(clicked()),
                this, SIGNAL(changed()));
        connect(sortEnvironmentsCB, SIGNAL(clicked()),
                this, SIGNAL(changed()));
@@ -2657,6 +2723,8 @@ PrefEdit::PrefEdit(GuiPreferences * form)
                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()));
 }
@@ -2666,7 +2734,7 @@ void PrefEdit::apply(LyXRC & rc) const
 {
        rc.cursor_follows_scrollbar = cursorFollowsCB->isChecked();
        rc.scroll_below_document = scrollBelowCB->isChecked();
-       rc.mac_like_word_movement = macLikeWordMovementCB->isChecked();
+       rc.mac_like_cursor_movement = macLikeCursorMovementCB->isChecked();
        rc.sort_layouts = sortEnvironmentsCB->isChecked();
        rc.group_layouts = groupEnvironmentsCB->isChecked();
        switch (macroEditStyleCO->currentIndex()) {
@@ -2677,6 +2745,7 @@ void PrefEdit::apply(LyXRC & rc) const
        rc.cursor_width = cursorWidthSB->value();
        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.full_screen_width = fullscreenWidthSB->value();
@@ -2688,12 +2757,13 @@ void PrefEdit::update(LyXRC const & rc)
 {
        cursorFollowsCB->setChecked(rc.cursor_follows_scrollbar);
        scrollBelowCB->setChecked(rc.scroll_below_document);
-       macLikeWordMovementCB->setChecked(rc.mac_like_word_movement);
+       macLikeCursorMovementCB->setChecked(rc.mac_like_cursor_movement);
        sortEnvironmentsCB->setChecked(rc.sort_layouts);
        groupEnvironmentsCB->setChecked(rc.group_layouts);
        macroEditStyleCO->setCurrentIndex(rc.macro_edit_style);
        cursorWidthSB->setValue(rc.cursor_width);
        toggleScrollbarCB->setChecked(rc.full_screen_scrollbar);
+       toggleScrollbarCB->setChecked(rc.full_screen_statusbar);
        toggleToolbarsCB->setChecked(rc.full_screen_toolbars);
        toggleTabbarCB->setChecked(rc.full_screen_tabbar);
        toggleMenubarCB->setChecked(rc.full_screen_menubar);
@@ -2717,7 +2787,7 @@ GuiShortcutDialog::GuiShortcutDialog(QWidget * parent) : QDialog(parent)
 
 
 PrefShortcuts::PrefShortcuts(GuiPreferences * form)
-       : PrefModule(qt_(catEditing), qt_("Shortcuts"), form)
+       : PrefModule(catEditing, N_("Shortcuts"), form)
 {
        setupUi(this);
 
@@ -2738,8 +2808,6 @@ PrefShortcuts::PrefShortcuts(GuiPreferences * form)
        shortcut_bc_.setOK(shortcut_->okPB);
        shortcut_bc_.setCancel(shortcut_->cancelPB);
 
-       connect(shortcut_->okPB, SIGNAL(clicked()),
-               shortcut_, SLOT(accept()));
        connect(shortcut_->okPB, SIGNAL(clicked()),
                this, SIGNAL(changed()));
        connect(shortcut_->cancelPB, SIGNAL(clicked()),
@@ -3122,20 +3190,40 @@ void PrefShortcuts::shortcutOkPressed()
                // nothing has changed
                return;
        
-       // make sure this key isn't already bound---and, if so, not unbound
+       // make sure this key isn't already bound---and, if so, prompt user
        FuncCode const unbind = user_unbind_.getBinding(k).action();
        docstring const action_string = makeCmdString(oldBinding);
        if (oldBinding.action() > LFUN_NOACTION && unbind == LFUN_UNKNOWN_ACTION
                  && save_lfun_ != toqstr(action_string)) {
-               // FIXME Perhaps we should offer to over-write the old shortcut?
-               // If so, we'll need to remove it from our list, etc.
-               Alert::error(_("Failed to create shortcut"),
-                       bformat(_("Shortcut `%1$s' is already bound to:\n%2$s\n"
-                         "You need to remove that binding before creating a new one."), 
-                       k.print(KeySequence::ForGui), action_string));
-               return;
+               docstring const new_action_string = makeCmdString(func);
+               docstring const text = bformat(_("Shortcut `%1$s' is already bound to "
+                                                "%2$s.\n"
+                                                "Are you sure you want to unbind the "
+                                                "current shortcut and bind it to %3$s?"),
+                                              k.print(KeySequence::ForGui), action_string,
+                                              new_action_string);
+               int ret = Alert::prompt(_("Redefine shortcut?"),
+                                       text, 0, 1, _("&Redefine"), _("&Cancel"));
+               if (ret != 0)
+                       return;
+               QString const sequence_text = toqstr(k.print(KeySequence::ForGui));
+               QList<QTreeWidgetItem*> items = shortcutsTW->findItems(sequence_text,
+                       Qt::MatchFlags(Qt::MatchExactly | Qt::MatchRecursive), 1);
+               if (items.size() > 0) {
+                       // should always happen
+                       bool expanded = items[0]->parent()->isExpanded();
+                       shortcutsTW->setCurrentItem(items[0]);
+                       removeShortcut();
+                       shortcutsTW->setCurrentItem(0);
+                       // make sure user doesn't see tree expansion if
+                       // old binding wasn't in an expanded tree
+                       if (!expanded)
+                               items[0]->parent()->setExpanded(false);
+               }
        }
 
+       shortcut_->accept();
+
        if (!save_lfun_.isEmpty())
                // real modification of the lfun's shortcut,
                // so remove the previous one
@@ -3180,7 +3268,7 @@ void PrefShortcuts::shortcutRemovePressed()
 /////////////////////////////////////////////////////////////////////
 
 PrefIdentity::PrefIdentity(GuiPreferences * form)
-       : PrefModule(QString(), qt_("Identity"), form)
+       : PrefModule(QString(), N_("Identity"), form)
 {
        setupUi(this);
 
@@ -3228,6 +3316,7 @@ GuiPreferences::GuiPreferences(GuiView & lv)
        connect(restorePB, SIGNAL(clicked()), this, SLOT(slotRestore()));
 
        addModule(new PrefUserInterface(this));
+       addModule(new PrefDocHandling(this));
        addModule(new PrefEdit(this));
        addModule(new PrefShortcuts(this));
        PrefScreenFonts * screenfonts = new PrefScreenFonts(this);
@@ -3259,7 +3348,7 @@ GuiPreferences::GuiPreferences(GuiView & lv)
        addModule(converters);
        addModule(formats);
 
-       prefsPS->setCurrentPanel(qt_("User Interface"));
+       prefsPS->setCurrentPanel("User Interface");
 // FIXME: hack to work around resizing bug in Qt >= 4.2
 // bug verified with Qt 4.2.{0-3} (JSpitzm)
 #if QT_VERSION >= 0x040200