Merge lp:~bilalakhtar/unity/software-center-integration-for-o into lp:unity
Status: | Superseded |
---|---|
Proposed branch: | lp:~bilalakhtar/unity/software-center-integration-for-o |
Merge into: | lp:unity |
Diff against target: |
330 lines (+223/-4) 6 files modified
plugins/unityshell/src/Launcher.cpp (+3/-3) plugins/unityshell/src/Launcher.h (+1/-0) plugins/unityshell/src/LauncherController.cpp (+55/-1) plugins/unityshell/src/LauncherController.h (+2/-0) plugins/unityshell/src/SoftwareCenterLauncherIcon.cpp (+102/-0) plugins/unityshell/src/SoftwareCenterLauncherIcon.h (+60/-0) |
To merge this branch: | bzr merge lp:~bilalakhtar/unity/software-center-integration-for-o |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Mikkel Kamstrup Erlandsen (community) | 2012-01-15 | Needs Fixing on 2012-01-17 | |
Neil J. Patel (community) | 2011-08-17 | Needs Fixing on 2011-08-19 | |
Unity Team | 2012-01-17 | Pending | |
Review via email:
|
This proposal has been superseded by a proposal from 2012-01-20.
Description of the change
This branch contains the first phase of the implementation of software-center integration with Unity. The complete spec on how it should be implemented, is located at:
https:/
This branch brings the following changes:
1) An app being installed is shown in the launcher with a tooltip "Waiting to install"
2) A progress bar on the launcher item displays the download/install progress.
3) When the app gets installed, the launcher items becomes usable, and the tooltip gets changed to the app name.
Things which are still to be implemented, in the next phases:
1) Animate the movement of the icon from the USC window to the Unity launcher.
2) Make the launcher icon wiggle when installation is complete
3) Stop the launcher icon from blinking when clicked in "waiting to install" state.
In the meantime, you can merge this branch into Unity while I implement the remaining aspects
Branch Testing instructions:
1) Make sure Unity built from my branch is running.
2) Get software-center from bzr branch lp:~gary-lasker/software-center/launcher-integration-lp761851
3) In the software center branch dir, run PYTHONPATH=. python ./software-center
4) Make sure that in the software center View menu, "New Applications In Launcher" is CHECKED.
5) Install a package using software-center that contains a desktop file (like gnome-color-
6) Watch the Unity launcher :-)
- 1358. By Bilal Akhtar on 2011-08-17
-
MEH. Fix conflicts
- 1359. By Bilal Akhtar on 2011-08-19
-
Merge from trunk
- 1360. By Bilal Akhtar on 2011-09-04
-
Fix some issues, thanks Neil! Still need to work out on GDBusProxy
- 1361. By Bilal Akhtar on 2011-09-05
-
Trunkify yet again
- 1362. By Bilal Akhtar on 2011-09-06
-
Use GLIbDBusProxy
- 1363. By Bilal Akhtar on 2011-09-06
-
Massive code cleanup, still not able to solve a memory issue :(
Bilal Akhtar (bilalakhtar) wrote : | # |
Hi Neil,
I managed to get my file to use GLibDBusProxy. Remember the memory issue when adding the tooltip line suddenly made all the dbus calls fail mysteriously ? Moving to GLibDBusProxy has resurrected that weird issue, and now, I'm not able to find out the line which is causing it :(
Can you help me at it? I'll describe exactly what the issue is and where its happening:
1) The SCLauncherIcon class constructor is called, and both _aptdaemon_trans and _aptdaemon_
2) The Progress Get call is made. It fails, GLibDBusProxy returns an error that the proxy doesn't exist (while in fact it does, I've double-checked it with the aptdaemon log). Nothing comes in the log after this, except for point 3 below:
3) Mysteriously, the OnFinished callback gets called correctly when the transaction finishes (as expected), and I get the "Transaction Finished" message in the log at the right time.
Sure, C/C++ suck :(
Have you tried running a 'dbus-monitor > dbus-dump.txt' before doing a test run (and ctrl-c the command after). And then inspect the DBus traffic in that file carefully to make sure it looks like you expect?
Bilal Akhtar (bilalakhtar) wrote : | # |
Yes, its exactly how its expected to be. Aptdaemon is creating the exactly same object which is being said by Unity to "not exist".
- 1364. By Bilal Akhtar on 2012-01-15
-
Merge from trunk
- 1365. By Bilal Akhtar on 2012-01-15
-
Fix build failure
- 1366. By Bilal Akhtar on 2012-01-15
-
Integrate SoftwareCenterL
auncherIcon. * code back into the main Unity 5.0 source and fix build failures. - 1367. By Bilal Akhtar on 2012-01-15
-
Major code cleanup, get progress bar to work
- 1368. By Bilal Akhtar on 2012-01-15
-
Fix persistance of launcher icons
Bilal Akhtar (bilalakhtar) wrote : | # |
Okay, so this merge request is okay for a review again. Everything which I've mentioned in the description works, I've tested it with Gary's branch and all.
Do note that the animation hasn't been implemented yet, I'll do that later on. Most of the groundwork is complete, only the animation and the wiggle etc has to land, which I'll do next weekend.
This was originally supposed to land in Oneiric but due to my faults it was postponed to Precise., but I've had good progress so far in the Precise cycle and as per current state, expect all changes to have landed by Alpha 2.
- 1369. By Bilal Akhtar on 2012-01-16
-
Fix crash, icon of newly-created icon
Just some drive by comments - I am not sure I am the right guy to review this...
166 + * Copyright (C) 2010 Canonical Ltd
I believe we write 2012 these days ;-)
223 + _aptdaemon_
224 + _aptdaemon_
Are you sure you mean '*this' and not 'this'?
Generally; I don't like the 'if (!g_strcmp0 (variable, "XYZ"))' construction. Do it like how it's done elsewhere too, with == 0. It improves legibility. Humans doesn't not suck at negations ;-)
- 1370. By Bilal Akhtar on 2012-01-17
-
Make minor changes as pointed out by Mikkel, thanks!
Bilal Akhtar (bilalakhtar) wrote : | # |
Okay, fixed, ready for a review again!
Sorry :-)
249 + if (!g_strcmp0 (property_name, "Progress")) {
I am taking the branch for a test spin - and one problem I've discovered so far is that if S-C hangs (because apt is broken typically) then you'll be perpetually stuck with a launcher icon with an empty progress bar on it.
I am not sure what to do in these situations. I guess the right thing is to simply have some sort of timeout. If there haven't been progress in 20s then silently remove the launcher icon. There are probably better ways though..?
More comments - mostly also noted in your merge request:
- Clicking the icon when the root password dialog from USC is up, starts pulsing the icon as if launched. From the spec I gather the icon should be grayed out and unresponive.
- Same for while the app is installing
- With lots of apps in the launcher the new app is "folded away". Meaning that I can't see the progress bar or tell when the app is done installing. I'd suggest that we wiggle it/call for attention/set urgency when done installing.
I guess these are points 2) and 3) on your todo list - except that you should "graying out while installing" as well?
But with the g_strcmp0() fix I noted, I guess this branch is good enough to merge. It is at leats ways better than not having it.
Bilal Akhtar (bilalakhtar) wrote : | # |
As for the grey out part, I chatted with MPT at UDS and he was ready to compromise on that part and instead get a progress bar implemented.So, we'll implement a progress bar for now and we'll see later what we can do about the graying part.
Bilal Akhtar (bilalakhtar) wrote : | # |
I'll make the g_strcmp0 fix this evening and then you can go ahead with it for now.
- 1371. By Bilal Akhtar on 2012-01-17
-
Fix yet another g_strcmp0
Bilal Akhtar (bilalakhtar) wrote : | # |
There, you can review it again :)
Bilal Akhtar (bilalakhtar) wrote : | # |
As for your question on SC hanging, in theory a crashed SC shouldn't screw anything up, the progress bar will still be updated regularly as it queries progress status from aptdaemon and not software-center. And if aptdaemon crashes, the apt process itself would crash I guess. If Apt crashes and not aptdaemon, aptdaemon would send a "finished" signal which would clear up the progress bar and remove it from the launcher.
So I guess the current implementation is okay for now, we'll investigate later on if issues arise.
Hey Bilal, great work so far! I have some points which will hopefully reduce the code and make it a bit nicer to merge:
+ We try and not do anything _sync() in Unity, as it effects startup time and, if done after startup, painting time of Compiz. I see that you are connecting to the apt daemon via D-Bus, to make the code cleaner and automatically async, I suggest you use unity:: glib::DBusProxy in <UnityCore/ GLibDBusProxy. h> I added, which wraps the GIO DBusProxy bits in a C++ wrapper that:
- Connects to your chosen bus and object asynchronously
- Let's you use the Connect() method that allows you to connect to signals from the proxy individually [instead of
having a if (signal_name == foo) else if () etc etc], and also allows you to use a sigc::mem_fun instead of a
static function, which should make the code nicer.
You also forgot to store the proxy pointer and unref it on destruction (as well as disconnecting the signal). Using the glib::DBusProxy will handle all this for you internally, so you'll only need to delete the proxy instance once your done with it.
+ You shouldn't be g_variant_unref'ing the "params" value, as it is passed as a function argument and not expected to be unref'd. I think you wanted to unref "property_value".
+ When you start using glib::DBusProxy, you should be able to incorporate initialize_ tooltip_ text(); into your constructor as the constructor won't be as large anymore.
+ Instead of if (!app), do if (!BAMF_ IS_APPLICATION( app))