]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetInfo.cpp
Remove all BufferParam arguments in InsetXXX methods (since insets know about their...
[lyx.git] / src / insets / InsetInfo.cpp
index 57f63a9947f98fd8b4a6d2466003fcd367267621..6875afd47b595bd0fb121a3c89ff10dfc289e870 100644 (file)
@@ -112,10 +112,8 @@ docstring InsetInfo::name() const
 
 docstring InsetInfo::toolTip(BufferView const &, int, int) const
 {
-       odocstringstream os;
-       os << _("Information regarding ")
-          << _(infoType()) << " " << from_utf8(name_);
-       return os.str();
+       return bformat(_("Information regarding %1$s '%2$s'"),
+                       _(infoType()), from_utf8(name_));
 }
 
 
@@ -141,7 +139,7 @@ void InsetInfo::read(Lexer & lex)
                        _("Missing \\end_inset at this point."),
                        from_utf8(token));
        }
-       setLayout(buffer().params());
+       setLayout();
        updateInfo();
 }
 
@@ -199,17 +197,17 @@ bool InsetInfo::getStatus(Cursor & cur, FuncRequest const & cmd,
        case LFUN_MOUSE_DOUBLE:
        case LFUN_MOUSE_TRIPLE:
        case LFUN_COPY:
-       case LFUN_INSET_SETTINGS:
                return InsetCollapsable::getStatus(cur, cmd, flag);
 
+       case LFUN_INSET_DIALOG_UPDATE:
        case LFUN_INSET_MODIFY:
+       case LFUN_INSET_SETTINGS:
                flag.setEnabled(true);
-               break;
+               return true;
 
        default:
                return false;
        }
-       return true;
 }
 
 
@@ -246,20 +244,21 @@ void InsetInfo::setInfo(string const & name)
        string type;
        name_ = trim(split(name, type, ' '));
        type_ = nameTranslator().find(type);
-       setLayout(buffer().params());
+       setLayout();
        updateInfo();
 }
 
 
 void InsetInfo::error(string const & err)
 {
-       setText(bformat(_(err), from_utf8(name_)), Font(inherit_font), false);
+       setText(bformat(_(err), from_utf8(name_)), 
+               Font(inherit_font, buffer().params().language), false);
 }
 
 
 void InsetInfo::setText(docstring const & str)
 {
-       setText(str, Font(inherit_font), false);
+       setText(str, Font(inherit_font, buffer().params().language), false);
 }
 
 
@@ -285,11 +284,9 @@ void InsetInfo::updateInfo()
                        break;
                }
                if (type_ == SHORTCUT_INFO)
-                       setText(bindings.rbegin()->print(KeySequence::Portable),
-                               Font(getLayout().font()), false);
+                       setText(bindings.begin()->print(KeySequence::Portable));
                else
-                       setText(theTopLevelKeymap().printBindings(func, KeySequence::Portable), 
-                               Font(getLayout().font()), false);
+                       setText(theTopLevelKeymap().printBindings(func, KeySequence::Portable));
                break;
        }
        case LYXRC_INFO: {
@@ -328,7 +325,7 @@ void InsetInfo::updateInfo()
                // if found, return its path.
                clear();
                Paragraph & par = paragraphs().front();
-               Font const f = Font(getLayout().font());
+               Font const f(inherit_font, buffer().params().language);
                //Font fu = f;
                //fu.fontInfo().setUnderbar(FONT_ON);
                docstring_list::const_iterator beg = names.begin();