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

Proposed by Christopher Townsend
Status: Merged
Approved by: Brandon Schaefer
Approved revision: no longer in the source branch.
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
Brandon Schaefer (community) Approve
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.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
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
Revision history for this message
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.

Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

LGTM :)

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

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

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

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

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'launcher/SoftwareCenterLauncherIcon.cpp'
--- launcher/SoftwareCenterLauncherIcon.cpp 2013-07-01 21:20:51 +0000
+++ launcher/SoftwareCenterLauncherIcon.cpp 2013-07-17 18:51:25 +0000
@@ -254,6 +254,7 @@
254 {254 {
255 SetQuirk(Quirk::PROGRESS, true);255 SetQuirk(Quirk::PROGRESS, true);
256 finished_ = false;256 finished_ = false;
257 tooltip_text = _("Installing...");
257 }258 }
258259
259 SetProgress(progress/100.0f);260 SetProgress(progress/100.0f);
260261
=== modified file 'launcher/SoftwareCenterLauncherIcon.h'
--- launcher/SoftwareCenterLauncherIcon.h 2012-12-05 10:24:53 +0000
+++ launcher/SoftwareCenterLauncherIcon.h 2013-07-17 18:51:25 +0000
@@ -50,9 +50,9 @@
50 std::string GetActualDesktopFileAfterInstall();50 std::string GetActualDesktopFileAfterInstall();
51 void ActivateLauncherIcon(ActionArg arg);51 void ActivateLauncherIcon(ActionArg arg);
52 void OnFinished(GVariant *params);52 void OnFinished(GVariant *params);
53 void OnPropertyChanged(GVariant* params);
5354
54private:55private:
55 void OnPropertyChanged(GVariant* params);
56 void OnDragAnimationFinished();56 void OnDragAnimationFinished();
5757
58 glib::DBusProxy aptdaemon_trans_;58 glib::DBusProxy aptdaemon_trans_;
5959
=== modified file 'tests/test_software_center_launcher_icon.cpp'
--- tests/test_software_center_launcher_icon.cpp 2013-07-09 15:00:39 +0000
+++ tests/test_software_center_launcher_icon.cpp 2013-07-17 18:51:25 +0000
@@ -56,6 +56,7 @@
56 using SoftwareCenterLauncherIcon::_desktop_file;56 using SoftwareCenterLauncherIcon::_desktop_file;
57 using SoftwareCenterLauncherIcon::GetRemoteUri;57 using SoftwareCenterLauncherIcon::GetRemoteUri;
58 using SoftwareCenterLauncherIcon::OnFinished;58 using SoftwareCenterLauncherIcon::OnFinished;
59 using SoftwareCenterLauncherIcon::OnPropertyChanged;
59};60};
6061
61struct TestSoftwareCenterLauncherIcon : testing::Test62struct TestSoftwareCenterLauncherIcon : testing::Test
@@ -134,6 +135,20 @@
134 EXPECT_TRUE(icon.IsVisible());135 EXPECT_TRUE(icon.IsVisible());
135}136}
136137
138TEST_F(TestSoftwareCenterLauncherIcon, TooltipInstalling)
139{
140 ASSERT_EQ(icon.tooltip_text(), "Waiting to install");
141
142 GVariant *progress = g_variant_new("i", 10);
143 GVariant *params = g_variant_new("(sv)", "Progress", progress);
144
145 icon.OnPropertyChanged(params);
146
147 EXPECT_EQ(icon.tooltip_text(), "Installing...");
148
149 g_variant_unref(params);
150}
151
137}152}
138153
139}154}