Re: [SailfishDevel] Saving state/config

2013-11-15 Thread Jonni Rainisto
Yes your .spec file should have following line if you want to use the plugin:

Requires:   nemo-qml-plugin-configuration-qt5


From: devel-boun...@lists.sailfishos.org [devel-boun...@lists.sailfishos.org] 
on behalf of Thomas Tanghus [tho...@tanghus.net]
Sent: Friday, November 15, 2013 4:24 PM
To: Sailfish OS Developers
Subject: Re: [SailfishDevel] Saving state/config

On Friday 15 November 2013 05:44 Jonni Rainisto wrote:
 import org.nemomobile.configuration 1.0

My n00bness shows again :P Will I have to add this module to my project? The
SailfishOS-i486-x86 target only comes with org.nemomobile.ngf

--
Med venlig hilsen / Best Regards

Thomas Tanghus
___
SailfishOS.org Devel mailing list
___
SailfishOS.org Devel mailing list


Re: [SailfishDevel] Saving state/config

2013-11-15 Thread Thomas Tanghus
On Friday 15 November 2013 20:26 Andrey Kozhevnikov wrote:
 use QSettings as Jonni said and register own component to use in qml, if
 need, or export single class instance via setContextProperty

The latter sounds like the easiest approach.

Thanks both for your good advice.

 On 15.11.2013 20:24, Thomas Tanghus wrote:
  On Friday 15 November 2013 05:44 Jonni Rainisto wrote:
  import org.nemomobile.configuration 1.0
  
  My n00bness shows again :P Will I have to add this module to my project?
  The SailfishOS-i486-x86 target only comes with org.nemomobile.ngf

-- 
Med venlig hilsen / Best Regards

Thomas Tanghus
___
SailfishOS.org Devel mailing list


Re: [SailfishDevel] Saving state/config

2013-11-15 Thread Andrey Kozhevnikov
both are easy. check Qt Assistant. examples and api reference are inside 
your Qt Creator ;)


On 15.11.2013 20:48, Thomas Tanghus wrote:

On Friday 15 November 2013 20:26 Andrey Kozhevnikov wrote:

use QSettings as Jonni said and register own component to use in qml, if
need, or export single class instance via setContextProperty

The latter sounds like the easiest approach.

Thanks both for your good advice.


On 15.11.2013 20:24, Thomas Tanghus wrote:

On Friday 15 November 2013 05:44 Jonni Rainisto wrote:

import org.nemomobile.configuration 1.0

My n00bness shows again :P Will I have to add this module to my project?
The SailfishOS-i486-x86 target only comes with org.nemomobile.ngf


___
SailfishOS.org Devel mailing list


Re: [SailfishDevel] Saving state/config

2013-11-15 Thread Marcin M.
The plugin uses gconf, doesn't it?
Can we use it to modify any gconf entry then?

--
Marcin


2013/11/15 Andrey Kozhevnikov coderusin...@gmail.com

 both are easy. check Qt Assistant. examples and api reference are inside
 your Qt Creator ;)


 On 15.11.2013 20:48, Thomas Tanghus wrote:

 On Friday 15 November 2013 20:26 Andrey Kozhevnikov wrote:

 use QSettings as Jonni said and register own component to use in qml, if
 need, or export single class instance via setContextProperty

 The latter sounds like the easiest approach.

 Thanks both for your good advice.

  On 15.11.2013 20:24, Thomas Tanghus wrote:

 On Friday 15 November 2013 05:44 Jonni Rainisto wrote:

 import org.nemomobile.configuration 1.0

 My n00bness shows again :P Will I have to add this module to my project?
 The SailfishOS-i486-x86 target only comes with org.nemomobile.ngf


 ___
 SailfishOS.org Devel mailing list

___
SailfishOS.org Devel mailing list

Re: [SailfishDevel] Status of Sailfish SMS?

2013-11-15 Thread christopher . lamb

Hi Jonni

Could you please confirm whether or not it will be possible to send  
SMSes direct from an app? (from your reply below it seems this will  
not be possible).


My app Landed on Harmattan could send SMS directly - indeed it is the  
raison-d'etre for the app, and it is obvious to the user that he is  
sending an SMS (so no problems of secret bypassing...).


