Re: [SailfishDevel] SearchField and focus

2013-08-11 Thread Bea Lam
I've updated the SearchField docs, so it should be there in the next SDK 
release.

Thanks,
Bea


From: devel-boun...@lists.sailfishos.org [devel-boun...@lists.sailfishos.org] 
on behalf of Lucien XU [sfietkonstan...@free.fr]
Sent: 09 August 2013 20:29
To: devel@lists.sailfishos.org
Subject: Re: [SailfishDevel] SearchField and focus

Hello !

It works here on Weatherfish. Thanks ! However, it might worth it to mention
it in official docs, since it might happen often.

Cheers,
Lucien

Le vendredi 9 août 2013 12:11:35 Benoît HERVIER a écrit :
> Hello,
>
> Indeed.
>
> Thanks a lot for the explanation.
>
> Regards,
>
> Le 2013-08-09 03:12, Bea Lam a écrit :
> > Hello,
> >
> > The problem is that when the model changes, the last added delegate
> > steals the focus, as ListView has a focus scope.
> >
> > If you set "currentIndex: -1" on the ListView, then this behaviour
> > will be disabled. (This is what's done in the SearchPage.qml example
> > in silicacomponentgallery.)
> >
> > cheers,
> > Bea
> >
> >
> > 
> > From: devel-boun...@lists.sailfishos.org
> > [devel-boun...@lists.sailfishos.org] on behalf of Martin Grimme
> > [martin.gri...@gmail.com]
> > Sent: 09 August 2013 02:06
> > To: Lucien XU
> > Cc: devel@lists.sailfishos.org
> > Subject: Re: [SailfishDevel] SearchField and focus
> >
> > Hi,
> >
> > I had exactly the same problem. My solution was to define the
> > SearchField _outside_ the list view, like this:
> >
> > SilicaListView {
> >
> > id: listview
> >
> > ...
> >
> > header: Item {
> >
> > // This is just a placeholder for the header box. To avoid the
> > // list view resetting the input box everytime the model
> >
> > resets,
> >
> > // the search entry is defined outside the list view.
> > height: headerBox.implicitHeight
> >
> > }
> >
> > }
> >
> > ...
> >
> > Column {
> >
> > id: headerBox
> >
> > property int neutralPos: 0
> >
> > y: 0 - listview.contentY + neutralPos
> > width: parent.width
> >
> > Component.onCompleted: {
> >
> > neutralPos = listview.contentY;
> >
> > }
> >
> > SearchField {
> >
> > ...
> >
> > }
> >
> > }
> >
> >
> > That way, the SearchField floats on top of the list at the place
> > reserved by the placeholder Item.
> >
> >
> > Martin
> >
> > 2013/8/8, Lucien XU :
> >> Le jeudi 8 août 2013 17:10:26 Benoît HERVIER a écrit :
> >>> Hi,
> >>>
> >>> I'm trying to use SearchField to have a  suspense ... a search
> >>> field for my list view.
> >>> So i try to filter in realtime ... and i notice that SearchField
> >>> lose
> >>> focus
> >>>
> >>> Basically, i do a reset on the ListModel and append data
> >>>
> >>> This could come from the use i made from SearchField, so here a
> >>> snippet
> >>>
> >>> of the code :
> >>>  SilicaListView {
> >>>
> >>>  id: notesView
> >>>  model: notesModel
> >>>  anchors.fill: parent
> >>>  header: Column {
> >>>
> >>>  width: parent.width
> >>>  PageHeader {
> >>>
> >>>  title: "ownNotes"
> >>>
> >>>  }
> >>>  SearchField {
> >>>
> >>>  id: searchField
> >>>  placeholderText: "Search"
> >>>  width: parent.width
> >>>  onTextChanged: {
> >>>
> >>>  searchText = searchField.text;
> >>>  notesModel.applyFilter(searchText)
> >>>
> >>>  }
> >>>
> >>>  }
> >>>
> >>>  }
> >>>  section {
> >>>
> >>>  property: 'category'
> >>>  delegate: SectionHeader {
> >>>
> >>>  text: section
> >>>
> >>>  }
> >>>
> >>>  }
> >>>
> >>> Any advices ?
> >>
> >> I have the same issue. The searchfield got unfocused each time data
> >> is added
> >>
> >> in a list view. That's not conveinent for an autocomplete field ...
> >>
> >> No advices though, I'm trying to see what's wrong.
> >> ___
> >> SailfishOS.org Devel mailing list
> >
> > ___
> > SailfishOS.org Devel mailing list
> > ___
> > SailfishOS.org Devel mailing list
___
SailfishOS.org Devel mailing list
___
SailfishOS.org Devel mailing list


Re: [SailfishDevel] Bug in the Silica Reference docs and possible bug in the Dialog component

2013-08-11 Thread Matthew Vogt
Also, I forgot to mention: the reason that explicitly popping the dialog page 
did not work, is that the previous animated transition would have been ongoing 
at the time you issued pop().  Popping explicitly would have worked if you had, 
for example, invoked the pop() in reaction to the dialog status changing to 
'PageStatus.Activated', which occurs when the transition ends.
If you can see the output stream for your app, you should see a warning that 
the pop can't be initiated because of the ongoing transition.

In any case, while this can be made to work, the 'acceptDestination' version 
will give a better user experience.

Thanks,
Matt


From: devel-boun...@lists.sailfishos.org [devel-boun...@lists.sailfishos.org] 
on behalf of Matthew Vogt [matthew.v...@jollamobile.com]
Sent: Monday, August 12, 2013 8:58 AM
To: Superpelican
Cc: devel@lists.sailfishos.org
Subject: Re: [SailfishDevel] Bug in the Silica Reference docs and possible bug 
in the Dialog component

Hi Superpelican, thanks for the explanation.

What you want is for the dialog which selects the multiplier to be transitory, 
right?  So the page sequence will be: initial-page ->dialog -> question-page  
-> base-page.

In this case, you need to use the 'acceptDestination' property of the dialog: 
https://sailfishos.org/sailfish-silica/qml-sailfishsilica-dialog.html#acceptDestination-prop

If you set the question-page as the 'acceptDestination' and set the 
'acceptDestinationAction' property to 'PageStackAction.Replace', then the 
effect of accepting the dialog will be to replace the dialog on the stack top 
with question-page.  The pageStack state will transition directly from [ 
initial-page, dialog] to [ initial-page, question-page ], and returning from 
question-page will then go directly back to initial-page.

Note that you must provide the instance or component for the 
'acceptDestination' page before the user has accepted the dialog (because we 
need to be able to show that page when the user starts to drag right-to-left).  
This means you may need to communicate the dialog state at acceptance to the 
already instantiated question-page, by some means.

Hope that helps,
Matt


From: Superpelican [superpeli...@zoho.com]
Sent: Monday, August 12, 2013 4:45 AM
To: Matthew Vogt
Cc: devel@lists.sailfishos.org
Subject: Re: [SailfishDevel] Bug in the Silica Reference docs and possible bug 
in the Dialog component

Hello Matthew,

Sorry for my late reply.

I believe you misunderstood me. I'm not developing a custom Sailfish Dialog 
component, but creating a Sailfish app.
The sources can be found 
here.

My intent is also not to explicitly pop the dialog of the pageStack, but I was 
forced to do this, because the dialog doesn't do it itself!
BTW I have already removed the code that should explicitly pop the dialog of 
the pageStack because it didn't work.

>Also, as the implementor of the Dialog, you should use the onDone() handler to 
>react to the user's actions, leaving the accepted() signal to be handled by 
>users of >your dialog.

Because I'm not creating a custom dialog component, I am actually the user of 
the dialog, so that's why I'm handling the onAccepted() signal. ;)

