Re: [SailfishDevel] Swipe Lock

2013-11-29 Thread Mariano Boragno
Hi Jonni,


Does that mean that I cannot dynamically enable/disable swipe lock on the
fly?


Thanks for your answer!


Regards...



--



...Mariano Boragno...



On 29/11/13 14:45 Jonni Rainisto wrote:
Hi

You need to call that before your setSource-line, as setFlags will not do
anything if qml is already loaded.

Usually I do it with something like this:
QScopedPointerQGuiApplication app(Sailfish::createApplication(argc
, argv));
QScopedPointerQQuickView view(Sailfish::createView());

// Disable swipe gestures in proper way

view-setFlags(view-flags()|Qt::WindowOverridesSystemGestures);

Sailfish::setView(view.data(), qrc:/main.qml);


re, Jonni
 --
*From:* devel-boun...@lists.sailfishos.org [
devel-boun...@lists.sailfishos.org] on behalf of Mariano Boragno [
marianobora...@gmail.com]
*Sent:* Friday, November 29, 2013 6:54 PM
*To:* devel@lists.sailfishos.org
*Subject:* [SailfishDevel] Swipe Lock

   Hi guys,

 I'm doing a game that requires to lock the system gestures (it's a game
for babies, so I have to lock the swipe to avoid the baby from surfing all
around the phone :) )

 According to https://sailfishos.org/wiki/Porting/Harmattan it must be done
through Qt::WindowOverridesSystemGestures, which I guess must be set on the
main window. What I've done is:

QGuiApplication *app = SailfishApp::application(argc, argv);
QQuickView *view = SailfishApp::createView();
 view-setSource(SailfishApp::pathTo(qml/myGame.qml));
view-showFullScreen();

view-setFlags(view-flags() | Qt::WindowOverridesSystemGestures);

return app-exec();

 But I can still swipe the app away in the emulator.

What am I doing wrong?

Thanks a lot, regards...


 ...Mariano Boragno...

___
SailfishOS.org Devel mailing list
___
SailfishOS.org Devel mailing list

Re: [SailfishDevel] Swipe Lock

2013-11-29 Thread Mariano Boragno
Hi guys,

Anyway, this didn't work. I've set the Qt::WindowOverridesSystemGestures as
Jonni proposed but I can still minimize and close the application using the
swipe gesture.

This feature is a must in my application. The game is intended to block
babies from playing around with the phone while getting them entertained,
so I need a way to block the gestures.

Any other suggestions?

Thank you!!!

Regards...


...Mariano Boragno...


On Fri, Nov 29, 2013 at 3:13 PM, Mariano Boragno
marianobora...@gmail.comwrote:

 Hi Jonni,


 Does that mean that I cannot dynamically enable/disable swipe lock on the
 fly?


 Thanks for your answer!


 Regards...



 --



 ...Mariano Boragno...



 On 29/11/13 14:45 Jonni Rainisto wrote:
  Hi

 You need to call that before your setSource-line, as setFlags will not do
 anything if qml is already loaded.

 Usually I do it with something like this:
 QScopedPointerQGuiApplication app(Sailfish::createApplication(
 argc, argv));
 QScopedPointerQQuickView view(Sailfish::createView());

 // Disable swipe gestures in proper way

 view-setFlags(view-flags()|Qt::WindowOverridesSystemGestures);

 Sailfish::setView(view.data(), qrc:/main.qml);


 re, Jonni
  --
 *From:* devel-boun...@lists.sailfishos.org [
 devel-boun...@lists.sailfishos.org] on behalf of Mariano Boragno [
 marianobora...@gmail.com]
 *Sent:* Friday, November 29, 2013 6:54 PM
 *To:* devel@lists.sailfishos.org
 *Subject:* [SailfishDevel] Swipe Lock