My understanding was that it should be possible to send SMS from an  
app on Sailfish using Telepathy.


I would be thankful for clarification on this issue.

Chris

Zitat von Jonni Rainisto jonni.raini...@jolla.com:

Afaik, if you try to send sms, it opens default messaging  
application where you can enter the sms. And same for outgoing  
phonecalls, opens phone application where you can make a call.


Reasoning behind it is that as those call create a phone bill to end  
user, then applications are not allowed to secretly bypass default  
applications. But dont take my word on it, its just AFAIK on store  
QA process.


But ofcourse if you enable developer mode you can do what ever you  
want. I'm not familiar with that side of middleware, so someone else  
can comment more.


re, Jonni


From: devel-boun...@lists.sailfishos.org  
[devel-boun...@lists.sailfishos.org] on behalf of Seppo Tiainen  
[seppo.tiai...@gmail.com]

Sent: Wednesday, November 13, 2013 8:19 PM
To: devel@lists.sailfishos.org
Subject: [SailfishDevel] Status of Sailfish SMS?

Hi,

Does anybody know about a possible module and its status in  
Sailfish/Qt-5 that corresponds to Harmattan Qt Mobility Messaging so  
that it would be possible to send and receive SMSs (which is  
essential in my app) through Qt/QML on the Jolla phone?


Thanks,
Seppo





___
SailfishOS.org Devel mailing list


Re: [SailfishDevel] Saving state/config

2013-11-15 Thread Andrey Kozhevnikov

Sure. but you can make own classes for bth QSettings and GConfItem ;)

On 15.11.2013 21:00, Marcin M. wrote:

The plugin uses gconf, doesn't it?
Can we use it to modify any gconf entry then?

--
Marcin


2013/11/15 Andrey Kozhevnikov coderusin...@gmail.com 
mailto:coderusin...@gmail.com


both are easy. check Qt Assistant. examples and api reference are
inside your Qt Creator ;)


On 15.11.2013 20:48, Thomas Tanghus wrote:

On Friday 15 November 2013 20:26 Andrey Kozhevnikov wrote:

use QSettings as Jonni said and register own component to
use in qml, if
need, or export single class instance via setContextProperty

The latter sounds like the easiest approach.

Thanks both for your good advice.

On 15.11.2013 20:24, Thomas Tanghus wrote:

On Friday 15 November 2013 05:44 Jonni Rainisto wrote:

import org.nemomobile.configuration 1.0

My n00bness shows again :P Will I have to add this
module to my project?
The SailfishOS-i486-x86 target only comes with
org.nemomobile.ngf


___
SailfishOS.org Devel mailing list




___
SailfishOS.org Devel mailing list


___
SailfishOS.org Devel mailing list

[SailfishDevel] Persecute - indie WhatsApp client for SailfishOS

2013-11-15 Thread Andrey Kozhevnikov

Hello Sailors!

Please test my application - Persecute.

Persecute is indie WhatsApp client in Qt/QML. Initially written by me 
for Harmattan in Qt4/QML and now ported to Qt5/QML for Sailfish.


http://sailfish.openrepos.net/coderus/personal/main/p/persecute-0.1-1.armv7hl.rpm
http://sailfish.openrepos.net/coderus/personal/main/p/persecute-0.1-1.i586.rpm
___
SailfishOS.org Devel mailing list


Re: [SailfishDevel] Status of Sailfish SMS?

2013-11-15 Thread Andrey Kozhevnikov
Telepathy is not protocol. Its service controlling all system-wide 
accounts including ring, sms, mms services.


On 15.11.2013 22:22, Seppo Tiainen wrote:
I just want to point out what exactly I meant by SMS: Short Message 
Service of a mobile network (GSM/2G/3G/LTE) provided by the network 
operators. To me, Telepathy protocol is something else (chat using SIP 
etc.).


Regards,
Seppo


2013/11/15 christopher.l...@thurweb.ch 
mailto:christopher.l...@thurweb.ch


Hi Jonni

Could you please confirm whether or not it will be possible to
send SMSes direct from an app? (from your reply below it seems
this will not be possible).

