]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetInfo.cpp
Restore XHTML output for InsetListings.
[lyx.git] / src / insets / InsetInfo.cpp
index c87df0acd1f8025e4f678c65c978898a55c6be51..45d63287c89d7b92111f0e529a2ea7af9b7525a7 100644 (file)
@@ -82,7 +82,7 @@ NameTranslator const & nameTranslator()
 
 
        
-InsetInfo::InsetInfo(Buffer const & buf, string const & name) 
+InsetInfo::InsetInfo(Buffer * buf, string const & name) 
        : InsetCollapsable(buf), type_(UNKNOWN_INFO), name_()
 {
        setAutoBreakRows(true);
@@ -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,6 @@ void InsetInfo::read(Lexer & lex)
                        _("Missing \\end_inset at this point."),
                        from_utf8(token));
        }
-       setLayout(buffer().params());
        updateInfo();
 }
 
@@ -199,17 +196,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 +243,20 @@ void InsetInfo::setInfo(string const & name)
        string type;
        name_ = trim(split(name, type, ' '));
        type_ = nameTranslator().find(type);
-       setLayout(buffer().params());
        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 +282,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), 
-                               Font(getLayout().font()), false);
+                       setText(theTopLevelKeymap().printBindings(func, KeySequence::Portable));
                break;
        }
        case LYXRC_INFO: {
@@ -328,7 +323,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();
@@ -360,7 +355,7 @@ void InsetInfo::updateInfo()
                FileName file(to_utf8(icon_name));
                if (!file.exists())
                        break;
-               InsetGraphics * inset = new InsetGraphics(buffer());
+               InsetGraphics * inset = new InsetGraphics(buffer_);
                InsetGraphicsParams igp;
                igp.filename = file;
                inset->setParams(igp);