summaryrefslogtreecommitdiffstats
path: root/tools/printslides/main.cpp
blob: 21f59f05832438342a6e68990b11b32dfad278c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*          DO WHAT THE FRAK YOU WANT TO PUBLIC LICENSE (WTFPL)
                    Version 4, October 2012
	    Based on the wtfpl: http://sam.zoy.org/wtfpl/

 Copyright (C) 2012 Alan Ezust

 Everyone is permitted to copy and distribute verbatim or modified
 copies of this license document, and changing it is allowed as long
 as the name is changed.

            DO WHAT THE FRAK YOU WANT TO PUBLIC LICENSE
   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

  0. You just DO WHAT THE FRAK YOU WANT TO.
  1. It is provided "as is" without any warranty whatsoever.
*/

#include <QtGui>
#include "slideview.h"

/** PrintSlides main program.
    A program to print qt-labs qml-presentation-system Presentations.
    @author ezust@ics.com
*/
int main (int argc, char* argv[]) {
    QGuiApplication app(argc, argv);
    app.setOrganizationDomain("com");
    app.setOrganizationName("ics");
    app.setApplicationName("printslides");
    app.setApplicationVersion("0.2");
    app.setApplicationDisplayName("QML Presentation Slide Printer");
    SlideView mainView;
    argc = app.arguments().length();
    if ((argc != 2) || app.arguments()[1].endsWith("?")) {
        QString progName = app.applicationName();
        QString message = QString().arg(progName);
        qFatal("%s usage: \n\t    %s path/to/presentation.qml\n"
            "Displays and prints each slides to slides.pdf\n",
            progName.toLocal8Bit().constData(),
            progName.toLocal8Bit().constData());
        return 2;
    }
    mainView.setSource(app.arguments()[1]);
    mainView.show();
    return app.exec();
}