I've demonstrated what I'm experiencing in this video: 
http://ubuntuone.com/71UqvktzqGWMvukeVTW8Qy (should be viewable in any HTML5 
video supporting browser, that supports WebM, like Firefox and Chromium).

Kind Regards,

Superpelican

On 08/05/2013 01:38 PM, Matthew Vogt wrote:
Hi Superpelican.
Thanks for catching the errors in the Dialog documentation, I will correct them.

In your Clamshell dialog, you do not need to explicitly pop() the dialog page 
in response to the accept action; it is popped by the user's interaction 
(either a drag or an 'Accept' click), and the accepted signal is generated in 
response to this event.

Also, as the implementor of the Dialog, you should use the onDone() handler to 
react to the user's actions, leaving the accepted() signal to be handled by 
users of your dialog.

Thanks,
Matt


From: 
devel-boun...@lists.sailfishos.org 
[devel-boun...@lists.sailfishos.org] 
on behalf of Superpelican [superpeli...@zoho.com]
Sent: Sunday, August 04, 2013 8:42 PM
To: devel@lists.sailfishos.org
Subject: [SailfishDevel] Bug in the Silica Reference docs and possible bug in 
the Dialog component

Hello,

Sfiet_Konstantin and I have had another debugging session on IRC recently with 
my app.
(http://merproject.org/logs/%23sailfishos/%23sailfishos.2013-08-03.log)

I had defined a handler that would be called when the user accepted a dialog. 
However
we saw that the handler was never called. Then I noticed that the documentation 
page
on the Silica Reference ab

[SailfishDevel] Sailfish APIs

2013-08-11 Thread Michael Faro-Tusino
Hi guys,

I was wondering if Sailfish APIs would be released before the final SDK (or 
Jolla device) ships.

I am currently building a System Profiler on BB10 and Harmattan, but 
unfortunately I can't seem to find any list of available APIs for Sailfish. I 
am looking for APIs related to the OS Version, Device ID, Hardware config. etc.

Appreciate any information about this.


Thanks,
Michael


Sent from my Z10___
SailfishOS.org Devel mailing list

Re: [SailfishDevel] Bug in the Silica Reference docs and possible bug in the Dialog component

2013-08-11 Thread Matthew Vogt
Hi Superpelican, thanks for the explanation.

What you want is for the dialog which selects the multiplier to be transitory, 
right?  So the page sequence will be: initial-page ->dialog -> question-page  
-> base-page.

In this case, you need to use the 'acceptDestination' property of the dialog: 
https://sailfishos.org/sailfish-silica/qml-sailfishsilica-dialog.html#acceptDestination-prop

If you set the question-page as the 'acceptDestination' and set the 
'acceptDestinationAction' property to 'PageStackAction.Replace', then the 
effect of accepting the dialog will be to replace the dialog on the stack top 
with question-page.  The pageStack state will transition directly from [ 
initial-page, dialog] to [ initial-page, question-page ], and returning from 
question-page will then go directly back to initial-page.

Note that you must provide the instance or component for the 
'acceptDestination' page before the user has accepted the dialog (because we 
need to be able to show that page when the user starts to drag right-to-left).  
This means you may need to communicate the dialog state at acceptance to the 
already instantiated question-page, by some means.

Hope that helps,
Matt


From: Superpelican [superpeli...@zoho.com]
Sent: Monday, August 12, 2013 4:45 AM
To: Matthew Vogt
Cc: devel@lists.sailfishos.org
Subject: Re: [SailfishDevel] Bug in the Silica Reference docs and possible bug 
in the Dialog component

Hello Matthew,

Sorry for my late reply.

I believe you misunderstood me. I'm not developing a custom Sailfish Dialog 
component, but creating a Sailfish app.
The sources can be found 
here.

My intent is also not to explicitly pop the dialog of the pageStack, but I was 
forced to do this, because the dialog doesn't do it itself!
BTW I have already removed the code that should explicitly pop the dialog of 
the pageStack because it didn't work.

>Also, as the implementor of the Dialog, you should use the onDone() handler to 
>react to the user's actions, leaving the accepted() signal to be handled by 
>users of >your dialog.

Because I'm not creating a custom dialog component, I am actually the user of 
the dialog, so that's why I'm handling the onAccepted() signal. ;)

