Merge lp:~bilalakhtar/unity/software-center-integration-for-o into lp:unity

Proposed by Bilal Akhtar
Status: Merged
Approved by: Mikkel Kamstrup Erlandsen
Approved revision: no longer in the source branch.
Merged at revision: 1858
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
Reviewer Review Type Date Requested Status
Mikkel Kamstrup Erlandsen (community) Approve
Unity Team Pending
Neil J. Patel Pending
Review via email: mp+89364@code.launchpad.net

This proposal supersedes a proposal from 2011-08-17.

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://wiki.ubuntu.com/SoftwareCenter#Learning_how_to_launch_an_application

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-chooser, gnome-mplayer or could be any package with a .desktop file)
6) Watch the Unity launcher :-)

To post a comment you must log in.
Revision history for this message
Neil J. Patel (njpatel) wrote : Posted in a previous version of this proposal

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))

review: Needs Fixing
Revision history for this message
Bilal Akhtar (bilalakhtar) wrote : Posted in a previous version of this proposal

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_trans_prop are initialized.

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 :(

Revision history for this message
Mikkel Kamstrup Erlandsen (kamstrup) wrote : Posted in a previous version of this proposal

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?

Revision history for this message
Bilal Akhtar (bilalakhtar) wrote : Posted in a previous version of this proposal

Yes, its exactly how its expected to be. Aptdaemon is creating the exactly same object which is being said by Unity to "not exist".

Revision history for this message
Bilal Akhtar (bilalakhtar) wrote : Posted in a previous version of this proposal

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.

Revision history for this message
Mikkel Kamstrup Erlandsen (kamstrup) wrote : Posted in a previous version of this proposal

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_trans->Connect("Finished", sigc::mem_fun(*this, &SoftwareCenterLauncherIcon::OnFinished));
224 + _aptdaemon_trans->Connect("PropertyChanged", sigc::mem_fun(*this, &SoftwareCenterLauncherIcon::OnPropertyChanged));

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 ;-)

review: Needs Fixing
Revision history for this message
Bilal Akhtar (bilalakhtar) wrote : Posted in a previous version of this proposal

Okay, fixed, ready for a review again!

Revision history for this message
Mikkel Kamstrup Erlandsen (kamstrup) wrote : Posted in a previous version of this proposal

Sorry :-)

249 + if (!g_strcmp0 (property_name, "Progress")) {

Revision history for this message
Mikkel Kamstrup Erlandsen (kamstrup) wrote : Posted in a previous version of this proposal

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..?

review: Needs Fixing
Revision history for this message
Mikkel Kamstrup Erlandsen (kamstrup) wrote : Posted in a previous version of this proposal

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.

Revision history for this message
Bilal Akhtar (bilalakhtar) wrote : Posted in a previous version of this proposal

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.

Revision history for this message
Bilal Akhtar (bilalakhtar) wrote : Posted in a previous version of this proposal

I'll make the g_strcmp0 fix this evening and then you can go ahead with it for now.

Revision history for this message
Bilal Akhtar (bilalakhtar) wrote : Posted in a previous version of this proposal

There, you can review it again :)

Revision history for this message
Bilal Akhtar (bilalakhtar) wrote : Posted in a previous version of this proposal

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.

Revision history for this message
Mikkel Kamstrup Erlandsen (kamstrup) wrote :

Looks good now. Thanks Bilal!

review: Approve
Revision history for this message
Gary Lasker (gary-lasker) wrote :

Bilal, this is awesome!! I'm so excited that this is landed. Thank you for your great work, and thank you Mikkel for reviewing!

I'm am wondering if we need to coordinate releasing the USC side of this (currently being held in the branch lp:~gary-lasker/software-center/launcher-integration-lp761851, as you noted above) with the Unity release that contains this change. It definitely seems like we should release the USC side as soon as possible after the Unity update goes out. Please let me know and we can make sure that happens.

Thanks again!!! (/me ^5s Bilal)
Gary

