Changeset 7ed8b57eea in tspsg
- Timestamp:
- Aug 31, 2013, 11:52:34 PM (11 years ago)
- Branches:
- appveyor, imgbot, master, readme
- Children:
- 2a5e50e0a9
- Parents:
- 1241232377
- Files:
-
- 2 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
src/defaults.h
r1241232377 r7ed8b57eea 86 86 //! Default for "Embed solution graph into HTML" 87 87 #define DEF_EMBED_GRAPH_INTO_HTML false 88 //! Default solution graph size in centimeters (HQ size is this size * HQ_FACTOR) 89 #define DEF_GRAPH_WIDTH 4.5 88 /*! 89 * \def DEF_GRAPH_WIDTH 90 * \brief Default solution graph size in centimeters (HQ size is this size * HQ_FACTOR) 91 */ 92 #ifdef Q_OS_BLACKBERRY 93 # define DEF_GRAPH_WIDTH 2.5 94 #else 95 # define DEF_GRAPH_WIDTH 4.5 96 #endif 90 97 //! Default for "Show solution steps' matrices for every solution step" 91 98 #define DEF_SHOW_MATRIX true … … 104 111 #ifdef Q_OS_SYMBIAN 105 112 # define DEF_FONT_SIZE 8 113 #elif defined(Q_OS_BLACKBERRY) 114 # define DEF_FONT_SIZE 7 106 115 #else 107 116 # define DEF_FONT_SIZE 10 108 117 #endif // Q_OS_SYMBIAN 109 //! Default solution text color 110 #define DEF_TEXT_COLOR QApplication::palette().color(QPalette::Text) 118 /*! 119 * \def DEF_TEXT_COLOR 120 * \brief Default solution text color 121 */ 122 #ifdef Q_OS_BLACKBERRY 123 # define DEF_TEXT_COLOR Qt::black 124 #else 125 # define DEF_TEXT_COLOR QApplication::palette().color(QPalette::Text) 126 #endif 111 127 //! Default selected candidate color 112 128 #define DEF_SELECTED_COLOR "#008000" -
src/globals.h
r1241232377 r7ed8b57eea 120 120 #ifndef DOXYGEN_EXCLUDE 121 121 122 #if def HANDHELD122 #if defined(HANDHELD) && !defined(Q_OS_BLACKBERRY) 123 123 # define ICON_SIZE "48x48" 124 124 # define ICON_FORMAT "png" -
src/main.cpp
r1241232377 r7ed8b57eea 23 23 24 24 #include "mainwindow.h" 25 #include "version.h" 26 27 #ifdef Q_OS_BLACKBERRY 28 # include "bb10proxystyle.h" 29 #endif // Q_OS_BLACKBERRY 25 30 26 31 #include <QDateTime> … … 28 33 #include <QTextCodec> 29 34 #include <QTranslator> 30 #include "version.h"31 35 32 36 #if QT_VERSION < QT_VERSION_CHECK(4,6,0) … … 64 68 app.setApplicationName("TSP Solver and Generator"); 65 69 app.setApplicationVersion(BUILD_VERSION); 70 71 #ifdef Q_OS_BLACKBERRY 72 QApplication::setStartDragDistance(42); 73 QApplication::setStyle(new BB10ProxyStyle); 74 app.setStyleSheet(CSS_FIX); 75 #endif // Q_OS_BLACKBERRY 66 76 67 77 // Seeding random number generator -
src/mainwindow.cpp
r1241232377 r7ed8b57eea 149 149 setAcceptDrops(true); 150 150 151 #ifdef Q_OS_BLACKBERRY 152 taskView->setEditTriggers(QAbstractItemView::AllEditTriggers); 153 #endif 154 151 155 initDocStyleSheet(); 152 156 … … 182 186 connect(actionFileSaveAsTask, SIGNAL(triggered()), SLOT(actionFileSaveAsTaskTriggered())); 183 187 connect(actionFileSaveAsSolution, SIGNAL(triggered()), SLOT(actionFileSaveAsSolutionTriggered())); 184 #ifndef QT_NO_PRINT ER188 #ifndef QT_NO_PRINTDIALOG 185 189 connect(actionFilePrintPreview, SIGNAL(triggered()), SLOT(actionFilePrintPreviewTriggered())); 186 190 connect(actionFilePageSetup, SIGNAL(triggered()), SLOT(actionFilePageSetupTriggered())); … … 483 487 } 484 488 485 #ifndef QT_NO_PRINT ER489 #ifndef QT_NO_PRINTDIALOG 486 490 void MainWindow::actionFilePrintPreviewTriggered() 487 491 { … … 541 545 QApplication::restoreOverrideCursor(); 542 546 } 543 #endif // QT_NO_PRINT ER547 #endif // QT_NO_PRINTDIALOG 544 548 545 549 void MainWindow::actionSettingsPreferencesTriggered() … … 744 748 txtAbout->moveCursor(QTextCursor::Start); 745 749 txtAbout->setFrameShape(QFrame::NoFrame); 750 #ifdef Q_OS_BLACKBERRY 751 txtAbout->setAttribute(Qt::WA_InputMethodEnabled, false); 752 #endif 746 753 747 754 // txtCredits->setWordWrapMode(QTextOption::NoWrap); … … 750 757 txtCredits->moveCursor(QTextCursor::Start); 751 758 txtCredits->setFrameShape(QFrame::NoFrame); 759 #ifdef Q_OS_BLACKBERRY 760 txtCredits->setAttribute(Qt::WA_InputMethodEnabled, false); 761 #endif 752 762 753 763 txtLicense->setWordWrapMode(QTextOption::NoWrap); … … 756 766 txtLicense->moveCursor(QTextCursor::Start); 757 767 txtLicense->setFrameShape(QFrame::NoFrame); 768 #ifdef Q_OS_BLACKBERRY 769 txtLicense->setAttribute(Qt::WA_InputMethodEnabled, false); 770 #endif 758 771 759 772 bb->button(QDialogButtonBox::Ok)->setCursor(QCursor(Qt::PointingHandCursor)); … … 807 820 #ifndef HANDHELD 808 821 dlg->resize(450, 350); 809 #elif defined(Q_OS_SYMBIAN) 822 #elif defined(Q_OS_SYMBIAN) || defined(Q_OS_BLACKBERRY) 810 823 dlg->setWindowState(Qt::WindowMaximized); 811 824 #endif … … 857 870 pd.setCancelButton(cancel); 858 871 pd.setMaximum(n); 872 pd.setAutoClose(false); 859 873 pd.setAutoReset(false); 860 874 pd.setLabelText(tr("Calculating optimal route...")); … … 1737 1751 Ui_MainWindow::retranslateUi(this); 1738 1752 1753 #ifdef Q_OS_BLACKBERRY 1754 menuSettings->removeAction(menuSettingsStyle->menuAction()); 1755 #else 1739 1756 loadStyleList(); 1757 #endif 1740 1758 loadToolbarList(); 1741 1759 1742 #ifndef QT_NO_PRINT ER1760 #ifndef QT_NO_PRINTDIALOG 1743 1761 actionFilePrintPreview->setText(tr("P&rint Preview...")); 1744 1762 #ifndef QT_NO_TOOLTIP … … 1764 1782 actionFilePrint->setStatusTip(tr("Print current solution results")); 1765 1783 #endif // QT_NO_STATUSTIP 1784 #ifndef QT_NO_SHORTCUT 1766 1785 actionFilePrint->setShortcut(tr("Ctrl+P")); 1767 #endif // QT_NO_PRINTER 1786 #endif // QT_NO_SHORTCUT 1787 #endif // QT_NO_PRINTDIALOG 1768 1788 1769 1789 #ifndef QT_NO_STATUSTIP … … 1846 1866 actionFileOpen->setIcon(GET_ICON("document-open")); 1847 1867 actionFileSave->setIcon(GET_ICON("document-save")); 1848 #if ndef HANDHELD1868 #if !defined(HANDHELD) || defined(Q_OS_BLACKBERRY) 1849 1869 menuFileSaveAs->setIcon(GET_ICON("document-save-as")); 1850 1870 #endif 1851 1871 actionFileExit->setIcon(GET_ICON("application-exit")); 1852 1872 // Settings Menu 1853 #if ndef HANDHELD1873 #if !defined(HANDHELD) || defined(Q_OS_BLACKBERRY) 1854 1874 menuSettingsLanguage->setIcon(GET_ICON("preferences-desktop-locale")); 1855 1875 #if QT_VERSION >= QT_VERSION_CHECK(4,6,0) … … 1862 1882 actionSettingsPreferences->setIcon(GET_ICON("preferences-system")); 1863 1883 // Help Menu 1864 #if ndef HANDHELD1884 #if !defined(HANDHELD) || defined(Q_OS_BLACKBERRY) 1865 1885 actionHelpContents->setIcon(GET_ICON("help-contents")); 1866 1886 actionHelpContextual->setIcon(GET_ICON("help-contextual")); … … 1868 1888 actionHelpReportBug->setIcon(GET_ICON("tools-report-bug")); 1869 1889 actionHelpAbout->setIcon(GET_ICON("help-about")); 1890 #ifdef Q_OS_BLACKBERRY 1891 // Qt about dialog is too big for the screen 1892 // and it's impossible to close it. 1893 menuHelp->removeAction(actionHelpAboutQt); 1894 #else // Q_OS_BLACKBERRY 1870 1895 #if QT_VERSION < QT_VERSION_CHECK(5,0,0) 1871 1896 actionHelpAboutQt->setIcon(QIcon(":/trolltech/qmessagebox/images/qtlogo-64.png")); 1872 #else 1897 #else // QT_VERSION < QT_VERSION_CHECK(5,0,0) 1873 1898 actionHelpAboutQt->setIcon(QIcon(":/qt-project.org/qmessagebox/images/qtlogo-64.png")); 1874 1899 #endif // QT_VERSION < QT_VERSION_CHECK(5,0,0) 1900 #endif // Q_OS_BLACKBERRY 1875 1901 #endif // HANDHELD 1876 1902 // Buttons … … 1922 1948 solutionText->setWordWrapMode(QTextOption::WordWrap); 1923 1949 1924 #ifndef QT_NO_PRINT ER1950 #ifndef QT_NO_PRINTDIALOG 1925 1951 actionFilePrintPreview = new QAction(this); 1926 1952 actionFilePrintPreview->setObjectName("actionFilePrintPreview"); … … 1948 1974 1949 1975 toolBarMain->insertAction(actionSettingsPreferences, actionFilePrint); 1950 #endif // QT_NO_PRINT ER1976 #endif // QT_NO_PRINTDIALOG 1951 1977 1952 1978 groupSettingsLanguageList = new QActionGroup(this); … … 2021 2047 actionFileSaveAsSolution->setEnabled(enable); 2022 2048 solutionText->setEnabled(enable); 2023 #ifndef QT_NO_PRINT ER2049 #ifndef QT_NO_PRINTDIALOG 2024 2050 actionFilePrint->setEnabled(enable); 2025 2051 actionFilePrintPreview->setEnabled(enable); 2026 #endif // QT_NO_PRINT ER2052 #endif // QT_NO_PRINTDIALOG 2027 2053 } 2028 2054 -
src/mainwindow.h
r1241232377 r7ed8b57eea 71 71 void actionFileSaveAsTaskTriggered(); 72 72 void actionFileSaveAsSolutionTriggered(); 73 #ifndef QT_NO_PRINT ER73 #ifndef QT_NO_PRINTDIALOG 74 74 void actionFilePrintPreviewTriggered(); 75 75 void actionFilePageSetupTriggered(); 76 76 void actionFilePrintTriggered(); 77 #endif // QT_NO_PRINT ER77 #endif // QT_NO_PRINTDIALOG 78 78 void actionSettingsPreferencesTriggered(); 79 79 void actionSettingsLanguageAutodetectTriggered(bool checked); … … 118 118 #ifndef QT_NO_PRINTER 119 119 QPrinter *printer; 120 #ifndef QT_NO_PRINTDIALOG 120 121 QAction *actionFilePrintPreview; 121 122 QAction *actionFilePageSetup; 122 123 QAction *actionFilePrint; 124 #endif // QT_NO_PRINTDIALOG 123 125 #endif // QT_NO_PRINTER 124 126 QAction *actionHelpCheck4Updates; -
src/settingsdialog.cpp
r1241232377 r7ed8b57eea 546 546 void SettingsDialog::buttonFontClicked() 547 547 { 548 bool ok; 549 QFont font = QFontDialog::getFont(&ok, this->font, this); 550 if (ok && (this->font != font)) { 551 this->font = font; 552 QFont f = font; 553 f.setPointSize(labelFontExample->font().pointSize()); 554 labelFontExample->setFont(f); 555 labelFontExample->setText(font.family()); 556 _fontChanged = true; 557 } 548 QFont newFont; 549 #ifdef Q_OS_BLACKBERRY 550 QFontDialog fd(font, this); 551 fd.setWindowState(Qt::WindowMaximized); 552 if ((fd.exec() != QDialog::Accepted) || (fd.selectedFont() == font)) 553 return; 554 newFont = fd.selectedFont(); 555 #else 556 bool ok; 557 newFont = QFontDialog::getFont(&ok, font, this); 558 if (!ok || (font == newFont)) 559 return; 560 #endif 561 font = newFont; 562 QFont f = font; 563 f.setPointSize(labelFontExample->font().pointSize()); 564 labelFontExample->setFont(f); 565 labelFontExample->setText(font.family()); 566 _fontChanged = true; 558 567 } 559 568 -
tspsg.pri
r1241232377 r7ed8b57eea 32 32 src/qtwin.cpp 33 33 34 blackberry { 35 HEADERS += src/bb10proxystyle.h 36 SOURCES += src/bb10proxystyle.cpp 37 } 38 34 39 #Forms 35 40 FORMS += ui/mainwindow.ui \ … … 40 45 l10n/l10n.qrc 41 46 42 handheld { 47 blackberry { 48 RESOURCES += resources/desktop.qrc 49 } else:handheld { 43 50 RESOURCES += resources/handheld.qrc 44 51 } else { -
tspsg.pro
r1241232377 r7ed8b57eea 23 23 wincewm*|symbian|maemo*|simulator|blackberry { 24 24 CONFIG += handheld 25 } 26 blackberry { 27 # DEFINES += QT_NO_SHORTCUT 28 DEFINES += QT_NO_PRINTDIALOG 29 DEFINES += QT_NO_PRINTPREVIEWDIALOG 25 30 } 26 31
Note: See TracChangeset
for help on using the changeset viewer.