I've demonstrated what I'm experiencing in this video: 
http://ubuntuone.com/71UqvktzqGWMvukeVTW8Qy (should be viewable in any HTML5 
video supporting browser, that supports WebM, like Firefox and Chromium).

Kind Regards,

Superpelican

On 08/05/2013 01:38 PM, Matthew Vogt wrote:
Hi Superpelican.
Thanks for catching the errors in the Dialog documentation, I will correct them.

In your Clamshell dialog, you do not need to explicitly pop() the dialog page 
in response to the accept action; it is popped by the user's interaction 
(either a drag or an 'Accept' click), and the accepted signal is generated in 
response to this event.

Also, as the implementor of the Dialog, you should use the onDone() handler to 
react to the user's actions, leaving the accepted() signal to be handled by 
users of your dialog.

Thanks,
Matt


From: 
devel-boun...@lists.sailfishos.org 
[devel-boun...@lists.sailfishos.org] 
on behalf of Superpelican [superpeli...@zoho.com]
Sent: Sunday, August 04, 2013 8:42 PM
To: devel@lists.sailfishos.org
Subject: [SailfishDevel] Bug in the Silica Reference docs and possible bug in 
the Dialog component

Hello,

Sfiet_Konstantin and I have had another debugging session on IRC recently with 
my app.
(http://merproject.org/logs/%23sailfishos/%23sailfishos.2013-08-03.log)

I had defined a handler that would be called when the user accepted a dialog. 
However
we saw that the handler was never called. Then I noticed that the documentation 
page
on the Silica Reference about the Dialog component has an error in it. The 
description part
of the page described that an user can accept a dialog by pushing it from right
to left.

But the onAccepted() signal hander description described that the user could 
accept a dialog
by pushing it from left to right. Well I tested it in the emulator and the 
description of the
Dialog component at the top of the page is correct. However the description of 
the onAccepted()
signal handler is incorrect. Instead when you push the dialog from left to 
right you reject it!

So every time I thought I was accepting the dialog, I actually rejected it! ;) 
I had only read the wrong part
of the documentation page.