My app Landed on Harmattan could send SMS directly - indeed it is
the raison-d'etre for the app, and it is obvious to the user that
he is sending an SMS (so no problems of secret bypassing...).

My understanding was that it should be possible to send SMS from
an app on Sailfish using Telepathy.

I would be thankful for clarification on this issue.

Chris

Zitat von Jonni Rainisto jonni.raini...@jolla.com
mailto:jonni.raini...@jolla.com:


Afaik, if you try to send sms, it opens default messaging
application where you can enter the sms. And same for outgoing
phonecalls, opens phone application where you can make a call.

Reasoning behind it is that as those call create a phone bill
to end user, then applications are not allowed to secretly
bypass default applications. But dont take my word on it, its
just AFAIK on store QA process.

But ofcourse if you enable developer mode you can do what ever
you want. I'm not familiar with that side of middleware, so
someone else can comment more.

re, Jonni


From: devel-boun...@lists.sailfishos.org
mailto:devel-boun...@lists.sailfishos.org
[devel-boun...@lists.sailfishos.org
mailto:devel-boun...@lists.sailfishos.org] on behalf of
Seppo Tiainen [seppo.tiai...@gmail.com
mailto:seppo.tiai...@gmail.com]
Sent: Wednesday, November 13, 2013 8:19 PM
To: devel@lists.sailfishos.org mailto:devel@lists.sailfishos.org
Subject: [SailfishDevel] Status of Sailfish SMS?

Hi,

Does anybody know about a possible module and its status in
Sailfish/Qt-5 that corresponds to Harmattan Qt Mobility
Messaging so that it would be possible to send and receive
SMSs (which is essential in my app) through Qt/QML on the
Jolla phone?

Thanks,
Seppo




___
SailfishOS.org Devel mailing list




___
SailfishOS.org Devel mailing list


___
SailfishOS.org Devel mailing list

Re: [SailfishDevel] Status of Sailfish SMS?

2013-11-15 Thread Seppo Tiainen
OK, my mistake. So you can use Telepathy service to control the 'real' SMS.
Need to study more. Thanks.


2013/11/15 Andrey Kozhevnikov coderusin...@gmail.com

  Telepathy is not protocol. Its service controlling all system-wide
 accounts including ring, sms, mms services.


 On 15.11.2013 22:22, Seppo Tiainen wrote:

 I just want to point out what exactly I meant by SMS: Short Message
 Service of a mobile network (GSM/2G/3G/LTE) provided by the network
 operators. To me, Telepathy protocol is something else (chat using SIP
 etc.).

  Regards,
 Seppo


 2013/11/15 christopher.l...@thurweb.ch

 Hi Jonni

 Could you please confirm whether or not it will be possible to send SMSes
 direct from an app? (from your reply below it seems this will not be
 possible).

 My app Landed on Harmattan could send SMS directly - indeed it is the
 raison-d'etre for the app, and it is obvious to the user that he is sending
 an SMS (so no problems of secret bypassing...).

 My understanding was that it should be possible to send SMS from an app
 on Sailfish using Telepathy.

 I would be thankful for clarification on this issue.

 Chris

 Zitat von Jonni Rainisto jonni.raini...@jolla.com:


  Afaik, if you try to send sms, it opens default messaging application
 where you can enter the sms. And same for outgoing phonecalls, opens phone
 application where you can make a call.

 Reasoning behind it is that as those call create a phone bill to end
 user, then applications are not allowed to secretly bypass default
 applications. But dont take my word on it, its just AFAIK on store QA
 process.

 But ofcourse if you enable developer mode you can do what ever you want.
 I'm not familiar with that side of middleware, so someone else can comment
 more.

 re, Jonni

 
 From: devel-boun...@lists.sailfishos.org [
 devel-boun...@lists.sailfishos.org] on behalf of Seppo Tiainen [
 seppo.tiai...@gmail.com]
 Sent: Wednesday, November 13, 2013 8:19 PM
 To: devel@lists.sailfishos.org
 Subject: [SailfishDevel] Status of Sailfish SMS?

 Hi,

 Does anybody know about a possible module and its status in
 Sailfish/Qt-5 that corresponds to Harmattan Qt Mobility Messaging so that
 it would be possible to send and receive SMSs (which is essential in my
 app) through Qt/QML on the Jolla phone?

 Thanks,
 Seppo




   ___
 SailfishOS.org Devel mailing list




 ___
 SailfishOS.org Devel mailing list



 ___
 SailfishOS.org Devel mailing list

