Skip to content

Commit

Permalink
splash scree initialization changed from main.cpp to angadiapp.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
mohanrex committed May 17, 2014
1 parent 72dc995 commit bb845f0
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
12 changes: 12 additions & 0 deletions src/angadiapp.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "angadiapp.h"
#include <connection.h>
#include <QSplashScreen>

#include <QDebug>

Expand All @@ -18,6 +19,17 @@ void AngadiApp::start()
connect(login,SIGNAL(exitApp()),this,SLOT(exitApp()));
connect(angadiMainWindow,SIGNAL(exit()),this,SLOT(exitApp()));
// login->show();

QPixmap pix(":/images/icons/about_splash.png");
QSplashScreen splash(pix);
splash.show();

QTime dieTime= QTime::currentTime().addSecs(3);
while( QTime::currentTime() < dieTime )
QCoreApplication::processEvents(QEventLoop::AllEvents,50);

splash.hide();

angadiMainWindow->showMaximized();
}

Expand Down
4 changes: 2 additions & 2 deletions src/connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ void Connection::createSqliteTables()
") ENGINE=InnoDB DEFAULT CHARSET=utf8;");

// default category
db.exec("INSERT INTO `categories` (`code`, `name`, `status`) VALUES ('0', 'GENERAL', 'A');");
db.exec("INSERT INTO `categories` (`code`, `name`, `status`) VALUES ('1001', 'GENERAL', 'A');");

// customers table creation
db.exec("CREATE TABLE IF NOT EXISTS `customers` ("
Expand Down Expand Up @@ -141,7 +141,7 @@ void Connection::createSqliteTables()
") ENGINE=InnoDB DEFAULT CHARSET=utf8;");

// default customer
db.exec("INSERT INTO `customers` (`code`, `name`, `type`, `creditLimit`, `gender`, `status`) VALUES ('0', 'GENERAL', 'Retailer', '0', 'Male', 'A');");
db.exec("INSERT INTO `customers` (`code`, `name`, `type`, `creditLimit`, `gender`, `status`) VALUES ('1001', 'GENERAL', 'Retailer', '0', 'Male', 'A');");

// products table creation
db.exec("CREATE TABLE IF NOT EXISTS `products` ("
Expand Down
6 changes: 3 additions & 3 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ int main(int argc, char *argv[])
// a.installTranslator(&translator);
// }

QPixmap pix(":/images/icons/about_splash.png");
/*QPixmap pix(":/images/icons/about_splash.png");
QSplashScreen splash(pix);
splash.show();
QTime dieTime= QTime::currentTime().addSecs(3);
while( QTime::currentTime() < dieTime )
QCoreApplication::processEvents(QEventLoop::AllEvents, 100);
QCoreApplication::processEvents(QEventLoop::AllEvents,50);
splash.hide();
splash.hide();*/
a.start();

return a.exec();
Expand Down

0 comments on commit bb845f0

Please sign in to comment.