2010-11-11 08:32:12 +01:00
|
|
|
/**
|
|
|
|
|
* Small executable that loads a javascript or html page from local a URI.
|
|
|
|
|
* If the URI ends in .js it will be run in QtScript engine, otherwise, it will
|
|
|
|
|
* be assumed to be a webpage that will be opened in
|
|
|
|
|
*/
|
|
|
|
|
#include "pagerunner.h"
|
2011-07-26 13:22:33 +02:00
|
|
|
#include <QtGui/QApplication>
|
2010-11-11 08:32:12 +01:00
|
|
|
int
|
|
|
|
|
main(int argc, char** argv) {
|
2010-11-25 08:40:25 +01:00
|
|
|
if (argc < 2) {
|
2011-02-24 18:20:37 +01:00
|
|
|
QTextStream err(stderr);
|
2011-07-19 18:32:13 +02:00
|
|
|
err << "Usage: " << argv[0] << " [--export-pdf pdffile] "
|
|
|
|
|
"[--export-png pngfile] html/javascripfile [arguments]\n";
|
2010-11-11 08:32:12 +01:00
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
QApplication app(argc, argv);
|
2010-11-16 19:51:48 +01:00
|
|
|
app.setApplicationName(argv[0]);
|
2010-11-25 08:40:25 +01:00
|
|
|
PageRunner p(QCoreApplication::arguments().mid(1));
|
2010-11-11 08:32:12 +01:00
|
|
|
return app.exec();
|
|
|
|
|
}
|