___
SailfishOS.org Devel mailing list

Re: [SailfishDevel] Status of Sailfish SMS?

2013-11-15 Thread christopher . lamb

Hi Seppo

My definition of SMS is exactly the same as yours.

You will find some older questions from me on the subject of Telepathy  
and SMSes in the archive of this mailing list.


Chris

Zitat von Seppo Tiainen seppo.tiai...@gmail.com:


OK, my mistake. So you can use Telepathy service to control the 'real' SMS.
Need to study more. Thanks.


2013/11/15 Andrey Kozhevnikov coderusin...@gmail.com


 Telepathy is not protocol. Its service controlling all system-wide
accounts including ring, sms, mms services.


On 15.11.2013 22:22, Seppo Tiainen wrote:

I just want to point out what exactly I meant by SMS: Short Message
Service of a mobile network (GSM/2G/3G/LTE) provided by the network
operators. To me, Telepathy protocol is something else (chat using SIP
etc.).

 Regards,
Seppo


2013/11/15 christopher.l...@thurweb.ch


Hi Jonni

Could you please confirm whether or not it will be possible to send SMSes
direct from an app? (from your reply below it seems this will not be
possible).

My app Landed on Harmattan could send SMS directly - indeed it is the
raison-d'etre for the app, and it is obvious to the user that he is sending
an SMS (so no problems of secret bypassing...).

My understanding was that it should be possible to send SMS from an app
on Sailfish using Telepathy.

I would be thankful for clarification on this issue.

Chris

Zitat von Jonni Rainisto jonni.raini...@jolla.com:


 Afaik, if you try to send sms, it opens default messaging application

where you can enter the sms. And same for outgoing phonecalls, opens phone
application where you can make a call.

Reasoning behind it is that as those call create a phone bill to end
user, then applications are not allowed to secretly bypass default
applications. But dont take my word on it, its just AFAIK on store QA
process.

But ofcourse if you enable developer mode you can do what ever you want.
I'm not familiar with that side of middleware, so someone else can comment
more.

re, Jonni


From: devel-boun...@lists.sailfishos.org [
devel-boun...@lists.sailfishos.org] on behalf of Seppo Tiainen [
seppo.tiai...@gmail.com]
Sent: Wednesday, November 13, 2013 8:19 PM
To: devel@lists.sailfishos.org
Subject: [SailfishDevel] Status of Sailfish SMS?

Hi,

Does anybody know about a possible module and its status in
Sailfish/Qt-5 that corresponds to Harmattan Qt Mobility Messaging so that
it would be possible to send and receive SMSs (which is essential in my
app) through Qt/QML on the Jolla phone?

Thanks,
Seppo





  ___
SailfishOS.org Devel mailing list





___
SailfishOS.org Devel mailing list



___
SailfishOS.org Devel mailing list







___
SailfishOS.org Devel mailing list


Re: [SailfishDevel] Status of Sailfish SMS?

2013-11-15 Thread John Brooks
Hi,

On Nov 15, 2013, at 8:01 AM, christopher.l...@thurweb.ch wrote:

 Hi Jonni
 
 Could you please confirm whether or not it will be possible to send SMSes 
 direct from an app? (from your reply below it seems this will not be 
 possible).

As Robin said, the only API we’re supporting initially is the ability to launch 
the messaging application to send a SMS, particularly via a sms: URL.The reason 
for that is simple: most of the relevant middleware is not yet written to offer 
any API guarantees, and we intend to change it quite a bit in updates going 
forward. We don’t have documentation, and couldn’t offer any promise that 
applications using those APIs would continue working after updates.

From my understanding, store applications are only supposed to use supported 
API. I’m not sure of the specifics of how that works; maybe one of the Harbor 
guys could answer?

 My app Landed on Harmattan could send SMS directly - indeed it is the 
 raison-d'etre for the app, and it is obvious to the user that he is sending 
 an SMS (so no problems of secret bypassing...).
 
 My understanding was that it should be possible to send SMS from an app on 
 Sailfish using Telepathy.

