Ejemplo n.º 1
0
Archivo: main.cpp Proyecto: pech/yags
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    QSplashScreen *splash = new QSplashScreen;
    splash->setPixmap(QPixmap(":/ICO_Home.gif"));
    splash->show();
    Qt::Alignment toRight = Qt::AlignTop | Qt::AlignTop;
    splash->showMessage(QObject::tr("Seeting up the main windows ..."), toRight, Qt::black);
    MainWindow w;


    for(int i=0;i<90000;i++)
           for(int j=0;j<900;j++);
        splash->showMessage(QObject::tr("Loading modules..."), toRight, Qt::black);
        for(int i=0;i<90000;i++)
           for(int j=0;j<900;j++);
        splash->showMessage(QObject::tr("Etablishing connections..."), toRight, Qt::black);
        for(int i=0;i<90000;i++)
           for(int j=0;j<6000;j++);


    w.setWindowState(w.windowState() ^ Qt::WindowMaximized);
    w.show();

    splash->finish(&w);
        delete splash;

    return a.exec();
}
Ejemplo n.º 2
0
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    QTextCodec *codec = QTextCodec::codecForName("UTF-8");
    QTextCodec::setCodecForLocale(codec);

    QSplashScreen *splash = new QSplashScreen;
    MainWindow w;

    splash->setPixmap(QPixmap(":/data/splash.jpg").scaled(640, 480));
    // splash->setPixmap(QPixmap(":/dataplash.png").scaled(400, 300, Qt::KeepAspectRatio));
    splash->show();
    w.show();
    Qt::Alignment topRight = Qt::AlignRight | Qt::AlignTop;
    w.move ((QApplication::desktop()->width() - w.width()) / 2, (QApplication::desktop()->height() - w.height()) / 2);
    splash->showMessage(QObject::tr("Setting up the main window..."));
    sleep(1);

    splash->showMessage(QObject::tr("Loading modules..."), topRight, Qt::black);

    splash->finish(&w);
    delete splash;

    return a.exec();
}
Ejemplo n.º 3
0
int main(int argc, char *argv[])
{

#ifndef QT_DEBUG
    QString fileName = FilePirate::StoragePath + "captains-log.log";
    QFile *log = new QFile(fileName);
    if (log->open(QIODevice::WriteOnly | QIODevice::Append | QIODevice::Text)) {
        out = new QTextStream(log);
        qInstallMsgHandler(logOutput);
    } else {
        qDebug() << "Error opening log file '" << fileName << "'. All debug output redirected to console.";
    }
#endif


    SingleApplication a(argc, argv, "9578A25E-F82A-4558-842C-1DE074F3C232");

    if (a.alreadyExists()) {
        qDebug() << "FilePirate is already running.";
        a.sendMessage("fg");
        return 0;
    }

    QPixmap pixmap(":/images/splash.png");
    QSplashScreen *splash = new QSplashScreen(pixmap);
    splash->show();
    a.processEvents();
    splash->showMessage("Loading...",Qt::AlignCenter | Qt::AlignBottom,Qt::white);
    qDebug() << "Registering URL handler...";
    QDesktopServices::setUrlHandler("pirate",&FilePirate::Application(),"handleUrl");
    a.processEvents();
    // Force the user to see the splash screen for at least some time
    QMutex dummy;
    dummy.lock();
    QWaitCondition wait;
    wait.wait(&dummy, 750);
    dummy.unlock();
    // And move on to the rest of loading
    splash->showMessage("Loading settings...",Qt::AlignCenter | Qt::AlignBottom,Qt::white);
    // load the settings here
    FilePirate::Application().settingsLoaded = FilePirate::Application().loadSettings();
    splash->showMessage("Loading local filelist...",Qt::AlignCenter | Qt::AlignBottom,Qt::white);
    FilePirate::Application().fileMon->fullRefreshFileList();

    // bring up the filelist - this is a good time to start up the settings dialog
    // if the user hasn't done so yet...
    splash->showMessage("Finishing up...",Qt::AlignCenter | Qt::AlignBottom,Qt::white);
    FilePirate::Application().moveHelpersToThreads();

    MainWindow w;
    w.show();
    splash->finish(&w);

    a.connect(&a, SIGNAL(messageAvailable(QStringList)), &w, SLOT(secondInstanceMessages(QStringList)));

    delete splash;

    return a.exec();
}
Ejemplo n.º 4
0
BibleTime::BibleTime()
        : m_WindowWasMaximizedBeforeFullScreen(false) {
    namespace DU = util::directory;

    QSplashScreen splash;
    bool showSplash = CBTConfig::get(CBTConfig::logo);
    QString splashHtml;

    if (showSplash) {
        splashHtml = "<div style='background:transparent;color:white;font-weight:bold'>%1"
                     "</div>";
        const QDate date(QDate::currentDate());
        const int day = date.day();
        const int month = date.month();
        QString splashImage(DU::getPicsDir().canonicalPath().append("/"));

        if ((month >= 12 && day >= 24) || (month <= 1 && day < 6)) {
            splashImage.append("startuplogo_christmas.png");
        } else {
            splashImage.append("startuplogo.png");
        }

        QPixmap pm;
        if (!pm.load(splashImage)) {
            qWarning("Can't load startuplogo! Check your installation.");
        }
        splash.setPixmap(pm);
        splash.show();

        splash.showMessage(splashHtml.arg(tr("Initializing the SWORD engine...")),
                           Qt::AlignCenter);
    }
    initBackends();

    if (showSplash) {
        splash.showMessage(splashHtml.arg(tr("Creating BibleTime's user interface...")),
                           Qt::AlignCenter);
    }
    initView();

    if (showSplash) {
        splash.showMessage(splashHtml.arg(tr("Initializing menu- and toolbars...")),
                           Qt::AlignCenter);
    }
    initActions();
    initConnections();
    readSettings();

    setWindowTitle("BibleTime " BT_VERSION);
    setWindowIcon(DU::getIcon(CResMgr::mainWindow::icon));
}
Ejemplo n.º 5
0
int main(int argc, char *argv[])
{


    QApplication a(argc, argv);
    Q_INIT_RESOURCE(images);

    // Show a loading screen, I am not sure this is showed even on slow computers...
    QSplashScreen *splash = new QSplashScreen;
    splash->setPixmap(QPixmap("../resources/images/splash.jpg"));
    splash->show();
    splash->showMessage(QObject::tr("ROS GUI is launching...."),Qt::AlignBottom,Qt::black);

    //Make the main window appear
    MainWindow w;
    w.show();
    w.setArguments(argc,argv);

    // The main window is fully loaded, we can now delete the splash screen
    splash->finish(&w);
    delete splash;

    a.setStyle("gtk+");
    a.exec();

    return 0;
}
Ejemplo n.º 6
0
extern "C" KDE_EXPORT int kdemain( int argc, char* argv[] )
{
    KCmdLineArgs::init( argc, argv, KarbonFactory::aboutData() );

    KCmdLineOptions options;
    options.add("+[file]", ki18n( "File to open" ));
    KCmdLineArgs::addCmdLineOptions( options );

    KoApplication app(KARBON_MIME_TYPE);

#ifdef MAINTANER_WANTED_SPLASH
    // After creating the KApplication then create the pixmap from an xpm: we cannot get the
    // location of our datadir before we've started our components,
    // so use an xpm.
    QSplashScreen *splashScreen = new KoSplashScreen(QPixmap(splash_screen_xpm));
    splashScreen->show();
    splashScreen->showMessage("<p style=\"color:black\">"
    "<b>Calligra Karbon is unmaintained!</b><br><br>"
    "The Calligra community welcomes someone to take over.<br><br>"
    "See community.kde.org/Calligra</p>");
#endif

    if( !app.start() )  // parses command line args, create initial docs and mainwindows
        return 1;

    return app.exec();
}
Ejemplo n.º 7
0
  int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) 
{
    int argc = 0;
    char **argv = 0;
#else
  int main(int argc, char *argv[]) 
{
#endif

  using namespace ReconstructMeGUI;

  QApplication app(argc, argv);

  // Splashscreen
  QPixmap splashPix(":/images/splash_screen.png");
  QSplashScreen *sc = new QSplashScreen(splashPix);
  sc->setAutoFillBackground(false);
  sc->showMessage(welcome_tag, SPLASH_MSG_ALIGNMENT);
  sc->show();

  // global style sheet
  QFile style_file(style_sheet_file_tag);
  if(style_file.open(QFile::ReadOnly)) {
    app.setStyle("plastique");
    app.setStyleSheet(style_file.readAll());
  }

  // MainWindow
  reconstructme reme;
  sc->finish(&reme);
  reme.show();

  return app.exec();
}
Ejemplo n.º 8
0
Archivo: main.cpp Proyecto: mcmdhr/RMMS
int main(int argc, char *argv[])
{
    QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
    QApplication a(argc, argv);
    RMMSMain w;

    QSplashScreen *splash = new QSplashScreen;
    splash->setStyleSheet("font-size: 16px");
    splash->setPixmap(QPixmap(":/splash/1.png"));//设置图片
    splash->show();//显示图片
    Qt::Alignment topRight = Qt::AlignCenter | Qt::AlignBottom;
    splash->showMessage(QObject::tr("Setting up the main window..."), topRight, Qt::white);//显示信息

    QDateTime curtime = QDateTime::currentDateTime();
    QDateTime nowtime;
    do{
        nowtime = QDateTime::currentDateTime();
    } while(curtime.secsTo(nowtime) <= 3);

    w.setWindowTitle(SystemName);
    w.show();

    splash->finish(&w);//图片一直显示到mainWin加载完成
    delete splash;

    return a.exec();
}
Ejemplo n.º 9
0
int main(int argc, char *argv[])
{
	
	QoccApplication app( argc, argv );
	

	QSplashScreen *mySplash = new QSplashScreen;
	mySplash->setPixmap(QPixmap(QString::fromUtf8(":/images/style/FMD_SPLASH.png")).scaledToWidth(600));
	mySplash->show();
	Qt::Alignment topright = Qt::AlignRight | Qt::AlignTop;
	mySplash->showMessage(QString::fromUtf8("Loading More CowBell ..."),topright,Qt::white);

#if defined(Q_WS_WIN)
	//QtDotNetStyle* style = new QtDotNetStyle();
	//QCDEStyle* style = new QCDEStyle();
	//app.setStyle(QStyleFactory::create("motif"));
	//cleanlooks,"motif", "cde", "plastique" and "cleanlooks

#endif
	
	qGeomApp->msleep ( 100 );
	QoccMainWindow *window = new QoccMainWindow();
    window->showMaximized();
	mySplash->finish(window);
	delete mySplash;
	
	int retval = app.exec();
	return retval;
}
Ejemplo n.º 10
0
int main(int argc, char *argv[])
{
    g_app = new QApplication(argc, argv);

    // Create a splash screen.
    QSplashScreen *splash = new QSplashScreen;
    splash->setPixmap(QPixmap(":/images/splash.bmp"));
    splash->show();

    // Set message alignment for splash screen.
    Qt::Alignment topRight = Qt::AlignRight | Qt::AlignTop;
    // Display message while bringing up main window state.
    splash->showMessage(QObject::tr("Setting up the main window ..."),
        topRight, Qt::black);
    g_app->processEvents(); // Accept a click on the screen so that user can cancel the screen.

    // Switch from splash state to main window.
    MainWindow mainWindow;
    //SplashUtil::sleep(3); // Splash page is shown for 3 seconds.

    mainWindow.show();
    splash->finish(&mainWindow);
    delete splash;

    return g_app->exec();
}
Ejemplo n.º 11
0
void splashScreen()
{
	QSplashScreen *splash = new QSplashScreen;  
    splash->setPixmap(QPixmap("./image/splash.jpg"));  
    splash->show();
	Qt::Alignment topRight = Qt::AlignRight | Qt::AlignTop;  
    splash->showMessage(QObject::tr("Setting up the Login Window..."),  
                        topRight,  
                        Qt::red);
	QTest::qSleep(3000);
	splash->showMessage(QObject::tr("Loading modules..."),  
                        topRight,  
                        Qt::blue);  
    QTest::qSleep(3000);  
	delete splash;
}
Ejemplo n.º 12
0
int main(int argc, char *argv[])
{


    Q_INIT_RESOURCE(icons); /** Initializing the icon images for the application. */

    /** Application object for creating the application */
    QApplication app(argc, argv);
    /** Providing application settings */
    app.setOrganizationName("NITK Surathkal");
    app.setApplicationName("Talk To The Hand");
    app.setApplicationVersion("Version 1.0");
    app.setWindowIcon(QIcon(":/images/logo.jpg"));

    /** Initializing splash screen for the application */
    QSplashScreen *splash = new QSplashScreen;
    QImage *splashImage = new QImage(":/images/SplashScreen.jpg");
    *splashImage = splashImage->scaledToHeight(300);
    splash->setPixmap(QPixmap::fromImage(*splashImage));
    splash->show();
    Qt::Alignment topRight = Qt::AlignLeft | Qt::AlignBottom;
    splash->showMessage(QObject::tr("Initializing..."),topRight, Qt::black);
    sleep(3);

    /** Creating mainwindow of the application and then showing it*/
    MainWindow mainWin;
    mainWin.show();
    //mainWin.showFullScreen();

    /** Remove splash screen as soon as the window loads */
    splash->finish(&mainWin);
    delete splash;

    return app.exec();
}
Ejemplo n.º 13
0
 explicit Splash()
     : pixmap(getPixmapFilenameRaw("splash20.png"))
     , splash(pixmap)
 {
     const auto message = QString("%1").arg(MMAPPER_VERSION, -9);
     splash.showMessage(message, Qt::AlignBottom | Qt::AlignRight, Qt::yellow);
     splash.show();
 }
Ejemplo n.º 14
0
int main(int argc, char *argv[])
{

#ifdef HAS_GUI

    if (argc > 1){
    	// using terminal mode
    	if (argc < 2){
            printf("Usage: %s input _file\n", argv[0]);
    		exit(1);
    	}
    	else {
            TEMP_SCHEME* RunEngine = new TEMP_SCHEME(argc, argv);
    		RunEngine->evaluation();
    		return(0);
    	}
    }
    else {			// using GUI
    	QApplication app(argc, argv);
    	app.setOrganizationName(ORGANIZATION);
    	app.setApplicationName(NAME);
    	app.setApplicationVersion(VERSION);
/*
        QFile stylesheetfile(":/css/stylesheet.css");
        if (stylesheetfile.open(QFile::ReadOnly)){
            app.setStyleSheet(stylesheetfile.readAll());
            stylesheetfile.close();
        }
*/
    	QSplashScreen *splash = new QSplashScreen;
		splash->setPixmap(QPixmap(":/libel.png"));
		splash->show();
		splash->showMessage(app.organizationName());
		QIcon windowIcon(":/libel.png");

    	GUI gui;
    	gui.setWindowIcon(windowIcon);

        QTimer::singleShot(1000, splash, SLOT(close()));
        QTimer::singleShot(1000, &gui, SLOT(showMaximized()));

    	return app.exec();
    }
#else
    if (argc > 1){
        	// using terminal mode
        	if (argc < 2){
        		printf("Usage: %s input_file\n", argv[0]);
        		exit(1);
        	}
        	else {
                TEMP_SCHEME* RunEngine = new TEMP_SCHEME(argc, argv);
        		RunEngine->evaluation();
        		return(0);
        	}
        }
#endif
}
Ejemplo n.º 15
0
Archivo: main.cpp Proyecto: metasim/ews
/** Application launch functionn. */
int main(int argc, char *argv[]) {
    using namespace ews::app::model;
    using namespace ews::app::widget;

#if defined(QT_DEBUG)                
    osg::setNotifyLevel(osg::INFO);
#endif                
    
    // To see Qt object dumps on macos, run with the environment variable
    // "DYLD_IMAGE_SUFFIX" set to "_debug".
    
    QApplication mainQApp(argc, argv);
    mainQApp.setQuitOnLastWindowClosed(true);
    QApplication::setOrganizationName(EWS_ORGANIZATION_NAME);
    QApplication::setOrganizationDomain(EWS_BUNDLE_ID);
    QApplication::setApplicationVersion(EWS_VERSION);
    QApplication::setApplicationName(EWS_APP_NAME);
    
    // First register the dialog error handler, then
    // get the function pointer to it by passing zero to the handler installer
    // then install our own.
    QErrorMessage::qtHandler();
    saveHandler(qInstallMsgHandler(0));
    qInstallMsgHandler(errHandler);
    
    QSplashScreen splash;
    QPixmap img(":/images/splash");
    
    if (img.isNull()) {
       qWarning() << "Couldn't load splash image";
    }
    
    splash.setPixmap(img);
    splash.showMessage(QObject::tr("Starting up...."));
    splash.show();
    
    mainQApp.connect(&mainQApp, SIGNAL(lastWindowClosed()), &mainQApp, SLOT(quit()));

    SimulationState state;
    state.setObjectName("root");
    
    EWSMainWindow w(&state);
    w.setWindowTitle(EWS_APP_NAME);
#if defined(__APPLE__)
    w.setWindowIcon(QIcon(":/images/appicon"));
#else    
    QApplication::setWindowIcon(QIcon(":/images/appicon"));    
#endif    


    w.show();
    
    splash.finish(&w);

    return mainQApp.exec();
}
Ejemplo n.º 16
0
// Start method main
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    // Create splashscreen object
    QSplashScreen *splash = new QSplashScreen;
    splash->setPixmap(QPixmap(":/img/images/splash.png"));
    splash->show();

    // Create database object
    Database *db = new Database();

    Qt::Alignment topRight = Qt::AlignRight | Qt::AlignTop;

    splash->showMessage(QObject::tr("Establishing connections..."),
                        topRight, Qt::white);
    // Database connection
    if(!db->createConnection())
        return 1;
    // Client connection
    Clock clock;
    clock.show();


    splash->showMessage(QObject::tr("Setting up main window..."),
                        topRight, Qt::white);
    // Create game window
    GameWindow gameWindow;

    splash->showMessage(QObject::tr("Setting up game..."),
                            topRight, Qt::white);
    // create game
    Game *game = new Game();

    gameWindow.setCentralWidget(game);
    gameWindow.show();
    splash->finish(&gameWindow);

    delete splash;

    return a.exec();
}// End method main
Ejemplo n.º 17
0
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    MainWindow w;
    QPixmap pixmap=QPixmap("hello1.png");
    QSplashScreen *splash = new QSplashScreen(pixmap);
    splash->show();
    Qt::Alignment topRight = Qt::AlignRight | Qt::AlignTop;
    splash->showMessage(QString::fromLocal8Bit("Setting up the main window..."),topRight, Qt::white);
    splash->showMessage(QString::fromLocal8Bit("Loading modules..."), topRight,Qt::white);
    QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
    QTextCodec::setCodecForLocale(QTextCodec::codecForName("GBK")); //路径名支持中文
    QTextCodec::setCodecForTr(QTextCodec::codecForName("GBK")); //QString支持中文
    QTextCodec::setCodecForCStrings(QTextCodec::codecForName("GBK")); //string支持中文
    QApplication::setFont(QFont(QString::fromLocal8Bit("宋体"), 10, QFont::Normal));
    w.setWindowTitle(QString::fromLocal8Bit("数字图像处理"));
    w.show();
    splash->finish(&w);
    delete splash;
    return a.exec();
}
Ejemplo n.º 18
0
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    QPixmap pixmap(":/tv.png");
    QSplashScreen *splash = new QSplashScreen(pixmap);
    splash->show();
    //a.processEvents();

    MainWindow w;

    splash->showMessage("Hello I am a Spash",Qt::AlignBottom,Qt::black);
    w.show();
    splash->finish(&w);
    return a.exec();
}
Ejemplo n.º 19
0
bool DesignerApp::initApplication(QString cmdLine)
{
    QLocale::setDefault(QLocale(QLocale::English));
    QTextCodec::setCodecForTr(QTextCodec::codecForLocale());

    QPixmap pixmap(":/designer/splash.png");
    QSplashScreen *splash = new QSplashScreen(pixmap);
    splash->show();
    splash->showMessage(tr("Loading..."));

    processEvents();

    writeConfigValue("", "apppath", QtSingleApplication::applicationFilePath());

    dbIgame = QSqlDatabase::addDatabase("QMYSQL","igame");
    dbIgame.setDatabaseName("MoDeL");
    dbIgame.setHostName("localhost");
    dbIgame.setUserName("root");
    dbIgame.setPassword("lovewin");
    dbIgame.open();

    DesignerViewMgr::initializeIfNotYet();
    DesignerDocMgr::initializeIfNotYet();
    DesignerModelMgr::initializeIfNotYet();

    DesignerExtensionMgr::initializeIfNotYet();

    DesignerMainWnd* mainWnd = DesignerMainWnd::globalCreateNewMainWnd();
    setActivationWindow(mainWnd);
    QObject::connect(this, SIGNAL(messageReceived(const QString&)), mainWnd, SLOT(instanceMessageReceived(const QString&)));
    splash->setWindowFlags(Qt::WindowStaysOnTopHint);
    splash->setParent(mainWnd);
    splash->show();

    QTimer::singleShot(1500, splash, SLOT(close()));

    if(cmdLine!="/new")
        mainWnd->instanceMessageReceived(cmdLine);

    while(splash->isVisible())
    {
        processEvents();
    }

    return true;
}
Ejemplo n.º 20
0
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    QSplashScreen *splash = new QSplashScreen;
    splash->setPixmap(QPixmap(":/images/splash.jpg"));
    splash->show();
    splash->showMessage(QApplication::tr("Setting up the main window..."), Qt::AlignRight | Qt::AlignTop);

    MainWindow w;
    w.show();
    splash->finish(&w);
    splash->close();
    delete splash;

    return a.exec();
}
Ejemplo n.º 21
0
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));

    QSplashScreen *splash = new QSplashScreen(QPixmap(":/pics/splash.jpg"));
    splash->showMessage(QString::fromUtf8("<font size=5 color=white><b>v0.9.1.867</b></font><br><font size=3 color=white>2012</font>"), Qt::AlignRight);
    splash->show();

    sleep(5000);

    MainWindow w;
    w.show();

    splash->finish(&w);
    delete splash;

    return a.exec();
}
Ejemplo n.º 22
0
int main(int argc, char* argv[])
{
	QApplication app(argc, argv);

	QSplashScreen* splash = new QSplashScreen(QPixmap(":splash/cgogn/splash.png"));
	splash->show();
	splash->showMessage("Welcome to SCHNApps", Qt::AlignBottom | Qt::AlignCenter);

	// init PythonQt and Python itself
	PythonQt::init();

	QStringList classNames;
	classNames.append("View");
	classNames.append("Camera");
	classNames.append("Plugin");
	classNames.append("MapHandlerGen");
	PythonQt::self()->registerQObjectClassNames(classNames);

	// get a smart pointer to the __main__ module of the Python interpreter
	PythonQtObjectPtr pythonContext = PythonQt::self()->getMainModule();

	PythonQtScriptingConsole* pythonConsole = new PythonQtScriptingConsole(NULL, pythonContext);

	CGoGN::SCHNApps::SCHNApps schnapps(app.applicationDirPath(), pythonContext, *pythonConsole);

	schnapps.show();

	pythonContext.addObject("schnapps", &schnapps);

	if(argc > 1)
	{
		QString filename(argv[1]);
		QFileInfo fi(filename);
		if (fi.exists())
			//pythonContext.evalFile(fi.filePath());
			schnapps.loadPythonScriptFromFile(fi.filePath());
	}

	splash->finish(&schnapps);
	delete splash;

	return app.exec();;
}
Ejemplo n.º 23
0
/*!
 * \brief Software entry point.
 * \param[in] argc Number of arguments.
 * \param[in] argv Arguments.
 * \return Execution status.
 */
