2010-07-16 14:09:54 +02:00
|
|
|
|
2010-06-17 17:24:36 +02:00
|
|
|
#include "mainwindow.h"
|
2010-07-16 14:09:54 +02:00
|
|
|
#include "odftohtmlconverter.h"
|
|
|
|
|
#include <QtGui/QApplication>
|
|
|
|
|
#include <QtCore/QTimer>
|
2010-06-17 17:24:36 +02:00
|
|
|
|
|
|
|
|
int main(int argc, char *argv[])
|
|
|
|
|
{
|
|
|
|
|
QApplication a(argc, argv);
|
2010-07-16 14:09:54 +02:00
|
|
|
|
|
|
|
|
if (argc == 4 && strcmp(argv[1], "--tohtml") == 0) {
|
|
|
|
|
OdfToHtmlConverter converter;// = new OdfToHtmlConverter(&a);
|
|
|
|
|
a.connect(&converter, SIGNAL(conversionFinished()),
|
|
|
|
|
SLOT(quit()));
|
|
|
|
|
converter.convertToHtml(argv[2], argv[3]);
|
|
|
|
|
|
|
|
|
|
int timeout = 50000; // ms
|
|
|
|
|
if (timeout > 0) {
|
|
|
|
|
QTimer* timer = new QTimer(&a);
|
|
|
|
|
a.connect(timer, SIGNAL(timeout()), SLOT(quit()));
|
|
|
|
|
timer->setSingleShot(true);
|
|
|
|
|
timer->start(timeout);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return a.exec();
|
|
|
|
|
}
|
|
|
|
|
|
2010-06-17 17:24:36 +02:00
|
|
|
MainWindow w;
|
|
|
|
|
w.show();
|
2010-06-24 10:48:55 +02:00
|
|
|
for (int i=1; i<argc; ++i) {
|
|
|
|
|
w.openFile(argv[i]);
|
|
|
|
|
}
|
2010-06-17 17:24:36 +02:00
|
|
|
return a.exec();
|
|
|
|
|
}
|