Changeset 96 in tspsg-svn for trunk/src/mainwindow.cpp


Ignore:
Timestamp:
Mar 1, 2010, 2:13:23 PM (15 years ago)
Author:
laleppa
Message:
  • Fixed some wrong defines that prevented successful compilation under *nix.
  • Renamed i18n to l10n to follow common standards.
  • Translation and documentation paths are now synchronized between .pro and source.
  • Moved some versioning information to .pro file.
  • Updated translations.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/mainwindow.cpp

    r95 r96  
    149149void MainWindow::actionFileSaveTriggered()
    150150{
    151         if ((fileName == tr("Untitled") + ".tspt") || (!fileName.endsWith(".tspt",Qt::CaseInsensitive)))
     151        qDebug() << tr("Untitled");
     152        if ((fileName == tr("Untitled") + ".tspt") || (!fileName.endsWith(".tspt", Qt::CaseInsensitive)))
    152153                saveTask();
    153154        else
     
    311312        title += QString::fromUtf8("<b><a href=\"http://tspsg.sourceforge.net/\">http://tspsg.sf.net/</a></b><br>");
    312313QString about;
    313         about += QString::fromUtf8("Target OS: <b>%1</b><br>").arg(OS);
     314        about += QString::fromUtf8("Target OS (ARCH): <b>%1</b><br>").arg(OS);
    314315#ifndef STATIC_BUILD
    315316        about += "Qt library (shared):<br>";
     
    320321#endif // STATIC_BUILD
    321322        about += QString::fromUtf8("Built on <b>%1</b> at <b>%2</b><br>").arg(__DATE__).arg(__TIME__);
    322         about += "<br>";
    323         about += QString::fromUtf8("Id: <b>"VERSIONID"</b><br>");
     323//      about += "<br>";
     324//      about += QString::fromUtf8("Id: <b>"VERSIONID"</b><br>");
    324325        about += QString::fromUtf8("Algorithm: <b>%1</b><br>").arg(CTSPSolver::getVersionId());
    325326        about += "<br>";
     
    372373        connect(bb, SIGNAL(accepted()), dlg, SLOT(accept()));
    373374
     375#ifdef Q_OS_WIN32
    374376        // Adding some eyecandy in Vista and 7 :-)
    375377        if (QtWin::isCompositionEnabled())  {
    376378                QtWin::enableBlurBehindWindow(dlg, true);
    377379        }
    378 
    379         dlg->resize(410, 300);
     380#endif // Q_OS_WIN32
     381
     382        dlg->resize(480, 400);
    380383        dlg->exec();
    381384
     
    599602void MainWindow::loadLangList()
    600603{
    601 QDir dir(PATH_I18N, "tspsg_*.qm", QDir::Name | QDir::IgnoreCase, QDir::Files);
     604QDir dir(PATH_L10N, "tspsg_*.qm", QDir::Name | QDir::IgnoreCase, QDir::Files);
    602605        if (!dir.exists())
    603606                return;
     
    610613        for (int k = 0; k < langs.size(); k++) {
    611614                QFileInfo lang = langs.at(k);
    612                 if (lang.completeBaseName().compare("tspsg_en", Qt::CaseInsensitive) && t.load(lang.completeBaseName(), PATH_I18N)) {
     615                if (lang.completeBaseName().compare("tspsg_en", Qt::CaseInsensitive) && t.load(lang.completeBaseName(), PATH_L10N)) {
    613616                        name = t.translate("--------", "LANGNAME", "Please, provide a native name of your translation language here.");
    614617                        a = menuSettingsLanguage->addAction(name);
     
    654657        else {
    655658                // No luck. Let's try to load a bundled one.
    656                 if (qtTranslator->load("qt_" + lng, PATH_I18N))
     659                if (qtTranslator->load("qt_" + lng, PATH_L10N))
    657660                        qApp->installTranslator(qtTranslator);
    658661                else {
     
    665668        // Now let's load application translation.
    666669        translator = new QTranslator(this);
    667         if (translator->load("tspsg_" + lng, PATH_I18N))
     670        if (translator->load("tspsg_" + lng, PATH_L10N))
    668671                qApp->installTranslator(translator);
    669672        else {
     
    863866        retranslateUi(false);
    864867
     868#ifdef Q_OS_WIN32
    865869        // Adding some eyecandy in Vista and 7 :-)
    866870        if (QtWin::isCompositionEnabled() && settings->value("UseTranslucency", DEF_USE_TRANSLUCENCY).toBool())  {
    867871                toggleTranclucency(true);
    868872        }
     873#endif // Q_OS_WIN32
    869874}
    870875
     
    884889void MainWindow::toggleTranclucency(bool enable)
    885890{
     891#ifdef Q_OS_WIN32
    886892        QtWin::enableBlurBehindWindow(this, enable);
    887893        QtWin::enableBlurBehindWindow(tabWidget, enable);
     
    891897        if (QtWin::enableBlurBehindWindow(tabSolution, enable))
    892898                tabSolution->setAutoFillBackground(enable);
    893 }
     899#else
     900        Q_UNUSED(enable);
     901#endif // Q_OS_WIN32
     902}
Note: See TracChangeset for help on using the changeset viewer.