imedgine.cpp

00001 #include <QApplication>
00002 
00003 #include "gui/first_start_settings_dialog.h"
00004 #include "gui/main_window.h"
00005 #include "controller/controller.h"
00006 #include "exceptions/null_pointer_exception.h"
00007 #include "exceptions/index_out_of_bounds_exception.h"
00008 #include "global/settings.h"
00009 
00010 #include <iostream>
00011 
00012 int main(int argc, char *argv[])
00013 {
00014   try 
00015   {    
00016     QApplication app(argc, argv);
00017   //  Q_INIT_RESOURCE(dockwidgets);
00018 
00019 
00020     if((imedgine::Settings::getInstance())->getStringValue("first_start") != "false")
00021     {
00022       imedgine::FirstStartSettingsDialog* first_start_settings_dialog =
00023         new imedgine::FirstStartSettingsDialog();
00024       first_start_settings_dialog->exec();
00025 
00026       // FIXXXME: Lex Alexander, 02.08.2006, provide a setStringValue method in Settings?
00027       std::string key = "first_start";
00028       std::string value = "false";
00029       (imedgine::Settings::getInstance())->setValue(key, value);
00030     }
00031 
00032     imedgine::Controller::getInstance().loadConfiguration(
00033       (imedgine::Settings::getInstance())->
00034         getStringValue("algorithms_config_path"));
00035 
00036     //imedgine::Controller::getInstance().getLoadedAlgorithmNames();
00037     imedgine::MainWindow mainWin;
00038     mainWin.show();
00039     return app.exec();
00040   }
00041   catch (imedgine::IndexOutOfBoundsException const& exc)
00042   {
00043     std::cout << "Caught IndexOutOfBoundsException thrown in : " 
00044               << exc.getDetail() << std::endl;
00045   }
00046   catch (imedgine::Exception &exc)
00047   {
00048     std::cout << exc.what() << ": " << exc.getDetail() << std::endl;  
00049   }
00050 }

Generated on Sun Aug 13 18:19:40 2006 for iMEDgine by  doxygen 1.4.6