Reply
Thread Tools
Posts: 80 | Thanked: 51 times | Joined on Feb 2010 @ Finland
#41
Originally Posted by javispedro View Post
Guys, as pycage said, if you are developing a QML Sailfish program then there's the nemo-qml-plugin-notifications API which is the one you should use. (Not sure where the documentation for that is).
Sorry for going littelbit offtopic, but does anyone has idea where to find documentation for nemo-qml-plugin-notifications? I haven't yet found any documentation by googling. OR if someone can tell how to use it from QML ?
 
donaggio's Avatar
Posts: 50 | Thanked: 60 times | Joined on Feb 2010 @ Venice, Italy
#42
Originally Posted by junnuvi View Post
Sorry for going littelbit offtopic, but does anyone has idea where to find documentation for nemo-qml-plugin-notifications? I haven't yet found any documentation by googling. OR if someone can tell how to use it from QML ?
On the developers mailing list it has been suggest to have a look at the source code:

https://github.com/nemomobile/nemo-q...-notifications

it's fairly simple, but... it's not allowed in harbour AFAIK

Anyway they are standard freedesktop notifications, so you can Do It Yourself (TM) with some DBUS messages (on the C++ side, of course).
__________________
Luca Donaggio
 
Posts: 80 | Thanked: 51 times | Joined on Feb 2010 @ Finland
#43
Answering to myself.. hopefully this will be helpful for others too

Code:
import org.nemomobile.notifications 1.0

.......
Button {
	Notification {
		id: notification
		category: "x-nemo.example"
		summary: "Notification summary"
		body: "Notification body"
		previewSummary: "Notification preview summary"
		previewBody: "Notification preview body"
		itemCount: 5
		timestamp: "2013-02-20 18:21:00"
		remoteDBusCallServiceName: "org.nemomobile.example"
		remoteDBusCallObjectPath: "/example"
		remoteDBusCallInterface: "org.nemomobile.example"
		remoteDBusCallMethodName: "doSomething"
		remoteDBusCallArguments: [ "argument", 1 ]
		onClicked: console.log("Clicked")
		onClosed: console.log("Closed, reason: " + reason)
	}
	text: "Application notification, ID " + notification.replacesId
	onClicked: notification.publish()
}
More information available on comments in following page:
https://github.com/nemomobile/nemo-q...tification.cpp
 

The Following 2 Users Say Thank You to junnuvi For This Useful Post:
kimmoli's Avatar
Posts: 562 | Thanked: 2,744 times | Joined on Dec 2013 @ Espoo, Finland
#44
just wanted to share, little python script to change maliit keyboard layout to e.g. Finnish

if it is already known, you may just ignore me - i record it here for me.

Code:
#!/usr/bin/python
import dbus

bus = dbus.SessionBus()
object = bus.get_object('org.gnome.GConf','/org/gnome/GConf/Database/0')

interface = dbus.Interface(object,'org.gnome.GConf.Database')

interface.Set("/sailfish/text_input/active_layout",  dbus.Struct((dbus.Int32(1), "fi.qml")))
__________________
TOH ideas, concepts and creations since 2013 toholed tohuart toheink Heebo tohIRi i2ctool tohmm LeTOH FMTOH
 

The Following User Says Thank You to kimmoli For This Useful Post:
Posts: 958 | Thanked: 483 times | Joined on May 2010
#45
i also found the following when watching for an out-going call to be connected. look for

Code:
dbus-monitor "type=signal, interface=org.freedesktop.Telepathy.Channel.Interface.Group, member=MembersChangedDetailed" |  
while read -r line; 
do
	if echo $line | grep "string \"Call answered\""; then
		/home/nemo/Vibrate
	fi
done
that should catch dbus events of calls being answered. hope it is useful to someone.,
 

The Following User Says Thank You to droll For This Useful Post:
solbrit's Avatar
Posts: 126 | Thanked: 59 times | Joined on Jan 2011
#46
How can you disable cellular radio (only, leaving wlan enabled)? I tried disabling it with mcetool which didn't work and the following (from Phone control) won't work either...
Code:
dbus-send --system --type=method_call --dest=com.nokia.phone.SSC /com/nokia/phone/SSC com.nokia.phone.SSC.set_radio boolean:false
What would be the equivalent to this in Sailfish?
 
solbrit's Avatar
Posts: 126 | Thanked: 59 times | Joined on Jan 2011
#47
Anyone...?
 
EmaNymton's Avatar
Posts: 141 | Thanked: 267 times | Joined on May 2010 @ Germany
#48
Not a full answer to your question but maybe a first step in the right direction but I'm short of time.

First try with mce:
With
Code:
dbus-send --system --dest=com.nokia.mce --print-reply /com/nokia/mce/request com.nokia.mce.request.req_radio_states_change uint32:0 uint32:1
you can set the device into flightmode. First argument is for states, second for mask, but I don't know how to differentiate between wlan and cellular (1 stands for master e.g. deactive all, I think)
With
Code:
dbus-send --system --dest=com.nokia.mce --print-reply /com/nokia/mce/request com.nokia.mce.request.req_radio_states_change uint32:1 uint32:1
you disable filght mode.

