Re: [SailfishDevel] qml dbus send SMS

2015-03-18 Thread Roland Whitehead
On Tue, 17 Mar 2015 at 20:20:06, Michael Fuchs wrote:

> This is exactly what the dbus call does.
> But your approach looks simpler, will try this one as well.

I wrote a nasty shell script to send SMS so that I could do so from my
desktop over ssh. There might be some nuggets there that might help with
your project. Serveral people have also raised other questions and
there's an alternate script. There is no hope that anything based on my
script would ever get into Harbour so don't bother trying - it's a hack!
I'm sure you will write something much better.

https://together.jolla.com/question/17992/sending-an-sms-via-the-command-line/


Roland
-- 
QURU Ltd, London
___
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org

Re: [SailfishDevel] (no subject)

2015-03-18 Thread Luciano Montanaro
Well, I am no expert on SDL. But apparently there should be a way to
set orientation on wayland.

The SDL_waylandwindow.h

shows there is a qt_extended_surface pointer in the SDL_WindowData
structure, which is used by the
qt_extended_surface_set_content_orientation(struct qt_extended_surface
*qt_extended_surface, int32_t orientation);

function. So if you manage to create your surface, and get the
extended_surface pointer, you should be able to set the orientation as
well as add listeners for events.

If you manage to get this working, please create a guide about it somewhere.

Luciano

On Wed, Mar 18, 2015 at 11:18 AM, Iosif Hamlatzis  wrote:
> Regarding the orientation it's not something I can patch and submit, it's a
> thing for Jolla since it has to do with the video driver.
>
> Looking at the code of SDL2, I would say the hint for the orientation is iOS
> specific:
> From the SDL_hints.h
>
> /**
>  *  \brief  A variable controlling which orientations are allowed on iOS.
>  *
>  *  In some circumstances it is necessary to be able to explicitly control
>  *  which UI orientations are allowed.
>  *
>  *  This variable is a space delimited list of the following values:
>  *"LandscapeLeft", "LandscapeRight", "Portrait" "PortraitUpsideDown"
>  */
> #define SDL_HINT_ORIENTATIONS "SDL_IOS_ORIENTATIONS"
>
>
>
> And besides, if the system doesn't understand that I have rotated the device
> I cannot do much in my game to modify the behaviour of "the go to
> background" or "close" swipe.
>
> From previous emails I and others were given as a solution to the rotation
> problem that we should do the math in our rendering functions as well as the
> rotation and transformation for the touch events. So I did and my games work
> perfectly on my device.
>
> I was happy to learn that problems they had in their system regarding the
> SDL2 library were fixed and now they could accept games in the market
> (previously my games were rejected because they didn't accept the SDL2
> library) and now I get my games again rejected not because of my fault, but
> because they cannot handle the rotation, even if I am using a solution they
> provided.
>
> I believe most games would be in landscape mode and not portrait, at least
> mine are. So I would wait either for a solution from them or if they start
> accepting games with different swipe gestures for "go to background" and
> "close".
>
> And hopefully in the tablet version the default would be landscape mode.
> I'll port the rest of the games to SailfishOS and have them ready for when
> and if the problem has been fixed.
>
>
>
>
> ___
> SailfishOS.org Devel mailing list
> To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org



-- 
Luciano Montanaro

Anyone who is capable of getting themselves made President should on
no account be allowed to do the job. -- Douglas Adams
___
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org


[SailfishDevel] qml dbus send SMS

2015-03-18 Thread Michael Fuchs
Hi there,

this is my first post in this list, so hello to everyone.

I want to write a small App, which helps writing SMS for booking a parking 
ticket in Vienna/Austria and later other cities as well.

As i read the recommended way for sending messages from qml is using 
dbus. I found this command for the command line, which works:

$ dbus-send --type=method_call --dest=org.nemomobile.qmlmessages / \
 org.nemomobile.qmlmessages.startSMS array:string:"+358123456" \
string:"Hello world"

dbus-monitor shows:
method call sender=:1.41 -> dest=org.nemomobile.qmlmessages serial=2
   path=/; interface=org.nemomobile.qmlmessages; member=startSMS
   array [
  string "+358123456"
   ]
  string "Hello world"


So in qml I made a 

DBusInterface {
id: smsIf
service: "org.nemomobile.qmlmessages"
iface: "org.nemomobile.qmlmessages"
path: "/"
}

and called the method

smsIf.call("startSMS", [[""], "smsText.text"])

The output of dbus-monitor say "no such method".

method call sender=:1.39 -> dest=org.nemomobile.qmlmessages serial=7 path=/; 
interface=org.nemomobile.qmlmessages; member=startSMS
   array [
  variant  string "+12312312312"
   ]
   string "Hello World"
error sender=:1.32 -> dest=:1.39 
error_name=org.freedesktop.DBus.Error.UnknownMethod reply_serial=7
   string "No such method 'startSMS' in interface 'org.nemomobile.qmlmessages' 
