Re: [SailfishDevel] qml dbus send SMS

2015-03-17 Thread Alfonso Martone
If you use a shell to execute dbus-send, you may need to quote the
"quoted" message string. Here this works for me from command-line (note
that this does not update the database of SMS messages and does not let
you know if it was actually sent):

dbus-send --system --print-reply --dest=org.ofono /ril_0
org.ofono.MessageManager.SendMessage string:"+39347347347347"
'string:"This is an SMS message #OMG 2+2=4"'


___
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-17 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] qml dbus send SMS

2015-03-17 Thread Jonni Rainisto
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


Re: [SailfishDevel] qml dbus send SMS

2015-03-17 Thread Michael Fuchs
On Wednesday 18 March 2015 00:05:55 Andrey Kozhevnikov wrote:
> smsIf.typedCall("startSMS", [{"type":"as", "value":[""]}, {"type":"s", 
> "value":smsText.text}])

Thanks, that works.
I was already close to this one, but didnt find out, how to define  an array 
of strings.


___
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-17 Thread Andrey Kozhevnikov

you need to use different method:

smsIf.typedCall("startSMS", [{"type":"as", "value":[""]}, {"type":"s", 
"value":smsText.text}])


17.03.2015 23:49, 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


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

Re: [SailfishDevel] Update previous page

2015-03-17 Thread Alejandro Exojo
El Tuesday 17 March 2015, Chris Walker escribió:
> The problems for me are 1) I need to attach models to lots of the
> tables in the CAMRA database file and I struggle with models, and 2) I
> cannot make the app connect to two databases. In doing item 1, I would
> also want the app to update a previous page, much as Florian does.

There are some Sailfish specific issues that you might have. I struggled a bit 
in making Page navigation more or less elegant, since drilling down some 
structure and pushing and popping pages is not that declarative, and I wasn't 
that experienced with QML. Here, I would not mind extra documentation about 
the Sailfish components (although isn't that necessary, I think it is well 
documented in general, provided that you know Qt, or course).

But for 1, you should just search about it in the Qt normal sources. The Model 
View Framework is extensively documented, and there are videos with full 
training sessions recorded:

http://doc.qt.io/qt-5/model-view-programming.html
https://www.youtube.com/watch?v=N4X8oLgVORY
https://www.youtube.com/watch?v=1yppMnwshsk

-- 
Alex (a.k.a. suy) | GPG ID 0x0B8B0BC2
http://barnacity.net/ | http://disperso.net
___
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org

[SailfishDevel] qml dbus send SMS

2015-03-17 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] Update previous page

2015-03-17 Thread Chris Walker
On Tue, 17 Mar 2015 19:16:53 +0500
Andrey Kozhevnikov  wrote:

> No, you wrong. In your link read " Connecting Signals to Methods and 
> Signals".
> 
> 17.03.2015 19:11, Florian Desneux пишет:
> > Great news: I succeed it :) Thanks Andrey!
> >
> > Side note: dialog.readPropertyChanged should be 
> > dialog.*_on_*ReadPropertyChanged (see 
> > http://doc.qt.io/qt-5/qtqml-syntax-signals.html) for people who
> > want to achieve this in the future.

Can I make a request? How about one of you clever people writing a full
tutorial online to which people like me that don't fully grasp things
like models and signals can ask questions?

For example, I want to write a beer app (I have one which works but
isn't comprehensive enough) which takes a supplied database (it comes
from a UK organisation called CAMRA) and have my own database record
things like 'Yes, I've drunk that beer' and in a separate app (the
CAMRA app which runs on Android but is hideous, records all those things
within one app) record the pub in which I drank that beer.

The problems for me are 1) I need to attach models to lots of the
tables in the CAMRA database file and I struggle with models, and 2) I
cannot make the app connect to two databases. In doing item 1, I would
also want the app to update a previous page, much as Florian does.

Of course if that same clever person were to offer to write the whole
thing for me I wouldn't say no :-)
___
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org

Re: [SailfishDevel] Update previous page

2015-03-17 Thread Andrey Kozhevnikov
No, you wrong. In your link read " Connecting Signals to Methods and 
Signals".


17.03.2015 19:11, Florian Desneux пишет:

Great news: I succeed it :) Thanks Andrey!

Side note: dialog.readPropertyChanged should be 
dialog.*_on_*ReadPropertyChanged (see 
http://doc.qt.io/qt-5/qtqml-syntax-signals.html) for people who want 
to achieve this in the future.


2015-03-17 14:07 GMT+01:00 Florian Desneux >:


I'm afraid I don't understand or I'm doing my stuff in the wrong
way...

I think I must read some documentation about signal...

Andrey: Your example suggests that I need a property readProperty
on my 3th page and connect it to a signal still on my 3th page so
my second page is aware if the change? No clue on how to do this
but I will have a read :)

Thanks

2015-03-17 13:23 GMT+01:00 François mailto:daithe...@free.fr>>:

Hi Florian,

When you mark a file as read, your model should be updated and
the list on the previous page should be updated accordingly
(this is done automatically).

Hope this can help you.

À mar. mars 17 13:01:04 2015 GMT+0100, Florian Desneux a écrit :
> Hello,
>
> I'm wondering how can I refresh the page when the little
white round in the
> corner is clicked or a swipe left to right from the corner
is triggered?
>
> Meaning: I'm on my 3th app page, I trigger an action (i.e.
mark as read the
> file), I go back to my 2th page on which there is a list of
files. How can
> I update the list's item (the file) so it's displayed as
'read' (i.e. with
> an eye icon)?
>
> Summary: How can I pass back some properties? (Those three
questions are
> the same ;) ).
>
> Regards,
> --
> *Florian Desneux*
>

--
François
Envoyé depuis mon Jolla
___
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to
devel-unsubscr...@lists.sailfishos.org





-- 
*Florian Desneux*





--
*Florian Desneux*


___
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] Update previous page

2015-03-17 Thread Florian Desneux
Great news: I succeed it :) Thanks Andrey!

Side note: dialog.readPropertyChanged should be dialog.*on*ReadPropertyChanged
(see http://doc.qt.io/qt-5/qtqml-syntax-signals.html) for people who want
to achieve this in the future.

2015-03-17 14:07 GMT+01:00 Florian Desneux :

> I'm afraid I don't understand or I'm doing my stuff in the wrong way...
>
> I think I must read some documentation about signal...
>
> Andrey: Your example suggests that I need a property readProperty on my
> 3th page and connect it to a signal still on my 3th page so my second page
> is aware if the change? No clue on how to do this but I will have a read :)
>
> Thanks
>
> 2015-03-17 13:23 GMT+01:00 François :
>
>> Hi Florian,
>>
>> When you mark a file as read, your model should be updated and the list
>> on the previous page should be updated accordingly (this is done
>> automatically).
>>
>> Hope this can help you.
>>
>> À mar. mars 17 13:01:04 2015 GMT+0100, Florian Desneux a écrit :
>> > Hello,
>> >
>> > I'm wondering how can I refresh the page when the little white round in
>> the
>> > corner is clicked or a swipe left to right from the corner is triggered?
>> >
>> > Meaning: I'm on my 3th app page, I trigger an action (i.e. mark as read
>> the
>> > file), I go back to my 2th page on which there is a list of files. How
>> can
>> > I update the list's item (the file) so it's displayed as 'read' (i.e.
>> with
>> > an eye icon)?
>> >
>> > Summary: How can I pass back some properties? (Those three questions are
>> > the same ;) ).
>> >
>> > Regards,
>> > --
>> > *Florian Desneux*
>> >
>>
>> --
>> François
>> Envoyé depuis mon Jolla
>> ___
>> SailfishOS.org Devel mailing list
>> To unsubscribe, please send a mail to
>> devel-unsubscr...@lists.sailfishos.org
>>
>
>
>
> --
> *Florian Desneux*
>



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

Re: [SailfishDevel] Update previous page

2015-03-17 Thread Florian Desneux
I'm afraid I don't understand or I'm doing my stuff in the wrong way...

I think I must read some documentation about signal...

Andrey: Your example suggests that I need a property readProperty on my 3th
page and connect it to a signal still on my 3th page so my second page is
aware if the change? No clue on how to do this but I will have a read :)

Thanks