Second try with connman:
use qdbus to get information:
Code:
/usr/lib/qt5/bin/qdbus --system --literal net.connman
/
/net
/net/connman
/net/connman/service
/net/connman/service
/net/connman/technology
/net/connman/technology/bluetooth
/net/connman/technology/cellular
/net/connman/technology/wifi
and to get available methods
Code:
/usr/lib/qt5/bin/qdbus --system --literal net.connman  /net/connman/technology/wifi
method QString org.freedesktop.DBus.Introspectable.Introspect()
signal void net.connman.Technology.PropertyChanged(QString name, QDBusVariant value)
method QVariantMap net.connman.Technology.GetProperties()
method void net.connman.Technology.Scan()
method void net.connman.Technology.SetProperty(QString name, QDBusVariant value)
I tried setting cellular "Powered" to false with
Code:
dbus-send --system --type=method_call --print-reply --dest=net.connman /net/connman/technology/cellular net.connman.Technology.SetProperty string:"Powered" variant:boolean:false
but the device is set to flightmode instead, so wifi is disabled too.

I hope you can solve your problem, please share your answer!


Edit:
Third try
What about
Code:
[nemo@localhost ~]$ mcetool --enable-radio=cellular
[nemo@localhost ~]$ mcetool --disable-radio=cellular
?

Last edited by EmaNymton; 2014-03-05 at 12:43.
 

The Following User Says Thank You to EmaNymton For This Useful Post:
solbrit's Avatar
Posts: 126 | Thanked: 59 times | Joined on Jan 2011
#49
First of all thanks for your answer! I too am short on time right now so I'll try it out tonight, but as far as the mcetool suggestion goes, I tried that and it doesn't work. It works that way on the N9 but not in Sailfish. While the airplane icon shows up (as it does in Harmattan) it doesn't actually disconnect anything (even though the mcetool status shows cellular radio as ·"disabled"). But I'll give the other suggestions a try
Thanks!
 
Posts: 33 | Thanked: 32 times | Joined on Nov 2007 @ Finland
#50
Originally Posted by EmaNymton View Post
Not a full answer to your question but maybe a first step in the right direction but I'm short of time.

First try with mce:
With
Code:
dbus-send --system --dest=com.nokia.mce --print-reply /com/nokia/mce/request com.nokia.mce.request.req_radio_states_change uint32:0 uint32:1
you can set the device into flightmode. First argument is for states, second for mask, but I don't know how to differentiate between wlan and cellular (1 stands for master e.g. deactive all, I think)
With
Code:
dbus-send --system --dest=com.nokia.mce --print-reply /com/nokia/mce/request com.nokia.mce.request.req_radio_states_change uint32:1 uint32:1
you disable filght mode.
You can go to flight mode via connman like this
Code:
dbus-send --system --type=method_call --print-reply --dest=net.connman / net.connman.Manager.SetProperty string:"OfflineMode" variant:boolean:true
Second try with connman:
use qdbus to get information:
Code:
/usr/lib/qt5/bin/qdbus --system --literal net.connman
/
/net
/net/connman
/net/connman/service
/net/connman/service
/net/connman/technology
/net/connman/technology/bluetooth
/net/connman/technology/cellular
/net/connman/technology/wifi
and to get available methods
Code:
/usr/lib/qt5/bin/qdbus --system --literal net.connman  /net/connman/technology/wifi
method QString org.freedesktop.DBus.Introspectable.Introspect()
signal void net.connman.Technology.PropertyChanged(QString name, QDBusVariant value)
method QVariantMap net.connman.Technology.GetProperties()
method void net.connman.Technology.Scan()
method void net.connman.Technology.SetProperty(QString name, QDBusVariant value)
I tried setting cellular "Powered" to false with
Code:
dbus-send --system --type=method_call --print-reply --dest=net.connman /net/connman/technology/cellular net.connman.Technology.SetProperty string:"Powered" variant:boolean:false
but the device is set to flightmode instead, so wifi is disabled too.
This is the correct way, only cellular should be disabled now. If it does not, then that is a bug.

I hope you can solve your problem, please share your answer!


Edit:
Third try
What about
Code:
[nemo@localhost ~]$ mcetool --enable-radio=cellular
[nemo@localhost ~]$ mcetool --disable-radio=cellular
?
There seems to be some co-operation issues with mce and connman. ConnMan expects to control the technologies (like radios) in the system. If MCE is also trying to tweak those technologies at the same time, then there might be some issues. ConnMan also honors the rfkill events, so you should be able to get the same result by running rfkill command (not found in the device by default thou) and disabling the cellular modem.
 

The Following User Says Thank You to jukkar For This Useful Post:
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 12:14.