The onRejected() signal handler description is incorrect too. It says you can 
reject a dialog by pushing it
from right to left. Which actually accepts the dialog.

I hope someone can edit the Silica Reference, so that not more developers read 
the wrong part and wonder
why their defined action doesn't occur! ;)


Also we notice

Re: [SailfishDevel] under which user do apps run

2013-08-11 Thread Jonni Rainisto
http://qt-project.org/doc/qt-5.0/qtcore/qdir.html#homePath

You should replace ~ with homePath() as in some operating systems ~ doesn't 
mean anything.

QDir::homePath()+"/checklist"

From: Wim de Vries [wsvr...@xs4all.nl]
Sent: Sunday, August 11, 2013 11:29 PM
To: Jonni Rainisto
Cc: devel@lists.sailfishos.org
Subject: Re: [SailfishDevel] under which user do apps run

On 08/11/2013 09:22 PM, Jonni Rainisto wrote:
> You must be doing something wrong :)
>
>  qDebug() << getuid();
>  system("whoami");
> ->
> 10
> nemo
You're right. The above gives the same output (I was using QProcess with
no results).
Anyway,  QDir dp("~/checklists") does not return anything, whereas QDir
dp("/home/nemo/checklists") works ok.
That's why I got confused. But the ~ not being recognized may be a Qt issue.

> 
> From: devel-boun...@lists.sailfishos.org [devel-boun...@lists.sailfishos.org] 
> on behalf of Wim de Vries [wsvr...@xs4all.nl]
> Sent: Sunday, August 11, 2013 9:53 PM
> To: devel@lists.sailfishos.org
> Subject: [SailfishDevel] under which user do apps run
>
> Hi,
> Trying to find out under which user my app runs.
> whoami from within the app returns "".
> and ~ has no content.
> Thanks.
> ___
> SailfishOS.org Devel mailing list
>

___
SailfishOS.org Devel mailing list


Re: [SailfishDevel] under which user do apps run

2013-08-11 Thread Wim de Vries

On 08/11/2013 09:22 PM, Jonni Rainisto wrote:

You must be doing something wrong :)

 qDebug() << getuid();
 system("whoami");
->
10
nemo
You're right. The above gives the same output (I was using QProcess with 
no results).
Anyway,  QDir dp("~/checklists") does not return anything, whereas QDir 
dp("/home/nemo/checklists") works ok.

