Changeset e2abfd326f in tspsg for src
- Timestamp:
- Mar 12, 2010, 8:28:42 PM (15 years ago)
- Branches:
- 0.1.3.145-beta1-symbian, 0.1.4.170-beta2-bb10, appveyor, imgbot, master, readme
- Children:
- 394216e468
- Parents:
- f19df0a3e5
- Location:
- src
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
src/globals.h
rf19df0a3e5 re2abfd326f 32 32 #include <QtCore> 33 33 #include <QtGui> 34 #include <limits> 34 35 35 36 // Version info … … 89 90 #undef INFINITY 90 91 #endif 91 #define INFINITY 1.7E+30892 #define INFINITY std::numeric_limits<double>::infinity() 92 93 //! This string represents infinite value in the table 93 94 #define INFSTR "---" … … 104 105 return (modf(x, &i) == 0.0); 105 106 } 107 108 #ifdef Q_OS_WIN32 109 /*! 110 * \brief Enables or disables a mask for the \a widget. 111 * \param widget A widget to toggle mask on. 112 * \param enable Set to \c true to enable mask or \c false to disable it. 113 * 114 * This function is used to enable an outlined font effect for \c QLabel with a static text. 115 */ 116 void toggleStyle(QWidget *widget, bool enable); 117 #endif // Q_OS_WIN32 106 118 107 119 // Sanity checks -
src/main.cpp
rf19df0a3e5 re2abfd326f 34 34 35 35 #ifdef STATIC_BUILD 36 Q_IMPORT_PLUGIN(qjpeg)37 Q_IMPORT_PLUGIN(qsvg)36 // Q_IMPORT_PLUGIN(qjpeg) 37 // Q_IMPORT_PLUGIN(qsvg) 38 38 #endif 39 39 -
src/mainwindow.cpp
rf19df0a3e5 re2abfd326f 295 295 if (untitled) 296 296 setFileName(); 297 #ifdef Q_OS_WIN32 298 if (QtWin::isCompositionEnabled() && settings->value("UseTranslucency", DEF_USE_TRANSLUCENCY).toBool()) { 299 toggleStyle(labelVariant, true); 300 toggleStyle(labelCities, true); 301 } 302 #endif 297 303 QApplication::restoreOverrideCursor(); 298 304 } … … 304 310 QString title; 305 311 #if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN) 306 title += QString ::fromUtf8("<b>TSPSG<br>TSP Solver and Generator</b><br>");312 title += QString("<b>TSPSG<br>TSP Solver and Generator</b><br>"); 307 313 #else 308 title += QString::fromUtf8("<b>TSPSG: TSP Solver and Generator</b><br>"); 309 #endif // Q_OS_WINCE 310 title += QString::fromUtf8("Version: <b>"BUILD_VERSION"</b><br>"); 311 title += QString::fromUtf8("<b>© 2007-%1 Lёppa</b><br>").arg(QDate::currentDate().toString("yyyy")); 312 title += QString::fromUtf8("<b><a href=\"http://tspsg.sourceforge.net/\">http://tspsg.sf.net/</a></b><br>"); 314 title += QString("<b>TSPSG: TSP Solver and Generator</b><br>"); 315 #endif // Q_OS_WINCE || Q_OS_SYMBIAN 316 title += QString("%1: <b>%2</b><br>").arg(tr("Version"), BUILD_VERSION); 317 #if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN) 318 title += QString("<b>© 2007-%1 Oleksii \"Lёppa\" Serdiuk</b><br>").arg(QDate::currentDate().toString("yyyy")); 319 title += QString("<b><a href=\"http://tspsg.sourceforge.net/\">http://tspsg.sourceforge.net/</a></b>"); 320 #else 321 title += QString("<b><a href=\"http://tspsg.sourceforge.net/\">http://tspsg.sf.net/</a></b>"); 322 #endif // Q_OS_WINCE && Q_OS_SYMBIAN 323 313 324 QString about; 314 about += QString ::fromUtf8("Target OS (ARCH): <b>%1</b><br>").arg(OS);325 about += QString("%1: <b>%2</b><br>").arg(tr("Target OS (ARCH)"), OS); 315 326 #ifndef STATIC_BUILD 316 about += "Qt library (shared):<br>";317 about += QString ::fromUtf8(" Build time: <b>%1</b><br>").arg(QT_VERSION_STR);318 about += QString ::fromUtf8(" Runtime: <b>%1</b><br>").arg(qVersion());327 about += QString("%1 (%2):<br>").arg(tr("Qt library"), tr("shared")); 328 about += QString(" %1: <b>%2</b><br>").arg(tr("Build time"), QT_VERSION_STR); 329 about += QString(" %1: <b>%2</b><br>").arg(tr("Runtime"), qVersion()); 319 330 #else 320 about += QString ::fromUtf8("Qt library: <b>%1</b> (static)<br>").arg(QT_VERSION_STR);331 about += QString("%1: <b>%2</b> (%3)<br>").arg(tr("Qt library"), QT_VERSION_STR, tr("static")); 321 332 #endif // STATIC_BUILD 322 about += QString::fromUtf8("Built on <b>%1</b> at <b>%2</b><br>").arg(__DATE__).arg(__TIME__); 323 // about += "<br>"; 324 // about += QString::fromUtf8("Id: <b>"VERSIONID"</b><br>"); 325 about += QString::fromUtf8("Algorithm: <b>%1</b><br>").arg(CTSPSolver::getVersionId()); 333 about += tr("Buid <b>%1</b>, built on <b>%2</b> at <b>%3</b>").arg(BUILD_NUMBER).arg(__DATE__).arg(__TIME__) + "<br>"; 334 about += QString("%1: <b>%2</b><br>").arg(tr("Algorithm"), CTSPSolver::getVersionId()); 326 335 about += "<br>"; 327 about += "TSPSG is free software: you can redistribute it and/or modify it<br>"336 about += tr("TSPSG is free software: you can redistribute it and/or modify it<br>" 328 337 "under the terms of the GNU General Public License as published<br>" 329 338 "by the Free Software Foundation, either version 3 of the License,<br>" … … 336 345 "<br>" 337 346 "You should have received a copy of the GNU General Public License<br>" 338 "along with TSPSG. If not, see <a href=\"http://www.gnu.org/licenses/\">http://www.gnu.org/licenses/</a>." ;347 "along with TSPSG. If not, see <a href=\"http://www.gnu.org/licenses/\">http://www.gnu.org/licenses/</a>."); 339 348 340 349 QDialog *dlg = new QDialog(this); 341 350 QLabel *lblIcon = new QLabel(dlg), 342 *lblTitle = new QLabel(dlg); 351 *lblTitle = new QLabel(dlg), 352 *lblTranslated = new QLabel(dlg); 353 #if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN) 354 QLabel *lblSubTitle = new QLabel(QString("<b>© 2007-%1 Oleksii \"Lёppa\" Serdiuk</b>").arg(QDate::currentDate().toString("yyyy")), dlg); 355 #endif // Q_OS_WINCE || Q_OS_SYMBIAN 343 356 QTextBrowser *txtAbout = new QTextBrowser(dlg); 344 357 QVBoxLayout *vb = new QVBoxLayout(); 345 QHBoxLayout *hb = new QHBoxLayout(); 358 QHBoxLayout *hb1 = new QHBoxLayout(), 359 *hb2 = new QHBoxLayout(); 346 360 QDialogButtonBox *bb = new QDialogButtonBox(QDialogButtonBox::Ok, Qt::Horizontal, dlg); 347 361 348 362 lblIcon->setPixmap(QPixmap(":/images/tspsg.png").scaledToWidth(logicalDpiX() * 2 / 3, Qt::SmoothTransformation)); 349 363 lblIcon->setAlignment(Qt::AlignTop); 364 #if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN) 365 lblIcon->setStyleSheet(QString("QLabel {background-color: %1; border-color: %2; border-width: 1px; border-style: solid; border-radius: 3px;}").arg(palette().window().color().name(), palette().windowText().color().name())); 366 #endif 367 350 368 lblTitle->setOpenExternalLinks(true); 351 369 lblTitle->setText(title); 352 353 hb->addWidget(lblIcon); 354 hb->addWidget(lblTitle); 355 hb->addStretch(); 356 357 // txtAbout->setTextInteractionFlags(txtAbout->textInteractionFlags() ^ Qt::TextEditable); 370 lblTitle->setAlignment(Qt::AlignTop); 371 lblTitle->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); 372 #if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN) 373 lblTitle->setStyleSheet(QString("QLabel {background-color: %1; border-color: %2; border-width: 1px; border-style: solid; border-radius: 3px;}").arg(palette().window().color().name(), palette().shadow().color().name())); 374 #endif 375 376 hb1->addWidget(lblIcon); 377 hb1->addWidget(lblTitle); 378 358 379 txtAbout->setWordWrapMode(QTextOption::NoWrap); 359 380 txtAbout->setOpenExternalLinks(true); 360 381 txtAbout->setHtml(about); 361 382 txtAbout->moveCursor(QTextCursor::Start); 383 #if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN) 384 txtAbout->setStyleSheet(QString("QTextBrowser {border-color: %1; border-width: 1px; border-style: solid; border-radius: 3px;}").arg(palette().shadow().color().name())); 385 #endif 362 386 363 387 bb->button(QDialogButtonBox::Ok)->setCursor(QCursor(Qt::PointingHandCursor)); 364 388 365 vb->addLayout(hb); 389 lblTranslated->setText(QApplication::translate("--------", "TRANSLATION", "Please, provide translator credits here.")); 390 if (lblTranslated->text() == "TRANSLATION") 391 lblTranslated->hide(); 392 else { 393 lblTranslated->setOpenExternalLinks(true); 394 #if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN) 395 lblTranslated->setStyleSheet(QString("QLabel {background-color: %1; border-color: %2; border-width: 1px; border-style: solid; border-radius: 3px;}").arg(palette().window().color().name(), palette().shadow().color().name())); 396 #endif 397 hb2->addWidget(lblTranslated); 398 } 399 400 hb2->addWidget(bb); 401 402 #if defined(Q_OS_WINCE) 403 vb->setMargin(3); 404 #endif 405 vb->addLayout(hb1); 406 #if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN) 407 vb->addWidget(lblSubTitle); 408 #endif // Q_OS_WINCE || Q_OS_SYMBIAN 366 409 vb->addWidget(txtAbout); 367 vb->add Widget(bb);368 369 dlg->setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint );410 vb->addLayout(hb2); 411 412 dlg->setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint | Qt::MSWindowsFixedSizeDialogHint); 370 413 dlg->setWindowTitle(tr("About TSPSG")); 371 414 dlg->setLayout(vb); … … 380 423 #endif // Q_OS_WIN32 381 424 382 dlg->resize(450, 400); 425 dlg->resize(450, 350); 426 383 427 dlg->exec(); 384 428 … … 825 869 scrollArea->setWidget(tabWidget); 826 870 setCentralWidget(scrollArea); 871 #else 872 setCentralWidget(tabWidget); 827 873 #endif // Q_OS_WINCE 828 874 … … 890 936 { 891 937 #ifdef Q_OS_WIN32 938 toggleStyle(labelVariant, enable); 939 toggleStyle(labelCities, enable); 940 toggleStyle(statusBar(), enable); 892 941 tabWidget->setDocumentMode(enable); 893 942 QtWin::enableBlurBehindWindow(this, enable); -
src/pch.h
rf19df0a3e5 re2abfd326f 27 27 28 28 #ifdef __cplusplus 29 // Qt Libraries 30 #include <QtCore> 31 #include <QtGui> 32 #include <QtSvg> 33 34 // Rarely modified parts 35 #include "version.h" 36 #include "os.h" 37 #ifdef Q_OS_WIN32 38 #include "qtwin.h" 39 #endif // Q_OS_WIN32 29 #include "globals.h" 40 30 #endif // __cplusplus -
src/settingsdialog.cpp
rf19df0a3e5 re2abfd326f 71 71 vbox1->addWidget(bgGrey); 72 72 setLayout(vbox1); 73 #else 73 #else // Q_OS_WINCE || Q_OS_SYMBIAN 74 74 // Layout helper elements 75 75 QVBoxLayout *vbox1, *vbox2; -
src/tspsolver.cpp
rf19df0a3e5 re2abfd326f 326 326 matrix[nRow][k] -= val; 327 327 } 328 329 QDebug operator<<(QDebug dbg, const TMatrix &matrix) 330 { 331 for (int r = 0; r < matrix.count(); r++) { 332 for (int c = 0; c < matrix.at(r).count(); c++) 333 dbg.space() << matrix.at(r).at(c); 334 dbg << endl; 335 } 336 return dbg; 337 } -
src/tspsolver.h
rf19df0a3e5 re2abfd326f 108 108 }; 109 109 110 #ifdef DEBUG 111 QDebug operator<<(QDebug dbg, const TMatrix &matrix); 112 #endif 113 110 114 #endif // TSPSOLVER_H -
src/version.h
rf19df0a3e5 re2abfd326f 58 58 #define BUILD_VERSION_MINOR 0 59 59 #endif // BUILD_VERSION_MINOR 60 /*!61 * \brief TSPSG release number62 *63 * Release number meanings:64 * - 1 -- 3: <b>alpha</b> 1 to 365 * - 4 -- 7: <b>beta</b> 1 to 466 * - 8 -- 10: <b>rc</b> 1 to 367 * - 11 -- x: <b>release</b> 1 to x-1068 */69 60 #ifndef BUILD_RELEASE 61 //! TSPSG release number 70 62 #define BUILD_RELEASE 0 71 63 #endif // BUILD_RELEASE 72 64 73 /*!74 * \brief Current TSPSG build number75 *76 * This will only change on releases and will be the same as revision number.77 */78 65 #ifndef BUILD_NUMBER 66 //! Current TSPSG build number 79 67 #define BUILD_NUMBER 0 80 68 #endif // BUILD_NUMBER … … 83 71 * \def BUILD_STATUS 84 72 * \brief TSPSG build status 85 *86 * Determined based on BUILD_NUMBER and BUILD_RELEASE.87 73 */ 88 #if ndef TSPSG_RELEASE_BUILD74 #if !defined(TSPSG_RELEASE_BUILD) 89 75 #define BUILD_STATUS (dev build) 90 #elif BUILD_RELEASE < 4 91 #define BUILD_STATUS (alpha) 92 #elif BUILD_RELEASE < 8 93 #define BUILD_STATUS (beta) 94 #elif BUILD_RELEASE < 11 95 #define BUILD_STATUS (rc) 76 #elif !defined(BUILD_STATUS) 77 #define BUILD_STATUS (build BUILD_NUMBER) 96 78 #endif // TSPSG_RELEASE_BUILD 97 79 … … 101 83 #define QUOTE(x) QUOTE_X(x) 102 84 103 /*! 104 * \def BUILD_VERSION 105 * \brief Full version of TSPSG in the form: \c major.minor.release.build [\c status]. 106 */ 107 #ifndef BUILD_STATUS 108 #define BUILD_VERSION QUOTE(BUILD_VERSION_MAJOR.BUILD_VERSION_MINOR.BUILD_RELEASE.BUILD_NUMBER) 109 #else 110 #define BUILD_VERSION QUOTE(BUILD_VERSION_MAJOR.BUILD_VERSION_MINOR.BUILD_RELEASE.BUILD_NUMBER BUILD_STATUS) 111 #endif 85 //! Full version of TSPSG in the form: \c major.minor.release.build \c status. 86 #define BUILD_VERSION QUOTE(BUILD_VERSION_MAJOR.BUILD_VERSION_MINOR.BUILD_RELEASE BUILD_STATUS) 112 87 113 88 #endif // VERSION_H
Note: See TracChangeset
for help on using the changeset viewer.