]> git.lyx.org Git - lyx.git/commitdiff
Allow to hide formats from menus
authorJuergen Spitzmueller <spitz@lyx.org>
Wed, 11 Sep 2019 08:29:50 +0000 (10:29 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Wed, 11 Sep 2019 08:46:07 +0000 (10:46 +0200)
Fixes: #11657
(cherry picked from commit d76cef70a0320212adb3cfcf73aa77174802e4fc)

lib/configure.py
src/Format.h
src/LyXRC.cpp
src/frontends/qt4/Menus.cpp
status.23x

index 23b631f9dc27243da3a41aaa9b6893a07bfedba1..c115ac15aa3d9ab7e91594b7969b2d6ab6f241f9 100644 (file)
@@ -686,7 +686,7 @@ def checkFormatEntries(dtl_tools):
 \Format luatex     tex    "LaTeX (LuaTeX)"        "" ""        "%%"    "document,menu=export"  ""
 \Format pdflatex   tex    "LaTeX (pdflatex)"      "" ""        "%%"    "document,menu=export"  ""
 \Format xetex      tex    "LaTeX (XeTeX)"         "" ""        "%%"    "document,menu=export"  ""
-\Format latexclipboard tex "LaTeX (clipboard)"    "" ""        "%%"    "     ""
+\Format latexclipboard tex "LaTeX (clipboard)"    "" ""        "%%"    "menu=none"     ""
 \Format text       txt    "Plain text"            a  ""        "%%"    "document,menu=export"  "text/plain"
 \Format text2      txt    "Plain text (pstotext)" "" ""        "%%"    "document"      ""
 \Format text3      txt    "Plain text (ps2ascii)" "" ""        "%%"    "document"      ""
index cc383c02497820d8a127b56a29afcf79c607abe9..4fcd3c955316d00b7a6c90882429cef1bfa403a3 100644 (file)
@@ -39,7 +39,9 @@ public:
                /// This format should  appear in the File > Export menu
                export_menu = 4,
                /// This may be a compressed file but doesn't need decompression
-               zipped_native = 8
+               zipped_native = 8,
+               /// This format should not appear in a menu at all
+               no_menu = 16
        };
        ///
        Format(std::string const & n, std::string const & e, docstring const & p,
@@ -96,6 +98,8 @@ public:
        ///
        bool inExportMenu() const { return flags_ & export_menu; }
        ///
+       bool noMenu() const { return flags_ & no_menu; }
+       ///
        bool zippedNative() const { return flags_ & zipped_native; }
        ///
        static bool formatSorter(Format const * lhs, Format const * rhs);
index 67530bd3e349eff5129081b89de1e0739d8a8673..fb711743363a92fe1b1682845b64fc66c84673cc 100644 (file)
@@ -1056,6 +1056,8 @@ LyXRC::ReturnValues LyXRC::read(Lexer & lexrc, bool check_format)
                                        flgs |= Format::zipped_native;
                                else if (flag == "menu=export")
                                        flgs |= Format::export_menu;
+                               else if (flag == "menu=none")
+                                       flgs |= Format::no_menu;
                                else
                                        LYXERR0("Ignoring unknown flag `"
                                               << flag << "' for format `"
@@ -2721,6 +2723,7 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) c
                            format->documentFormat() != cit->documentFormat() ||
                            format->vectorFormat() != cit->vectorFormat() ||
                            format->inExportMenu() != cit->inExportMenu() ||
+                           format->noMenu() != cit->noMenu() ||
                            format->mime() != cit->mime()) {
                                os << "\\format \"" << cit->name() << "\" \""
                                   << cit->extensions() << "\" \""
index 5eafff6f74b333ce0527e0e84edc843b0bed1759..0872152e3495ecb1d3e088e7308721691710184a 100644 (file)
@@ -1112,6 +1112,8 @@ void MenuDefinition::expandFormats(MenuItem::Kind const kind, Buffer const * buf
 
                switch (kind) {
                case MenuItem::ImportFormats:
+                       if (f->noMenu())
+                               continue;
                        label += from_ascii("...");
                        break;
                case MenuItem::ViewFormats:
index 319b18cd420c86e67f012cf2109cdda8500efa40..7f4232e45ecf9b208f71442b9b04fea77fd75df6 100644 (file)
@@ -135,6 +135,8 @@ What's new
 
 - Fix crash when deleting column in math grid (bug 11623).
 
+- Hide "LaTeX (Clipboard)" entry from import menu (bug 11657).
+
 
 * INTERNALS