at object path '/' (signature 'avs')"

Is it just the wrong type of the first argument?
But how can I pass the proper type? (Array of strings)
Or is ther some general error?

Thanks for your help,

Michael.

___
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org


Re: [SailfishDevel] qml dbus send SMS

2015-03-18 Thread Michael Fuchs
This is exactly what the dbus call does.
But your approach looks simpler, will try this one as well.


On Tuesday 17 March 2015 19:16:20 Jonni Rainisto wrote:
> Just a reminder to people that harbour QA will most likely reject
> applications that send sms messages through dbus without opening official
> sms application. As recomended way is to open sms application with sms: tag
> (mailto: for email) where user can press send button himself. Like
> Qt.openUrlExternally("sms:123456789?body=XXX")
> 
> But ofcourse if your not aiming for harbour and are targeting openrepos then
> you can ignore that.
> 
> re, Jonni
> 
> From: devel-boun...@lists.sailfishos.org
> [devel-boun...@lists.sailfishos.org] on behalf of Michael Fuchs
> [mic...@gmx.at] Sent: Tuesday, March 17, 2015 8:49 PM
> To: devel@lists.sailfishos.org
> Subject: [SailfishDevel] qml dbus send SMS
> 
> Hi there,
> 
> this is my first post in this list, so hello to everyone.
> 
> I want to write a small App, which helps writing SMS for booking a parking
> ticket in Vienna/Austria and later other cities as well.
> 
> As i read the recommended way for sending messages from qml is using
> dbus. I found this command for the command line, which works:
> 
> $ dbus-send --type=method_call --dest=org.nemomobile.qmlmessages / \
>  org.nemomobile.qmlmessages.startSMS array:string:"+358123456" \
> string:"Hello world"
> 
> dbus-monitor shows:
> method call sender=:1.41 -> dest=org.nemomobile.qmlmessages serial=2
>path=/; interface=org.nemomobile.qmlmessages; member=startSMS
>array [
>   string "+358123456"
>]
>   string "Hello world"
> 
> 
> So in qml I made a
> 
> DBusInterface {
> id: smsIf
> service: "org.nemomobile.qmlmessages"
> iface: "org.nemomobile.qmlmessages"
> path: "/"
> }
> 
> and called the method
> 
> smsIf.call("startSMS", [[""], "smsText.text"])
> 
> The output of dbus-monitor say "no such method".
> 
> method call sender=:1.39 -> dest=org.nemomobile.qmlmessages serial=7 path=/;
> interface=org.nemomobile.qmlmessages; member=startSMS
>array [
>   variant  string "+12312312312"
>]
>string "Hello World"
> error sender=:1.32 -> dest=:1.39
> error_name=org.freedesktop.DBus.Error.UnknownMethod reply_serial=7
>string "No such method 'startSMS' in interface
> 'org.nemomobile.qmlmessages' at object path '/' (signature 'avs')"
> 
> Is it just the wrong type of the first argument?
> But how can I pass the proper type? (Array of strings)
> Or is ther some general error?
> 
> Thanks for your help,
> 
> Michael.
> ___
> SailfishOS.org Devel mailing list
> To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org
> ___
> SailfishOS.org Devel mailing list
> To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org
___
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org


Re: [SailfishDevel] (no subject)

2015-03-18 Thread Iosif Hamlatzis
Regarding the orientation it's not something I can patch and submit, it's a
thing for Jolla since it has to do with the video driver.

Looking at the code of SDL2, I would say the hint for the orientation is
iOS specific:
>From the SDL_hints.h

/**
 *  \brief  A variable controlling which orientations are allowed on iOS.
 *
 *  In some circumstances it is necessary to be able to explicitly control
 *  which UI orientations are allowed.
 *
 *  This variable is a space delimited list of the following values:
 *"LandscapeLeft", "LandscapeRight", "Portrait" "PortraitUpsideDown"
 */
#define SDL_HINT_ORIENTATIONS "SDL_IOS_ORIENTATIONS"



And besides, if the system doesn't understand that I have rotated the
device I cannot do much in my game to modify the behaviour of "the go to
background" or "close" swipe.

>From previous emails I and others were given as a solution to the rotation
problem that we should do the math in our rendering functions as well as
the rotation and transformation for the touch events. So I did and my games
work perfectly on my device.

I was happy to learn that problems they had in their system regarding the
SDL2 library were fixed and now they could accept games in the market
(previously my games were rejected because they didn't accept the SDL2
library) and now I get my games again rejected not because of my fault, but
because they cannot handle the rotation, even if I am using a solution they
provided.

I believe most games would be in landscape mode and not portrait, at least
mine are. So I would wait either for a solution from them or if they start
accepting games with different swipe gestures for "go to background" and
"close".

And hopefully in the tablet version the default would be landscape mode.
I'll port the rest of the games to SailfishOS and have them ready for when
and if the problem has been fixed.
___
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org