set softkeys on qt for symbian - qt

On E63 or similar smart phones,there can be three softkeys(the left and right one always named "OK" or "Cancel" and the middle one always named "Select" or 'Query" alike actions' name) on the screen.QAction has this method:
void setSoftKeyRole ( SoftKeyRole softKeyRole )
,and SoftKeyRole goes these descriptions:
QAction::NoSoftKey 0 This action should not be used as a softkey
QAction::PositiveSoftKey 1 This action is used to describe a softkey with a positive or non-destructive role such as Ok, Select, or Options.
QAction::NegativeSoftKey 2 This action is used to describe a softkey with a negative or destructive role role such as Cancel, Discard, or Close.
QAction::SelectSoftKey 3 This action is used to describe a role that selects a particular item or widget in the application.
I have used PositiveSoftKeys and NegativeSoftKey to set the left and right softkey,but I can never do SelectSoftKey to the middle one?I found nothing related to this on qt bug repository.What I want to do is make full use of the three softkeys on most smartphones.Can anybody figure out what happened?Thanks always.

E63 does not have a touch screen,and it seems only smart phones with a touch screen(Nokia series) can set SelectSoftKey to the middle one.

Related

How to catch click to dial events in Unified Service Desk?

The event raised by clicking on a phone number will either be of the form "tel:" or "skype:". Here are the steps I've followed so far to enable a window navigation rule to capture the event, and I've attached events to the rule to actually see the action get fired in the Debugger. Still, even with navigation rules set to capture tel: and skype:, the action will never fire in USD Debugger. Here is the general approach I've used so far (From another post):
Create a Windownavigation rule.
Don't put anything into the entity Settings but put "tel:" or "skype:" into the URL TextBox.
Routetype will be Popup
Target will be Tab (or registercard, at least I think that's the name for it in english - I'm using a german one)
Define None as Action in result for your Windownavigationrule
Create your own Action to resolve when the Navigation rule is triggered
Set your own hosted control (In this case I use the CTIConnector class.)
Define an Actionname for your Action that will be exectued (I named it "MakeCall" in CRM)
Set Data to [[SUBJECTURL]] so the URL ist given to the Action als Parameter.
Override the method DoAction from your hosted control
Just 2 -3 points to verify.
Do you have a UII action with the name "MakeCall"? If that is there then only your code will be triggered from DoAction.
In case, if you have above in place please check whether your action calls and other records are added to the respective configuration reocrd?

Add custom text to AX 2012 drill-down links

I want to customize the standard drill-down functionality and add a text parameter to the drill-down URL. I will then parse and use the parameter in the SysStartUpCmdDrillDown or EventDrillDownPoller class like the solution provided by Jan B. Kjeldsen in this question.
The standard drill-down link is dynamics://Target/?DrillDown_RecID/ :
dynamics://0/?DrillDown_5637230378/
In previous versions of AX it was possible to modify the RecId to custom text and parse the text once the client is started:
dynamics://0/?DrillDown_0MenuItemName=PurchTable&FieldName=PurchId&FieldValue=P000044
Unfortunately, in AX 2012 the RecId is checked before the client is started and if it is not a valid int64, the drill-down event is not sent to the client. Since it is not possible to change the RecId to anything other than an integer, #Alex Kwitny suggested in the comments at that same question that you can add the custom text to the drill-down target like this:
dynamics://0MenuItemName=PurchTable/?DrillDown_5637230378/
The problem I experience with this is that the link now gets confused about which instance to start.
If the target is equal to the value in the System Admin -> system parameters -> Alerts ->Drill-down target, a client with the correct server instance is started. When I append the text with my custom text, it always starts the default instance(Which could be different from the instance I intended to start). While this is not ideal, I could work around this issue.
The bigger problem is that it now always starts a new session of the default instance, even if a client session is already started. As far as I can see I cannot write X++ code to solve this issue since the server instance is determined before any code in the client is executed.
My question is this - How can I add custom text to the drill-down link while preserving the way the client instance is started: If a client for the instance is already open, it should process the link in the open client, and not start up a new client of the default instance.
You should probably come up with another solution as mentioned in this post, but there could still be a way.
The URL has two objects that can be modified:
dynamics://[Drill-down target(str)]/?Drilldown_[Int64]
According to you, if you modify the [Drill-down target], then it launches AX using the default client config, and that is behavior that you don't want. If you have a matching [Drill-down target], it'll launch in the open client window, which is behavior I can't confirm, but I'll take it at face value and assume you're correct.
So that means the only thing you can modify in the URL is [int64]. This is actually a string that is converted to an int64 via str2int64(...), which in turn corresponds to a RecId. This is where it gets interesting.
This work all happens in \Classes\SysStartUpCmdDrillDown\infoRun.
Well, lucky for you the ranges for the objects are:
RecId - 0 to 9223372036854775807
Int64 - -9223372036854775808 to 9223372036854775807
You can call minRecId() and maxRecId() to confirm this.
So this means you have -9223372036854775808 to -1 numbers to work with by calling URLs in this range:
dynamics://0/?DrillDown_-1
to
dynamics://0/?DrillDown_-9223372036854775808
Then you would modify \Classes\SysStartUpCmdDrillDown\infoRun to look for negative numbers, and fork to your custom code.
HOW you decide to user these negative #'s is up to you. You can have the first n-digits be a table id or a look-up value for a custom table. You can't technically use a RecId as part of that negative number because in theory the RecId could get up that high (minus 1).

