/srv/irclogs.ubuntu.com/2015/09/12/#ubuntu-app-devel.txt

justCarakas@balloons I have a problem with my nexus 4 and don't know who to ask. I wanted to switch from the ubuntu channel to the bq-aquaris channel but I accidently switched to the devel of the meizu. I quickly noticed my mistake and switched to the bq-aquaris channel but since then I have some graphical errors, background of message app is empty. system reset screen is just white I can't change my alarms because there are b08:39
justCarakas@popey @mhall119 @anyone who can help me ?09:30
nik90justCarakas: Have you tried wipe user data while reflashing to the bq-aquaris channel?09:34
nik90s/Have you tried/Did you09:34
justCarakasnik90: is that an extra option ? I usually switch channels by sshing to my phone and then sudo system-image-cli --switch ubuntu-touch/stable/bq-aquaris.en or another channel09:37
nik90justCarakas: I am having trouble remembering the argument you need to pass, let me check. But usually when I run into issues like this, I just reflash it clean.09:38
justCarakasis there a way to keep the installed apps or at least the data ?09:39
justCarakasnik90: I use this phone as my daily driver, so being able to keep the important stuff would be handy09:40
nik90justCarakas: Ah oke..then a data wipe is not recommended.09:41
nik90not sure why you're getting graphical glitches..09:41
nik90I thought perhaps it could be app configuration data that got messed up09:42
nik90which is why I suggested a clean slate09:42
justCarakasI think it is something that got on to my phone from the ubuntu-touch/devel/krillin.en channel that stayed after switching09:43
justCarakasthat channel is still on 14.10 if I remember correctly09:43
justCarakasis it possible to reset only sertain apps ?09:46
justCarakasbecause  I've been looking around and I think it is only in the alarm, the messaging and settings app09:46
justCarakasthe 3 apps I opened while on the wrong channel09:47
justCarakasit worked :)10:22
aquariusIf my app is started with a URL (that is: I've registered for URL scheme "myapp", and some other app opens the URL myapp://something), then I can get the URL from Qt.application.arguments. But how do I do that if my app is already running?10:25
aquariusnik90 you may know the answer to the question I asked ten seconds before you appeared:10:26
aquariusIf my app is started with a URL (that is: I've registered for URL scheme "myapp", and some other app opens the URL myapp://something), then I can get the URL from Qt.application.arguments. But how do I do that if my app is already running?10:26
nik90aquarius: can you repeat the question since I dont log message when I am offline10:27
aquariusyup did so :)10:27
nik90hmm..I have done it personally, but I am remember someone else having that very issue. I think it was the omgubuntu scope&app developer.10:29
nik90s/have/haven't10:29
aquariusthe documentation is completely silent on this issue :)10:29
nik90What happens when you call your app by myapp://something while your app is running? Does it not update the arguments?10:30
aquariusthe issue is where I *look* for the arguments10:30
DanChapmannik90: regarding your enum question, you probably won't be able to use the Alarm enums in another c++ directly as the enum types have only been registered in the qml context. So you can only use them in qml and the qobject class they have been declared in. When passing an enum to another c++ class from qml it will get passed as an int. So it's easy enough to translate that back to something meaningful inside the class10:31
nik90aquarius: well you said that the arguments are stored in Qt.application.arguments. So monitor that variable for changes.10:31
aquariusMy thought was to check its value in MainView:Component.onCompleted10:32
aquariusbut that will only get called on actual startup10:32
aquariusbut I could do it in onActive or whatever it is, which is called whenever I become foreground, couldn't I?10:33
nik90DanChapman: the thing is in the clock app we have some alarm helper functions defined in javascript. I would like ideally convert that to a nice abstracted c++ class library. I suppose I could pass the Alarm enum types as properties to the class and use it internally.10:33
nik90aquarius: yes that's also possible.10:33
DanChapmanaquarius: in dekko we listen to UriHandler and process uri's as they arrive https://bitbucket.org/dekkoproject/dekko/src/82d2e8077780f39ede2f9ff8eb005242955dc29a/qml/main.qml?at=devel&fileviewer=file-view-default#main.qml-24610:33
* aquarius rtfdanchapmans10:33
aquariushuh.10:33
nik90ah yes..QML Connections should do it!10:34
aquariusthat seems extremely useful10:34
aquariusand extremely undocumented ;)10:34
aquariusnice one DanChapman10:34
nik90aquarius: https://developer.ubuntu.com/api/apps/qml/sdk-15.04/Ubuntu.Components.UriHandler/10:34
nik90it is documented :)10:34
aquariusha!10:34
aquariusI shall write a bug saying "WHY DOESN'T THE URLDISPATCHER DOC LINK TO THIS" :)10:35
nik90haha :P10:36
nik90oh aquarius ... very hard to meet your requirements :P10:36
nik90s/requirements/expectations10:36
* nik90 always uses the wrong word10:36
aquariushttps://bugs.launchpad.net/developer-ubuntu-com/+bug/1495052 filed. :)10:37
ubot5Ubuntu bug 1495052 in Ubuntu Developer Portal "URLDispatcher documentation does not mention UriHandler" [Undecided,New]10:37
nik90and confirmed :)10:38
DanChapmannik90: can you point me to an example of a helper you want to convert.10:38
aquariusif "our documentation ought to be useful to app developers" is an unattainably high expectation then I'm giving up hacking and going back to chemistry. :)10:38
nik90DanChapman: sure, one sec10:38
nik90DanChapman: http://bazaar.launchpad.net/~ubuntu-clock-dev/ubuntu-clock-app/trunk/view/head:/app/alarm/AlarmUtils.qml10:39
nik90DanChapman: I would like to convert it to something like http://bazaar.launchpad.net/~ubuntu-clock-dev/ubuntu-clock-app/trunk/view/head:/backend/modules/Stopwatch/formattime.h10:40
nik90essentially moving all logic functions to c++ and retaining qml for UI purposes. So nothing complicated as I am just starting to get familiar with Qt C++.10:40
=== nik90 is now known as nik90|Lunch
aquariushuh. So, UriHandler works for URLs received at runtime. It does not work for having your app be *started* with a URL11:20
aquariusbut, weirdly, Qt.application.arguments when my app is started by URL is: ["/path/to/qmlscene", "$@", "app.qml"]11:21
aquariusthat is: $@ is not being substituted with actual arguments; it's passed literally11:21
aquariusthat's surely not supposed to happen?11:21
zsombiElleo: what was your workaround?11:27
zsombinik90|Lunch: there' sno C++ alarm api11:28
aquariuszsombi, do you know what's going on with my QML app not getting arguments substituted? Maybe I've misunderstood how URLDispatcher and UriHandler work11:30
zsombinik90|Lunch: but you can call all the methods/properties/signals from cpp11:30
zsombinik90|Lunch: that's the beauty of meta object model ;)11:30
zsombiaquarius: arguments?11:30
zsombiaquarius: app args are only given by UriHandler when the app is started first time, never after11:31
aquariuszsombi, I think that's actually exactly the wrong way around11:32
aquariuszsombi, I'm testing here, and UriHandler gives me the URL if the app is already running, and *doesn't* when the app is started11:32
aquariusand I can't see how to get the URL when the app is started; I thought maybe it would be in Qt.application.arguments, but those are ["/path/to/qmlscene", "$@", "app.qml"] which means that the $@ isn't being substituted with the actual arguments11:34
zsombiaquarius: uhh, sorry, I messed it, it's other way around :)11:35
aquariuszsombi, yup :) So... how do I get the URL when my app is started?11:36
zsombiaquarius: so UriHandler will get it only when the app is already running :)11:36
Elleozsombi: monitor onPressedChanged in the AbstractButton and if(!pressed) { trigger(); }11:36
zsombiaquarius: easily, you have the Arguments QML element to help you out11:36
Elleoso when pressed stops being true it triggers instead of when the release event is emitted (which doesn't happen due to the movement of the mouse area)11:36
zsombiElleo: that's bad11:36
DanChapmanaquarius: i remember being puzzled by something similar. I ended up just picking the uri's of the APP_URIS env var on app launch. Obviously that's not so easy for qml only apps11:37
aquariuszsombi, the URL isn't *in* the arguments I'm given, though. Qt.application.arguments is ["/path/to/qmlscene", "$@", "app.qml"]11:37
zsombiElleo: the clicked should happen, but as said in #ubuntu-touch, the ListItem grabs the mouse event from the panels, which shouldn't be like that11:37
zsombiaquarius: do you use Arguments type?11:38
zsombiaquarius: I'm not talking about the UriHandler11:38
aquariuszsombi, I haven't used the Arguments type yet; I'm just printing out the actual arguments that are passed to the app, which are in Qt.application.arguments. The Arguments type helps me to parse that, but it won't help because the URI is not *in* the arguments that my app is passed.11:39
zsombiaquarius: https://developer.ubuntu.com/api/apps/qml/sdk-15.04/Ubuntu.Components.Arguments/11:39
Elleozsombi: yeah, it's the movement that stops onClicked happening, I'd thought the movement started on release but it seems it starts if you make a tiny positional shift (presumably that's due to it viewing it as a swipe)11:39
zsombiaquarius: ahha... then applauncher somehow eats 'em11:39
aquariuszsombi, indeed11:39
aquariuszsombi, that's my question :)11:39
Elleozsombi: onclicked and onrelease don't work if the mousearea they're reporting for has moved11:40
zsombiaquarius: buggy :D11:40
aquariuszsombi, Qt.application.arguments is ["/path/to/qmlscene", "$@", "app.qml"]11:40
zsombiElleo: right... there was a fix recently which did mess this up.11:40
zsombiElleo: and as touch events do usually produce press and move events immediately, this is revealed on touch only11:40
DanChapmanaquarius: i think zsombi means this Argumetns type https://developer.ubuntu.com/api/apps/qml/sdk-15.04/Ubuntu.Components.Arguments/11:40
DanChapmanbah just read scrollback11:41
DanChapmanignore me11:41
zsombiDanChapman: yes, I already posted the link, what I'm saying is that UriHandler and Arguments should both get the URI when the app is launched (I forgot the word both last time)11:41
=== nik90|Lunch is now known as nik90
zsombiso for you there shouldn't be any diff when your app is launched or re-activated11:42
nik90zsombi: you mentioned "but you can call all the methods/properties/signals from cpp"..how do I that?11:42
zsombinik90: yes11:42
zsombinik90: duuude, welcome to the wonderful world of MOM11:42
zsombi:)11:42
zsombinik90: a bit of history11:43
zsombinik90: does QtServiceFramework ring any bell for you?11:43
zsombinik90: from Qt mobility 1.211:43
nik90I have used Qt Mobility 1.2, but not QtServiceFramework. I shall read about it11:44
zsombinik90: ok, never mind11:44
zsombinik90: so, QtServiceFramework was working so that dynamically loaded plugins, was working with in-process and out-of-process plugins11:45
zsombinik90: AND the beauty: the plugins were able to provide interfaces whos API was only on "paper"11:45
zsombinik90: querying meta object from the interface object itself, they were invoking 'em11:46
nik90ok11:46
zsombinik90: so11:46
aquariuszsombi, my exec line in myapp.desktop is "Exec=qmlscene $@ myapp.qml". I think that the $@ should be being substituted with actual arguments, and it isn't :(11:46
zsombinik90: same with Alarms11:46
zsombiaquarius: yeah11:46
zsombiaquarius: tedg is your friend on that :)11:47
aquariuszsombi, I don't know how to debug that... it's surely a huge platform bug? That means that no argument passing works for anything :(11:47
aquariusI will ping tedg :)11:47
aquariusbah is 6.45am in Texas :)11:47
zsombinik90: so if in cpp you can access the alarm object or the alarm model, if you know the params/signals/slots, you can invoke them :)11:47
nik90ah ok now I get it.11:48
zsombinik90: how to get it? easily!11:48
zsombinik90: assume each page has a property called alarm and one called alarmModel11:48
zsombinik90: yiou simply do fetch the QObject* in cpp like11:49
zsombipage->property("alarm").value<QObject*>();11:49
zsombinik90: where Page is a QObject as well11:49
nik90ok11:50
zsombinik90: then alarm->metaObject()->invoke(alarm, "save);11:50
zsombinik90: it is that simple :)11:50
nik90zsombi: but my class object will be instantiated within a Page and should thereby have access to the Page QObject..through which I use the above syntax to access the alarm properties11:51
zsombinik90: but, if you store the alarm in cpp member somewhere, beware and use QPointer<QObject> alarm11:51
zsombinik90: or your object can have properties you will set then11:52
zsombinik90: even easier11:52
zsombinik90: I just used this to illustrate the possibility :)11:53
zsombinik90: the only thing is to transfer the objects to cpp, you can do that thru functions, properties, whatever11:53
nik90cool11:54
aquariusAhahahaha!11:54
aquariusHaving the desktop Exec line be qmlscene "$@" main.qml is WRONG.11:54
aquariusIt should be qmlscene %u main.qml or qmlscene %f main.qml.11:54
aquariusThat means that the default template is wrong )11:54
aquarius:)11:54
zsombiaquarius: okaaay... so then the bug is in qtcreator-plugin project11:55
aquariusyup!11:55
nik90https://launchpad.net/qtcreator-plugin-ubuntu11:55
aquariusI am filing it now :)11:55
zsombiaquarius: zbenjamin will be utmost happy to fix it ;)11:55
aquariushttps://bugs.launchpad.net/ubuntu/+source/qtcreator-plugin-ubuntu/+bug/1495062 filed :)11:58
ubot5Ubuntu bug 1495062 in qtcreator-plugin-ubuntu (Ubuntu) "QML project .desktop Exec line incorrectly uses $@" [Undecided,New]11:58
* zbenjamin can not promise nor deny anthing11:59
nik90zsombi: so QProperty(QVariant tempAlarm read TempAlarm write setTempAlarm notify onTempAlarmChanged) where in qml I pass it an alarm object.11:59
nik90Where does the QPointer<QObject> alarm come int play?12:00
nik90I want to set the tempAlarm properties like daysOfWeek, etc.. and then use that alarm object in QML12:00
zbenjaminnik90: btw, happy to see you here but what happend to the break you wanted to take ? :D12:01
zsombinik90: setTempAlarm would need to store the value somewhere right? you store in a QPointer<QObject>12:01
zsombizbenjamin: he cannot escape from ubuntu app development :)12:01
nik90zbenjamin: I was and then got sucked into stopwatch. Now I mostly review code and occasionally provide patches to clock-app.12:01
nik90zsombi: ah yes..I need to private variable to store the value.12:02
zsombinik90: :)12:02
nik90Elleo: current podbird trunk has a issue with the page tab button when you press the search button and then press back.14:37
nik901. Search for a podcast in the podcast tab. 2. Press Back 3. Notice black square instead of tab button14:38
Elleonik90: okay, will take a look at that next14:43
nik90Elleo: I moved the list/grid view button to the settings page. That's why I removed it from the podcast tab header since I figured people don't switch views that frequently.14:45
nik90I am really liking the new improved icon. Adds a nice touch to the bird ;)14:46
Elleonik90: ah, I didn't spot that14:46
nik90Elleo: It was due to https://bugs.launchpad.net/podbird/+bug/1451999. People are requesting more and more views.14:48
ubot5Ubuntu bug 1451999 in podbird trunk "Add 'Downloaded' view" [Wishlist,Triaged]14:48
Elleonik90: yeah, I don't really want to add any more top level views, but I have split the episodes page into Unheard/Listened/Downloaded which I think covers most common cases for filtering14:50
nik90Elleo: True, if you install Podbird-Devel you will see that I actually reduced the Top views to just Podcasts, Episodes and Settings.14:50
nik90the What's new tab becomes a page section in the episodes tab.14:51
nik90but its something I was testing around14:51
Elleoyeah, I prefer having a global what's new myself14:51
nik90ah ok14:51
Elleoso you can see at a glance everything that's new14:51
nik90well the what's new won't go away in devel. it still shown by default. Its just that it wont have its own dedicated tab.14:52
nik90but people are going to love rev 121 :D14:53
nik90the episode refreshing gets quickly annoying.14:53
Elleoheh14:53
DanChapmanDoes anyone know if there is docs anywhere for the Oxide webview, not the Ubuntu.Web ones but for com.canonical.Oxide. Looking at the source is getting a bit tedious :-)15:13
bzoltanaquarius: your bugreport have a proposed fix, feel free to check if it does what you expect.16:19
nemomcphail: ehm. sure16:40
=== chihchun is now known as chihchun_afk
InglebardHi, what is the way to show qml errors during application developement ? (I mean qml error like import errors, undefined variables,...)18:26
InglebardI try "/tmp/qtc_device_applaunch.py /tmp/myapp_1.0_all.click --hook myapp" but seems not display errors, maybe i miss something ?18:31
ahayzenInglebard, if you do it from QtCreator they appear in the console of that otherwise they app in ... /home/phablet/.cache/upstart/application-click-myapp_1.0.log or something similar18:35
ahayzen*they appear in18:35
InglebardYeah but i don't use QtCreator18:35
InglebardOk, I will check the log18:36
ahayzenyeah i usually $ tail -f the log file once you've found which one is for your app :-)18:36
InglebardOk thanks18:40
InglebardAnd I have another question, since 2 or 3 weeks I notice ubuntu-emulator crash after 2 application launched, someone have the problem too ? (I use 14.04)18:43
ahayzenInglebard, i know there were issues with the emulator, but thought they had fixed, ensure that it is all up to date. If not ask in the week when more folks are around :-)18:51
InglebardWhat do you mean by "up to date" ?18:52
ahayzenensure you packages on your desktop are up to date and the emulator's image is up to date18:55
ahayzen(i haven't used the emulator in a while so i'm not much use i'm afraid :-/ )18:55
InglebardOk, I recreate an emultor today after update my system, but issue still here. So I will wait :(18:59
Inglebardahayzen, I will disturbed you again but the error I would like to see is not present in the log.19:08
Inglebard    QString path = m_cordova->get_app_dir() + "/../qml/InAppBrowser.qml";19:08
Inglebard    QString qml = QString(code)19:08
Inglebard      .arg(CordovaInternal::format(path)).arg(CordovaInternal::format(url));19:08
Inglebard    m_cordova->execQML(qml);19:08
InglebardI don't have errors from InAppBrowser.qml19:08
ahayzenis the app actually starting ?19:08
InglebardYes, except if there is an error in the qml file.19:09
ahayzenok :-)19:09
ahayzenyou'd usually get something in the app log if the app is launching and then erroring19:09
ahayzenif it is higher up it can appear in other logs sometimes19:10
ahayzenbut i've not used the cordova things before19:10
InglebardOk, I just would like to change the adress bar of cordova in app browser plugin because it is actually outdated/incomplete. But I have not a lot of skills in C++/qml/debugging :)19:17
ahayzenInglebard, yeah thats probably better to ask in the week when folks that work on those components are around :-)19:24
InglebardOk ok thanks19:25

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!