Hi guys,

  I'm doing a game that requires to lock the system gestures (it's a game
 for babies, so I have to lock the swipe to avoid the baby from surfing all
 around the phone :) )

  According to https://sailfishos.org/wiki/Porting/Harmattan it must be
 done through Qt::WindowOverridesSystemGestures, which I guess must be set
 on the main window. What I've done is:

 QGuiApplication *app = SailfishApp::application(argc, argv);
 QQuickView *view = SailfishApp::createView();
  view-setSource(SailfishApp::pathTo(qml/myGame.qml));
 view-showFullScreen();

 view-setFlags(view-flags() | Qt::WindowOverridesSystemGestures);

 return app-exec();

  But I can still swipe the app away in the emulator.

 What am I doing wrong?

 Thanks a lot, regards...


  ...Mariano Boragno...

 ___
 SailfishOS.org Devel mailing list


___
SailfishOS.org Devel mailing list

Re: [SailfishDevel] Feedback / Haptics on Jolla Device

2013-11-21 Thread Mariano Boragno
Hi Chris,

Well, that was sss simple! I wasn't able to find any documentation,
next time I will try to calm myself down and dig some more, lol!

Thanks a lot for the support, guys! I hope to submit my game soon to the
harbour... :-)



...Mariano Boragno...


On Thu, Nov 21, 2013 at 7:52 PM, christopher.l...@thurweb.ch wrote:

 Ciao Mariaon

 Have you tried:

 import QtFeedback 5.0

 https://qt.gitorious.org/qt/qtfeedback/source/
 dea0da72655f1defccaea643dbe37373f6692243:doc/src/snippets/
 declarative/declarative-feedback.qml

 Obviously your emulator won't vibrate ...8-)

 Chris



 Zitat von Mariano Boragno marianobora...@gmail.com:


  Hi there,

 I'm porting a little game I wrote for Harmattan in QML which uses
 HapticsEffect from the Qt Mobility 1.2 Feedback API. I've found that as
 per https://sailfishos.org/wiki/Porting/Harmattan, Qt5 QtFeedback Add-on
 could be used in Sailfish, but I haven't found much documentation about
 it.

 Is there any QML plugin (something like a wrapper) to use the add-on or
 should I interface the QML view with C++? Any suggestion, ideas?

 Thanks a lot in advance.

 Regards...

 ...Mariano Boragno...





___
SailfishOS.org Devel mailing list

Re: [SailfishDevel] Playing a wav in Sailfish

2013-06-16 Thread Mariano Boragno
I just wanted to add that I had no sound either at Windows. After
connecting to the emulator through ssh I just used alsamix to adjust the
volume (had to select the sound card in there), it was mutes. That brought
the sound on!


Hope this helps!


Regards...



--



...Mariano Boragno...



On 16/06/13 04:29 christopher.l...@thurweb.ch wrote:
Hi Joao

we need to get your SSH connections working! Just like every driver should
at least be able open the bonnet of a car, so being able to ssh to the SDK
and Emulator is very handy. (and the little boy in me just loves to open
things up ...)

Trekking back to the Alpha known issues page:

https://sailfishos.org/wiki/**SDK_Alpha_Known_Issueshttps://sailfishos.org/wiki/SDK_Alpha_Known_Issues

we find quite a few hints on SSH problems, including:

If you get Agent admitted failure to sign using the key when using ssh,
try setting SSH_AUTH_SOCK=

When I was playing around with a Sailfish on Lubuntu host that fixed it for
me.

Try that on the command line of your development host.

Another possible solution is suggested here (for GitHub, not Sailfish)
https://help.github.com/**articles/error-agent-admitted-**failure-to-signhttps://help.github.com/articles/error-agent-admitted-failure-to-sign


Chris


