TonicTones
Src/main.cpp
00001 //      main.cpp
00002 //      
00003 //      Copyright 2010 Jérémy Laumon <jeremy.laumon@gmail.com>
00004 //      
00005 //      This program is free software; you can redistribute it and/or modify
00006 //      it under the terms of the GNU General Public License as published by
00007 //      the Free Software Foundation; either version 2 of the License, or
00008 //      (at your option) any later version.
00009 //      
00010 //      This program is distributed in the hope that it will be useful,
00011 //      but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 //      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 //      GNU General Public License for more details.
00014 //      
00015 //      You should have received a copy of the GNU General Public License
00016 //      along with this program; if not, write to the Free Software
00017 //      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
00018 //      MA 02110-1301, USA.
00019 
00020 
00021 #include <QApplication>
00022 #include <QtGui>
00023 #include <TonicTones.h>
00024 
00025 void messageHandler(QtMsgType type, const char *msg)
00026 {
00027     QMessageBox msgBox;
00028     switch (type) 
00029     {
00030         case QtWarningMsg:
00031             msgBox.setIcon(QMessageBox::Warning);
00032             msgBox.setText(msg);
00033             msgBox.exec();
00034             break;
00035         case QtCriticalMsg:
00036             msgBox.setIcon(QMessageBox::Warning);
00037             msgBox.setText(msg);
00038             msgBox.exec();
00039             break;
00040         case QtFatalMsg:
00041             msgBox.setIcon(QMessageBox::Critical);
00042             msgBox.setText(msg);
00043             msgBox.exec();
00044             abort();
00045             break;
00046         default:
00047             fprintf(stderr, "%s\n", msg);
00048             break;
00049     }
00050 }
00051 
00052 
00053 int main(int argc, char *argv[])
00054 {
00055     QApplication app(argc, argv);
00056     
00057     qInstallMsgHandler(messageHandler);
00058     TonicTones t;
00059     t.show();
00060 
00061     return app.exec();
00062 }
00063 
 All Classes Functions Variables