It is possible, and it will install and work without any modification to the 
device. It isn’t documented or properly supported, and it may change in 
incompatible ways at any time, for now. I realize that’s not ideal, but it’s 
still very early in creating a platform, and we need the flexibility to improve 
things.

 I would be thankful for clarification on this issue.

I hope that helps.

—
John Brooks
Jolla

 
 Chris
 
 Zitat von Jonni Rainisto jonni.raini...@jolla.com:
 
 Afaik, if you try to send sms, it opens default messaging application where 
 you can enter the sms. And same for outgoing phonecalls, opens phone 
 application where you can make a call.
 
 Reasoning behind it is that as those call create a phone bill to end user, 
 then applications are not allowed to secretly bypass default applications. 
 But dont take my word on it, its just AFAIK on store QA process.
 
 But ofcourse if you enable developer mode you can do what ever you want. I'm 
 not familiar with that side of middleware, so someone else can comment more.
 
 re, Jonni
 
 
 From: devel-boun...@lists.sailfishos.org 
 [devel-boun...@lists.sailfishos.org] on behalf of Seppo Tiainen 
 [seppo.tiai...@gmail.com]
 Sent: Wednesday, November 13, 2013 8:19 PM
 To: devel@lists.sailfishos.org
 Subject: [SailfishDevel] Status of Sailfish SMS?
 
 Hi,
 
 Does anybody know about a possible module and its status in Sailfish/Qt-5 
 that corresponds to Harmattan Qt Mobility Messaging so that it would be 
 possible to send and receive SMSs (which is essential in my app) through 
 Qt/QML on the Jolla phone?
 
 Thanks,
 Seppo
 
 
 
 
 ___
 SailfishOS.org Devel mailing list

___
SailfishOS.org Devel mailing list


Re: [SailfishDevel] Saving state/config

2013-11-15 Thread Thomas Tanghus
On Friday 15 November 2013 20:50 Andrey Kozhevnikov wrote:
 both are easy. check Qt Assistant. examples and api reference are inside
 your Qt Creator ;)

Forgive me for non-SailfishOS questions, but I must be doing something wrong, 
even if it's easy ;)

My main is now:

int main(int argc, char *argv[]) {
QGuiApplication *app = SailfishApp::application(argc, argv);
QQuickView *view = SailfishApp::createView();
QSettings *settings = new QSettings(Tanghus, 
net.tanghus.currencyconverter.sailfish);
view-rootContext()-setContextProperty(settings, settings);
view-
setSource(SailfishApp::pathTo(qml/net.tanghus.currencyconverter.sailfish.qml));
view-showFullScreen();
return app-exec();
}

And in ApplicationWindow I can see it's instantiated:

Component.onCompleted: {
console.log('Ready', settings);
}

Prints: Ready QSettings(0x70b633a0)

But if I use it like:

refreshInterval = settings.value('refreshInterval', 3600).toInt();

I get:

file:///opt/sdk/net.tanghus.currencyconverter.sailfish/usr/share/net.tanghus.currencyconverter.sailfish/qml/net.tanghus.currencyconverter.sailfish.qml:64:
 
TypeError: Object [object Object] has no method 'value'

I'm sure this is very trivial - but atm I'm stuck :P

 On 15.11.2013 20:48, Thomas Tanghus wrote:
  On Friday 15 November 2013 20:26 Andrey Kozhevnikov wrote:
  use QSettings as Jonni said and register own component to use in qml, if
  need, or export single class instance via setContextProperty
  
  The latter sounds like the easiest approach.
  

-- 
Med venlig hilsen / Best Regards

Thomas Tanghus
___
SailfishOS.org Devel mailing list


Re: [SailfishDevel] Saving state/config

2013-11-15 Thread Thomas Tanghus
Ah OK. I had missed that. It would also have been almost too easy ;)

Thanks a lot for your thorough help

On Friday 15 November 2013 23:39 Andrey Kozhevnikov wrote:
 unfortunately you cant use QSettings class this way. It have no public
 slots to be used from QML side. You need to write some QmlSettings class
 wrapper for QSettings:
 
 class QmlSettings: publicQObject
 ...
 public slots:
QVariant value(const QString key);
void setValue(const QString key, const QVariant value);
 
 ...
 private:
QSettings *_settings;
 
 ...
 
 in class constructor:
 
 _settings = new QSettings(Tanghus,
 net.tanghus.currencyconverter.sailfish);
 
 and
 
 QVariant QmlSettings::value(const QString key){
return _settings-value(key);
 }
 
 void QmlSettings::setValue(const QString key, const QVariant value){
_settings-setValue(key, value);
 }
 
 and then you can use QmlSettings class in QML
 
 On 15.11.2013 23:32, Thomas Tanghus wrote:
  On Friday 15 November 2013 20:50 Andrey Kozhevnikov wrote:
  both are easy. check Qt Assistant. examples and api reference are inside
  your Qt Creator ;)
  
  Forgive me for non-SailfishOS questions, but I must be doing something
  wrong, even if it's easy ;)
  
  My main is now:
  
  int main(int argc, char *argv[]) {
  
   QGuiApplication *app = SailfishApp::application(argc, argv);
   QQuickView *view = SailfishApp::createView();
   QSettings *settings = new QSettings(Tanghus,
  
  net.tanghus.currencyconverter.sailfish);
  
   view-rootContext()-setContextProperty(settings, settings);
   view-
  
  setSource(SailfishApp::pathTo(qml/net.tanghus.currencyconverter.sailfish
  .qml)); 
   view-showFullScreen();
   return app-exec();
  
  }
  
  And in ApplicationWindow I can see it's instantiated:
   Component.onCompleted: {
   
   console.log('Ready', settings);
   
   }
  
  Prints: Ready QSettings(0x70b633a0)
  
  But if I use it like:
   refreshInterval = settings.value('refreshInterval', 3600).toInt();
  
  I get:
  
  file:///opt/sdk/net.tanghus.currencyconverter.sailfish/usr/share/net.tangh
  us.currencyconverter.sailfish/qml/net.tanghus.currencyconverter.sailfish.q
  ml:64: TypeError: Object [object Object] has no method 'value'
  
  I'm sure this is very trivial - but atm I'm stuck :P
  
  On 15.11.2013 20:48, Thomas Tanghus wrote:
  On Friday 15 November 2013 20:26 Andrey Kozhevnikov wrote:
  use QSettings as Jonni said and register own component to use in qml,
  if
  need, or export single class instance via setContextProperty
  
  The latter sounds like the easiest approach.
 
 ___
 SailfishOS.org Devel mailing list

-- 
Med venlig hilsen / Best Regards

Thomas Tanghus
___
SailfishOS.org Devel mailing list


Re: [SailfishDevel] Saving state/config

2013-11-15 Thread Artem Marchenko
Thanks a lot, Jonni!

Discussion went further already, but I am just fascinated you guys have got
such a plugin ready! I used to implement GConf modification on my own or
create a Settings wrapper for the LocalStorage and now there's a ready made
plugin for GConf - great!

Best regards,
Artem.