int main(int argc, char *argv[])
{
  QApplication a(argc, argv);
  // Set application info.
  qApp->setOrganizationName("DKrepsky");
  qApp->setOrganizationDomain("dkrepsky.blogspot.com.br");
  qApp->setApplicationName("QuickFlow");
  qApp->setApplicationVersion(version);

  QSplashScreen *splash = new QSplashScreen();

  // Load splash screen if arg -nosplash is not present.
  if(!QApplication::arguments().contains("-nosplash")) {
    QPixmap pixmap(qApp->applicationDirPath() + QDir::separator() + "images" +
                   QDir::separator() + "splash.png");
    splash->setPixmap(pixmap);
    splash->show();
    splash->showMessage(QString("Version: ") + version,
                        Qt::AlignBottom | Qt::AlignRight);
    qApp->processEvents();
  }

  // Load and configure main window.
  QuickFlow w;
  QIcon appicon(qApp->applicationDirPath() + QDir::separator() + "images" +
                QDir::separator() + "appicon.png");
  qApp->setWindowIcon(appicon);
  w.setWindowIcon(appicon);

  // Show mainWindow.
  if(!QApplication::arguments().contains("-nosplash")) {
    // Close splash screen and open main windows after 2500 msec.
    QTimer::singleShot(2500, splash, SLOT(close()));
    QTimer::singleShot(2500, &w, SLOT(show()));
  } else {
    // Show it right way.
    w.show();
  }

  // Process application messages.
  return a.exec();
}
Ejemplo n.º 24
0
int main(int argc, char *argv[])
{

    QApplication a(argc, argv);
    Q_INIT_RESOURCE(QtOME);
    MainWindow w;

    QSplashScreen *splash = new QSplashScreen;
    splash->setPixmap(QPixmap(":/splash"));

    Qt::Alignment topRight = Qt::AlignRight | Qt::AlignTop;
    splash->show();splash->showMessage(QObject::tr("Setting up the main window..."), topRight, Qt::black);

    w.setSplash(splash);

    //QObject::connect(w.action_Quit, SIGNAL(triggered()), MainWindow, SLOT(close()));
    w.showMaximized();

    return a.exec();
}
Ejemplo n.º 25
0
int main(int argc, char *argv[])
{
    Q_INIT_RESOURCE(eepe);
    QApplication app(argc, argv);

    QString dir;
    if(argc) dir = QFileInfo(argv[0]).canonicalPath() + "/lang";

    if ( argc > 1 )
    {
      DebugMode = 1 ;
    }

    QSettings settings("er9x-eePe", "eePe");
    QString locale = settings.value("locale",QLocale::system().name()).toString();
    bool showSplash = settings.value("show_splash", true).toBool();


    QPixmap pixmap(":/images/eepe-title.png");
    QSplashScreen *splash = new QSplashScreen(pixmap);
    if(showSplash)
    {
        splash->show();

        bool checkER9X  = settings.value("startup_check_er9x", true).toBool();
        bool checkEEPE  = settings.value("startup_check_eepe", true).toBool();

        if(checkEEPE || checkER9X)
            splash->showMessage(QObject::tr("Checking for updates..."));
    }

    QTranslator *translator = new QTranslator();
    translator->load(QString("eepe_") + locale, dir);
    app.installTranslator(translator);

    MainWindow mainWin;
    mainWin.show();
    splash->finish(&mainWin);
    return app.exec();
}
Ejemplo n.º 26
0
int main(int argc, char ** argv)
{
	QApplication app(argc, argv);
	app.setQuitOnLastWindowClosed(true);
	app.setApplicationName("TextRoom");
	
	// show splashscreen
#ifdef Q_OS_WIN32
	QSettings settings(QDir::homePath()+QObject::tr("/Application Data/")+qApp->applicationName()+".ini", QSettings::IniFormat);
#else

	QSettings settings;
#endif
	QSplashScreen *splash = NULL;
	if ( settings.value( "WindowState/ShowSplashScreen", true ).toBool() )
	{
		QPixmap splashpix(":/images/splash.jpg");
		if (!splashpix.isNull())
		{
			splash = new QSplashScreen(splashpix);
			splash->show();
			splash->showMessage(QObject::tr("Loading... "), Qt::AlignBottom+Qt::AlignRight, QColor(128,128,128));
		}
	}
	
	TextRoom *win = new TextRoom(NULL);
	win->show();

	if (splash)
	{
		QTimer *timer = new QTimer(win);
		QObject::connect(timer, SIGNAL(timeout()), splash, SLOT(close()));
		timer->start(2000);
		timer->setSingleShot(true);
		//splash->finish(win);
	}

	return app.exec();
}
Ejemplo n.º 27
0
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    QCoreApplication::setOrganizationName("FreeSWITCH");
    QCoreApplication::setOrganizationDomain("freeswitch.org");
    QCoreApplication::setApplicationName("FSComm");

    QPixmap image(":/images/splash.png");
    QSplashScreen *splash = new QSplashScreen(image);
    splash->show();
    splash->showMessage("Loading core, please wait...", Qt::AlignRight|Qt::AlignBottom, Qt::blue);

	g_FSHost = new FSHost();

    QObject::connect(g_FSHost, SIGNAL(loadingModules(QString,int,QColor)), splash, SLOT(showMessage(QString,int,QColor)));

    QObject::connect(g_FSHost, SIGNAL(ready()), splash, SLOT(close()));
    MainWindow w;    
    QObject::connect(g_FSHost, SIGNAL(ready()), &w, SLOT(show()));
    g_FSHost->start();
    return a.exec();
}
Ejemplo n.º 28
0
int main(int argc, char *argv[])
{
    qRegisterMetaType<byte>("byte");
    qRegisterMetaType<word>("word");
    qRegisterMetaType<dword>("dword");

    QApplication a(argc, argv);

    QSplashScreen *splash = new QSplashScreen;
    splash->setPixmap(QPixmap(":/icon/icon/splash.png"));
    splash->setDisabled(true);
    splash->show();

    splash->showMessage(QObject::tr("Starting..."), Qt::AlignRight | Qt::AlignTop, Qt::white);

    MainWindow w;
    w.show();

    splash->finish(&w);
    delete splash;
    
    return a.exec();
}
Ejemplo n.º 29
0
void *TUIMod::Task( void * )
{
    vector<string> list;
    bool first_ent = true;
    QImage ico_t;
    time_t st_time = time(NULL);
    vector<TMess::SRec> recs;

    //> Init locale setLocale
    QLocale::setDefault(QLocale(Mess->lang().c_str()));

    //> Qt application object init
    QApplication *QtApp = new QApplication(mod->qtArgC, (char**)&mod->qtArgV);
    QtApp->setApplicationName(PACKAGE_STRING);
    QtApp->setQuitOnLastWindowClosed(false);
    mod->run_st = true;

    //> Create I18N translator
    I18NTranslator translator;
    QtApp->installTranslator(&translator);

    //> Start splash create
    if(!ico_t.load(TUIS::icoGet(SYS->id()+"_splash",NULL,true).c_str())) ico_t.load(":/images/splash.png");
    QSplashScreen *splash = new QSplashScreen(QPixmap::fromImage(ico_t));
    splash->show();
    QFont wFnt = splash->font();
    wFnt.setPixelSize(10);
    splash->setFont(wFnt);

    while(!mod->startCom() && !mod->endRun())
    {
	SYS->archive().at().messGet(st_time, time(NULL), recs, "", TMess::Debug, BUF_ARCH_NM);
	QString mess;
	for(int i_m = recs.size()-1; i_m >= 0 && i_m > ((int)recs.size()-10); i_m--)
	    mess += QString("\n%1: %2").arg(recs[i_m].categ.c_str()).arg(recs[i_m].mess.c_str());
	recs.clear();
	splash->showMessage(mess,Qt::AlignBottom|Qt::AlignLeft);
	QtApp->processEvents();
	TSYS::sysSleep(0.5);
    }

    //> Start external modules
    WinControl *winCntr = new WinControl( );

    int op_wnd = 0;
    mod->owner().modList(list);
    for(unsigned i_l = 0; i_l < list.size(); i_l++)
	if(mod->owner().modAt(list[i_l]).at().modInfo("SubType") == "QT" &&
		mod->owner().modAt(list[i_l]).at().modFuncPresent("QMainWindow *openWindow();"))
	{
	    //>> Search module into start list
	    int i_off = 0;
	    string s_el;
	    while((s_el=TSYS::strSepParse(mod->start_mod,0,';',&i_off)).size())
		if(s_el == list[i_l])	break;
	    if(!s_el.empty() || !i_off)
		if(winCntr->callQTModule(list[i_l])) op_wnd++;
	}

    delete splash;

    //> Start call dialog
    if(QApplication::topLevelWidgets().isEmpty()) winCntr->startDialog( );

    QObject::connect(QtApp, SIGNAL(lastWindowClosed()), winCntr, SLOT(lastWinClose()));

    QtApp->exec();
    delete winCntr;

    //> Stop splash create
    if(!ico_t.load(TUIS::icoGet(SYS->id()+"_splash_exit",NULL,true).c_str())) ico_t.load(":/images/splash.png");
    splash = new QSplashScreen(QPixmap::fromImage(ico_t));
    splash->show();
    splash->setFont(wFnt);

    st_time = time(NULL);
    while(!mod->endRun())
    {
	SYS->archive().at().messGet( st_time, time(NULL), recs, "", TMess::Debug, BUF_ARCH_NM );
	QString mess;
	for(int i_m = recs.size()-1; i_m >= 0 && i_m > ((int)recs.size()-10); i_m--)
	    mess += QString("\n%1: %2").arg(recs[i_m].categ.c_str()).arg(recs[i_m].mess.c_str());
	recs.clear();
	splash->showMessage(mess,Qt::AlignBottom|Qt::AlignLeft);
	QtApp->processEvents();
	TSYS::sysSleep(0.5);
    }
    delete splash;

    //> Qt application object free
    delete QtApp;
    first_ent = false;

    mod->run_st = false;

    return NULL;
}
Ejemplo n.º 30
0
int main(int argc, char *argv[])
{

    QDir dir;
    QString path=dir.absolutePath();

    QDate data = QDate::currentDate();
    int DaysInMonths = data.daysInMonth();
    int ActualDay = data.day();

    int currentExitCode = 0;

    do
    {
            QApplication a(argc, argv);
            a.setStyle("fusion");

            QFont font("Calibri Light", 12, QFont::Light ,false);
            QFont font_main("Calibri Light", 10, QFont::Light ,false);
            QFont splash_font("Calibri Light", 24, QFont::Bold);

            LoginDialog *logindialog = new LoginDialog;
            MainWindow w;

            logindialog->setWindowFlags(((logindialog->windowFlags() | Qt::CustomizeWindowHint) & Qt::WindowCloseButtonHint & ~Qt::WindowContextHelpButtonHint) );

            /* Ekran startowy*/
            if(currentExitCode != MainWindow::EXIT_CODE_REBOOT)
            {
                QSplashScreen * splash = new QSplashScreen;
                splash->setPixmap(QPixmap(path+"/obrazy/splash.png"));
                splash->setFont(splash_font);
                splash->show();
                splash->showMessage(QObject::tr("Uruchamianie programu "),
                                Qt::AlignLeft | Qt::AlignTop, Qt::black);  //This line represents the alignment of text, color and position

                qApp->processEvents();
                QTimer::singleShot(2000,splash,SLOT(close()));
                QString Splash_string = "Uruchamianie programu";
                QString Splash_string_add = "Uruchamianie programu";

                for(int i=0;i<12;i++)
                {
                    QThread::msleep(150);
                    Splash_string_add = Splash_string_add + ".";

                    if(i==3 || i==7 || i==11) Splash_string_add = Splash_string;

                    splash->showMessage(Splash_string_add,
                                    Qt::AlignLeft | Qt::AlignTop, Qt::black);  //This line represents the alignment of text, color and position
                }
            }



            /* signal-slot - connect login and password from logindialog with MainWindow */
            QObject::connect(logindialog, SIGNAL(sendAccess(QString,QString)),
                             &w, SLOT(receiveAccess(QString,QString)));



            logindialog->setWindowIcon(QIcon(path+"/obrazy/log_icon.png"));
            logindialog->setWindowTitle("SERWIS - Logowanie");
            logindialog->setFont(font);
            if (logindialog->exec() != QDialog::Accepted) {
                a.quit();
                return 0;
            } else {
                delete logindialog;
                w.showMaximized();
                w.setWindowTitle("SERWIS");
                w.setWindowIcon(QIcon(path+"/obrazy/services_icon.png"));
                w.setFont(font_main);
                w.show();

                QFile file;
                QString file_name="AUTO_BACKUP.txt";
                file.setFileName(file_name);
                if(!file.exists() && (DaysInMonths-ActualDay)==1){

                    QMessageBox::warning(&w,"Informacja","****************** Do końca miesiąca został 1 dzień! *******************\n"
                                                         "Wykonany zostanie automatyczny zapis kopii zapasowej bazy danych. \n"
                                                         "*************************************************************************");
                    QTimer::singleShot(500,&w,SLOT(create_backup()));

                    qDebug() << "Doesn't exists: "<<file_name;
                    file.open(QIODevice::ReadWrite | QIODevice::Text);
                    QTextStream stream(&file);
                    file.close();

                }else if (file.exists() && (DaysInMonths-ActualDay)!=1){
                    qDebug() << file_name <<" removing ...";
                    file.remove();
                }else if (file.exists() && (DaysInMonths-ActualDay)==1)
                {
                    qDebug() << file_name <<" already created ...";
                }

            }
             currentExitCode = a.exec();
     } while( currentExitCode == MainWindow::EXIT_CODE_REBOOT );

    return currentExitCode;
}