Mercurial > clickerconvert
comparison src/main.cpp @ 38:5354cbda7188
Fix HTML Layout. Support multiple formats at once. More handling.
This commit is a bad mix of multiple changes. It addresses:
- HTML Width is now relative and should fix some pdf creation problems.
- Format is now taken from the extension of the file names provided.
- Multiple file names are accepted at once.
- Parser now handles missing values in Multiple choice answers
- Parser now handles unfilled multiple choice values
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Fri, 15 Apr 2016 15:19:04 +0200 |
parents | 927794e3cc52 |
children | 36ee5dd46fd3 |
comparison
equal
deleted
inserted
replaced
37:b574990e90a5 | 38:5354cbda7188 |
---|---|
127 const QStringList args = parser.positionalArguments(); | 127 const QStringList args = parser.positionalArguments(); |
128 if (args.size() > 1) { | 128 if (args.size() > 1) { |
129 parser.showHelp(1); | 129 parser.showHelp(1); |
130 } | 130 } |
131 | 131 |
132 ConvertFormat fmt = Format_XLSX; | |
133 /* Initialize the converter. */ | |
134 const QString format = parser.value("format").toLower(); | |
135 if (format == "xlsx" || format.isEmpty()) { | |
136 fmt = Format_XLSX; | |
137 } else if (format == "html") { | |
138 fmt = Format_HTML; | |
139 } else if (format == "pdf") { | |
140 fmt = Format_PDF; | |
141 } else { | |
142 qCritical() << "Format: " << parser.value("format") << "not supported"; | |
143 exit(1); | |
144 } | |
145 QString infile; | 132 QString infile; |
146 if (args.size()) { | 133 if (args.size()) { |
147 infile = args.first(); | 134 infile = args.first(); |
148 } | 135 } |
149 Converter conv(infile, parser.value("output"), fmt, | 136 Converter conv(infile, parser.values("output"), |
150 parser.value("title")); | 137 parser.value("title")); |
151 | 138 |
152 conv.start(); | 139 conv.start(); |
153 conv.wait(); | 140 conv.wait(); |
154 | 141 |