make version dlg more readable
authorKonrad Rosenbaum <konrad@silmor.de>
Fri, 29 Jun 2012 17:24:57 +0000 (19:24 +0200)
committerKonrad Rosenbaum <konrad@silmor.de>
Fri, 29 Jun 2012 17:24:57 +0000 (19:24 +0200)
src/main.cpp

index 72b66af..a453d94 100644 (file)
@@ -109,6 +109,7 @@ void MApplication::versionDlg()
        mb.setIconPixmap(QPixmap(":/icon.png"));
        mb.setWindowTitle(tr("MagicSmoke Version Information"));
        TimeZoneLib::TZFile tzf=TimeStamp::defaultZoneFile();
+       auto unknown=[](const QString&s)->QString{if(s.isEmpty())return "(unknown)";else return "'"+s+"'";};
        mb.setText(tr(  "<h3>MagicSmoke Version %3</h3>"
                        "<table>"
                        "<tr><td>Repository:<td>%1</tr>"
@@ -122,7 +123,7 @@ void MApplication::versionDlg()
                        "<tr><td>PACK&nbsp;Library:<td>%9<br/>%10</tr>"
                        "<tr><td>Qt:<td>%11</tr>"
                        "<tr><td>ELAM:<td>%12</tr>"
-                       "<tr><td>Time&nbsp;Zone&nbsp;Default:<td>%13 in %14<br/>version %15</tr>"
+                       "<tr><td>Time&nbsp;Zone&nbsp;Default:<td>%13 in directory %14<br/>version %15</tr>"
                        "<tr><td>Time&nbsp;Zone&nbsp;Built-In:<td>%16</tr>"
                        "</table>"
                        )
@@ -138,9 +139,9 @@ void MApplication::versionDlg()
                        .arg(htmlize(WInterface::staticLibraryVersionInfo(WOb::VersionNumber)))
                        .arg(htmlize(QT_VERSION_STR)) //%11
                        .arg(htmlize(ELAM::versionInfo())) //%12
-                       .arg(tzf.name()) //%13
-                       .arg(tzf.dirName())
-                       .arg(tzf.version())
+                       .arg(unknown(tzf.name())) //%13
+                       .arg(unknown(tzf.dirName()))
+                       .arg(unknown(tzf.version()))
                        .arg(TimeZoneLib::TZFile::builtinVersion()) //%16
                );
        mb.setStandardButtons(QMessageBox::Ok);