Logo Search packages:      
Sourcecode: qcomicbook version File versions  Download package


 * This file is a part of QComicBook.
 * Copyright (C) 2005-2006 Pawel Stolowski <yogin@linux.bydg.org>
 * QComicBook is free software; you can redestribute it and/or modify it
 * under terms of GNU General Public License by Free Software Foundation.
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY. See GPL for more details.

#include <qapplication.h>
#include <qmessagebox.h>
#include <qsplashscreen.h>
#include <qtimer.h>
#include "imgarchivesink.h"
#include "icons.h"
#include "comicmain.h"
#include "cbsettings.h"

int main(int argc, char *argv[])
      using namespace QComicBook;

      QApplication app(argc, argv);
      const QString errcaption = ComicMainWindow::tr("QComicBook error");


      // show splashscreen
      QSplashScreen *splash = NULL;
      if (ComicBookSettings::instance().showSplash())
            QPixmap splashpix(DATADIR "qcomicbook-splash.png");
            if (!splashpix.isNull())
                  splash = new QSplashScreen(splashpix);
      if (!Icons::init(DATADIR))
            QMessageBox::critical(NULL, errcaption, ComicMainWindow::tr("Can't initialize icons path") + ":\n" DATADIR,
                        QMessageBox::Ok, QMessageBox::NoButton);

      if (!ComicBookSettings::checkDirs())
            QMessageBox::critical(NULL, errcaption, ComicMainWindow::tr("Can't initialize QComicBook directories"),
                        QMessageBox::Ok, QMessageBox::NoButton);
      // initialize unpackers
      ComicMainWindow *win = new ComicMainWindow(NULL);

      // command line argument
      if (app.argc() > 1)

      // close splashscreen after a few seconds
      if (splash)
            QTimer *timer = new QTimer(win);
            QObject::connect(timer, SIGNAL(timeout()), splash, SLOT(close()));
            timer->start(2000, true);

      return app.exec();

Generated by  Doxygen 1.6.0   Back to index