Merge lp:~azzar1/unity/fix-874380 into lp:unity

Proposed by Andrea Azzarone
Status: Merged
Approved by: Andrea Azzarone
Approved revision: no longer in the source branch.
Merged at revision: 1775
Proposed branch: lp:~azzar1/unity/fix-874380
Merge into: lp:unity
Diff against target: 53 lines (+6/-11)
2 files modified
plugins/unityshell/src/BamfLauncherIcon.cpp (+4/-7)
plugins/unityshell/src/DeviceLauncherIcon.cpp (+2/-4)
To merge this branch: bzr merge lp:~azzar1/unity/fix-874380
Reviewer Review Type Date Requested Status
Mirco Müller (community) Approve
Marco Trevisan (Treviño) Approve
Tim Penhey Pending
Review via email: mp+83538@code.launchpad.net

Description of the change

Uses a two state item (Lock to launcher/Unlock from launcher) instead of the current checkbox option.

To post a comment you must log in.
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Good for me.

review: Approve
Revision history for this message
Mirco Müller (macslow) wrote :

I can't compile your branch. This is the error I get:

[ 13%] Building CXX object tests/CMakeFiles/standalone-dash.dir/standalone_dash.cpp.o
In file included from /tmp/fix-874380/tests/standalone_dash.cpp:33:0:
/tmp/fix-874380/tests/../plugins/unityshell/src/DashStyle.h:83:41: Fehler: »nux::ButtonVisualState« wurde nicht deklariert
/tmp/fix-874380/tests/../plugins/unityshell/src/DashStyle.h:86:44: Fehler: »nux::ButtonVisualState« wurde nicht deklariert
/tmp/fix-874380/tests/../plugins/unityshell/src/DashStyle.h:88:43: Fehler: »nux::ButtonVisualState« wurde nicht deklariert
/tmp/fix-874380/tests/../plugins/unityshell/src/DashStyle.h:90:43: Fehler: »nux::ButtonVisualState« wurde nicht deklariert
/tmp/fix-874380/tests/../plugins/unityshell/src/DashStyle.h:93:39: Fehler: »nux::ButtonVisualState« wurde nicht deklariert
/tmp/fix-874380/tests/../plugins/unityshell/src/DashStyle.h:99:37: Fehler: »nux::ButtonVisualState« wurde nicht deklariert
/tmp/fix-874380/tests/../plugins/unityshell/src/DashStyle.h:103:35: Fehler: »nux::ButtonVisualState« wurde nicht deklariert
/tmp/fix-874380/tests/../plugins/unityshell/src/DashStyle.h:106:36: Fehler: »nux::ButtonVisualState« wurde nicht deklariert
make[2]: *** [tests/CMakeFiles/standalone-dash.dir/standalone_dash.cpp.o] Fehler 1
make[1]: *** [tests/CMakeFiles/standalone-dash.dir/all] Fehler 2
make: *** [all] Fehler 2

review: Needs Fixing
Revision history for this message
Mirco Müller (macslow) wrote :

Ok works now.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/unityshell/src/BamfLauncherIcon.cpp'
2--- plugins/unityshell/src/BamfLauncherIcon.cpp 2011-12-07 04:34:01 +0000
3+++ plugins/unityshell/src/BamfLauncherIcon.cpp 2011-12-13 09:02:24 +0000
4@@ -929,8 +929,6 @@
5 {
6 menu_item = dbusmenu_menuitem_new();
7
8- dbusmenu_menuitem_property_set(menu_item, DBUSMENU_MENUITEM_PROP_TOGGLE_TYPE, DBUSMENU_MENUITEM_TOGGLE_CHECK);
9- dbusmenu_menuitem_property_set(menu_item, DBUSMENU_MENUITEM_PROP_LABEL, _("Keep in launcher"));
10 dbusmenu_menuitem_property_set_bool(menu_item, DBUSMENU_MENUITEM_PROP_ENABLED, true);
11 dbusmenu_menuitem_property_set_bool(menu_item, DBUSMENU_MENUITEM_PROP_VISIBLE, true);
12
13@@ -938,12 +936,11 @@
14
15 _menu_items["Pin"] = menu_item;
16 }
17- int checked = !bamf_view_is_sticky(BAMF_VIEW(m_App)) ?
18- DBUSMENU_MENUITEM_TOGGLE_STATE_CHECKED : DBUSMENU_MENUITEM_TOGGLE_STATE_UNCHECKED;
19+
20+ const char* label = !bamf_view_is_sticky(BAMF_VIEW(m_App)) ?
21+ _("Lock to launcher") : _("Unlock from launcher");
22
23- dbusmenu_menuitem_property_set_int(_menu_items["Pin"],
24- DBUSMENU_MENUITEM_PROP_TOGGLE_STATE,
25- checked);
26+ dbusmenu_menuitem_property_set(_menu_items["Pin"], DBUSMENU_MENUITEM_PROP_LABEL, label);
27
28
29 /* Quit */
30
31=== modified file 'plugins/unityshell/src/DeviceLauncherIcon.cpp'
32--- plugins/unityshell/src/DeviceLauncherIcon.cpp 2011-10-25 17:00:12 +0000
33+++ plugins/unityshell/src/DeviceLauncherIcon.cpp 2011-12-13 09:02:24 +0000
34@@ -96,17 +96,15 @@
35 DbusmenuMenuitem* menu_item;
36 glib::Object<GDrive> drive(g_volume_get_drive(volume_));
37
38- // "Keep in launcher" item
39+ // "Lock to launcher"/"Unlock from launcher" item
40 if (DevicesSettings::GetDefault().GetDevicesOption() == DevicesSettings::ONLY_MOUNTED
41 && drive && !g_drive_is_media_removable (drive))
42 {
43 menu_item = dbusmenu_menuitem_new();
44
45- dbusmenu_menuitem_property_set(menu_item, DBUSMENU_MENUITEM_PROP_LABEL, _("Keep in launcher"));
46- dbusmenu_menuitem_property_set(menu_item, DBUSMENU_MENUITEM_PROP_TOGGLE_TYPE, DBUSMENU_MENUITEM_TOGGLE_CHECK);
47+ dbusmenu_menuitem_property_set(menu_item, DBUSMENU_MENUITEM_PROP_LABEL, !keep_in_launcher_ ? _("Lock to launcher") : _("Unlock from launcher"));
48 dbusmenu_menuitem_property_set_bool(menu_item, DBUSMENU_MENUITEM_PROP_ENABLED, true);
49 dbusmenu_menuitem_property_set_bool(menu_item, DBUSMENU_MENUITEM_PROP_VISIBLE, true);
50- dbusmenu_menuitem_property_set_int(menu_item, DBUSMENU_MENUITEM_PROP_TOGGLE_STATE, !keep_in_launcher_);
51
52 g_signal_connect(menu_item, DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED,
53 G_CALLBACK(&DeviceLauncherIcon::OnTogglePin), this);