Changeset 2a436ea693 in tspsg for src/mainwindow.cpp
- Timestamp:
- Sep 6, 2010, 10:23:38 PM (14 years ago)
- Branches:
- 0.1.3.145-beta1-symbian, 0.1.4.170-beta2-bb10, appveyor, imgbot, master, readme
- Children:
- a713b103e8
- Parents:
- bbac1ebb13
- git-author:
- Oleksii Serdiuk <contacts@…> (09/06/10 22:23:38)
- git-committer:
- Oleksii Serdiuk <contacts@…> (06/29/12 19:45:57)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mainwindow.cpp
rbbac1ebb13 r2a436ea693 226 226 #endif 227 227 filters.append(tr("HTML Files") + " (*.html *.htm)"); 228 #if QT_VERSION >= 0x040500229 228 filters.append(tr("OpenDocument Files") + " (*.odt)"); 230 #endif // QT_VERSION >= 0x040500231 229 filters.append(tr("All Files") + " (*)"); 232 230 … … 258 256 QFileInfo fi(selectedFile); 259 257 QString format = settings->value("Output/GraphImageFormat", DEF_GRAPH_IMAGE_FORMAT).toString(); 260 #if !defined(NOSVG) && (QT_VERSION >= 0x040500)258 #if !defined(NOSVG) 261 259 if (!QImageWriter::supportedImageFormats().contains(format.toAscii()) && (format != "svg")) { 262 #else // NOSVG && QT_VERSION >= 0x040500260 #else // NOSVG 263 261 if (!QImageWriter::supportedImageFormats().contains(format.toAscii())) { 264 #endif // NOSVG && QT_VERSION >= 0x040500262 #endif // NOSVG 265 263 format = DEF_GRAPH_IMAGE_FORMAT; 266 264 settings->remove("Output/GraphImageFormat"); … … 277 275 278 276 // Saving solution graph as SVG or PNG (depending on settings and SVG support) 279 #if !defined(NOSVG) && (QT_VERSION >= 0x040500)277 #if !defined(NOSVG) 280 278 if (format == "svg") { 281 279 QSvgGenerator svg; … … 290 288 p.end(); 291 289 } else { 292 #endif // NOSVG && QT_VERSION >= 0x040500290 #endif // NOSVG 293 291 QImage i(graph.width(), graph.height(), QImage::Format_ARGB32); 294 292 i.fill(0x00FFFFFF); … … 311 309 return; 312 310 } 313 #if !defined(NOSVG) && (QT_VERSION >= 0x040500) 314 } 315 #endif // NOSVG && QT_VERSION >= 0x040500 316 317 // Qt < 4.5 has no QTextDocumentWriter class 318 #if QT_VERSION >= 0x040500 311 #if !defined(NOSVG) 312 } 313 #endif // NOSVG 319 314 } else { 320 315 QTextDocumentWriter dw(selectedFile); … … 323 318 if (!dw.write(solutionText->document())) 324 319 QMessageBox::critical(this, tr("Solution Save"), tr("Unable to save the solution.\nError: %1").arg(dw.device()->errorString())); 325 #endif // QT_VERSION >= 0x040500326 320 } 327 321 QApplication::restoreOverrideCursor(); … … 565 559 566 560 bb->button(QDialogButtonBox::Ok)->setCursor(QCursor(Qt::PointingHandCursor)); 567 bb->button(QDialogButtonBox::Ok)->setIcon( QIcon::fromTheme("dialog-ok", QIcon(":/images/icons/dialog-ok.png")));561 bb->button(QDialogButtonBox::Ok)->setIcon(GET_ICON("dialog-ok")); 568 562 569 563 hb2->addWidget(bb); … … 599 593 dlg->setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint); 600 594 dlg->setWindowTitle(tr("About %1").arg(QApplication::applicationName())); 601 dlg->setWindowIcon( QIcon::fromTheme("help-about", QIcon(":/images/icons/help-about.png")));595 dlg->setWindowIcon(GET_ICON("help-about")); 602 596 dlg->setLayout(vb); 603 597 … … 655 649 pd.setBar(pb); 656 650 QPushButton *cancel = new QPushButton(&pd); 657 cancel->setIcon( QIcon::fromTheme("dialog-cancel", QIcon(":/images/icons/dialog-cancel.png")));651 cancel->setIcon(GET_ICON("dialog-cancel")); 658 652 cancel->setText(QApplication::translate("QProgressDialog", "Cancel", "No need to translate this. This translation will be taken from Qt translation files.")); 659 653 pd.setCancelButton(cancel); … … 1224 1218 a = menuSettingsLanguage->addAction(language.at(2)); 1225 1219 a->setStatusTip(language.at(3)); 1220 #if QT_VERSION >= 0x040600 1226 1221 a->setIcon(QIcon::fromTheme(QString("flag-%1").arg(language.at(1)), QIcon(QString(":/images/icons/l10n/flag-%1.png").arg(language.at(1))))); 1222 #else 1223 a->setIcon(QIcon(QString(":/images/icons/l10n/flag-%1.png").arg(language.at(1)))); 1224 #endif 1227 1225 a->setData(language.at(0)); 1228 1226 a->setCheckable(true); … … 1479 1477 1480 1478 // File Menu 1481 actionFileNew->setIcon( QIcon::fromTheme("document-new", QIcon(":/images/icons/document-new.png")));1482 actionFileOpen->setIcon( QIcon::fromTheme("document-open", QIcon(":/images/icons/document-open.png")));1483 actionFileSave->setIcon( QIcon::fromTheme("document-save", QIcon(":/images/icons/document-save.png")));1484 menuFileSaveAs->setIcon( QIcon::fromTheme("document-save-as", QIcon(":/images/icons/document-save-as.png")));1485 actionFileExit->setIcon( QIcon::fromTheme("application-exit", QIcon(":/images/icons/application-exit.png")));1479 actionFileNew->setIcon(GET_ICON("document-new")); 1480 actionFileOpen->setIcon(GET_ICON("document-open")); 1481 actionFileSave->setIcon(GET_ICON("document-save")); 1482 menuFileSaveAs->setIcon(GET_ICON("document-save-as")); 1483 actionFileExit->setIcon(GET_ICON("application-exit")); 1486 1484 // Settings Menu 1487 menuSettingsLanguage->setIcon( QIcon::fromTheme("preferences-desktop-locale", QIcon(":/images/icons/preferences-desktop-locale.png")));1488 actionSettingsLanguageEnglish->setIcon( QIcon::fromTheme("flag-gb", QIcon(":/images/icons/l10n/flag-gb.png")));1489 menuSettingsStyle->setIcon( QIcon::fromTheme("preferences-desktop-theme", QIcon(":/images/icons/preferences-desktop-theme.png")));1490 actionSettingsPreferences->setIcon( QIcon::fromTheme("preferences-system", QIcon(":/images/icons/preferences-system.png")));1485 menuSettingsLanguage->setIcon(GET_ICON("preferences-desktop-locale")); 1486 actionSettingsLanguageEnglish->setIcon(GET_ICON("flag-gb")); 1487 menuSettingsStyle->setIcon(GET_ICON("preferences-desktop-theme")); 1488 actionSettingsPreferences->setIcon(GET_ICON("preferences-system")); 1491 1489 // Help Menu 1492 actionHelpContents->setIcon( QIcon::fromTheme("help-contents", QIcon(":/images/icons/help-contents.png")));1493 actionHelpContextual->setIcon( QIcon::fromTheme("help-contextual", QIcon(":/images/icons/help-contextual.png")));1494 actionHelpAbout->setIcon( QIcon::fromTheme("help-about", QIcon(":/images/icons/help-about.png")));1490 actionHelpContents->setIcon(GET_ICON("help-contents")); 1491 actionHelpContextual->setIcon(GET_ICON("help-contextual")); 1492 actionHelpAbout->setIcon(GET_ICON("help-about")); 1495 1493 // Buttons 1496 buttonRandom->setIcon( QIcon::fromTheme("roll", QIcon(":/images/icons/roll.png")));1497 buttonSolve->setIcon( QIcon::fromTheme("dialog-ok", QIcon(":/images/icons/dialog-ok.png")));1498 buttonSaveSolution->setIcon( QIcon::fromTheme("document-save-as", QIcon(":/images/icons/document-save-as.png")));1499 buttonBackToTask->setIcon( QIcon::fromTheme("go-previous", QIcon(":/images/icons/go-previous.png")));1500 1501 // action->setIcon( QIcon::fromTheme("", QIcon(":/images/icons/.png")));1494 buttonRandom->setIcon(GET_ICON("roll")); 1495 buttonSolve->setIcon(GET_ICON("dialog-ok")); 1496 buttonSaveSolution->setIcon(GET_ICON("document-save-as")); 1497 buttonBackToTask->setIcon(GET_ICON("go-previous")); 1498 1499 // action->setIcon(GET_ICON("")); 1502 1500 1503 1501 #if QT_VERSION >= 0x040600 … … 1541 1539 actionFilePrintPreview->setObjectName("actionFilePrintPreview"); 1542 1540 actionFilePrintPreview->setEnabled(false); 1543 actionFilePrintPreview->setIcon( QIcon::fromTheme("document-print-preview", QIcon(":/images/icons/document-print-preview.png")));1541 actionFilePrintPreview->setIcon(GET_ICON("document-print-preview")); 1544 1542 1545 1543 actionFilePrint = new QAction(this); 1546 1544 actionFilePrint->setObjectName("actionFilePrint"); 1547 1545 actionFilePrint->setEnabled(false); 1548 actionFilePrint->setIcon( QIcon::fromTheme("document-print", QIcon(":/images/icons/document-print.png")));1546 actionFilePrint->setIcon(GET_ICON("document-print")); 1549 1547 1550 1548 menuFile->insertAction(actionFileExit,actionFilePrintPreview); … … 1566 1564 #ifndef HANDHELD 1567 1565 actionSettingsToolbarsConfigure = new QAction(this); 1568 actionSettingsToolbarsConfigure->setIcon( QIcon::fromTheme("configure-toolbars", QIcon(":/images/icons/configure-toolbars.png")));1566 actionSettingsToolbarsConfigure->setIcon(GET_ICON("configure-toolbars")); 1569 1567 #endif // HANDHELD 1570 1568 1571 1569 #ifdef Q_OS_WIN32 1572 1570 actionHelpCheck4Updates = new QAction(this); 1573 actionHelpCheck4Updates->setIcon( QIcon::fromTheme("system-software-update", QIcon(":/images/icons/system-software-update.png")));1571 actionHelpCheck4Updates->setIcon(GET_ICON("system-software-update")); 1574 1572 actionHelpCheck4Updates->setEnabled(hasUpdater()); 1575 1573 menuHelp->insertAction(actionHelpAboutQt, actionHelpCheck4Updates);
Note: See TracChangeset
for help on using the changeset viewer.