Revision history for this message
Bilal Akhtar (bilalakhtar) wrote :

Yes, Gary's right, we'd surely need a co-ordinated upload.

I'm not sure about when the next Unity precise upload will be, otherwise I'd have acted as a mediator. Could someone from the Unity team point me/Gary at a roadmap OR poke me or Gary when Unity packages with this change get uploaded to the repos?

Thanks!

Revision history for this message
Michal Hruby (mhr3) wrote :

Hey Bilal, next unity release (5.2) should be next week (most likely Thursday).

Revision history for this message
Michael Vogt (mvo) wrote :

Once the new unity is uploaded we will upload a matching s-c as well.

Revision history for this message
Bilal Akhtar (bilalakhtar) wrote :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'plugins/unityshell/src/Launcher.cpp'
--- plugins/unityshell/src/Launcher.cpp 2012-01-18 11:16:38 +0000
+++ plugins/unityshell/src/Launcher.cpp 2012-01-20 00:43:27 +0000
@@ -112,8 +112,8 @@
112 " <interface name='com.canonical.Unity.Launcher'>"112 " <interface name='com.canonical.Unity.Launcher'>"
113 ""113 ""
114 " <method name='AddLauncherItemFromPosition'>"114 " <method name='AddLauncherItemFromPosition'>"
115 " <arg type='s' name='title' direction='in'/>"
115 " <arg type='s' name='icon' direction='in'/>"116 " <arg type='s' name='icon' direction='in'/>"
116 " <arg type='s' name='title' direction='in'/>"
117 " <arg type='i' name='icon_x' direction='in'/>"117 " <arg type='i' name='icon_x' direction='in'/>"
118 " <arg type='i' name='icon_y' direction='in'/>"118 " <arg type='i' name='icon_y' direction='in'/>"
119 " <arg type='i' name='icon_size' direction='in'/>"119 " <arg type='i' name='icon_size' direction='in'/>"
@@ -3300,10 +3300,10 @@
3300 gchar* desktop_file;3300 gchar* desktop_file;
3301 gchar* aptdaemon_task;3301 gchar* aptdaemon_task;
33023302
3303 g_variant_get(parameters, "(ssiiiss)", &icon, &title, &icon_x, &icon_y, &icon_size, &desktop_file, &aptdaemon_task, NULL);3303 g_variant_get(parameters, "(ssiiiss)", &title, &icon, &icon_x, &icon_y, &icon_size, &desktop_file, &aptdaemon_task, NULL);
33043304
3305 Launcher* self = (Launcher*)user_data;3305 Launcher* self = (Launcher*)user_data;
3306 self->launcher_addrequest.emit(desktop_file, NULL);3306 self->launcher_addrequest_special.emit(desktop_file, NULL, aptdaemon_task, icon);
33073307
3308 g_dbus_method_invocation_return_value(invocation, NULL);3308 g_dbus_method_invocation_return_value(invocation, NULL);
3309 g_free(icon);3309 g_free(icon);
33103310
=== modified file 'plugins/unityshell/src/Launcher.h'
--- plugins/unityshell/src/Launcher.h 2012-01-17 15:41:30 +0000
+++ plugins/unityshell/src/Launcher.h 2012-01-20 00:43:27 +0000
@@ -196,6 +196,7 @@
196 void EnableCheckWindowOverLauncher(gboolean enabled);196 void EnableCheckWindowOverLauncher(gboolean enabled);
197197
198 sigc::signal<void, char*, LauncherIcon*> launcher_addrequest;198 sigc::signal<void, char*, LauncherIcon*> launcher_addrequest;
199 sigc::signal<void, char*, LauncherIcon*, char*, char*> launcher_addrequest_special;
199 sigc::signal<void, LauncherIcon*> launcher_removerequest;200 sigc::signal<void, LauncherIcon*> launcher_removerequest;
200 sigc::signal<void> selection_change;201 sigc::signal<void> selection_change;
201 sigc::signal<void> hidden_changed;202 sigc::signal<void> hidden_changed;
202203
=== modified file 'plugins/unityshell/src/LauncherController.cpp'
--- plugins/unityshell/src/LauncherController.cpp 2012-01-10 15:26:51 +0000
+++ plugins/unityshell/src/LauncherController.cpp 2012-01-20 00:43:27 +0000
@@ -38,12 +38,12 @@
38#include "LauncherEntryRemote.h"38#include "LauncherEntryRemote.h"
39#include "LauncherEntryRemoteModel.h"39#include "LauncherEntryRemoteModel.h"
40#include "LauncherIcon.h"40#include "LauncherIcon.h"
41#include "SoftwareCenterLauncherIcon.h"
41#include "LauncherModel.h"42#include "LauncherModel.h"
42#include "WindowManager.h"43#include "WindowManager.h"
43#include "TrashLauncherIcon.h"44#include "TrashLauncherIcon.h"
44#include "BFBLauncherIcon.h"45#include "BFBLauncherIcon.h"
4546
46
47namespace unity47namespace unity
48{48{
49namespace launcher49namespace launcher
@@ -68,6 +68,7 @@
68 void OnIconRemoved(LauncherIcon* icon);68 void OnIconRemoved(LauncherIcon* icon);
6969
70 void OnLauncherAddRequest(char* path, LauncherIcon* before);70 void OnLauncherAddRequest(char* path, LauncherIcon* before);
71 void OnLauncherAddRequestSpecial(char* path, LauncherIcon* before, char* aptdaemon_trans_id, char* icon_path);
71 void OnLauncherRemoveRequest(LauncherIcon* icon);72 void OnLauncherRemoveRequest(LauncherIcon* icon);
7273
73 void OnLauncherEntryRemoteAdded(LauncherEntryRemote* entry);74 void OnLauncherEntryRemoteAdded(LauncherEntryRemote* entry);
@@ -85,6 +86,8 @@
8586
86 LauncherIcon* CreateFavorite(const char* file_path);87 LauncherIcon* CreateFavorite(const char* file_path);
8788
89 SoftwareCenterLauncherIcon* CreateSCLauncherIcon(const char* file_path, const char* aptdaemon_trans_id, char* icon_path);
90
88 void SetupBamf();91 void SetupBamf();
8992
90 void OnExpoActivated();93 void OnExpoActivated();
@@ -148,6 +151,7 @@
148151
149 launcher_->SetModel(model_.get());152 launcher_->SetModel(model_.get());
150 launcher_->launcher_addrequest.connect(sigc::mem_fun(this, &Impl::OnLauncherAddRequest));153 launcher_->launcher_addrequest.connect(sigc::mem_fun(this, &Impl::OnLauncherAddRequest));
154 launcher_->launcher_addrequest_special.connect(sigc::mem_fun(this, &Impl::OnLauncherAddRequestSpecial));
151 launcher_->launcher_removerequest.connect(sigc::mem_fun(this, &Impl::OnLauncherRemoveRequest));155 launcher_->launcher_removerequest.connect(sigc::mem_fun(this, &Impl::OnLauncherRemoveRequest));
152156
153 device_section_ = new DeviceLauncherSection(raw_launcher);157 device_section_ = new DeviceLauncherSection(raw_launcher);
@@ -236,6 +240,30 @@
236 unity::FavoriteStore::GetDefault().SetFavorites(desktop_paths);240 unity::FavoriteStore::GetDefault().SetFavorites(desktop_paths);
237}241}
238242
243void
244Controller::Impl::OnLauncherAddRequestSpecial(char* path, LauncherIcon* before, char* aptdaemon_trans_id, char* icon_path)
245{
246 std::list<BamfLauncherIcon*> launchers;
247 std::list<BamfLauncherIcon*>::iterator it;
248
249 launchers = model_->GetSublist<BamfLauncherIcon> ();
250 for (it = launchers.begin(); it != launchers.end(); it++)
251 {
252 if (g_strcmp0(path, (*it)->DesktopFile()) == 0)
253 return;
254 }
255
256 SoftwareCenterLauncherIcon* result = CreateSCLauncherIcon(path, aptdaemon_trans_id, icon_path);
257 if (result)
258 {
259 RegisterIcon(result);
260
261 if (before)
262 model_->ReorderBefore(result, before, false);
263 }
264 Save();
265}
266
239void Controller::Impl::SortAndUpdate()267void Controller::Impl::SortAndUpdate()
240{268{
241 gint shortcut = 1;269 gint shortcut = 1;
@@ -450,6 +478,32 @@
450 return icon;478 return icon;
451}479}
452480
481SoftwareCenterLauncherIcon*
482Controller::Impl::CreateSCLauncherIcon(const char* file_path, const char* aptdaemon_trans_id, char* icon_path)
483{
484 BamfApplication* app;
485 SoftwareCenterLauncherIcon* icon;
486
487 app = bamf_matcher_get_application_for_desktop_file(matcher_, file_path, true);
488 if (!BAMF_IS_APPLICATION(app))
489 return NULL;
490
491 if (g_object_get_qdata(G_OBJECT(app), g_quark_from_static_string("unity-seen")))
492 {
493 bamf_view_set_sticky(BAMF_VIEW(app), true);
494 return 0;
495 }
496
497 g_object_set_qdata(G_OBJECT(app), g_quark_from_static_string("unity-seen"), GINT_TO_POINTER(1));
498
499 bamf_view_set_sticky(BAMF_VIEW(app), true);
500 icon = new SoftwareCenterLauncherIcon(launcher_.GetPointer(), app, (char*)aptdaemon_trans_id, icon_path);
501 icon->SetIconType(LauncherIcon::TYPE_APPLICATION);
502 icon->SetSortPriority(sort_priority_++);
503
504 return icon;
505}
506
453void Controller::Impl::SetupBamf()507void Controller::Impl::SetupBamf()
454{508{
455 GList* apps, *l;509 GList* apps, *l;
456510
=== modified file 'plugins/unityshell/src/LauncherController.h'
--- plugins/unityshell/src/LauncherController.h 2011-11-30 03:06:44 +0000
+++ plugins/unityshell/src/LauncherController.h 2012-01-20 00:43:27 +0000
@@ -26,6 +26,8 @@
26#include <sigc++/sigc++.h>26#include <sigc++/sigc++.h>
27#include <core/core.h>27#include <core/core.h>
2828
29#include "SoftwareCenterLauncherIcon.h"
30
29namespace unity31namespace unity
30{32{
31namespace launcher33namespace launcher
3234
=== added file 'plugins/unityshell/src/SoftwareCenterLauncherIcon.cpp'
--- plugins/unityshell/src/SoftwareCenterLauncherIcon.cpp 1970-01-01 00:00:00 +0000
+++ plugins/unityshell/src/SoftwareCenterLauncherIcon.cpp 2012-01-20 00:43:27 +0000
@@ -0,0 +1,102 @@
1// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
2/*
3 * Copyright (C) 2012 Canonical Ltd
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 *
17 * Authored by: Bilal Akhtar <bilalakhtar@ubuntu.com>
18 */
19
20#include "Nux/Nux.h"
21#include "Nux/BaseWindow.h"
22
23#include "BamfLauncherIcon.h"
24#include "Launcher.h"
25#include "LauncherController.h"
26#include "PluginAdapter.h"
27#include "FavoriteStore.h"
28
29#include "ubus-server.h"
30#include "UBusMessages.h"
31
32#include <glib.h>
33#include <glib/gvariant.h>
34#include <glib/gi18n-lib.h>
35#include <gio/gio.h>
36#include <libindicator/indicator-desktop-shortcuts.h>
37#include <core/core.h>
38#include <core/atoms.h>
39
40#include "SoftwareCenterLauncherIcon.h"
41
42namespace unity
43{
44namespace launcher
45{
46
47SoftwareCenterLauncherIcon::SoftwareCenterLauncherIcon(Launcher* IconManager, BamfApplication* app, char* aptdaemon_trans_id, char* icon_path)
48: BamfLauncherIcon(IconManager, app)
49{
50 _aptdaemon_trans_id = aptdaemon_trans_id;
51
52 g_debug("Aptdaemon transaction ID: %s", _aptdaemon_trans_id);
53
54 _aptdaemon_trans = new unity::glib::DBusProxy("org.debian.apt",
55 _aptdaemon_trans_id,
56 "org.debian.apt.transaction",
57 G_BUS_TYPE_SYSTEM,
58 G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START);
59
60 _aptdaemon_trans->Connect("Finished", sigc::mem_fun(this, &SoftwareCenterLauncherIcon::OnFinished));
61 _aptdaemon_trans->Connect("PropertyChanged", sigc::mem_fun(this, &SoftwareCenterLauncherIcon::OnPropertyChanged));
62
63 icon_name = icon_path;
64}
65
66SoftwareCenterLauncherIcon::~SoftwareCenterLauncherIcon() {
67
68}
69
70void
71SoftwareCenterLauncherIcon::OnFinished(GVariant* params) {
72
73 tooltip_text = BamfName();
74
75 SetQuirk(LauncherIcon::QUIRK_PROGRESS, FALSE);
76}
77
78void
79SoftwareCenterLauncherIcon::OnPropertyChanged(GVariant* params) {
80
81 gint32 progress;
82 gchar* property_name;
83 GVariant* property_value;
84
85 g_variant_get_child (params, 0, "s", &property_name);
86 if (g_strcmp0 (property_name, "Progress") == 0) {
87 g_variant_get_child (params,1,"v",&property_value);
88 g_variant_get (property_value, "i", &progress);
89
90 if (progress < 100) {
91 SetQuirk(LauncherIcon::QUIRK_PROGRESS, TRUE);
92 tooltip_text = _("Waiting to install");
93 }
94 SetProgress(((float)progress) / ((float)100));
95 }
96 g_variant_unref(property_value);
97 g_free(property_name);
98
99}
100
101}
102}
0103
=== added file 'plugins/unityshell/src/SoftwareCenterLauncherIcon.h'
--- plugins/unityshell/src/SoftwareCenterLauncherIcon.h 1970-01-01 00:00:00 +0000
+++ plugins/unityshell/src/SoftwareCenterLauncherIcon.h 2012-01-20 00:43:27 +0000
@@ -0,0 +1,60 @@
1// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
2/*
3 * Copyright (C) 2010 Canonical Ltd
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 *
17 * Authored by: Bilal Akhtar <bilalakhtar@ubuntu.com>
18 */
19
20#ifndef SOFTWARECENTERLAUNCHERICON_H
21#define SOFTWARECENTERLAUNCHERICON_H
22
23#include "BamfLauncherIcon.h"
24#include <Nux/BaseWindow.h>
25#include <NuxCore/Math/MathInc.h>
26#include <core/core.h>
27#include <gio/gio.h>
28#include <glib.h>
29#include <glib/gvariant.h>
30#include <UnityCore/GLibDBusProxy.h>
31
32
33namespace unity
34{
35namespace launcher
36{
37
38
39class SoftwareCenterLauncherIcon : public BamfLauncherIcon
40{
41public:
42
43 SoftwareCenterLauncherIcon(Launcher* IconManager, BamfApplication* app, char* aptdaemon_trans_id, char* icon_path);
44 virtual ~SoftwareCenterLauncherIcon();
45
46 gchar* original_tooltip_text;
47
48private:
49 char* _aptdaemon_trans_id;
50 unity::glib::DBusProxy* _aptdaemon_trans;
51
52 void OnFinished(GVariant* params);
53
54 void OnPropertyChanged(GVariant* params);
55};
56
57}
58}
59
60#endif