Changeset fddcfa4b55 in tspsg


Ignore:
Timestamp:
Apr 15, 2011, 4:21:25 AM (13 years ago)
Author:
Oleksii Serdiuk
Branches:
0.1.4.170-beta2-bb10, appveyor, imgbot, master, readme
Children:
27b1dca32b
Parents:
8f2427aaf0
git-author:
Oleksii Serdiuk <contacts@…> (04/15/11 04:21:25)
git-committer:
Oleksii Serdiuk <contacts@…> (06/29/12 19:45:59)
Message:
  • Removed static build detection as it caused some troubles with Qt Creator and Symbian on-device debugging. Not that much needed, anyway :-)
  • FIX: No Cancel option in Unsaved Changes dialog under Symbian (fixed bug:7).
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/mainwindow.cpp

    r8f2427aaf0 rfddcfa4b55  
    545545QString about;
    546546    about += QString("%1: <b>%2</b><br>").arg(tr("Target OS (ARCH)"), PLATFROM);
    547 #ifndef STATIC_BUILD
    548     about += QString("%1 (%2):<br>").arg(tr("Qt library"), tr("shared"));
     547    about += QString("%1:<br>").arg(tr("Qt library"));
    549548    about += QString("&nbsp;&nbsp;&nbsp;&nbsp;%1: <b>%2</b><br>").arg(tr("Build time"), QT_VERSION_STR);
    550549    about += QString("&nbsp;&nbsp;&nbsp;&nbsp;%1: <b>%2</b><br>").arg(tr("Runtime"), qVersion());
    551 #else
    552     about += QString("%1: <b>%2</b> (%3)<br>").arg(tr("Qt library"), QT_VERSION_STR, tr("static"));
    553 #endif // STATIC_BUILD
    554550    about.append(QString("%1: <b>%2x%3</b><br>").arg("Logical DPI").arg(logicalDpiX()).arg(logicalDpiY()));
    555551    about += tr("Buid <b>%1</b>, built on <b>%2</b> at <b>%3</b> with <b>%4</b> compiler.").arg(BUILD_NUMBER).arg(__DATE__).arg(__TIME__).arg(COMPILER) + "<br>";
     
    742738QPushButton *cancel = new QPushButton(&pd);
    743739    cancel->setIcon(GET_ICON("dialog-cancel"));
    744     cancel->setText(QCoreApplication::translate("QProgressDialog", "Cancel", "No need to translate this. This translation will be taken from Qt translation files."));
     740    cancel->setText(QCoreApplication::translate("QDialogButtonBox", "Cancel", "No need to translate this. This translation will be taken from Qt translation files."));
    745741    pd.setCancelButton(cancel);
    746742    pd.setMaximum(n);
     
    838834        pic.setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform);
    839835QFont font = qvariant_cast<QFont>(settings->value("Output/Font", QFont(DEF_FONT_FACE)));
    840         font.setStyleHint(QFont::Monospace);
     836        font.setStyleHint(QFont::TypeWriter);
    841837        // Font size in pixels = graph node radius / 2.75.
    842838        // See MainWindow::drawNode() for graph node radius calcualtion description.
     839#ifndef Q_WS_S60
    843840        font.setPixelSize(logicalDpiX() * (settings->value("Output/GraphWidth", DEF_GRAPH_WIDTH).toReal() / CM_IN_INCH) / 4.5 / 2.75);
     841#else
     842        // Also, see again MainWindow::drawNode() for why is additional 1.3 divider added in Symbian.
     843        font.setPixelSize(logicalDpiX() * (settings->value("Output/GraphWidth", DEF_GRAPH_WIDTH).toReal() / CM_IN_INCH) / 4.5 / 2.75 / 1.3);
     844#endif
    844845        if (settings->value("Output/HQGraph", DEF_HQ_GRAPH).toBool()) {
    845846            font.setWeight(QFont::DemiBold);
     
    14741475    if (!isWindowModified())
    14751476        return true;
    1476 int res = QMessageBox::warning(this, tr("Unsaved Changes"), tr("Would you like to save changes in the current task?"), QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel);
     1477#ifdef Q_WS_S60
     1478    int res = QSMessageBox(this).exec();
     1479#else
     1480    int res = QMessageBox::warning(this, tr("Unsaved Changes"), tr("Would you like to save changes in the current task?"), QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel);
     1481#endif
    14771482    if (res == QMessageBox::Save)
    14781483        return actionFileSaveTriggered();
     
    16641669    actionHelpReportBug->setIcon(GET_ICON("tools-report-bug"));
    16651670    actionHelpAbout->setIcon(GET_ICON("help-about"));
    1666     actionHelpAboutQt->setIcon(QIcon(":/images/icons/"ICON_SIZE"/qtlogo."ICON_FORMAT));
     1671    actionHelpAboutQt->setIcon(QIcon(":/trolltech/qmessagebox/images/qtlogo-64.png"));
    16671672#endif
    16681673    // Buttons
     
    18411846    QDesktopServices::openUrl(QUrl("http://tspsg.info/goto/bugtracker"));
    18421847}
     1848
     1849#ifdef Q_WS_S60
     1850QSMessageBox::QSMessageBox(QWidget *parent)
     1851    : QMessageBox(parent)
     1852{
     1853    setIcon(QMessageBox::Warning);
     1854    setWindowTitle(QApplication::translate("MainWindow", "Unsaved Changes"));
     1855    setText(QApplication::translate("MainWindow", "Would you like to save changes in the current task?"));
     1856    setStandardButtons(QMessageBox::Save);
     1857
     1858    QMenu *m = new QMenu(this);
     1859    m->addAction(QApplication::translate("QDialogButtonBox", "Discard", "No need to translate this. This translation will be taken from Qt translation files."),
     1860                 this, SLOT(discard()));
     1861    m->addAction(QApplication::translate("QDialogButtonBox", "Cancel", "No need to translate this. This translation will be taken from Qt translation files."),
     1862                 this, SLOT(cancel()));
     1863
     1864    QAction *o = new QAction(QApplication::translate("QMenuBar", "Actions", "No need to translate this. This translation will be taken from Qt translation files."), this);
     1865    o->setSoftKeyRole(QAction::NegativeSoftKey);
     1866    o->setMenu(m);
     1867    addAction(o);
     1868}
     1869
     1870void QSMessageBox::cancel(){
     1871    done(QMessageBox::Cancel);
     1872}
     1873
     1874void QSMessageBox::discard() {
     1875    done(QMessageBox::Discard);
     1876}
     1877#endif // Q_WS_S60
  • src/mainwindow.h

    r8f2427aaf0 rfddcfa4b55  
    161161};
    162162
     163#ifdef Q_WS_S60
     164// A quickly hacked QMessageBox for Symbian that supports three buttons.
     165class QSMessageBox: public QMessageBox {
     166    Q_OBJECT
     167private slots:
     168    void cancel();
     169    void discard();
     170public:
     171    QSMessageBox(QWidget *parent = 0);
     172};
     173#endif // Q_WS_S60
     174
    163175#endif // MAINWINDOW_H
  • tspsg.pro

    r8f2427aaf0 rfddcfa4b55  
    6363    BUILD_NUMBER=$$REVISION
    6464
    65 # A hack to determine whether we have static or dynamic Qt build
    66 macx {
    67     PRL = $$[QT_INSTALL_LIBS] QtCore.framework QtCore.prl
    68 } else:symbian|maemo*|simulator {
    69     # Nothing here
    70 } else:unix {
    71     PRL = $$[QT_INSTALL_LIBS] libQtCore.prl
    72 } else {
    73     PRL = $$[QT_INSTALL_LIBS] QtCore.prl
    74 }
    75 !isEmpty(PRL) {
    76     include($$join(PRL, "/"))
    77     contains(QMAKE_PRL_CONFIG, static) {
    78         # We "embed" SVG icon support on static build
    79         DEFINES += STATIC_BUILD
    80 #               !nosvg:QTPLUGIN += qsvgicon
    81     }
    82 }
    83 
    8465CONFIG(release, debug|release) {
    8566    OBJECTS_DIR = release
Note: See TracChangeset for help on using the changeset viewer.