On Fri, Nov 15, 2013 at 7:44 AM, Jonni Rainisto jonni.raini...@jolla.comwrote:

 Hi,

 Normal usage of QSettings which saves under /home/nemo/.config/app would
 be just fine for C++.
 If you just want to save few config values in QML, then you might want to
 use GConf by importing nemo-qml-plugin-configuration module (
 https://github.com/nemomobile/nemo-qml-plugin-configuration) and use
 config key like com/yourdomain/applicationname etc.

 For example:
 --
 import org.nemomobile.configuration 1.0

 Page {
 ConfigurationValue {
 id: your_foo_setting
 key: /com/super/superapplication/light_value
 defaultValue: -1
 }
 --
 re, Jonni
 
 From: devel-boun...@lists.sailfishos.org [
 devel-boun...@lists.sailfishos.org] on behalf of Thomas Tanghus [
 tho...@tanghus.net]
 Sent: Friday, November 15, 2013 3:13 AM
 To: Sailfish OS Developers
 Subject: [SailfishDevel] Saving state/config

 I couldn't find any standard way of saving an apps config. Is there such a
 standard, or is it up to the developer to choose format and location?

 I'm making a *very* simple app, so only using QML/JS, and only have to save
 3-4 values.

 As far as I could see the location should be
 /home/nemo/.config/appname[.ext]
 which could probably be accomplished better using
 QStandardPaths::writableLocation(QStandardPaths::ConfigLocation) but is
 that
 possible in QML?
 And which format should it be in?

 --
 Med venlig hilsen / Best Regards

 Thomas Tanghus
 ___
 SailfishOS.org Devel mailing list
 ___
 SailfishOS.org Devel mailing list




-- 
Artem Marchenko
http://agilesoftwaredevelopment.com
http://twitter.com/AgileArtem
___
SailfishOS.org Devel mailing list

Re: [SailfishDevel] Saving state/config

2013-11-15 Thread Thomas Tanghus
On Friday 15 November 2013 14:27 Jonni Rainisto wrote:
 Yes your .spec file should have following line if you want to use the
 plugin:
 
 Requires:   nemo-qml-plugin-configuration-qt5

I went with the QSettings wrapper as proposed by Andrey, but this is certainly 
good to know for further development.
I've learned from the community a lot since I decided to awake my dormant 
Plasma widget Wednesday night :)

QML/Silica makes creating apps a breeze once you know your way around it :)

 From: devel-boun...@lists.sailfishos.org
 [devel-boun...@lists.sailfishos.org] on behalf of Thomas Tanghus
 [tho...@tanghus.net] Sent: Friday, November 15, 2013 4:24 PM
 To: Sailfish OS Developers
 Subject: Re: [SailfishDevel] Saving state/config
 
 On Friday 15 November 2013 05:44 Jonni Rainisto wrote:
  import org.nemomobile.configuration 1.0
 
 My n00bness shows again :P Will I have to add this module to my project? The
 SailfishOS-i486-x86 target only comes with org.nemomobile.ngf
-- 
Med venlig hilsen / Best Regards

Thomas Tanghus
___
SailfishOS.org Devel mailing list


Re: [SailfishDevel] best way to work with covers?

2013-11-15 Thread Artem Marchenko
Hi Gabriel

There are several ways of passing data between Cover and rest of app (or
any components). You can try using app global object ids or javascript
files with .pragma library and gloval [to them] variables or inject global
objects from C++ via setContextProperty().

The way I like doing it is to keep shared object in main.qml and pass it to
pages/covers at the moment of instantiation the following way:


ApplicationWindow
{
id: app
property string sharedValue: whatever you want to share to cover


initialPage: Component {
MainPage {
torch: app.sharedValue
}
}

cover: Component {
CoverPage {
torch: app.sharedValue
}
}

}


I hope if helps.

Cheers,
Artem.



On Sat, Nov 16, 2013 at 1:00 AM, Gabriel Boehme 
m.gabrielboe...@googlemail.com wrote:

 Hi Sailfish sailors,

 I want to ask, what is recommended/best practice to handle different
 covers/covers with dynamic information.

 My case:

 On the main page (MainPage.qml) you can select some options and search
 depending on the selected options. My main cover shows the selected
 options if minimized, so I can't just create it with
 Qt.resolvedUrl(path/to/maincover.qml), because I'm talking to the
 cover with via property aliases. So I'm creating this cover directly as
 an instance in ApplicationWindow.

 After the search a ListView shows the results from a model and I created
 another cover to switch between the results with CoverAction (show
 next/previous) - it takes the data from the model. But also shows some
 information from main page - via property alias.

 So the point is: to fill the cover pages with the dynamic data I can't
 create them with Qt.resolvedUrl(path/to/cover.qml), or
 push(mypage.qml) because I need property aliases to set the
 information on the covers. But in the most examples and also the console
 output tells me, that it is not clever to create instances in the
 ApplicationWindow part.

 So what is best practice? Do I miss something?

 Thank you very much in advance.

 Gabriel

 ___
 SailfishOS.org Devel mailing list




-- 
Artem Marchenko
http://agilesoftwaredevelopment.com
http://twitter.com/AgileArtem
___
SailfishOS.org Devel mailing list