Changeset 98 in tspsg-svn for trunk/src/mainwindow.cpp
- Timestamp:
- Mar 12, 2010, 8:28:42 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/mainwindow.cpp
r97 r98 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);
Note: See TracChangeset
for help on using the changeset viewer.