That's why I got confused. But the ~ not being recognized may be a Qt issue.



From: devel-boun...@lists.sailfishos.org [devel-boun...@lists.sailfishos.org] 
on behalf of Wim de Vries [wsvr...@xs4all.nl]
Sent: Sunday, August 11, 2013 9:53 PM
To: devel@lists.sailfishos.org
Subject: [SailfishDevel] under which user do apps run

Hi,
Trying to find out under which user my app runs.
whoami from within the app returns "".
and ~ has no content.
Thanks.
___
SailfishOS.org Devel mailing list



___
SailfishOS.org Devel mailing list


Re: [SailfishDevel] under which user do apps run

2013-08-11 Thread Jonni Rainisto
You must be doing something wrong :)

qDebug() << getuid();
system("whoami");
->
10 
nemo

From: devel-boun...@lists.sailfishos.org [devel-boun...@lists.sailfishos.org] 
on behalf of Wim de Vries [wsvr...@xs4all.nl]
Sent: Sunday, August 11, 2013 9:53 PM
To: devel@lists.sailfishos.org
Subject: [SailfishDevel] under which user do apps run

Hi,
Trying to find out under which user my app runs.
whoami from within the app returns "".
and ~ has no content.
Thanks.
___
SailfishOS.org Devel mailing list
___
SailfishOS.org Devel mailing list


[SailfishDevel] under which user do apps run

2013-08-11 Thread Wim de Vries

Hi,
Trying to find out under which user my app runs.
whoami from within the app returns "".
and ~ has no content.
Thanks.
___
SailfishOS.org Devel mailing list


Re: [SailfishDevel] Bug in the Silica Reference docs and possible bug in the Dialog component

2013-08-11 Thread Superpelican

Hello Matthew,

Sorry for my late reply.

I believe you misunderstood me. I'm not developing a custom Sailfish 
Dialog component, but creating a Sailfish app.
The sources can be found here 
.


My intent is also not to explicitly pop the dialog of the pageStack, but 
I was forced to do this, because the dialog doesn't do it itself!
BTW I have already removed the code that should explicitly pop the 
dialog of the pageStack because it didn't work.


>Also, as the implementor of the Dialog, you should use the onDone() 
handler to react to the user's actions, leaving the accepted() signal to 
be handled by users of >your dialog.


Because I'm not creating a custom dialog component, I am actually the 
user of the dialog, so that's why I'm handling the onAccepted() signal. ;)


I've demonstrated what I'm experiencing in this video: 
http://ubuntuone.com/71UqvktzqGWMvukeVTW8Qy (should be viewable in any 
HTML5 video supporting browser, that supports WebM, like Firefox and 
Chromium).


Kind Regards,

Superpelican

On 08/05/2013 01:38 PM, Matthew Vogt wrote:

Hi Superpelican.
Thanks for catching the errors in the Dialog documentation, I will 
correct them.


In your Clamshell dialog, you do not need to explicitly pop() the 
dialog page in response to the accept action; it is popped by the 
user's interaction (either a drag or an 'Accept' click), and the 
accepted signal is generated in response to this event.


Also, as the implementor of the Dialog, you should use the onDone() 
handler to react to the user's actions, leaving the accepted() signal 
to be handled by users of your dialog.


Thanks,
Matt


*From:* devel-boun...@lists.sailfishos.org 
[devel-boun...@lists.sailfishos.org] on behalf of Superpelican 
[superpeli...@zoho.com]

*Sent:* Sunday, August 04, 2013 8:42 PM
*To:* devel@lists.sailfishos.org
*Subject:* [SailfishDevel] Bug in the Silica Reference docs and 
possible bug in the Dialog component


Hello,

Sfiet_Konstantin and I have had another debugging session on IRC 
recently with my app.

