PageRenderTime 27ms CodeModel.GetById 12ms app.highlight 10ms RepoModel.GetById 1ms app.codeStats 1ms

/safeFatPrinter/branch/src/main.cpp

http://cupsfilter.googlecode.com/
C++ | 40 lines | 30 code | 5 blank | 5 comment | 1 complexity | 9e64284cca3d275d897d531068793d40 MD5 | raw file
 1#include <QDebug>
 2#include <QtGui/QApplication>
 3#include <QTextCodec>
 4#include <QMessageBox>
 5#include "config.h"
 6
 7#include "startdlg.h"
 8
 9int main(int argc, char *argv[])
10{
11    Q_INIT_RESOURCE(images);
12
13    QTextCodec *codec = QTextCodec::codecForName("UTF-8");
14    QTextCodec::setCodecForTr(codec);
15    //QTextCodec::setCodecForTr( QTextCodec::codecForName( "cp866" ) );
16    QTextCodec::setCodecForCStrings(codec);
17    QTextCodec::setCodecForLocale(codec);
18    qInstallMsgHandler(myMessageOutput);
19    QApplication app(argc, argv);
20/*
21View * t= new View();
22t->exec();
23*/
24    QStringList aList=app.arguments();
25    qDebug() << aList.size();
26    if (aList.size()< 1){
27	QMessageBox::critical(0,QObject::trUtf8("?????????? ? ?????????? ??????????????"),
28			      QObject::trUtf8("?????? ??????? ??????????, ?? ?????????? ?????????? ???????"));
29
30	qDebug() << aList<<QString("Need more command line arguments.Current arguments %1\nExample safe_printer input.file doc_name").arg(aList.size());
31	app.exit(1);
32    }else {
33	QString in_file =aList.at(1);
34
35	StartDlg w;
36	w.convertToPDF(in_file);
37	w.show();
38	return app.exec();
39    }
40}