Show disabled action instead of empty menu.
This commit is contained in:
parent
61854d2fa8
commit
b9b1d2fb66
|
@ -5035,6 +5035,14 @@ void TMainWindow::InitSearchHistory()
|
||||||
{
|
{
|
||||||
QStringList searchHistory = MApplication::VApp()->TapeSettings()->GetTapeSearchHistory();
|
QStringList searchHistory = MApplication::VApp()->TapeSettings()->GetTapeSearchHistory();
|
||||||
m_searchHistory->clear();
|
m_searchHistory->clear();
|
||||||
|
|
||||||
|
if (searchHistory.isEmpty())
|
||||||
|
{
|
||||||
|
QAction *action = m_searchHistory->addAction('<'_L1 + tr("Empty", "list") + '>'_L1);
|
||||||
|
action->setDisabled(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for (const auto &term : searchHistory)
|
for (const auto &term : searchHistory)
|
||||||
{
|
{
|
||||||
QAction *action = m_searchHistory->addAction(term);
|
QAction *action = m_searchHistory->addAction(term);
|
||||||
|
|
|
@ -885,6 +885,14 @@ void DialogFinalMeasurements::InitSearchHistory()
|
||||||
QStringList searchHistory =
|
QStringList searchHistory =
|
||||||
VAbstractValApplication::VApp()->ValentinaSettings()->GetFinalMeasurementsSearchHistory();
|
VAbstractValApplication::VApp()->ValentinaSettings()->GetFinalMeasurementsSearchHistory();
|
||||||
m_searchHistory->clear();
|
m_searchHistory->clear();
|
||||||
|
|
||||||
|
if (searchHistory.isEmpty())
|
||||||
|
{
|
||||||
|
QAction *action = m_searchHistory->addAction('<'_L1 + tr("Empty", "list") + '>'_L1);
|
||||||
|
action->setDisabled(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for (const auto &term : searchHistory)
|
for (const auto &term : searchHistory)
|
||||||
{
|
{
|
||||||
QAction *action = m_searchHistory->addAction(term);
|
QAction *action = m_searchHistory->addAction(term);
|
||||||
|
|
|
@ -767,6 +767,14 @@ void DialogHistory::InitSearchHistory()
|
||||||
{
|
{
|
||||||
QStringList searchHistory = VAbstractValApplication::VApp()->ValentinaSettings()->GetHistorySearchHistory();
|
QStringList searchHistory = VAbstractValApplication::VApp()->ValentinaSettings()->GetHistorySearchHistory();
|
||||||
m_searchHistory->clear();
|
m_searchHistory->clear();
|
||||||
|
|
||||||
|
if (searchHistory.isEmpty())
|
||||||
|
{
|
||||||
|
QAction *action = m_searchHistory->addAction('<'_L1 + tr("Empty", "list") + '>'_L1);
|
||||||
|
action->setDisabled(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for (const auto &term : searchHistory)
|
for (const auto &term : searchHistory)
|
||||||
{
|
{
|
||||||
QAction *action = m_searchHistory->addAction(term);
|
QAction *action = m_searchHistory->addAction(term);
|
||||||
|
|
|
@ -1131,6 +1131,14 @@ void DialogIncrements::InitIncrementsSearchHistory()
|
||||||
{
|
{
|
||||||
QStringList searchHistory = VAbstractValApplication::VApp()->ValentinaSettings()->GetIncrementsSearchHistory();
|
QStringList searchHistory = VAbstractValApplication::VApp()->ValentinaSettings()->GetIncrementsSearchHistory();
|
||||||
m_searchHistory->clear();
|
m_searchHistory->clear();
|
||||||
|
|
||||||
|
if (searchHistory.isEmpty())
|
||||||
|
{
|
||||||
|
QAction *action = m_searchHistory->addAction('<'_L1 + tr("Empty", "list") + '>'_L1);
|
||||||
|
action->setDisabled(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for (const auto &term : searchHistory)
|
for (const auto &term : searchHistory)
|
||||||
{
|
{
|
||||||
QAction *action = m_searchHistory->addAction(term);
|
QAction *action = m_searchHistory->addAction(term);
|
||||||
|
@ -1156,6 +1164,14 @@ void DialogIncrements::InitPreviewCalculationsSearchHistory()
|
||||||
QStringList searchHistory =
|
QStringList searchHistory =
|
||||||
VAbstractValApplication::VApp()->ValentinaSettings()->GetPreviewCalculationsSearchHistory();
|
VAbstractValApplication::VApp()->ValentinaSettings()->GetPreviewCalculationsSearchHistory();
|
||||||
m_searchHistoryPC->clear();
|
m_searchHistoryPC->clear();
|
||||||
|
|
||||||
|
if (searchHistory.isEmpty())
|
||||||
|
{
|
||||||
|
QAction *action = m_searchHistoryPC->addAction('<'_L1 + tr("Empty", "list") + '>'_L1);
|
||||||
|
action->setDisabled(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for (const auto &term : searchHistory)
|
for (const auto &term : searchHistory)
|
||||||
{
|
{
|
||||||
QAction *action = m_searchHistoryPC->addAction(term);
|
QAction *action = m_searchHistoryPC->addAction(term);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user