Zitat von joao morgado joaodeusmorg...@yahoo.com:



 Hi Chris

 Thanks for your help. I activated the audio in virtualbox with the options
 PulseAudio and ICH AC97 (I tested other options also), tested your program
 and still no sound. From what I've googled, it seems to be a virtualbox
 problem, some people fix it by changing PulseAudio and ICH AC97 options,
 but to me still didnt work.


 I tried to ssh  the sdk with ssh -i ~/.ssh/mer-qt-creator-rsa
 mersdk@localhost -p  but I got an error:
 Agent admitted failure to sign using the key.
 Permission denied (publickey).

 I got the same error trying to ssh the emulator, don't know why I, because
 from the QtCreator Tools - Options - devices , I can sucessfully test the
 connections with the emulator.

 At least I know that it's not  a problem with my code.

 Regards
 João




 __**__
  De: christopher.l...@thurweb.ch christopher.l...@thurweb.ch
 Para: joao morgado joaodeusmorg...@yahoo.com
 Cc: devel@lists.sailfishos.org devel@lists.sailfishos.org
 Enviadas: Sexta-feira, 14 de Junho de 2013 7:49
 Assunto: Re: [SailfishDevel] Playing a wav in Sailfish


 Hi João

 I have just made a little demo project, importing QtMultimediaKit 1.1,
 and a SoundEffect Component.

 I added a Button component to the Column to play the sound when clicked.

 My Demo works, I get a swish sound when the button is clicked.

 You will find the code of my FirstPage at the bottom of this mail.
 Create a new demo project, and paste my code into the FirstPage.

 Note I copied my wav to the pages folder (alongside FirstPage). Please
 substitute your own wav file - I grabbed the first one I could find on
 the train. Put you wav in the Pages folder.


 Do you get any sound at all from the Emulator? For instance on a demo
 new project with the PullDownMenu you should get a distinct click
 sound when the menu opens.

 On the known issues page
 https://sailfishos.org/wiki/**SDK_Alpha_Known_Issues#**Emulatorhttps://sailfishos.org/wiki/SDK_Alpha_Known_Issues#EmulatorI
  found
 this:

 The sound is not enabled in the Emulator. Fix: Shutdown the emulator;
 Open virtualbox manager; Pick SailfishOS Emulator, Pick Settings,
 pick Audio, Enable audio (default driver). Accept. Start Emulator. The
 Pulley menus make a sound for testing purposes.

 Assuming that you do get sound, do you have QtMultimedia installed?

 Connect to the SDK by SSH and search for QtMultimedia with zipper:

 zypper se multi

 I get this:

 S | Name | Zusammenfassung
 | Typ
 --+---**---+--**
 --**+--
| libdeclarative-multimedia| Qt Mobility
 Multimedia QML plugin  | Paket
| libqtmultimediakit1  | Qt Mobility
 MultimediaKit module   | Paket
 i | multi_c_rehash   | A c_rehash
 implementation in C | Paket
| multi_c_rehash-debuginfo | Debug
 information for package multi_c_rehash   | Paket
| multi_c_rehash-debugsource   | Debug sources
 for package multi_c_rehash   | Paket


 Repeat with the the Emulator:

 If  you don't get anything like this then you will have to install
 QtMultimedia.

 Chris


 //Start FirstPage.qml
 import QtQuick 1.1
 import Sailfish.Silica 1.0
 import QtMultimediaKit 1.1

 Page {
  id: page

  // To enable PullDownMenu, place our content in a SilicaFlickable
  SilicaFlickable {
  anchors.fill: parent

  // PullDownMenu and PushUpMenu must be declared

Re: [SailfishDevel] Playing a wav in Sailfish

2013-06-16 Thread Mariano Boragno
Hi Chris,

I don't know if João's system has the same specs as mine (Windows 7 64-bit,
VBox v4.2.12). What I did (same as João) are the following steps:

   1. Connect to the Emulator (SSH or Alt+Ctrl+F2 in the emulator window,
   nemo/nemo to log in).
   2. Run alsamixer in the command line.
   3. Press F6 and select 0 HDA Intel from the list (that is the sound
   card in my case, don't know if it's always the same).
   4. You will find that the master channel is muted. Press M key to unmute
   it and adjust it with the up/down arrow keys.
   5. Do the same for all muted output channels, if there are some.
   6. Press ESC to quit alsamixer.
   7. You are done, sounds was working fine, it was just muted :)

That did the trick for me and seems it did for João too.

João, glad you worked it out! :)


Sail on!



...Mariano Boragno...


