Changeset 7ed8b57eea in tspsg for src/mainwindow.cpp


Ignore:
Timestamp:
Aug 31, 2013, 11:52:34 PM (11 years ago)
Author:
Oleksii Serdiuk
Branches:
appveyor, imgbot, master, readme
Children:
2a5e50e0a9
Parents:
1241232377
Message:

[BB10] UI fixes:

  • added proxy style and stylesheet to fix some UI issues on BlackBerry?;
  • removed style selection option because most styles have UI issues and removed About Qt menu item because About Qt dialog is too big;
  • load bigger (128x128) icons on BlackBerry? 10;
  • removed printing related items from menu as there's no printer;
  • made dialogs to be shown maximized;
  • made solution graph smaller;
  • made font smaller;
  • made output text color black;
  • start editing table cells on single tap;
  • don't show keyboard in about dialog.

Cherry-picks from
aa64ad40827cde0a444cd8198b0f3457aa191f8f
95b0ef73dcb4517ac2ae08867494204bbe8d7ea6
ccdffe3a5f84f12fba2e2f19ab249c31f1fcf35d
628500a5d687889823197e476953859d529af4f0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mainwindow.cpp

    r1241232377 r7ed8b57eea  
    149149    setAcceptDrops(true);
    150150
     151#ifdef Q_OS_BLACKBERRY
     152    taskView->setEditTriggers(QAbstractItemView::AllEditTriggers);
     153#endif
     154
    151155    initDocStyleSheet();
    152156
     
    182186    connect(actionFileSaveAsTask, SIGNAL(triggered()), SLOT(actionFileSaveAsTaskTriggered()));
    183187    connect(actionFileSaveAsSolution, SIGNAL(triggered()), SLOT(actionFileSaveAsSolutionTriggered()));
    184 #ifndef QT_NO_PRINTER
     188#ifndef QT_NO_PRINTDIALOG
    185189    connect(actionFilePrintPreview, SIGNAL(triggered()), SLOT(actionFilePrintPreviewTriggered()));
    186190    connect(actionFilePageSetup, SIGNAL(triggered()), SLOT(actionFilePageSetupTriggered()));
     
    483487}
    484488
    485 #ifndef QT_NO_PRINTER
     489#ifndef QT_NO_PRINTDIALOG
    486490void MainWindow::actionFilePrintPreviewTriggered()
    487491{
     
    541545    QApplication::restoreOverrideCursor();
    542546}
    543 #endif // QT_NO_PRINTER
     547#endif // QT_NO_PRINTDIALOG
    544548
    545549void MainWindow::actionSettingsPreferencesTriggered()
     
    744748    txtAbout->moveCursor(QTextCursor::Start);
    745749    txtAbout->setFrameShape(QFrame::NoFrame);
     750#ifdef Q_OS_BLACKBERRY
     751    txtAbout->setAttribute(Qt::WA_InputMethodEnabled, false);
     752#endif
    746753
    747754//      txtCredits->setWordWrapMode(QTextOption::NoWrap);
     
    750757    txtCredits->moveCursor(QTextCursor::Start);
    751758    txtCredits->setFrameShape(QFrame::NoFrame);
     759#ifdef Q_OS_BLACKBERRY
     760    txtCredits->setAttribute(Qt::WA_InputMethodEnabled, false);
     761#endif
    752762
    753763    txtLicense->setWordWrapMode(QTextOption::NoWrap);
     
    756766    txtLicense->moveCursor(QTextCursor::Start);
    757767    txtLicense->setFrameShape(QFrame::NoFrame);
     768#ifdef Q_OS_BLACKBERRY
     769    txtLicense->setAttribute(Qt::WA_InputMethodEnabled, false);
     770#endif
    758771
    759772    bb->button(QDialogButtonBox::Ok)->setCursor(QCursor(Qt::PointingHandCursor));
     
    807820#ifndef HANDHELD
    808821    dlg->resize(450, 350);
    809 #elif defined(Q_OS_SYMBIAN)
     822#elif defined(Q_OS_SYMBIAN) || defined(Q_OS_BLACKBERRY)
    810823    dlg->setWindowState(Qt::WindowMaximized);
    811824#endif
     
    857870    pd.setCancelButton(cancel);
    858871    pd.setMaximum(n);
     872    pd.setAutoClose(false);
    859873    pd.setAutoReset(false);
    860874    pd.setLabelText(tr("Calculating optimal route..."));
     
    17371751        Ui_MainWindow::retranslateUi(this);
    17381752
     1753#ifdef Q_OS_BLACKBERRY
     1754    menuSettings->removeAction(menuSettingsStyle->menuAction());
     1755#else
    17391756    loadStyleList();
     1757#endif
    17401758    loadToolbarList();
    17411759
    1742 #ifndef QT_NO_PRINTER
     1760#ifndef QT_NO_PRINTDIALOG
    17431761    actionFilePrintPreview->setText(tr("P&rint Preview..."));
    17441762#ifndef QT_NO_TOOLTIP
     
    17641782    actionFilePrint->setStatusTip(tr("Print current solution results"));
    17651783#endif // QT_NO_STATUSTIP
     1784#ifndef QT_NO_SHORTCUT
    17661785    actionFilePrint->setShortcut(tr("Ctrl+P"));
    1767 #endif // QT_NO_PRINTER
     1786#endif // QT_NO_SHORTCUT
     1787#endif // QT_NO_PRINTDIALOG
    17681788
    17691789#ifndef QT_NO_STATUSTIP
     
    18461866    actionFileOpen->setIcon(GET_ICON("document-open"));
    18471867    actionFileSave->setIcon(GET_ICON("document-save"));
    1848 #ifndef HANDHELD
     1868#if !defined(HANDHELD) || defined(Q_OS_BLACKBERRY)
    18491869    menuFileSaveAs->setIcon(GET_ICON("document-save-as"));
    18501870#endif
    18511871    actionFileExit->setIcon(GET_ICON("application-exit"));
    18521872    // Settings Menu
    1853 #ifndef HANDHELD
     1873#if !defined(HANDHELD) || defined(Q_OS_BLACKBERRY)
    18541874    menuSettingsLanguage->setIcon(GET_ICON("preferences-desktop-locale"));
    18551875#if QT_VERSION >= QT_VERSION_CHECK(4,6,0)
     
    18621882    actionSettingsPreferences->setIcon(GET_ICON("preferences-system"));
    18631883    // Help Menu
    1864 #ifndef HANDHELD
     1884#if !defined(HANDHELD) || defined(Q_OS_BLACKBERRY)
    18651885    actionHelpContents->setIcon(GET_ICON("help-contents"));
    18661886    actionHelpContextual->setIcon(GET_ICON("help-contextual"));
     
    18681888    actionHelpReportBug->setIcon(GET_ICON("tools-report-bug"));
    18691889    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
    18701895#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
    18711896    actionHelpAboutQt->setIcon(QIcon(":/trolltech/qmessagebox/images/qtlogo-64.png"));
    1872 #else
     1897#else // QT_VERSION < QT_VERSION_CHECK(5,0,0)
    18731898    actionHelpAboutQt->setIcon(QIcon(":/qt-project.org/qmessagebox/images/qtlogo-64.png"));
    18741899#endif // QT_VERSION < QT_VERSION_CHECK(5,0,0)
     1900#endif // Q_OS_BLACKBERRY
    18751901#endif // HANDHELD
    18761902    // Buttons
     
    19221948    solutionText->setWordWrapMode(QTextOption::WordWrap);
    19231949
    1924 #ifndef QT_NO_PRINTER
     1950#ifndef QT_NO_PRINTDIALOG
    19251951    actionFilePrintPreview = new QAction(this);
    19261952    actionFilePrintPreview->setObjectName("actionFilePrintPreview");
     
    19481974
    19491975    toolBarMain->insertAction(actionSettingsPreferences, actionFilePrint);
    1950 #endif // QT_NO_PRINTER
     1976#endif // QT_NO_PRINTDIALOG
    19511977
    19521978    groupSettingsLanguageList = new QActionGroup(this);
     
    20212047    actionFileSaveAsSolution->setEnabled(enable);
    20222048    solutionText->setEnabled(enable);
    2023 #ifndef QT_NO_PRINTER
     2049#ifndef QT_NO_PRINTDIALOG
    20242050    actionFilePrint->setEnabled(enable);
    20252051    actionFilePrintPreview->setEnabled(enable);
    2026 #endif // QT_NO_PRINTER
     2052#endif // QT_NO_PRINTDIALOG
    20272053}
    20282054
Note: See TracChangeset for help on using the changeset viewer.