Use saved units in the HTML exporter

Also update the exporter to match the latest changes in the Subsurface
code.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2015-06-17 06:27:33 -07:00
parent ff4b5478b5
commit 11f457403f

View file

@ -16,7 +16,7 @@ QTranslator *qtTranslator, *ssrfTranslator;
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
QApplication *application = init_qt(&argc, &argv); QApplication *application = new QApplication(argc, argv);
git_libgit2_init(); git_libgit2_init();
setup_system_prefs(); setup_system_prefs();
prefs = default_prefs; prefs = default_prefs;
@ -41,15 +41,24 @@ int main(int argc, char **argv)
qDebug() << "need --source and --output"; qDebug() << "need --source and --output";
exit(1); exit(1);
} }
qDebug() << source << output;
fprintf(stderr, "parse_file returned %d\n", parse_file(qPrintable(source)));
int ret = parse_file(qPrintable(source));
if (ret)
fprintf(stderr, "parse_file returned %d\n", ret);
// this should have set up the informational preferences - let's grab
// the units from there
prefs.unit_system = informational_prefs.unit_system;
prefs.units = informational_prefs.units;
// now set up the export settings to create the HTML export
struct htmlExportSetting hes; struct htmlExportSetting hes;
hes.themeFile = "sand.css"; hes.themeFile = "sand.css";
hes.exportPhotos = true; hes.exportPhotos = true;
hes.selectedOnly = false; hes.selectedOnly = false;
hes.listOnly = false; hes.listOnly = false;
hes.yearlyStatistics = true; hes.yearlyStatistics = true;
exportHtmlInitLogic(output, &hes); exportHtmlInitLogic(output, hes);
exit(0); exit(0);
} }