On Sun, Jun 16, 2013 at 1:47 PM, christopher.l...@thurweb.ch wrote:

 Hi João

 It's really cool that you have got this working!

 What exactly did you do in alsamixer?

 If you let us know, then maybe one of the Jolla Sailors will add this to
 the known issues page.


 Chris

 Zitat von joao morgado joaodeusmorg...@yahoo.com:

  Thank all for your precious help, the sound is working now.

 Using SSH_AUTH_SOCK=  did the trick, I was able to log in.
 Then in the sdk, alsamixer was unknow, I installed alsa-utils with sudo
 zypper in alsa-utils and still no alsamixer.
 It was when I ssh the emulator that I could use alsamixer, the problem
 was in fact the mute and low sound, I had to playaround a bit to select the
 correct sound card.

 Solved :)

 Thanks again
 João




 __**__
  De: Mariano Boragno marianobora...@gmail.com
 Para: joao morgado joaodeusmorg...@yahoo.com; 
 christopher.l...@thurweb.ch christopher.l...@thurweb.ch
 Cc: devel@lists.sailfishos.org devel@lists.sailfishos.org
 Enviadas: Domingo, 16 de Junho de 2013 12:59
 Assunto: Re: [SailfishDevel] Playing a wav in Sailfish



 I just wanted to add that I had no sound either at Windows. After
 connecting to the emulator through ssh I just used alsamix to adjust the
 volume (had to select the sound card in there), it was mutes. That brought
 the sound on!

 Hope this helps!

 Regards...

 --

 ...Mariano Boragno...


 On 16/06/13 04:29 christopher.l...@thurweb.ch wrote:

 Hi Joao

 we need to get your SSH connections working! Just like every driver
 should at least be able open the bonnet of a car, so being able to ssh to
 the SDK and Emulator is very handy. (and the little boy in me just loves to
 open things up ...)

 Trekking back to the Alpha known issues page:

 https://sailfishos.org/wiki/**SDK_Alpha_Known_Issueshttps://sailfishos.org/wiki/SDK_Alpha_Known_Issues

 we find quite a few hints on SSH problems, including:

 If you get Agent admitted failure to sign using the key when using ssh,
 try setting SSH_AUTH_SOCK=

 When I was playing around with a Sailfish on Lubuntu host that fixed it
 for me.

 Try that on the command line of your development host.

 Another possible solution is suggested here (for GitHub, not Sailfish)
 https://help.github.com/**articles/error-agent-admitted-**failure-to-signhttps://help.github.com/articles/error-agent-admitted-failure-to-sign


 Chris


 Zitat von joao morgado joaodeusmorg...@yahoo.com:




 Hi Chris

 Thanks for your help. I activated the audio in virtualbox with the
 options PulseAudio and ICH AC97 (I tested other options also), tested your
 program and still no sound. From what I've googled, it seems to be a
 virtualbox problem, some people fix it by changing PulseAudio and ICH AC97
 options, but to me still didnt work.


 I tried to ssh  the sdk with ssh -i ~/.ssh/mer-qt-creator-rsa
 mersdk@localhost -p  but I got an error:
 Agent admitted failure to sign using the key.
 Permission denied (publickey).

 I got the same error trying to ssh the emulator, don't know why I,
 because from the QtCreator Tools - Options - devices , I can sucessfully
 test the connections with the emulator.

 At least I know that it's not  a problem with my code.

 Regards
 João




 __**__
  De: christopher.l...@thurweb.ch christopher.l...@thurweb.ch
 Para: joao morgado joaodeusmorg...@yahoo.com
 Cc: devel@lists.sailfishos.org devel@lists.sailfishos.org
 Enviadas: Sexta-feira, 14 de Junho de 2013 7:49
 Assunto: Re: [SailfishDevel] Playing a wav in Sailfish


 Hi João

 I have just made a little demo project, importing QtMultimediaKit 1.1,
 and a SoundEffect Component.

 I added a Button component to the Column to play the sound when clicked.

 My Demo works, I get a swish sound when the button is clicked.

 You will find the code of my FirstPage at the bottom of this mail.
 Create a new demo project, and paste my code into the FirstPage.

 Note I copied my wav to the pages folder (alongside FirstPage). Please
 substitute your own wav file - I grabbed the first one I could find on
 the train. Put you wav in the Pages folder.


 Do