" + QString(QObject::tr("If you have the klog_")) + (QLocale::system().name()).left(2) + QString(QObject::tr(".qm file for your language, you can copy it into the ")); msgBox.setWindowTitle("KLog"); msgBox.setIcon(QMessageBox::Warning); msgBox.setTextFormat(Qt::RichText); // The following URL links to google translator //URL: https://translate.google.com/?sl=auto&tl=auto#en/auto/No%20translation%20files%20for%20your%20language%20have%20been%20found%20so%20KLog%20will%20be%20shown%20in%20English.%0A%0AIf%20you%20have%20the%20klog_en.qm%20file%20for%20your%20language%2C%20you%20can%20copy%20it%20in%20the%20%2Fhome%2Fdevel%2F.klog%2F%20folder%20and%20restart%20KLog%20again.%0A%0A%20If%20you%20want%20to%20help%20to%20translate%20KLog%20into%20your%20language%2C%20please%20contact%20the%20author. QString msg2; msg2 = QString(); msg2 = QObject::tr("folder and restart KLog.") + "
" + QObject::tr("If you want to help to translate KLog into your language, please contact the author.
") + urlTranslate; #ifdef Q_OS_WIN if (QFile::exists(QDir::homePath()+"/klog/klog_" + (QLocale::system().name()).left(2)+ ".qm") ) { //qDebug() << "KLog OTHER -4: " << QDir::homePath()+"/klog/klog_" + (QLocale::system().name()).left(2) << endl; myappTranslator.load(QDir::homePath()+"/klog/klog_" + (QLocale::system().name())); } else { msg = msg + QDir::homePath()+ "/klog/" + msg2; msgBox.setText(msg); msgBox.setInformativeText("Do you want to remove the KLog dir from your disk?"); msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No ); msgBox.setDefaultButton(QMessageBox::Yes); msgBox.exec(); } #else //qDebug() << "KLog OTHER -5: " << QDir::homePath()+"/.klog/klog_" + (QLocale::system().name()).left(2)<< endl; if (QFile::exists(QDir::homePath()+"/.klog/klog_" + (QLocale::system().name()).left(2)+ ".qm") ) { //qDebug() << "KLog OTHER -4: " << QDir::homePath()+"/.klog/klog_" + (QLocale::system().name()).left(2) << endl; myappTranslator.load(QDir::homePath()+"/.klog/klog_" + (QLocale::system().name())); } else { //msg = msg + QDir::homePath()+"/.klog/ " + QObject::tr("folder and restart KLog again.\n\n If you want to help to translate KLog into your language, please contact the author.") + urlTranslate; msg = msg + QDir::homePath()+"/.klog/ " + msg2; msgBox.setText(msg); msgBox.setStandardButtons(QMessageBox::Ok); msgBox.setDefaultButton(QMessageBox::Ok); msgBox.exec(); } #endif } #endif //qDebug() << "KLog Main-1" << endl; //myappTranslator.load("klog_" + (QLocale::system().name()).left(2)); //qDebug() << "KLog locale: " << QLocale::system().name() << endl; //qDebug() << "KLog locale2: " << (QLocale().name()).left(2) << endl; //qDebug() << "KLog language: " << QLocale::system().language() << endl; //qDebug() << "KLog AppPath: " << QCoreApplication::applicationDirPath() << endl; app.installTranslator(&myappTranslator); // Traslations end QString configFileName, klogDir; int inMemory; //bool dbInMemory = true; klogDir = util.getHomeDir(); configFileName = util.getCfgFile(); qDebug() << "KLog Main-10" << endl; qDebug() << "KLog Main: Setting klog dir" << endl; if (!QDir::setCurrent (klogDir) ) { //qDebug() << "MAIN: KLogDir does not exist.... creating " << endl; if (d1.mkdir(klogDir)) { if (QDir::setCurrent (klogDir) ) { //qDebug() << "MAIN: KLogDir has just been created and pointed " << endl; } else { //qDebug() << "MAIN: KLogDir has just been created and pointed FAILED! " << endl; } } else { //qDebug() << "MAIN: KLogDir can not be created?? " << endl; } } else { //qDebug() << "MAIN: KLogDir already existed!! " << endl; } qDebug() << "KLog Main: Setting config file" << endl; if(!QFile::exists(configFileName)) { //qDebug() << "MAIN: Starting wizard... " << endl; StartWizard *wizard = new StartWizard(klogDir, version); wizard->setModal(true); inMemory = wizard->exec(); if (inMemory == 1) { //qDebug() << "MAIN: Wizard accepted " << QString::number(inMemory) << " ... Will run in Memory " << endl; MainWindow mw(klogDir, version); mw.show(); return app.exec(); } else if (inMemory == 2) { //qDebug() << "MAIN: Wizard accepted " << QString::number(inMemory) << " ... Will run in file " << endl; MainWindow mw(klogDir, version); mw.show(); return app.exec(); } else { //qDebug() << "MAIN: Wizard cancelled " << QString::number(inMemory) << " ... should close " << endl; QMessageBox msgBox; msgBox.setText(QObject::tr("Install wizard was canceled before completing...")); msgBox.setInformativeText(QObject::tr("Do you want to remove the KLog dir from your disk?")); msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No ); msgBox.setDefaultButton(QMessageBox::Yes); int ret = msgBox.exec(); switch (ret) { case QMessageBox::Yes: if (QDir::setCurrent (QDir::homePath()) ) { if (d1.remove(klogDir)) { QMessageBox msgBox; msgBox.setText(QObject::tr("Your KLog dir has been removed\n\nThank you for running KLog!")); msgBox.exec(); } else { QMessageBox msgBox; msgBox.setText(QObject::tr("I could not remove your KLog dir. You should do it manually if you want it removed from your hard disk.\n\nThank you for running KLog!")); msgBox.exec(); } } else { QMessageBox msgBox; msgBox.setText(QObject::tr("Your KLog dir could not be removed. You should do it manually if you want it removed from your hard disk.\n\nThank you for running KLog!")); msgBox.exec(); } break; case QMessageBox::No: QMessageBox msgBox; msgBox.setText(QObject::tr("Remember that your KLog dir is on your system...") + "\n\n" + QObject::tr("Thank you for running KLog!")); msgBox.exec(); break; } return 0; } } else { QPixmap pixmap(":img/klog_512x512.png"); QSplashScreen splash(pixmap); splash.show(); //qDebug() << "KLog Main-100" << endl; MainWindow mw(klogDir, version); //qDebug() << "KLog Main-101" << endl; mw.show(); splash.finish(&mw); //qDebug() << "KLog Main-102" << endl; return app.exec(); //qDebug() << "KLog Main-103" << endl; } qDebug() << "KLog Main-END" << endl; //return app.exec(); }