Changeset 162d5c5f94 in tspsg for src


Ignore:
Timestamp:
Mar 1, 2010, 2:13:23 PM (14 years ago)
Author:
Oleksii Serdiuk
Branches:
0.1.3.145-beta1-symbian, 0.1.4.170-beta2-bb10, appveyor, imgbot, master, readme
Children:
f19df0a3e5
Parents:
278bc7818f
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.
Location:
src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • src/globals.h

    r278bc7818f r162d5c5f94  
    3939// TSPSG Defaults
    4040#include "defaults.h"
    41 // Vista/7 Eyecandy
    42 #include "qtwin.h"
     41#ifdef Q_OS_WIN32
     42        // Vista/7 Eyecandy
     43        #include "qtwin.h"
     44#endif // Q_OS_WIN32
    4345
    4446// DEFINES
     
    5052// Paths
    5153/*!
    52  * \def PATH_I18N
     54 * \def PATH_L10N
    5355 * \brief Bath to internationalization files.
    5456 */
     57#ifndef PATH_L10N
     58        #define PATH_L10N "l10n"
     59#endif // PATH_L10N
    5560/*!
    5661 * \def PATH_DOCS
    5762 * \brief Bath to documentation files.
    5863 */
    59 #if defined(Q_OS_LINUX) || (defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN))
    60         #define PATH_I18N "/usr/share/tspsg/i18n"
    61         #define PATH_DOCS "/usr/share/doc/tspsg"
    62 #else
    63         #define PATH_I18N "i18n"
     64#ifndef PATH_DOCS
    6465        #define PATH_DOCS "help"
    65 #endif // Q_OS_LINUX
     66#endif // PATH_DOCS
    6667
    6768//! TSPSG Task file signature - letters \c TSPT
  • src/main.cpp

    r278bc7818f r162d5c5f94  
    5454
    5555QTranslator en;
    56         if (en.load("tspsg_en", PATH_I18N))
     56        if (en.load("tspsg_en", PATH_L10N))
    5757                app.installTranslator(&en);
    5858
  • src/mainwindow.cpp

    r278bc7818f r162d5c5f94  
    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}
  • src/qtwin.cpp

    r278bc7818f r162d5c5f94  
    115115{
    116116    Q_ASSERT(widget);
     117    Q_UNUSED(widget);
     118    Q_UNUSED(enable);
    117119    bool result = false;
    118120#ifdef Q_WS_WIN
     
    151153
    152154    Q_ASSERT(widget);
     155    Q_UNUSED(widget);
    153156    Q_UNUSED(left);
    154157    Q_UNUSED(top);
  • src/settingsdialog.cpp

    r278bc7818f r162d5c5f94  
    7676QHBoxLayout *hbox1;
    7777
     78#ifdef Q_OS_WIN32
    7879        if (QtWin::isCompositionEnabled()) {
    7980                cbUseTranslucency = new QCheckBox(bgWhite);
     
    8586                cbUseTranslucency->setCursor(QCursor(Qt::PointingHandCursor));
    8687        }
     88#endif // Q_OS_WIN32
    8789
    8890        cbSaveState = new QCheckBox(bgWhite);
  • src/version.h

    r278bc7818f r162d5c5f94  
    5252
    5353//! TSPSG version ID
    54 #define VERSIONID "$Id$"
     54//#define VERSIONID "$Id$"
    5555//! Major version of current TSPSG build
    56 #define BUILD_VERSION_MAJOR 0
     56//#define BUILD_VERSION_MAJOR 0
    5757//! Minor version of current TSPSG build
    58 #define BUILD_VERSION_MINOR 1
     58//#define BUILD_VERSION_MINOR 1
    5959/*!
    6060 * \brief TSPSG release number
     
    6666 *    - 11 --  x: <b>release</b> 1 to x-10
    6767 */
    68 #define BUILD_RELEASE 2
     68//#define BUILD_RELEASE 2
    6969
    7070/*!
     
    7373 *  This will only change on releases and will be the same as revision number.
    7474 */
    75 #define BUILD_NUMBER 65535
     75//#define BUILD_NUMBER 65535
    7676
    7777/*!
     
    8181 * Determined based on BUILD_NUMBER and BUILD_RELEASE.
    8282 */
    83 #if BUILD_NUMBER == 65535
     83#ifndef TSPSG_RELEASE_BUILD
    8484        #define BUILD_STATUS (dev build)
    8585#else
     
    9090        #elif BUILD_RELEASE < 11
    9191                #define BUILD_STATUS (rc)
    92         #else
    93                 #define BUILD_STATUS
     92//      #else
     93//              #define BUILD_STATUS
    9494        #endif
    95 #endif // BUILD_NUMBER == 65535
     95#endif // TSPSG_RELEASE_BUILD
    9696
    9797//! \internal \brief A helper for QUOTE(x).
     
    102102/*!
    103103 * \def BUILD_VERSION
    104  * \brief Full version of TSPSG in the form: \c major.\c minor.\c release[ \c status].
     104 * \brief Full version of TSPSG in the form: \c major.\c minor.\c release.\c build [ \c status].
    105105 */
    106106#ifndef BUILD_STATUS
    107         #define BUILD_VERSION QUOTE(BUILD_VERSION_MAJOR.BUILD_VERSION_MINOR.BUILD_RELEASE)
     107        #define BUILD_VERSION QUOTE(BUILD_VERSION_MAJOR.BUILD_VERSION_MINOR.BUILD_RELEASE.BUILD_NUMBER)
    108108#else
    109         #define BUILD_VERSION QUOTE(BUILD_VERSION_MAJOR.BUILD_VERSION_MINOR.BUILD_RELEASE BUILD_STATUS)
     109        #define BUILD_VERSION QUOTE(BUILD_VERSION_MAJOR.BUILD_VERSION_MINOR.BUILD_RELEASE.BUILD_NUMBER BUILD_STATUS)
    110110#endif
    111111
Note: See TracChangeset for help on using the changeset viewer.