2015-03-17 13:23 GMT+01:00 François :

> Hi Florian,
>
> When you mark a file as read, your model should be updated and the list on
> the previous page should be updated accordingly (this is done
> automatically).
>
> Hope this can help you.
>
> À mar. mars 17 13:01:04 2015 GMT+0100, Florian Desneux a écrit :
> > Hello,
> >
> > I'm wondering how can I refresh the page when the little white round in
> the
> > corner is clicked or a swipe left to right from the corner is triggered?
> >
> > Meaning: I'm on my 3th app page, I trigger an action (i.e. mark as read
> the
> > file), I go back to my 2th page on which there is a list of files. How
> can
> > I update the list's item (the file) so it's displayed as 'read' (i.e.
> with
> > an eye icon)?
> >
> > Summary: How can I pass back some properties? (Those three questions are
> > the same ;) ).
> >
> > Regards,
> > --
> > *Florian Desneux*
> >
>
> --
> François
> Envoyé depuis mon Jolla
> ___
> SailfishOS.org Devel mailing list
> To unsubscribe, please send a mail to
> devel-unsubscr...@lists.sailfishos.org
>



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

Re: [SailfishDevel] Update previous page

2015-03-17 Thread François
Hi Florian,

When you mark a file as read, your model should be updated and the list on the 
previous page should be updated accordingly (this is done automatically). 

Hope this can help you. 

À mar. mars 17 13:01:04 2015 GMT+0100, Florian Desneux a écrit :
> Hello,
> 
> I'm wondering how can I refresh the page when the little white round in the
> corner is clicked or a swipe left to right from the corner is triggered?
> 
> Meaning: I'm on my 3th app page, I trigger an action (i.e. mark as read the
> file), I go back to my 2th page on which there is a list of files. How can
> I update the list's item (the file) so it's displayed as 'read' (i.e. with
> an eye icon)?
> 
> Summary: How can I pass back some properties? (Those three questions are
> the same ;) ).
> 
> Regards,
> -- 
> *Florian Desneux*
>

-- 
François 
Envoyé depuis mon Jolla
___
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org

Re: [SailfishDevel] Update previous page

2015-03-17 Thread Andrey Kozhevnikov
pageStack.push returning you page object, so you can interact with it. 
for example:


var dialog = pageStack.push(Qt.resolvedUrl("SomeDialog.qml"))
dialog.readPropertyChanged.connect(function() { 
markAsRead(dialog.readProperty) })


or you can use signal inside your page instead of property.

17.03.2015 17:01, Florian Desneux пишет:

Hello,

I'm wondering how can I refresh the page when the little white round 
in the corner is clicked or a swipe left to right from the corner is 
triggered?


Meaning: I'm on my 3th app page, I trigger an action (i.e. mark as 
read the file), I go back to my 2th page on which there is a list of 
files. How can I update the list's item (the file) so it's displayed 
as 'read' (i.e. with an eye icon)?


Summary: How can I pass back some properties? (Those three questions 
are the same ;) ).


Regards,
--
*Florian Desneux*


___
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

[SailfishDevel] Update previous page

2015-03-17 Thread Florian Desneux
Hello,

I'm wondering how can I refresh the page when the little white round in the
corner is clicked or a swipe left to right from the corner is triggered?

Meaning: I'm on my 3th app page, I trigger an action (i.e. mark as read the
file), I go back to my 2th page on which there is a list of files. How can
I update the list's item (the file) so it's displayed as 'read' (i.e. with
an eye icon)?

Summary: How can I pass back some properties? (Those three questions are
the same ;) ).

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

Re: [SailfishDevel] (no subject)

2015-03-17 Thread Tone Kastlunger
I believe SDL library is open sourced on SailfihsOS; perhaps you could
submit a patch that fixes the issue?

Best,
tk

On Mon, Mar 16, 2015 at 10:05 PM, Iosif Hamlatzis 
wrote:

> Unfortunately the SDL_SetHint function didn't work, the game still only
> closes as if you hold the device in portrait mode.
>
> So since the game renders rotated (in order to have the perception of
> landscape) the only way to close the game is to swipe from right to left,
> which was one of the reasons they rejected it.
>
>
>
>
> ___
> 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