]> git.lyx.org Git - lyx.git/commitdiff
GuiInfo: Show "Unknown" only if issued from an unknown info.
authorJuergen Spitzmueller <spitz@lyx.org>
Wed, 8 Aug 2018 07:52:03 +0000 (09:52 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Wed, 8 Aug 2018 07:52:03 +0000 (09:52 +0200)
src/frontends/qt4/GuiInfo.cpp

index 7f0d4cc1efe996998f438135780f6d59292d2427..a499461282f193415d48c9bc0c8ffeb998577cce 100644 (file)
@@ -61,7 +61,6 @@ char const * info_types[] =
   "icon",
   "lyxrc",
   "lyxinfo",
-  "unknown",
   ""
 };
 
@@ -83,7 +82,6 @@ char const * info_types_gui[] =
   N_("LyX Toolbar Icon"),// icon
   N_("LyX Preferences Entry"),// lyxrc
   N_("LyX Application Information"),// lyxinfo
-  N_("Unknown"),// unknown
   ""
 };
 
@@ -245,7 +243,15 @@ void GuiInfo::paramsToDialog(Inset const * inset)
        typeCO->blockSignals(true);
        nameLE->blockSignals(true);
        nameLE->clear();
-       int const i = typeCO->findData(type);
+       // The "unknown" item is only in the combo if we open
+       // the dialog from an unknown info. The user should not
+       // change a valid info to an unknown one.
+       int i = typeCO->findData("unknown");
+       if (i == -1 && type == "unknown")
+               typeCO->addItem(qt_("Unknown"), toqstr("unknown"));
+       if (i != -1 && type != "unknown")
+               typeCO->removeItem(i);
+       i = typeCO->findData(type);
        typeCO->setCurrentIndex(i);
        updateArguments(i);
        int argindex = -1;