List of Soundcloud iframe parameters?

I'm working on a CMS, and want to let users embed Soundcloud tunes and playlists.
I'd like to avoid fiddling with the API - since it doesn't appear to be necessary: )
Instead I just piece together an iframe-src-url with the appropriate parameters.
I was unable to find an official list anywhere, so I've collected my own, from various posts here and elsewhere:
&color=FF4444 // play-button and equalizer graphic (if not &visual=true)
&auto_play=false // shouls be obvious
&show_artwork=true // show the artist-graphic on the left
&show_comments=true // show fans commenst under equalizer
&show_playcount=true // number of times played # bottom right
&hide_related=true // don't force user over to Soundcloud after play
&show_user=false // don't show uploaders name # top left
&show_reposts=false // ?
&liking=fals‌​e // dont show [Like] button
&visual=true // use artist-graphic for background (way cooler)
&buying=false // no Buy (iTunes) button
&sharing=false // no [Share] button
&download=false // no download button
&start_track=4 // start at specific track (for lists)
And guesed : )
&following=false (removes [Follow] when mouseover artwork)
What parameters am I missing?
What I really want is Next and Previous buttons for lists. Do they even exist?
You're missing:
download=true // Show/hide download buttons
sharing=true // Show/hide share buttons/dialogues
start_track=0 // Preselects a track in the playlist, given a number between 0 and the length of the playlist.
Found in the docs.
It looks like next() and prev() and skip(index) are all methods on the widget rather than parameters. You can get around this by keeping an index of the current track and pass in a value to the start_track parameter as a way to get to the next and previous tracks.

What is the most efficient way of filling in details on a web form?

Take a standard web page with lots of text fields, drop downs etc.
What is the most efficient way in webdriver to fill out the values and then verify if the values have been entered correctly.
You only have to test that the values are entered correctly if you have some javascript validation or other magic happening at your input fields. You don't want to test that webdriver/selenium works correctly.
There are various ways, depending if you want to use webdriver or selenium. Here is a potpourri of the stuff I'm using.
Assert.assertEquals("input field must be empty", "", selenium.getValue("name=model.query"));
driver.findElement(By.name("model.query")).sendKeys("Testinput");
//here you have to wait for javascript to finish. E.g wait for a css Class or id to appear
Assert.assertEquals("Testinput", selenium.getValue("name=model.query"));
With webdriver only:
WebElement inputElement = driver.findElement(By.id("input_field_1"));
inputElement.clear();
inputElement.sendKeys("12");
//here you have to wait for javascript to finish. E.g wait for a css Class or id to appear
Assert.assertEquals("12", inputElement.getAttribute("value"));
Hopefully, the results of filling out your form are visible to the user in some manner. So you could think along these BDD-esque lines:
When I create a new movie
Then I should see my movie page
That is, your "new movie" steps would do the field entry & submit. And your "Then" would assert that the movie shows up with your entered data.
element = driver.find_element(:id, "movie_title")
element.send_keys 'The Good, the Bad, the Ugly'
# etc.
driver.find_element(:id, "submit").click
I'm just dabbling in this now, but this is what I came up with so far. It certainly seems more verbose than something like Capybara:
fill_in 'movie_title', :with => 'The Good, the Bad, the Ugly'
Hope this helps.

X11: How do I REALLY grab the mouse pointer?

I've implemented a horizontal splitter widget in Xlib. I'm trying to grab the mouse when the user clicks & drags on the splitter bar (so that the user can dynamically move the split & thus resize the windows on either side of the splitter bar).
I've used XGrabPointer() after receiving a left click, in hopes that all future mouse motion (dragging) will be diverted to the splitter window until the left button is released.
Unfortuntately, it doesn't seem to work like that. If the user drags too quickly and the mouse pointer enters one of the windows on either side of the split, the MotionEvent messages are diverted to that (child) window rather than the splitter window.
What have I done wrong? My XGrabPointer() call is as follows:
::XGrabPointer(mDisplay, window, True,
ButtonPressMask |
ButtonReleaseMask |
PointerMotionMask |
FocusChangeMask |
EnterWindowMask |
LeaveWindowMask,
GrabModeAsync,
GrabModeAsync,
RootWindow(mDisplay, DefaultScreen(mDisplay)),
None,
CurrentTime);
I'm almost embarrassed to admit this, but the answer turned out to be as simple as changing that third parameter (owner_events) from True to False.
From the Xlib tutorial/reference at tronche.com:
If owner_events is False, all generated pointer events are reported with respect to grab_window and are reported only if selected by event_mask. If owner_events is True and if a generated pointer event would normally be reported to this client, it is reported as usual. Otherwise, the event is reported with respect to the grab_window and is reported only if selected by event_mask.
I'm still not sure I completely understand the behavior of the True case, but my interpretation is that if True, other X programs (that is, windows created by other processes) are barred from receiving XEvents, but those that would hit any window created by your process are delivered as normal. In the false case, all events are reported with respect to the specific window you have selected. This was the behavior I was after.

Resources