diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-02-18 09:09:13 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-02-18 09:09:13 (GMT) |
commit | 7cfae48c7ff8b0f8fa6e0a530ff86b30c1665508 (patch) | |
tree | 07631bea961291317cfe835a0204bd1a76e0532b /src/gui | |
parent | 01cf14ef278f564936eff9a392679526fe14e530 (diff) | |
parent | 342b916ab4fb1a9c6f3a2608e7c5a43d6a763981 (diff) | |
download | Qt-7cfae48c7ff8b0f8fa6e0a530ff86b30c1665508.zip Qt-7cfae48c7ff8b0f8fa6e0a530ff86b30c1665508.tar.gz Qt-7cfae48c7ff8b0f8fa6e0a530ff86b30c1665508.tar.bz2 |
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt-s60-public into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/qt-s60-public:
Use correct include path for qglobal.h
Fixed softkey localizaton to comile also on platforms without softkeys.
Use correct (forward slash) separators in qmake-generated bld.inf
Support for dynamic localization in Symbian softkeys.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/itemviews/qabstractitemview.cpp | 5 | ||||
-rw-r--r-- | src/gui/kernel/qsoftkeymanager.cpp | 17 | ||||
-rw-r--r-- | src/gui/kernel/qsoftkeymanager_p.h | 2 | ||||
-rw-r--r-- | src/gui/widgets/qcombobox.cpp | 6 | ||||
-rw-r--r-- | src/gui/widgets/qmainwindow.cpp | 5 | ||||
-rw-r--r-- | src/gui/widgets/qmenu.cpp | 20 |
6 files changed, 42 insertions, 13 deletions
diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp index cbd9a8a..adf3ce3 100644 --- a/src/gui/itemviews/qabstractitemview.cpp +++ b/src/gui/itemviews/qabstractitemview.cpp @@ -1540,6 +1540,11 @@ bool QAbstractItemView::event(QEvent *event) case QEvent::FontChange: d->doDelayedItemsLayout(); // the size of the items will change break; +#ifdef QT_SOFTKEYS_ENABLED + case QEvent::LanguageChange: + d->doneSoftKey->setText(QSoftKeyManager::standardSoftKeyText(QSoftKeyManager::DoneSoftKey)); + break; +#endif default: break; } diff --git a/src/gui/kernel/qsoftkeymanager.cpp b/src/gui/kernel/qsoftkeymanager.cpp index 6d108b0..7412b06 100644 --- a/src/gui/kernel/qsoftkeymanager.cpp +++ b/src/gui/kernel/qsoftkeymanager.cpp @@ -55,24 +55,24 @@ QT_BEGIN_NAMESPACE QSoftKeyManager *QSoftKeyManagerPrivate::self = 0; -const char *QSoftKeyManager::standardSoftKeyText(StandardSoftKey standardKey) +QString QSoftKeyManager::standardSoftKeyText(StandardSoftKey standardKey) { - const char *softKeyText = 0; + QString softKeyText; switch (standardKey) { case OkSoftKey: - softKeyText = QT_TRANSLATE_NOOP("QSoftKeyManager", "Ok"); + softKeyText = QSoftKeyManager::tr("Ok"); break; case SelectSoftKey: - softKeyText = QT_TRANSLATE_NOOP("QSoftKeyManager", "Select"); + softKeyText = QSoftKeyManager::tr("Select"); break; case DoneSoftKey: - softKeyText = QT_TRANSLATE_NOOP("QSoftKeyManager", "Done"); + softKeyText = QSoftKeyManager::tr("Done"); break; case MenuSoftKey: - softKeyText = QT_TRANSLATE_NOOP("QSoftKeyManager", "Options"); + softKeyText = QSoftKeyManager::tr("Options"); break; case CancelSoftKey: - softKeyText = QT_TRANSLATE_NOOP("QSoftKeyManager", "Cancel"); + softKeyText = QSoftKeyManager::tr("Cancel"); break; default: break; @@ -100,8 +100,7 @@ QSoftKeyManager::QSoftKeyManager() : QAction *QSoftKeyManager::createAction(StandardSoftKey standardKey, QWidget *actionWidget) { - const char* text = standardSoftKeyText(standardKey); - QAction *action = new QAction(QSoftKeyManager::tr(text), actionWidget); + QAction *action = new QAction(standardSoftKeyText(standardKey), actionWidget); QAction::SoftKeyRole softKeyRole = QAction::NoSoftKey; switch (standardKey) { case MenuSoftKey: // FALL-THROUGH diff --git a/src/gui/kernel/qsoftkeymanager_p.h b/src/gui/kernel/qsoftkeymanager_p.h index ce902fe..a6fe17e 100644 --- a/src/gui/kernel/qsoftkeymanager_p.h +++ b/src/gui/kernel/qsoftkeymanager_p.h @@ -87,6 +87,7 @@ public: static QAction *createAction(StandardSoftKey standardKey, QWidget *actionWidget); static QAction *createKeyedAction(StandardSoftKey standardKey, Qt::Key key, QWidget *actionWidget); + static QString standardSoftKeyText(StandardSoftKey standardKey); protected: bool event(QEvent *e); @@ -94,7 +95,6 @@ protected: private: QSoftKeyManager(); static QSoftKeyManager *instance(); - static const char *standardSoftKeyText(StandardSoftKey standardKey); bool appendSoftkeys(const QWidget &source, int level); QWidget *softkeySource(QWidget *previousSource, bool& recursiveMerging); bool handleUpdateSoftKeys(); diff --git a/src/gui/widgets/qcombobox.cpp b/src/gui/widgets/qcombobox.cpp index 72f32dc..585db70 100644 --- a/src/gui/widgets/qcombobox.cpp +++ b/src/gui/widgets/qcombobox.cpp @@ -607,7 +607,13 @@ void QComboBoxPrivateContainer::changeEvent(QEvent *e) view->setMouseTracking(combo->style()->styleHint(QStyle::SH_ComboBox_ListMouseTracking, &opt, combo) || combo->style()->styleHint(QStyle::SH_ComboBox_Popup, &opt, combo)); setFrameStyle(combo->style()->styleHint(QStyle::SH_ComboBox_PopupFrameStyle, &opt, combo)); +#ifdef QT_SOFTKEYS_ENABLED + } else if (e->type() == QEvent::LanguageChange) { + selectAction->setText(QSoftKeyManager::standardSoftKeyText(QSoftKeyManager::SelectSoftKey)); + cancelAction->setText(QSoftKeyManager::standardSoftKeyText(QSoftKeyManager::CancelSoftKey)); +#endif } + QWidget::changeEvent(e); } diff --git a/src/gui/widgets/qmainwindow.cpp b/src/gui/widgets/qmainwindow.cpp index 269cd12..e7c4f45 100644 --- a/src/gui/widgets/qmainwindow.cpp +++ b/src/gui/widgets/qmainwindow.cpp @@ -1426,6 +1426,11 @@ bool QMainWindow::event(QEvent *event) } break; #endif +#ifdef QT_SOFTKEYS_ENABLED + case QEvent::LanguageChange: + d->menuBarAction->setText(QSoftKeyManager::standardSoftKeyText(QSoftKeyManager::MenuSoftKey)); + break; +#endif default: break; } diff --git a/src/gui/widgets/qmenu.cpp b/src/gui/widgets/qmenu.cpp index 8ce7cc0..42b7406 100644 --- a/src/gui/widgets/qmenu.cpp +++ b/src/gui/widgets/qmenu.cpp @@ -117,7 +117,7 @@ public: if (parentWidget->parentWidget()) parentWidget = parentWidget->parentWidget(); setParent(parentWidget, Qt::Window | Qt::Tool); - setAttribute(Qt::WA_DeleteOnClose, true); + setAttribute(Qt::WA_DeleteOnClose, true); setAttribute(Qt::WA_X11NetWmWindowTypeMenu, true); setWindowTitle(p->windowTitle()); setEnabled(p->isEnabled()); @@ -1226,7 +1226,7 @@ void QMenu::initStyleOption(QStyleOptionMenuItem *option, const QAction *action) else if (action->isSeparator()) option->menuItemType = QStyleOptionMenuItem::Separator; else if (d->defaultAction == action) - option->menuItemType = QStyleOptionMenuItem::DefaultItem; + option->menuItemType = QStyleOptionMenuItem::DefaultItem; else option->menuItemType = QStyleOptionMenuItem::Normal; if (action->isIconVisibleInMenu()) @@ -1719,7 +1719,14 @@ bool QMenu::isEmpty() const void QMenu::clear() { QList<QAction*> acts = actions(); + for(int i = 0; i < acts.size(); i++) { +#ifdef QT_SOFTKEYS_ENABLED + Q_D(QMenu); + // Lets not touch to our internal softkey actions + if(acts[i] == d->selectAction || acts[i] == d->cancelAction) + continue; +#endif removeAction(acts[i]); if (acts[i]->parent() == this && acts[i]->d_func()->widgets.isEmpty()) delete acts[i]; @@ -2408,6 +2415,13 @@ QMenu::event(QEvent *e) } return true; #endif +#ifdef QT_SOFTKEYS_ENABLED + case QEvent::LanguageChange: { + d->selectAction->setText(QSoftKeyManager::standardSoftKeyText(QSoftKeyManager::SelectSoftKey)); + d->cancelAction->setText(QSoftKeyManager::standardSoftKeyText(QSoftKeyManager::CancelSoftKey)); + } + break; +#endif default: break; } @@ -2919,7 +2933,7 @@ void QMenu::actionEvent(QActionEvent *e) #endif if (isVisible()) { d->updateActionRects(); - resize(sizeHint()); + resize(sizeHint()); update(); } } |