ctriantaf / cnotes-ubuntu-touch

CNotes - Ubuntu Touch
2 stars 0 forks source link

Fix click on a link #16

Closed ctriantaf closed 11 years ago

ctriantaf commented 11 years ago

I need to open the default browser when the user clicks on a link. I can't do it now because I don't think that a thing like Intent on android exists for Ubuntu touch at the moment.

iBelieve commented 11 years ago

Just use Qt.openLinkExternally (or something like that, not sure on the exact function name).

To open links when clicking on them in a text view, you should be able to implement a signal handler called something like onLinkActivated (typing from memory again, so no guarantees that's exactly correct).

ctriantaf commented 11 years ago

I don't have the links in a textview.. Qt.openUrlExternally doesn't work.

gvfs-open: file:///media/Files/UbuntuTouchDevelopment/CNotes/components/www.google.com: error opening location: Error when getting information for file '/media/Files/UbuntuTouchDevelopment/CNotes/components/www.google.com'
iBelieve commented 11 years ago

Are you missing the http:// or https:// part from the start of the link?

ctriantaf commented 11 years ago

Yes. How I can know if a link needs http:// or https:// or it doesn't matter ? Because if you ask me to right down a link I'll never write http:// or https:// before www

iBelieve commented 11 years ago

I never would write that down either. I guess openUrlExternally defaults to using open it as a local file. What you could do is write a wrapper function that checks to see if you have :// at the start and if not, adds http:// to the start. That way you wouldn't need it write it.

ctriantaf commented 11 years ago

Thats what I'll do probably... If you have time can you help me with something else?