(http://merproject.org/logs/%23sailfishos/%23sailfishos.2013-08-03.log)

I had defined a handler that would be called when the user accepted a 
dialog. However
we saw that the handler was never called. Then I noticed that the 
documentation page
on the Silica Reference about the Dialog component has an error in it. 
The description part
of the page described that an user can accept a dialog by pushing it 
*from right

to left*.

But the onAccepted() signal hander description described that the user 
could accept a dialog
by pushing it *from left to right*. Well I tested it in the emulator 
and the description of the
Dialog component at the top of the page is correct. However the 
description of the onAccepted()
signal handler is incorrect. Instead when you push the dialog *from 
left to right* you *reject it*!


So every time I thought I was accepting the dialog, I actually 
rejected it! ;) I had only read the wrong part

of the documentation page.

The onRejected() signal handler description is incorrect too. It says 
you can reject a dialog by pushing it

*from right to left*. Which actually accepts the dialog.

I hope someone can edit the Silica Reference, so that not more 
developers read the wrong part and wonder

why their defined action doesn't occur! ;)


Also we noticed that when a dialog is accepted, it isn't popped from 
the pageStack. While according to Sfiet_Konstantin
this should happen. This is especially a problem in my app, where the 
app has a homescreen where a mode is chosen.
Then when a particular mode is chosen the user is first prompted for a 
dialog, to enter information that is required for
that mode to operate. After the user has accepted the dialog, the mode 
begins. The user can quit the mode and return

to the homescreen by simply pushing away the "mode page".

However when the user does that, the dialog is still there and he/she
will have to reject the dialog too and will then finally return to the 
homescreen. Not only does this require another action from the user,
it can also be confusing to see a dialog with the previously entered 
value still in it. Some users will think they need to accept the dialog.
But if they do, they'll return to the "mode page", not the homescreen. 
This can be very confusing.


This can all be seen in this video: 
http://ubuntuone.com/7MIfo6vKsdqg9PmgSQ9iH4 
 (note: this requires a 
browser that supports HTML5, otherwise
you'll need to download the video and play it in your local video 
player). Unfortunately the video has a very low framerate. 
Sfiet_Konstantin and I
don't know whether this is due to my laptop not being particulary 
highly spec'd or Wayland causing the low framerate. I can remember 
recording
applications and games with another recordmydesktop frontend on a much 
lower

Re: [SailfishDevel] file permissions of user data files

2013-08-11 Thread Wim de Vries

On 08/11/2013 01:36 PM, "Thomas B. Rücker" wrote:

On 08/11/2013 12:21 PM, Wim de Vries wrote:

Hi,
I am trying to save a file from within my app.
I can read the file, not write to it:

cannot open "/etc/ssh/authorized_keys/checklists/GEO1" ; "Permission
denied"
 From within ubuntu I have made the file (GEO1) and dir (checklists)
r/w for all.
Thanks.



Why are you as a *user* trying to write to /etc/?
That's usually completely off limits and for very good reasons I must say.

Thanks.
Indeed, you are right. Wrong place to have user data. I didn't focus on 
where it ends up on the emulator.
It seems that this is the place where shared files (from the devel 
machine: emulator/1/ssh) end up.

I guess I have to copy the files via the deployment.
I'll try to figure out the documentation on that ;-(
r
wim



Cheers

Thomas
___
SailfishOS.org Devel mailing list



___
SailfishOS.org Devel mailing list


Re: [SailfishDevel] file permissions of user data files

2013-08-11 Thread Thomas B. Rücker
On 08/11/2013 12:21 PM, Wim de Vries wrote:
> Hi,
> I am trying to save a file from within my app.
> I can read the file, not write to it:
>
> cannot open "/etc/ssh/authorized_keys/checklists/GEO1" ; "Permission
> denied"
> From within ubuntu I have made the file (GEO1) and dir (checklists)
> r/w for all.
> Thanks.
>
>

Why are you as a *user* trying to write to /etc/?
That's usually completely off limits and for very good reasons I must say.

Cheers

Thomas
___
SailfishOS.org Devel mailing list


[SailfishDevel] file permissions of user data files

2013-08-11 Thread Wim de Vries

Hi,
I am trying to save a file from within my app.
I can read the file, not write to it:

cannot open "/etc/ssh/authorized_keys/checklists/GEO1" ; "Permission 
denied"
From within ubuntu I have made the file (GEO1) and dir (checklists) r/w 
for all.

Thanks.


___
SailfishOS.org Devel mailing list