summaryrefslogtreecommitdiffstats
path: root/src/maingui/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/maingui/main.cpp')
-rw-r--r--src/maingui/main.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/maingui/main.cpp b/src/maingui/main.cpp
new file mode 100644
index 0000000..f9b8bb2
--- /dev/null
+++ b/src/maingui/main.cpp
@@ -0,0 +1,25 @@
+#include <QApplication>
+#include <fstream>
+#include "printergui.h"
+#include <fcntl.h>
+#include <sys/stat.h>
+
+int main(int argc, char *argv[])
+{
+ // First check parameter count
+ if (argc != 3)
+ return 2;
+
+ // Check if file exists
+ int fh = open(argv[2], O_RDONLY);
+ if (fh < 0) {
+ fprintf(stderr, "ERROR: Could not open %s for reading..\n", argv[2]);
+ return 2;
+ }
+ close(fh);
+
+ QApplication a(argc, argv);
+ PrinterGui w(argv);
+ w.show();
+ return a.exec();
+}