summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qsoftkeymanager.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Support for new softkey in Symbian^3Titta Heikkala2011-03-311-0/+31
| | | | | | | | QSoftKeyManager maps the StandardSoftKey values to Symbian commands. This way the softkeys are using Symbian defined icons. Task-number: QT-4620 Reviewed-by: Sami Merila
* Update copyright year to 2011.Jason McDonald2011-01-101-1/+1
| | | | Reviewed-by: Trust Me
* Fix crash when handleCommand() called before softkeys are updatedJason Barron2010-07-071-0/+5
| | | | | | | | | | | | | | | | | | | Softkeys are updated via a compressable event that is posted via the event loop. Since these events are not delivered immediately, there is a chance that a call to handleCommand() could happen before the softkeys have been updated which can lead to a crash if the previous QAction's have been deleted already since the data structure used by QSoftKeyManager is outdated. The likeliness of this is increased by the fact that S60 commands are normally sent from the WSERV active object which has a higher priority than the active object used by Qt's event loop which means commands will preempt the event loop. The fix is to introduce a flag that keeps track of pending update requests and if a command is received while there are outstanding requests, force the softkeys to be updated before handling the command. Task-number: QT-3571 Reviewed-by: axis
* Improve handling of QAction in soft key managerThierry Bastian2010-04-131-8/+4
| | | | It also reduces QActionPrivate by 16 bytes.
* Fixed modal dialog not to have automatic "Exit" right softkey in S60.Janne Anttila2010-04-061-0/+1
| | | | | | | | | | | During softkey refactoring this piece of code get changes, but the changed code did not work correctly if window had no softkey actions. Switched back to old way where softkey source is stored to variable, and windowType is asked from stored variable. If softkey source is dialog or popup, "Exit" is not added automatically to RSK. Task-number: QT-2203 Reviewed-by: Sami Merila
* Hotfix to const usage in 262e98f9a29385f99cd6f768632264e0b621dc01Janne Anttila2010-03-231-3/+3
| | | | Reviewed-By: TrustMe
* Fixed S60 softkey implementation to use popup/modal dialog softkeys.Janne Anttila2010-03-231-7/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously softkey implementation assumed that source for softkey actions is focused widget or activewindow if there is no focused widget. Since for example pop-up menu does not take focus immediately in touch enabled devices, the underlying widget softkeys were visible and usable when menu was open. This lead to problem that underlying widget could be interacted via softkeys when popup menu was open. For example as reported in QTBUG-8688, it was possible to close the underlying filedialog from which the currently active context menu was launched. It was also possible to open "Options" menu of underlying widget when context menu was open, leading to situation where several context menus could be launched via "Actions" item of "Options" menu. This was reported as an issue: QTBUG-6167 In addition when user started navigating in context menu via keypad, the menu got focus and softkeys changed to partially correct. Only partially correct, since context menu "Select" action and "Options" action had same priority and both associated to LSK. In addition the context menu action "Cancel" associated to RSK was set to invisible, meaning that it was also disabled and appeared in sofkeys as dimmed. All of these issues were fixed by making making the popup and modal dialogs highest priority softkey source. In case the focused widget is inside popup or modal dialog it is being used as an initial softkey source. In addition the softkeys created with QSoftKeyManager::createAction or QSoftKeyManager::createKeyedAction are now by default invisible i.e. not visible in context menu and have special property set to make them still normally enabled in softkeys. Task-number: QTBUG-6167 Task-number: QTBUG-8688 Task-number: QTBUG-9144 Reviewed-by: Sami Merila
* Simplify code, fix a compiler warning... profit!João Abecasis2010-02-181-7/+5
| | | | | | | Well, it was a compiler warning on master... :-/ Reviewed-by: Janne Anttila Reviewed-by: axis
* Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into ↵Qt Continuous Integration System2010-02-181-1/+1
|\ | | | | | | | | | | | | | | | | | | 4.6-integration * '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-1: QNAM HTTP: Always set channel.reply to 0 when done Revert "Added note to make QList destructor virtual in version 5" Fix s390(x) atomic ops related crashes Fix undefined sequence point compiler warning
| * Fix undefined sequence point compiler warningDirk Mueller2010-02-171-1/+1
| | | | | | | | | | | | | | | | | | level = ++level is not guaranteed to work, as the increment is not required to happen before the assignment. Change this code to be less obscure and use standard defined behavior. Merge-request: 471 Reviewed-by: Thiago Macieira <thiago.macieira@nokia.com>
* | Support for dynamic localization in Symbian softkeys.Janne Anttila2010-02-171-9/+8
|/ | | | | | | | | | | This commit adds support for dynamic i.e. runtime localization of S60 softkeys. Note that translations are not provided yet with qt.sis (QTBUG-4919), meaning that localization does not actually happen unless application developer provides its own translation (including translation for softkeys). Task-number: QTBUG-6785 Reviewed-by: Jason Barron
* S60 softkey refactoring (support for merging, priorities and menus)Janne Anttila2010-02-031-139/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | Implemented features: Softkey Merging: Widget can set only one softkey and set flag that rest of the softkeys shall be taken from parent. Priority Handling: If multiple sokftkeys with same role are set, the highest priority action gets displayed. Custom Softkey Menu: By setting QMenu to QAction and assigning a softkey role for that action, the native menubar will be displayed when sofkey is clicked. Softkey Image: Initial code for implementing sofkey image support, the final implementation is still pending legal acceptance to use eiksoftkeyimage.h header file which is under EPL license. Task-number: QTBUG-7315 Review-By: Sami Merila Review-By: Jason Barron
* Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into ↵Qt Continuous Integration System2010-01-091-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4.6-integration * '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-1: (49 commits) Reverted two commits that were pushed to the wrong branch. Use the new QTextCodec api in the QXmlStreamWriter. Added new functions to QTextCodec that accept ConversionFlags. Fix passing of arguments to syncqt doc: Fixed typos. Fixes: Fix spinbox with NoButton style in QGtkStyle doc: Explained parameter value defaults where appropriate. Cocoa: Fix painting errors on QGLWidget resizing. Fix broken QGLWidget::renderPixmap on Mac/Carbon Fixes: Setting any style sheet breaks checkbox positioning Fixes: MenuItem size fixes and missing separator with Gtk+ Autotest: add a test for QNAM's HTTP cache handling code QNAM HTTP: just use the expirationDate in the code that validates the cache QNAM HTTP: change the caching semantics to match documentation QNAM HTTP: fix the caching algorithm from RFC 2616 Avoid repeatedly calling LookupAccountSid in QFSFileEngine::owner improve readability a bit more fix styling; improve readability make it possible to retrieve name of the user who owns the file Updated WebKit from /home/shausman/src/webkit/trunk to qtwebkit/qtwebkit-4.6 ( 99ccc1c3e4db5354246720f9b9aa3d282e64497d ) ...
| * Update copyright year to 2010Jason McDonald2010-01-061-1/+1
| | | | | | | | Reviewed-by: Trust Me
* | Added a flag to avoid construction of application panes.axis2010-01-081-1/+2
|/ | | | | | | | | This is purely an optimization for fullscreen-only apps. Task: QTBUG-6098 RevBy: Jason Barron RevBy: mread AutoTest: Included
* Minor fixes to softkey dimming support (commit 245c9cc0).Janne Anttila2009-12-081-1/+5
| | | | | | | | | | | | | In Qt invisible actions are disabled by default, and our "Options" softkey is set to invisible in order that it is not show in context menu. Thus we need don't want to dim in softkey even it is disabled. Additionally, QDialogButtonEnabledProxy need to set the initial enabled state for proxy action from button. Fixes bugs in commit: 245c9cc0 Reviewed-by: TrustMe
* Added dimming support for disabled softkeys in Symbian.Janne Anttila2009-12-071-1/+4
| | | | | | | | | | | | | If QAction::setEnabled(false) is called, the CBA buttons are dimmed to have visual indication about disabled state. Since enabled/disabled state of buttons in QDialogButtonBox is controlled via QPushButton::setEnabled API, and because button box content in Symbian is mapped to sofkkeys we also need to have proxy for button enabled state to forward the information for underlying QAction. Reviewed-by: Sami Merila
* Fixed "...QString::QString(const char *)... is deprecated" warning.Janne Anttila2009-12-031-1/+1
| | | | | Task-number: QTBUG-6290 Reviewed-by: TrustMe
* Fixed softkey merging/traversing over window boundaries.Janne Anttila2009-12-021-1/+1
| | | | | | | | | | | If current dialog implementation had parent and no softkeys set, the dialog got softkeys from parent. This commit changes the behaviour so that softkeys are not traversed over window boundaries. Also added autotest for the bug report. Task-number: QTBUG-6163 Reviewed-by: Jason Barron
* Softkeymanager to not update sofkeys when native s60 dialog is shownJason Barron2009-11-181-0/+4
| | | | | | | | Fixes Qt Bug: QTBUG-5788 Softkeys do not change to dialog specific ones when native S60 dialog is being opened on top of Qt application Initial-patch-by: Markus Nolvi Reviewed-by: axis
* Fix for qmessagebox softkey dimming in Symbian.Janne Anttila2009-11-111-1/+2
| | | | | | | | QMessageBox softkeys gets dimmed by TAknPopupFader since we currently have one global softkey instance. Task-number: QTBUG-5691 Reviewed-by: Jason Barron
* Focus changes cause softkey area to flickerSami Merilä2009-11-091-4/+8
| | | | | | | | | | | | | | | | | | | Current implementation of softkeys causes flicker, since it re-draws the softkeys for each event handled. First re-draw initializes the softkeys to empty ones, and second one draws the new updated softkeys onscreen. Due to initialization to empty softkey command set, AVKON cannot deduce if the needed redraw is necessary (AVKON does not redraw softkeys if the softkey commands and/or texts won't change). The fixed behaviour is that softkeys are set to -1 for each command when initializing, but no call to SetCommandSetL is done. Now, AVKON won't even try to draw the softkeys until we set the real command set later. Task-number: QTBUG-5436 Reviewed-by: Janne Anttila
* Merge commit 'ceteam/4.6' into 4.6Joerg Bornemann2009-11-091-0/+4
|\ | | | | | | | | Conflicts: dist/changes-4.6.0
| * compilefixes for qfeaturesThomas Hartmann2009-11-061-0/+4
| | | | | | | | Reviewed-by: Maurice
* | Revert "Fixed a crash in the QApplication autotest."Gareth Stockwell2009-11-031-2/+1
| | | | | | | | | | | | | | | | This reverts commit f3854db64bcaa0f26faf5ff1414d3b9ccfc00e35. It is replaced by 6a89291d. Reviewed-by: Janne Anttila
* | Merge branch '4.6' into mmfphononGareth Stockwell2009-11-031-3/+13
|\ \ | |/
| * Merge commit 'origin/4.6' into featureJørgen Lind2009-11-021-1/+9
| |\
| | * Fix for softkey visibility when dialog launched from fullscreen widget.Janne Anttila2009-10-291-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Softkeys should be always the topmost window in order to be visible. For example when QMessageBox is launched from fullscreen window, we need to make sure that softkey is located on top of window tree. Task-number: QTBUG-4953 Reviewed-by: Jason Barron
| | * Cleanup softkeymanager keyedactions hash when QAction is being deleted.Janne Anttila2009-10-271-1/+8
| | | | | | | | | | | | Reviewed-by: TrustMe
| * | Fix QT_NO_ACTION dependenciesJørgen Lind2009-10-291-1/+2
| |/ | | | | | | Reviewed-by: tom
| * Fixed a crash in the QApplication autotest.axis2009-10-261-1/+2
| | | | | | | | | | | | | | | | If there is no focusWidget at the time of the event delivery, we must ensure that we don't dereference a null pointer. RevBy: Jason Barron RevBy: Liang Qi
* | Fix for defect introduced by dd48c27fGareth Stockwell2009-11-031-1/+4
|/ | | | | | | | | | | | | | | This change causes some applications to crash due to a null pointer dereference in QSoftKeyManagerPrivate::updateSoftKeys_sys. f3854db6 fixes the crash, but introduces incorrect behaviour: the softkey labels are not updated. To see this: 1. Launch qmediaplayer 2. Open a video clip 3. Video clip starts playing but softkeys still have labels "Open" and "Cancel" Reviewed-by: Janne Anttila
* Softkeys should not put exit by default on RSK for dialogs and popups.Janne Anttila2009-10-231-1/+2
| | | | | | | | The idea is that softkeys and pop-ups need to take care of setting all softkeys by themselves. Task-number: QTBUG-4916 Reviewed-by: Jason Barron
* Softkeys remain disabled if action owning action widget is enabledSami Merilä2009-10-161-3/+3
| | | | | | | | | | | | | | Softkeys have a QAction that is related to some action widget. The initial state of the action was set according the state of action widget (enabled/disabled). Now, if action widget's state changes, the softkey's action remain in the initial state. This was fixed by removing the enable/disable from the QAction and instead use the real state of action widget when handling the command of softkey. Task-number: QTBUG-4619 Reviewed-by: Janne Anttila
* Workaround for softkeys not working in modal dialogs on S60 5.0Shane Kearns2009-10-091-0/+1
| | | | | | | | Set the softkey container window to be selectable even when pointer is grabbed (via window server setting) Task-number: QT-2203 Reviewed-by: Espen Riskedal
* Fixing warnings on GCC... (III)João Abecasis2009-10-071-2/+1
| | | | | | | ... by establishing a default behaviour for the switch statements that follow. Reviewed-by: Thierry Bastian
* Fix warnings on mingwThierry Bastian2009-10-011-0/+1
| | | | Reviewed-by: trust me
* Fix tr-Errors/remove QObject::tr(), mainly in ScriptToolsFriedemann Kleint2009-09-291-1/+1
| | | | | | Note: Those messages are to be translated in Qt 4.6 for the first time. Reviewed-by: Kent Hansen <khansen@trolltech.com>
* Triggering softkey action for disbled widget causes a crash.Sami Merilä2009-09-281-2/+5
| | | | | | | | | | Softkey actions need to copy enable state from action widget to prevent crash when action is triggered and action widget is disabled. OPEN: dynamically setting enable state for softkey actions. Task-number: QT-2117 Reviewed-by: Jason Barron
* Make sure the correct soft key is triggered.Jason Barron2009-09-281-3/+9
| | | | | | | | | In cases where there are both softkey actions as well as "normal" actions, we need to be sure to skip over the none softkey actions since they should not be a part of the softkey framework and the 'index' will be out of sync. Reviewed-by: Sami Merila
* Remove key accelerators from Softkeys and Menus in S60.Sami Merilä2009-09-221-2/+4
| | | | | | | | | In S60 softkeys and menu items do not support key accelerators (i.e. CTRL+X). Therefore, removing the accelerator characters from both softkey and menu item texts. Related to task QT-1505 "Make Qt dialogs look native" Reviewed by Jason Barron
* Compile fix for non-Symbian.Alessandro Portale2009-09-211-1/+1
| | | | | | updateSoftKeys_sys() is now a member of QSoftKeyManagerPrivate Reviewed-by: Jason Barron
* Get menubars working again with new softkey API.Jason Barron2009-09-211-1/+3
| | | | | | | | | | | | | | | | This is an unfortunate workaround to get the menu bars working again. Previously we used the soft key role to determine what action command we should use for the softkey. Now we only use the role to determine the position (as we should) and ideally the command would be determined by checking if the action has a menu() and then forcing the command to EAknSoftkeyOptions. This would have enabled any softkey with a menu to work, but unfortunately this would require considerable effort in the menu implementation and time is short. So the workaround is to abuse object name to tell the softkey system that this key is special and should get EAknSoftkeyOptions. Reviewed-by: Alessandro Portale
* Introduce MenuSoftKey as a standard key to the internal enum.Jason Barron2009-09-211-0/+4
| | | | | | | | QMainWindow was using the 'Done' standard softkey to represent the action for the menu bar, but that was obviously wrong and pointed out that one of hte needed standard softkeys was needed. Reviewed-by: Alessandro Portale
* Introduce a d-pointer to QSoftKeyManager.Jason Barron2009-09-211-13/+28
| | | | | | | | Originally this was supposed to be a mostly static API, but now it looks like some more non-static members will be needed so introduce a d-pointer to store them. Reviewed-by: Alessandro Portale
* Add a new compressable event QEvent::UpdateSoftKeys.Jason Barron2009-09-211-22/+30
| | | | | | | | | | | Now that the softkey framework triggers updates on focus changed, window activated, and action added/removed/changed the softkey bar was updating many times resulting in flicker. Solve that by introducing a new event type that is posted to the softkey framework. Since we only need to update the softkeys once per event loop iteration, the event is compressible in the event loop. Reviewed-by: Alessandro Portale
* Simplify the soft key roles of QAction.Jason Barron2009-09-211-51/+28
| | | | | | | | | | | | | | | | | | | | | | | Previously there were many options here that were inherited from the Qtopia implementation. It was not clear to developers which value they actually should use. A good example was the 'Next' value. In a typical wizard application, next would be on the right and 'Previous' would be on the left. However, it is also common to have 'Next' on the left and have 'Cancel' on the right. Basically what people really wanted was a way to explicitly set the right and left soft keys, but since this relies on form factor and is wrong if the screen is rotated, we choose positive and negative actions as the values for these such that they still make sense when the screen is rotated. Also this helps people who don't know if a particular action should be on the left or right, but they *do* know if their action has destructive characterisitics (negative). As a convenience for widgets in Qt that use softkeys, we create a standard softkey enumeration. That maps the actions to the correct role and has default text. Reviewed-by: Alessandro Portale
* Refactor soft keys implementation.Jason Barron2009-09-211-0/+260
Reviewed-by: Alessandro Portale Squashed commit of the following: commit dae5eda6996d48c12c4a5efd3f6042eb293bacbf Author: Jason Barron <jbarron@trolltech.com> Date: Fri Sep 18 10:32:26 2009 +0200 Only update soft keys when KEYPAD_NAVIGATION is enabled. For 4.6, let's just call these functions when keypad navigation is defined to minimize the impact on other platforms. They should probably get thier own define some day. commit 30a730553531f0f138de5eddb30413936a34fa36 Author: Jason Barron <jbarron@trolltech.com> Date: Fri Sep 18 10:30:23 2009 +0200 Add/remove the menu bar action when menu bar is added/removed. commit a83343a2870b34c228c8bc5e6274607b0e97baf6 Author: Jason Barron <jbarron@trolltech.com> Date: Fri Sep 18 10:28:55 2009 +0200 Compile fix for other platforms commit 39c9e3a0a1d3d62bf6ebd3212cfd2a81b86b9b2a Author: Jason Barron <jbarron@trolltech.com> Date: Thu Sep 17 21:37:59 2009 +0200 Fix 'softkeys' example after API re-factoring. Clean up this example and use the simplified soft key API. Now the actions are only allocated in the constructor and dynamically updated by calling addAction and removeAction. commit 314e45c33f40552db74e61755c2a3b0f8c77a41a Author: Jason Barron <jbarron@trolltech.com> Date: Thu Sep 17 21:30:32 2009 +0200 Re-factor and simplify the soft keys API. Several things here: - Move all the logic into QSoftKeyManager - Move the files into 'kernel' since it is not a widget - Remove QWidget::setSoftKey*(). Use addAction/removeAction instead - Made soft keys update on focus, window activation, and action changes. - Fixed several memory leaks where QAction's were created too often - QAction ownership pushed out to widget's - Added Select/Cancel soft keys for comboboxes and menus to be more consistent to platform look-and-feel. commit fb4c240d970262e9872dc5737df6808879143c75 Author: Jason Barron <jbarron@trolltech.com> Date: Mon Sep 7 15:49:31 2009 +0200 Merge the Symbian implementation with the other platforms nativeMenuBar It seems this has been refactored to share more code across the various platforms that support native menubars so the Symbian code can be mostly removed. commit aa55e4bcd1f009ab35c9519e18aa325fd212dd23 Author: Jason Barron <jbarron@trolltech.com> Date: Wed Aug 26 17:00:34 2009 +0200 Change filenames and move softkey stuff from 'widgets' to 'kernel'. This thing isn't a widget and therefore should not be in the 'widgets' subdirectory of gui. Also rename the files in preparation for refactoring and extending.