Merge lp:~bilalakhtar/unity/sd-card-stop-device-960910 into lp:unity

Proposed by Bilal Akhtar
Status: Superseded
Proposed branch: lp:~bilalakhtar/unity/sd-card-stop-device-960910
Merge into: lp:unity
Diff against target: 75 lines (+26/-1)
4 files modified
launcher/DeviceLauncherIcon.cpp (+6/-0)
launcher/DeviceLauncherIcon.h (+2/-1)
launcher/LauncherController.cpp (+2/-0)
manual-tests/Launcher.txt (+16/-0)
To merge this branch: bzr merge lp:~bilalakhtar/unity/sd-card-stop-device-960910
Reviewer Review Type Date Requested Status
Tim Penhey (community) Needs Fixing
Review via email: mp+118220@code.launchpad.net

This proposal has been superseded by a proposal from 2012-08-08.

Description of the change

SD cards can now be stopped if their DeviceLauncherIcon is dragged into Trash. Fixes bug #960910 .

To post a comment you must log in.
Revision history for this message
Tim Penhey (thumper) wrote :

Test? I think a manual test would be needed here.

review: Needs Fixing

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'launcher/DeviceLauncherIcon.cpp'
2--- launcher/DeviceLauncherIcon.cpp 2012-06-21 06:55:53 +0000
3+++ launcher/DeviceLauncherIcon.cpp 2012-08-08 15:14:22 +0000
4@@ -119,6 +119,12 @@
5 return g_volume_can_eject(volume_);
6 }
7
8+bool
9+DeviceLauncherIcon::CanStop()
10+{
11+ return g_drive_can_stop(g_volume_get_drive(volume_));
12+}
13+
14 std::list<DbusmenuMenuitem*> DeviceLauncherIcon::GetMenus()
15 {
16 std::list<DbusmenuMenuitem*> result;
17
18=== modified file 'launcher/DeviceLauncherIcon.h'
19--- launcher/DeviceLauncherIcon.h 2012-07-18 16:06:32 +0000
20+++ launcher/DeviceLauncherIcon.h 2012-08-08 15:14:22 +0000
21@@ -40,7 +40,9 @@
22
23 void OnRemoved();
24 bool CanEject();
25+ bool CanStop();
26 void Eject();
27+ void StopDrive();
28
29 protected:
30 std::list<DbusmenuMenuitem*> GetMenus();
31@@ -52,7 +54,6 @@
32 void ActivateLauncherIcon(ActionArg arg);
33 void ShowMount(GMount* mount);
34 void Unmount();
35- void StopDrive();
36 static void OnTogglePin(DbusmenuMenuitem* item, int time, DeviceLauncherIcon* self);
37 static void OnOpen(DbusmenuMenuitem* item, int time, DeviceLauncherIcon* self);
38 static void OnEject(DbusmenuMenuitem* item, int time, DeviceLauncherIcon* self);
39
40=== modified file 'launcher/LauncherController.cpp'
41--- launcher/LauncherController.cpp 2012-08-03 11:58:29 +0000
42+++ launcher/LauncherController.cpp 2012-08-08 15:14:22 +0000
43@@ -428,6 +428,8 @@
44
45 if (device_icon && device_icon->CanEject())
46 device_icon->Eject();
47+ else if (device_icon && device_icon->CanStop())
48+ device_icon->StopDrive();
49
50 break;
51 }
52
53=== modified file 'manual-tests/Launcher.txt'
54--- manual-tests/Launcher.txt 2012-08-03 13:43:50 +0000
55+++ manual-tests/Launcher.txt 2012-08-08 15:14:22 +0000
56@@ -679,3 +679,19 @@
57 * No icon flickers near the top panel.
58 * See https://bugs.launchpad.net/unity/+bug/980942/+attachment/3059914/+files/launcher-accordion-effect-tooltip-bug.ogv.
59
60+
61+Stop SD card by dragging it's icon to trash
62+---------------------------------------------------
63+
64+Setup:
65+ * Have an SD Card reader and an SD Card
66+
67+Actions:
68+ * Insert the SD card into the SD card reader.
69+ * Wait for the SD card to mount.
70+ * Drag and drop the SD card icon into the trash.
71+
72+Expected result:
73+ * The SD card launcher icon appears in the launcher after the SD card is mounted
74+ * After the icon is dragged into the trash, the SD card is "stopped"
75+ * A notification appears, stating that the SD card has been stopped.