Merge lp:~townsend/unity/fix-waiting-to-install into lp:unity

Proposed by Christopher Townsend on 2013-06-21
Status: Merged
Approved by: Brandon Schaefer on 2013-07-19
Approved revision: 3383
Merged at revision: 3431
Proposed branch: lp:~townsend/unity/fix-waiting-to-install
Merge into: lp:unity
Diff against target: 59 lines (+17/-1)
3 files modified
launcher/SoftwareCenterLauncherIcon.cpp (+1/-0)
launcher/SoftwareCenterLauncherIcon.h (+1/-1)
tests/test_software_center_launcher_icon.cpp (+15/-0)
To merge this branch: bzr merge lp:~townsend/unity/fix-waiting-to-install
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve on 2013-07-19
Brandon Schaefer (community) 2013-06-21 Approve on 2013-07-19
Review via email: mp+170837@code.launchpad.net

Commit message

Modify the Launcher icon of an installing app to display "Installing..." instead of always saying "Waiting to install".

Description of the change

== Issue ==
When installing an app from the Dash (or Software Center), the Launcher icon that is presented for the installing app always says "Waiting to install" despite that the app may be really installing.

== Fix ==
The fix is to change the tooltip from "Waiting to install" to "Installing..." when the Progress property is received.

== Test ==
Added a unit test to test that the tooltip changes when the property change happens.

To post a comment you must log in.
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Brandon Schaefer (brandontschaefer) wrote :

Hmm this is nice, but it does go through the info quickly. Possibly just having it say "Installing..." instead of info thats goes by to fast to read. Also my icon didn't appear in the launcher after I removed the icon, then installed it again :(

review: Needs Information
Christopher Townsend (townsend) wrote :

The bug suggests using the "Installing..." or the actual state for the tool tip. I have added Ayatana Design to the bug to get their feedback, so we'll wait on that.

I also noticed the missing icon when trying to reinstall an app, but that is an unrelated bug. I should probably see if there is already a bug opened for that.

Brandon Schaefer (brandontschaefer) wrote :

LGTM :)

review: Approve
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Marco Trevisan (Treviño) (3v1n0) wrote :

Oh, maybe it was better to use the ellipsize char (…), see if you can replace it later.

Brandon Schaefer (brandontschaefer) wrote :

Jenkins seems to hate you Chris, possibly sending it some hateful mail will speed things up!

review: Approve
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'launcher/SoftwareCenterLauncherIcon.cpp'
2--- launcher/SoftwareCenterLauncherIcon.cpp 2013-07-01 21:20:51 +0000
3+++ launcher/SoftwareCenterLauncherIcon.cpp 2013-07-17 18:51:25 +0000
4@@ -254,6 +254,7 @@
5 {
6 SetQuirk(Quirk::PROGRESS, true);
7 finished_ = false;
8+ tooltip_text = _("Installing...");
9 }
10
11 SetProgress(progress/100.0f);
12
13=== modified file 'launcher/SoftwareCenterLauncherIcon.h'
14--- launcher/SoftwareCenterLauncherIcon.h 2012-12-05 10:24:53 +0000
15+++ launcher/SoftwareCenterLauncherIcon.h 2013-07-17 18:51:25 +0000
16@@ -50,9 +50,9 @@
17 std::string GetActualDesktopFileAfterInstall();
18 void ActivateLauncherIcon(ActionArg arg);
19 void OnFinished(GVariant *params);
20+ void OnPropertyChanged(GVariant* params);
21
22 private:
23- void OnPropertyChanged(GVariant* params);
24 void OnDragAnimationFinished();
25
26 glib::DBusProxy aptdaemon_trans_;
27
28=== modified file 'tests/test_software_center_launcher_icon.cpp'
29--- tests/test_software_center_launcher_icon.cpp 2013-07-09 15:00:39 +0000
30+++ tests/test_software_center_launcher_icon.cpp 2013-07-17 18:51:25 +0000
31@@ -56,6 +56,7 @@
32 using SoftwareCenterLauncherIcon::_desktop_file;
33 using SoftwareCenterLauncherIcon::GetRemoteUri;
34 using SoftwareCenterLauncherIcon::OnFinished;
35+ using SoftwareCenterLauncherIcon::OnPropertyChanged;
36 };
37
38 struct TestSoftwareCenterLauncherIcon : testing::Test
39@@ -134,6 +135,20 @@
40 EXPECT_TRUE(icon.IsVisible());
41 }
42
43+TEST_F(TestSoftwareCenterLauncherIcon, TooltipInstalling)
44+{
45+ ASSERT_EQ(icon.tooltip_text(), "Waiting to install");
46+
47+ GVariant *progress = g_variant_new("i", 10);
48+ GVariant *params = g_variant_new("(sv)", "Progress", progress);
49+
50+ icon.OnPropertyChanged(params);
51+
52+ EXPECT_EQ(icon.tooltip_text(), "Installing...");
53+
54+ g_variant_unref(params);
55+}
56+
57 }
58
59 }