Merge lp:~unity-team/unity/show-applications-folder-for-now into lp:unity

Proposed by Neil J. Patel
Status: Merged
Merge reported by: Neil J. Patel
Merged at revision: not available
Proposed branch: lp:~unity-team/unity/show-applications-folder-for-now
Merge into: lp:unity
Diff against target: 76 lines (+40/-0)
3 files modified
src/PanelHomeButton.cpp (+37/-0)
src/PanelHomeButton.h (+2/-0)
src/PanelIndicatorObjectEntryView.cpp (+1/-0)
To merge this branch: bzr merge lp:~unity-team/unity/show-applications-folder-for-now
Reviewer Review Type Date Requested Status
Neil J. Patel Pending
Review via email: mp+42140@code.launchpad.net

Description of the change

Just pops up the /usr/share/applications folder when you click on the panel home button. This is just for alpha 1.

To post a comment you must log in.
Revision history for this message
Mikkel Kamstrup Erlandsen (kamstrup) wrote :

review approve

♥ Nice clean diff

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/PanelHomeButton.cpp'
2--- src/PanelHomeButton.cpp 2010-11-12 12:22:07 +0000
3+++ src/PanelHomeButton.cpp 2010-11-29 16:24:54 +0000
4@@ -37,6 +37,9 @@
5 {
6 _pixbuf = gdk_pixbuf_new_from_file (PKGDATADIR"/bfb.png", NULL);
7 SetMinMaxSize (BUTTON_WIDTH, PANEL_HEIGHT);
8+
9+ OnMouseClick.connect (sigc::mem_fun (this, &PanelHomeButton::RecvMouseClick));
10+
11 Refresh ();
12 }
13
14@@ -103,3 +106,37 @@
15
16 NeedRedraw ();
17 }
18+
19+void
20+PanelHomeButton::RecvMouseClick (int x,
21+ int y,
22+ unsigned long button_flags,
23+ unsigned long key_flags)
24+{
25+#define APPS_URI "file:///usr/share/applications"
26+
27+ /* FIXME: This is just for Alpha 1, so we have some feedback on clicking the
28+ * PanelHomeButton, and especially because we don't have any other way of
29+ * launching non-launcher apps right now
30+ */
31+ if (nux::GetEventButton (button_flags) == 1)
32+ {
33+ GdkAppLaunchContext *context;
34+ GError *error = NULL;
35+
36+ context = gdk_app_launch_context_new ();
37+ gdk_app_launch_context_set_screen (context, gdk_screen_get_default ());
38+ gdk_app_launch_context_set_timestamp (context, GDK_CURRENT_TIME);
39+
40+ if (!g_app_info_launch_default_for_uri (APPS_URI,
41+ (GAppLaunchContext *)context,
42+ &error))
43+ {
44+ g_warning ("Unable to launcher applications folder: %s",
45+ error->message);
46+ g_error_free (error);
47+ }
48+
49+ g_object_unref (context);
50+ }
51+}
52
53=== modified file 'src/PanelHomeButton.h'
54--- src/PanelHomeButton.h 2010-11-05 12:30:02 +0000
55+++ src/PanelHomeButton.h 2010-11-29 16:24:54 +0000
56@@ -30,6 +30,8 @@
57 PanelHomeButton ();
58 ~PanelHomeButton ();
59
60+ void RecvMouseClick (int x, int y, unsigned long button_flags, unsigned long key_flags);
61+
62 private:
63 void Refresh ();
64
65
66=== modified file 'src/PanelIndicatorObjectEntryView.cpp'
67--- src/PanelIndicatorObjectEntryView.cpp 2010-11-11 15:07:58 +0000
68+++ src/PanelIndicatorObjectEntryView.cpp 2010-11-29 16:24:54 +0000
69@@ -44,6 +44,7 @@
70 _util_cg (CAIRO_FORMAT_ARGB32, 1, 1)
71 {
72 _proxy->Updated.connect (sigc::mem_fun (this, &PanelIndicatorObjectEntryView::Refresh));
73+
74 InputArea::OnMouseDown.connect (sigc::mem_fun (this, &PanelIndicatorObjectEntryView::OnMouseDown));
75
76 Refresh ();