From: Juergen Spitzmueller Date: Wed, 8 Aug 2018 07:52:03 +0000 (+0200) Subject: GuiInfo: Show "Unknown" only if issued from an unknown info. X-Git-Tag: lyx-2.4.0dev-acb2ca7b~3182 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=44718e0e8ca7542aa4b29ff5bc40b2624e944654;p=features.git GuiInfo: Show "Unknown" only if issued from an unknown info. --- diff --git a/src/frontends/qt4/GuiInfo.cpp b/src/frontends/qt4/GuiInfo.cpp index 7f0d4cc1ef..a499461282 100644 --- a/src/frontends/qt4/GuiInfo.cpp +++ b/src/frontends/qt4/GuiInfo.cpp @@ -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;