Skip to content

Commit

Permalink
Added hint in scenery library dialog about excluded folders.
Browse files Browse the repository at this point in the history
  • Loading branch information
albar965 committed Apr 25, 2023
1 parent cbc94da commit 4608d4c
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 48 deletions.
95 changes: 48 additions & 47 deletions src/db/databaseloader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,53 +66,54 @@ const static int UPDATE_RATE_MS = 250;
DatabaseLoader::DatabaseLoader(QObject *parent)
: QObject(parent)
{
databaseInfoText = QObject::tr("<table>"
"<tbody>"
"<tr> "
"<td width=\"60\"><b>Files:</b>"
"</td> "
"<td width=\"60\">&nbsp;&nbsp;&nbsp;&nbsp;%L6"
"</td> "
"<td width=\"60\"><b>VOR:</b>"
"</td> "
"<td width=\"60\">&nbsp;&nbsp;&nbsp;&nbsp;%L8"
"</td> "
"<td width=\"60\"><b>Markers:</b>"
"</td> "
"<td width=\"60\">&nbsp;&nbsp;&nbsp;&nbsp;%L11"
"</td>"
"</tr>"
"<tr> "
"<td width=\"60\"><b>Airports:</b>"
"</td> "
"<td width=\"60\">&nbsp;&nbsp;&nbsp;&nbsp;%L7"
"</td> "
"<td width=\"60\"><b>ILS:</b>"
"</td> "
"<td width=\"60\">&nbsp;&nbsp;&nbsp;&nbsp;%L9"
"</td> "
"<td width=\"60\"><b>Waypoints:</b>"
"</td> "
"<td width=\"60\">&nbsp;&nbsp;&nbsp;&nbsp;%L12"
"</td>"
"</tr>"
"<tr> "
"<td width=\"60\">"
"</td>"
"<td width=\"60\">"
"</td>"
"<td width=\"60\"><b>NDB:</b>"
"</td> "
"<td width=\"60\">&nbsp;&nbsp;&nbsp;&nbsp;%L10"
"</td> "
"<td width=\"60\"><b>Airspaces:</b>"
"</td> "
"<td width=\"60\">&nbsp;&nbsp;&nbsp;&nbsp;%L13"
"</td>"
"</tr>"
"</tbody>"
"</table>"
);
databaseInfoText = QObject::tr(
"<table>"
"<tbody>"
"<tr> "
"<td width=\"60\"><b>Files:</b>"
"</td> "
"<td width=\"60\">&nbsp;&nbsp;&nbsp;&nbsp;%L6"
"</td> "
"<td width=\"60\"><b>VOR:</b>"
"</td> "
"<td width=\"60\">&nbsp;&nbsp;&nbsp;&nbsp;%L8"
"</td> "
"<td width=\"60\"><b>Markers:</b>"
"</td> "
"<td width=\"60\">&nbsp;&nbsp;&nbsp;&nbsp;%L11"
"</td>"
"</tr>"
"<tr> "
"<td width=\"60\"><b>Airports:</b>"
"</td> "
"<td width=\"60\">&nbsp;&nbsp;&nbsp;&nbsp;%L7"
"</td> "
"<td width=\"60\"><b>ILS:</b>"
"</td> "
"<td width=\"60\">&nbsp;&nbsp;&nbsp;&nbsp;%L9"
"</td> "
"<td width=\"60\"><b>Waypoints:</b>"
"</td> "
"<td width=\"60\">&nbsp;&nbsp;&nbsp;&nbsp;%L12"
"</td>"
"</tr>"
"<tr> "
"<td width=\"60\">"
"</td>"
"<td width=\"60\">"
"</td>"
"<td width=\"60\"><b>NDB:</b>"
"</td> "
"<td width=\"60\">&nbsp;&nbsp;&nbsp;&nbsp;%L10"
"</td> "
"<td width=\"60\"><b>Airspaces:</b>"
"</td> "
"<td width=\"60\">&nbsp;&nbsp;&nbsp;&nbsp;%L13"
"</td>"
"</tr>"
"</tbody>"
"</table>"
);

databaseTimeText = QObject::tr(
"<b>%1</b><br/>" // Scenery:
Expand Down
21 changes: 20 additions & 1 deletion src/db/databasemanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1700,7 +1700,26 @@ void DatabaseManager::updateDialogInfo(atools::fs::FsPaths::SimulatorType value)
else
tableText = databaseInfoText.arg(0).arg(0).arg(0).arg(0).arg(0).arg(0).arg(0).arg(0);

databaseDialog->setHeader(metaText + tr("<p><big>Currently Loaded:</big></p><p>%1</p>").arg(tableText));
const OptionData& options = OptionData::instance();
QStringList optionsHeader;
if(!options.getDatabaseExclude().isEmpty())
optionsHeader.append(tr("%1 %2 excluded from loading").
arg(options.getDatabaseExclude().size()).
arg(options.getDatabaseExclude().size() > 1 ? tr("directories are") : tr("directory is")));
if(!options.getDatabaseAddonExclude().isEmpty())
optionsHeader.append(tr("%1 %2 excluded from add-on detection").
arg(options.getDatabaseAddonExclude().size()).
arg(options.getDatabaseAddonExclude().size() > 1 ? tr("directories are") : tr("directory is")));

if(!optionsHeader.isEmpty())
{
optionsHeader = QStringList(atools::strJoin(tr("<b>Note:</b> "), optionsHeader, tr(", "), tr(" and "), tr(".")));
optionsHeader.append(tr("Excluded directories can be changed in options on page \"Scenery Library Database\".").arg(tableText));
}

databaseDialog->setHeader(metaText +
atools::strJoin(tr("<p>"), optionsHeader, tr("<br/>"), tr("<br/>"), tr("</p>")) +
tr("<p><big>Currently Loaded:</big></p><p>%1</p>").arg(tableText));

if(tempDb.isOpen())
tempDb.close();
Expand Down

0 comments on commit 4608d4c

Please sign in to comment.