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
=== modified file 'launcher/DeviceLauncherIcon.cpp'
--- launcher/DeviceLauncherIcon.cpp 2012-06-21 06:55:53 +0000
+++ launcher/DeviceLauncherIcon.cpp 2012-08-08 15:14:22 +0000
@@ -119,6 +119,12 @@
119 return g_volume_can_eject(volume_);119 return g_volume_can_eject(volume_);
120}120}
121121
122bool
123DeviceLauncherIcon::CanStop()
124{
125 return g_drive_can_stop(g_volume_get_drive(volume_));
126}
127
122std::list<DbusmenuMenuitem*> DeviceLauncherIcon::GetMenus()128std::list<DbusmenuMenuitem*> DeviceLauncherIcon::GetMenus()
123{129{
124 std::list<DbusmenuMenuitem*> result;130 std::list<DbusmenuMenuitem*> result;
125131
=== modified file 'launcher/DeviceLauncherIcon.h'
--- launcher/DeviceLauncherIcon.h 2012-07-18 16:06:32 +0000
+++ launcher/DeviceLauncherIcon.h 2012-08-08 15:14:22 +0000
@@ -40,7 +40,9 @@
4040
41 void OnRemoved();41 void OnRemoved();
42 bool CanEject();42 bool CanEject();
43 bool CanStop();
43 void Eject();44 void Eject();
45 void StopDrive();
4446
45protected:47protected:
46 std::list<DbusmenuMenuitem*> GetMenus();48 std::list<DbusmenuMenuitem*> GetMenus();
@@ -52,7 +54,6 @@
52 void ActivateLauncherIcon(ActionArg arg);54 void ActivateLauncherIcon(ActionArg arg);
53 void ShowMount(GMount* mount);55 void ShowMount(GMount* mount);
54 void Unmount();56 void Unmount();
55 void StopDrive();
56 static void OnTogglePin(DbusmenuMenuitem* item, int time, DeviceLauncherIcon* self);57 static void OnTogglePin(DbusmenuMenuitem* item, int time, DeviceLauncherIcon* self);
57 static void OnOpen(DbusmenuMenuitem* item, int time, DeviceLauncherIcon* self);58 static void OnOpen(DbusmenuMenuitem* item, int time, DeviceLauncherIcon* self);
58 static void OnEject(DbusmenuMenuitem* item, int time, DeviceLauncherIcon* self);59 static void OnEject(DbusmenuMenuitem* item, int time, DeviceLauncherIcon* self);
5960
=== modified file 'launcher/LauncherController.cpp'
--- launcher/LauncherController.cpp 2012-08-03 11:58:29 +0000
+++ launcher/LauncherController.cpp 2012-08-08 15:14:22 +0000
@@ -428,6 +428,8 @@
428428
429 if (device_icon && device_icon->CanEject())429 if (device_icon && device_icon->CanEject())
430 device_icon->Eject();430 device_icon->Eject();
431 else if (device_icon && device_icon->CanStop())
432 device_icon->StopDrive();
431433
432 break;434 break;
433 }435 }
434436
=== modified file 'manual-tests/Launcher.txt'
--- manual-tests/Launcher.txt 2012-08-03 13:43:50 +0000
+++ manual-tests/Launcher.txt 2012-08-08 15:14:22 +0000
@@ -679,3 +679,19 @@
679 * No icon flickers near the top panel.679 * No icon flickers near the top panel.
680 * See https://bugs.launchpad.net/unity/+bug/980942/+attachment/3059914/+files/launcher-accordion-effect-tooltip-bug.ogv.680 * See https://bugs.launchpad.net/unity/+bug/980942/+attachment/3059914/+files/launcher-accordion-effect-tooltip-bug.ogv.
681681
682
683Stop SD card by dragging it's icon to trash
684---------------------------------------------------
685
686Setup:
687 * Have an SD Card reader and an SD Card
688
689Actions:
690 * Insert the SD card into the SD card reader.
691 * Wait for the SD card to mount.
692 * Drag and drop the SD card icon into the trash.
693
694Expected result:
695 * The SD card launcher icon appears in the launcher after the SD card is mounted
696 * After the icon is dragged into the trash, the SD card is "stopped"
697 * A notification appears, stating that the SD card has been stopped.