]> git.lyx.org Git - features.git/blobdiff - src/frontends/qt/GuiView.cpp
Revert "Show toolbar context menu only when clicking on the toolbar"
[features.git] / src / frontends / qt / GuiView.cpp
index 1b9f0ef27c1d2617250f465321d7b32a4afb5e42..948deb9a756c8378faa666f9974db143287037bd 100644 (file)
@@ -746,7 +746,7 @@ QVector<GuiWorkArea*> GuiView::GuiViewPrivate::guiWorkAreas()
 static void handleExportStatus(GuiView * view, Buffer::ExportStatus status,
        string const & format)
 {
-       docstring const fmt = theFormats().prettyName(format);
+       docstring const fmt = translateIfPossible(theFormats().prettyName(format));
        docstring msg;
        switch (status) {
        case Buffer::ExportSuccess:
@@ -2371,6 +2371,10 @@ bool GuiView::getStatus(FuncRequest const & cmd, FuncStatus & flag)
                flag.setOnOff(lyxrc.spellcheck_continuously);
                break;
 
+       case LFUN_CITATION_OPEN:
+               enable = true;
+               break;
+
        default:
                return false;
        }
@@ -2532,7 +2536,7 @@ static bool import(GuiView * lv, FileName const & filename,
                if (loader_format.empty()) {
                        frontend::Alert::error(_("Couldn't import file"),
                                         bformat(_("No information for importing the format %1$s."),
-                                        theFormats().prettyName(format)));
+                                        translateIfPossible(theFormats().prettyName(format))));
                        return false;
                }
        } else
@@ -2579,13 +2583,13 @@ void GuiView::importDocument(string const & argument)
                }
 
                docstring const text = bformat(_("Select %1$s file to import"),
-                       theFormats().prettyName(format));
+                       translateIfPossible(theFormats().prettyName(format)));
 
                FileDialog dlg(toqstr(text));
                dlg.setButton1(qt_("D&ocuments"), toqstr(lyxrc.document_path));
                dlg.setButton2(qt_("&Examples"), toqstr(lyxrc.example_path));
 
-               docstring filter = theFormats().prettyName(format);
+               docstring filter = translateIfPossible(theFormats().prettyName(format));
                filter += " (*.{";
                // FIXME UNICODE
                filter += from_utf8(theFormats().extensions(format));
@@ -4620,6 +4624,16 @@ void GuiView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
                        dr.screenUpdate(Update::Force);
                        break;
 
+               case LFUN_CITATION_OPEN: {
+                       string pdfv, psv;
+                       if (theFormats().getFormat("pdf"))
+                               pdfv = theFormats().getFormat("pdf")->viewer();
+                       if (theFormats().getFormat("ps"))
+                               psv = theFormats().getFormat("ps")->viewer();
+                       frontend::showTarget(argument, pdfv, psv);
+                       break;
+               }
+
                default:
                        // The LFUN must be for one of BufferView, Buffer or Cursor;
                        // let's try that: