diff options
author | Janne Anttila <janne.anttila@digia.com> | 2009-05-06 11:03:27 (GMT) |
---|---|---|
committer | Janne Anttila <janne.anttila@digia.com> | 2009-05-06 11:03:27 (GMT) |
commit | ee1899224a9622add24d3a7f94034197db838fee (patch) | |
tree | 1d8026b75cd3bac3ec313fb123e0d513962c645f | |
parent | 6902c158d3857061865dc29aa519dab93d8e2f0c (diff) | |
parent | a935becb2957604db0a389a084fc68b5a039d9c2 (diff) | |
download | Qt-ee1899224a9622add24d3a7f94034197db838fee.zip Qt-ee1899224a9622add24d3a7f94034197db838fee.tar.gz Qt-ee1899224a9622add24d3a7f94034197db838fee.tar.bz2 |
Merge branch 'master' of git@scm.dev.troll.no:qt/qt-s60-public
-rw-r--r-- | qmake/generators/symbian/symmake.cpp | 41 | ||||
-rw-r--r-- | qmake/generators/symbian/symmake.h | 1 | ||||
-rw-r--r-- | src/gui/styles/qs60style.cpp | 32 | ||||
-rw-r--r-- | src/gui/styles/qs60style_p.h | 1 | ||||
-rw-r--r-- | src/gui/styles/qs60style_symbian.cpp | 1 |
5 files changed, 63 insertions, 13 deletions
diff --git a/qmake/generators/symbian/symmake.cpp b/qmake/generators/symbian/symmake.cpp index 69d09ac..5c9ec13 100644 --- a/qmake/generators/symbian/symmake.cpp +++ b/qmake/generators/symbian/symmake.cpp @@ -666,6 +666,8 @@ bool SymbianMakefileGenerator::writeMmpFile(QString &filename, QStringList &symb writeMmpFileCompilerOptionPart(t); + writeMmpFileBinaryVersionPart(t); + writeMmpFileRulesPart(t); } else { return false; @@ -944,6 +946,45 @@ bool SymbianMakefileGenerator::writeMmpFileCompilerOptionPart(QTextStream& t) { if (!armcc.isEmpty()) t << "OPTION" << '\t' << " ARMCC "<< armcc << endl; // others to come + + t << endl; + return true; +} + +bool SymbianMakefileGenerator::writeMmpFileBinaryVersionPart(QTextStream& t) { + QString applicationVersion = project->first("VERSION"); + QStringList verNumList = applicationVersion.split('.'); + uint major = 0; + uint minor = 0; + uint patch = 0; + bool success = false; + + if (verNumList.size() > 0) { + major = verNumList[0].toUInt(&success); + if (success && verNumList.size() > 1) { + minor = verNumList[1].toUInt(&success); + if (success && verNumList.size() > 2) { + patch = verNumList[2].toUInt(&success); + } + } + } + + QString mmpVersion; + if (success && major <= 0xFFFF && minor <= 0xFF && patch <= 0xFF) { + // Symbian binary version only has major and minor components, so compress + // Qt's minor and patch values into the minor component. Since Symbian's minor + // component is a 16 bit value, only allow 8 bits for each to avoid overflow. + mmpVersion.append(QString::number(major)) + .append('.') + .append(QString::number((minor << 8) + patch)); + } else { + if (!applicationVersion.isEmpty()) + fprintf(stderr, "Invalid VERSION string: %s\n", qPrintable(applicationVersion)); + mmpVersion = "10.0"; // Default binary version for symbian is 10.0 + } + + t << "VERSION " << mmpVersion << endl; + return true; } diff --git a/qmake/generators/symbian/symmake.h b/qmake/generators/symbian/symmake.h index ed24d20..06732b5 100644 --- a/qmake/generators/symbian/symmake.h +++ b/qmake/generators/symbian/symmake.h @@ -83,6 +83,7 @@ protected: bool writeMmpFileLibraryPart(QTextStream& t); bool writeMmpFileCapabilityPart(QTextStream& t); bool writeMmpFileCompilerOptionPart(QTextStream& t); + bool writeMmpFileBinaryVersionPart(QTextStream& t); bool writeMmpFileRulesPart(QTextStream& t); bool writeRegRssFile(QString &appname, QStringList &useritems); diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 87353f9..ae639d7 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -1472,21 +1472,27 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, case CE_ProgressBarContents: if (const QStyleOptionProgressBarV2 *optionProgressBar = qstyleoption_cast<const QStyleOptionProgressBarV2 *>(option)) { QRect progressRect = optionProgressBar->rect; - const qreal progressFactor = (optionProgressBar->minimum == optionProgressBar->maximum) ? 1.0 - : (qreal)optionProgressBar->progress / optionProgressBar->maximum; - if (optionProgressBar->orientation == Qt::Horizontal) { - progressRect.setWidth(int(progressRect.width() * progressFactor)); - if(optionProgressBar->direction == Qt::RightToLeft) - progressRect.translate(optionProgressBar->rect.width()-progressRect.width(),0); - progressRect.adjust(1, 0, -1, 0); + + if (optionProgressBar->minimum == optionProgressBar->maximum && optionProgressBar->minimum == 0) { + // busy indicator + QS60StylePrivate::drawSkinPart(QS60StyleEnums::SP_QgnGrafBarWait, painter, progressRect,flags); } else { - progressRect.adjust(0, 1, 0, -1); - progressRect.setTop(progressRect.bottom() - int(progressRect.height() * progressFactor)); + const qreal progressFactor = (optionProgressBar->minimum == optionProgressBar->maximum) ? 1.0 + : (qreal)optionProgressBar->progress / optionProgressBar->maximum; + if (optionProgressBar->orientation == Qt::Horizontal) { + progressRect.setWidth(int(progressRect.width() * progressFactor)); + if(optionProgressBar->direction == Qt::RightToLeft) + progressRect.translate(optionProgressBar->rect.width()-progressRect.width(),0); + progressRect.adjust(1, 0, -1, 0); + } else { + progressRect.adjust(0, 1, 0, -1); + progressRect.setTop(progressRect.bottom() - int(progressRect.height() * progressFactor)); + } + + const QS60StylePrivate::SkinElements skinElement = optionProgressBar->orientation == Qt::Horizontal ? + QS60StylePrivate::SE_ProgressBarIndicatorHorizontal : QS60StylePrivate::SE_ProgressBarIndicatorVertical; + QS60StylePrivate::drawSkinElement(skinElement, painter, progressRect, flags); } - - const QS60StylePrivate::SkinElements skinElement = optionProgressBar->orientation == Qt::Horizontal ? - QS60StylePrivate::SE_ProgressBarIndicatorHorizontal : QS60StylePrivate::SE_ProgressBarIndicatorVertical; - QS60StylePrivate::drawSkinElement(skinElement, painter, progressRect, flags); } break; case CE_ProgressBarGroove: diff --git a/src/gui/styles/qs60style_p.h b/src/gui/styles/qs60style_p.h index 5afe702..7bfa57e 100644 --- a/src/gui/styles/qs60style_p.h +++ b/src/gui/styles/qs60style_p.h @@ -74,6 +74,7 @@ public: }; enum SkinParts { + SP_QgnGrafBarWait, SP_QgnGrafBarFrameCenter, SP_QgnGrafBarFrameSideL, SP_QgnGrafBarFrameSideR, diff --git a/src/gui/styles/qs60style_symbian.cpp b/src/gui/styles/qs60style_symbian.cpp index 154cf29..f90aa5b 100644 --- a/src/gui/styles/qs60style_symbian.cpp +++ b/src/gui/styles/qs60style_symbian.cpp @@ -89,6 +89,7 @@ private: }; const partMapEntry QS60StyleModeSpecifics::m_partMap[] = { + /* SP_QgnGrafBarWait */ {KAknsIIDQgnGrafBarWaitAnim, EDrawIcon, ES60_AllReleases, EMbmAvkonQgn_graf_bar_wait_1 ,-1,-1}, /* SP_QgnGrafBarFrameCenter */ {KAknsIIDQgnGrafBarFrameCenter, EDrawIcon, ES60_AllReleases, EMbmAvkonQgn_graf_bar_frame_center ,-1,-1}, /* SP_QgnGrafBarFrameSideL */ {KAknsIIDQgnGrafBarFrameSideL, EDrawIcon, ES60_AllReleases, EMbmAvkonQgn_graf_bar_frame_side_l ,-1,-1}, /* SP_QgnGrafBarFrameSideR */ {KAknsIIDQgnGrafBarFrameSideR, EDrawIcon, ES60_AllReleases, EMbmAvkonQgn_graf_bar_frame_side_r ,-1,-1}, |