Merge lp:~nonamenoname/slingshot/fix-1084101 into lp:~elementary-pantheon/slingshot/trunk

Proposed by No Name
Status: Merged
Approved by: Danielle Foré
Approved revision: 421
Merged at revision: 416
Proposed branch: lp:~nonamenoname/slingshot/fix-1084101
Merge into: lp:~elementary-pantheon/slingshot/trunk
Diff against target: 102 lines (+31/-1)
4 files modified
data/pantheon-applications.menu (+14/-0)
src/Backend/App.vala (+2/-0)
src/Backend/AppSystem.vala (+10/-1)
src/Widgets/CategoryView.vala (+5/-0)
To merge this branch: bzr merge lp:~nonamenoname/slingshot/fix-1084101
Reviewer Review Type Date Requested Status
Corentin Noël Approve
Danielle Foré Approve
David Gomes (community) Needs Fixing
Review via email: mp+217023@code.launchpad.net

Commit message

Allows plugs to display in Slingshot search

Description of the change

Allows plugs display in slingshot. Only available in serach and category view. Part of #1084101

To post a comment you must log in.
Revision history for this message
Corentin Noël (tintou) wrote :

This should take the OnlyShowIn parameter in account, here the gnome-region-panel.desktop is shown even if
OnlyShowIn=GNOME;

review: Needs Fixing
Revision history for this message
Corentin Noël (tintou) wrote :

Okay after talking, this is a problem from other packages that ships desktop files with NotShowIn

review: Approve
Revision history for this message
David Gomes (davidgomes) wrote :

Add newline after diff line 75.

review: Needs Fixing
Revision history for this message
Corentin Noël (tintou) wrote :

The elementary UX team has to review this, I'm not sure the System Settings section was the aim of this bug

Revision history for this message
Danielle Foré (danrabbit) wrote :

After some discussion with Corentin, let's please remove the entry from the category view. We want these to show up in search but since they aren't apps we don't want them mixed in with apps.

review: Needs Fixing
Revision history for this message
No Name (nonamenoname) wrote :

Removed application menu, are we good to go?

Revision history for this message
Danielle Foré (danrabbit) wrote :

Yep, let's do this!

review: Approve
Revision history for this message
Danielle Foré (danrabbit) wrote :

Wait, actually, they still show in "Other" any way around that?

Revision history for this message
No Name (nonamenoname) wrote :

> Wait, actually, they still show in "Other" any way around that?

When not having the items in a category GMenu won't load them. I think i revert the change and then hide the "System Settings" category in the UI only.

420. By No Name

hide Switchboard Plugs in category view

Revision history for this message
No Name (nonamenoname) wrote :

I think i achieved the correct behaviour. On my fresh install there is no system settings category and also no "Other". Corentin can you verify and then approve?

421. By No Name

forgot removing debug output

Revision history for this message
Corentin Noël (tintou) wrote :

That's the intended behavior indeed !

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'data/pantheon-applications.menu'
--- data/pantheon-applications.menu 2013-10-05 11:42:23 +0000
+++ data/pantheon-applications.menu 2014-04-27 21:12:14 +0000
@@ -220,4 +220,18 @@
220 <Directory>Debian.directory</Directory>220 <Directory>Debian.directory</Directory>
221 </Menu>221 </Menu>
222222
223 <!-- Switchboard menu -->
224 <Menu>
225 <Name>switchboard</Name>
226 <Directory>Switchboard.directory</Directory>
227 <Include>
228 <And>
229 <Or>
230 <Category>X-PANTHEON-Switchboard-Plugs</Category>
231 <Category>X-GNOME-Settings-Panel</Category>
232 </Or>
233 </And>
234 </Include>
235 </Menu>
236
223</Menu> <!-- End Applications -->237</Menu> <!-- End Applications -->
224238
=== modified file 'src/Backend/App.vala'
--- src/Backend/App.vala 2013-01-10 16:53:50 +0000
+++ src/Backend/App.vala 2014-04-27 21:12:14 +0000
@@ -28,6 +28,7 @@
28 public double popularity { get; set; }28 public double popularity { get; set; }
29 public double relevancy { get; set; }29 public double relevancy { get; set; }
30 public string desktop_path { get; private set; }30 public string desktop_path { get; private set; }
31 public string categories { get; private set; }
31 public string generic_name { get; private set; default = ""; }32 public string generic_name { get; private set; default = ""; }
3233
33 private bool is_command = false;34 private bool is_command = false;
@@ -45,6 +46,7 @@
45#if HAVE_UNITY46#if HAVE_UNITY
46 keywords = Unity.AppInfoManager.get_default ().get_keywords (desktop_id);47 keywords = Unity.AppInfoManager.get_default ().get_keywords (desktop_id);
47#endif48#endif
49 categories = info.get_categories ();
48 generic_name = info.get_generic_name ();50 generic_name = info.get_generic_name ();
4951
50 if (info.get_icon () is ThemedIcon) {52 if (info.get_icon () is ThemedIcon) {
5153
=== modified file 'src/Backend/AppSystem.vala'
--- src/Backend/AppSystem.vala 2014-03-01 15:19:12 +0000
+++ src/Backend/AppSystem.vala 2014-04-27 21:12:14 +0000
@@ -18,6 +18,9 @@
1818
19public class Slingshot.Backend.AppSystem : Object {19public class Slingshot.Backend.AppSystem : Object {
2020
21 const string GCC_PANEL_CATEGORY = "X-GNOME-Settings-Panel";
22 const string SWITCHBOARD_PLUG_CATEGORY = "X-PANTHEON-Switchboard-Plug";
23
21 private Gee.ArrayList<GMenu.TreeDirectory> categories = null;24 private Gee.ArrayList<GMenu.TreeDirectory> categories = null;
22 private Gee.HashMap<string, Gee.ArrayList<App>> apps = null;25 private Gee.HashMap<string, Gee.ArrayList<App>> apps = null;
23 private GMenu.Tree apps_menu = null;26 private GMenu.Tree apps_menu = null;
@@ -93,8 +96,9 @@
9396
94 apps.clear ();97 apps.clear ();
9598
96 foreach (var cat in categories)99 foreach (var cat in categories) {
97 apps.set (cat.get_name (), get_apps_by_category (cat));100 apps.set (cat.get_name (), get_apps_by_category (cat));
101 }
98102
99 }103 }
100104
@@ -156,6 +160,11 @@
156160
157 foreach (Gee.ArrayList<App> category in apps.values) {161 foreach (Gee.ArrayList<App> category in apps.values) {
158 foreach (App app in category) {162 foreach (App app in category) {
163
164 if (GCC_PANEL_CATEGORY in app.categories || SWITCHBOARD_PLUG_CATEGORY in app.categories)
165 continue;
166
167
159 if (!(app.exec in sorted_apps_execs)) {168 if (!(app.exec in sorted_apps_execs)) {
160 sorted_apps.insert_sorted_with_data (app, Utils.sort_apps_by_name);169 sorted_apps.insert_sorted_with_data (app, Utils.sort_apps_by_name);
161 sorted_apps_execs += app.exec;170 sorted_apps_execs += app.exec;
162171
=== modified file 'src/Widgets/CategoryView.vala'
--- src/Widgets/CategoryView.vala 2014-03-01 15:19:12 +0000
+++ src/Widgets/CategoryView.vala 2014-04-27 21:12:14 +0000
@@ -28,6 +28,8 @@
2828
29 private const string ALL_APPLICATIONS = _("All Applications");29 private const string ALL_APPLICATIONS = _("All Applications");
30 private const string NEW_FILTER = _("Create a new Filter");30 private const string NEW_FILTER = _("Create a new Filter");
31 private const string SWITCHBOARD_CATEGORY = "switchboard";
32
31 private int current_position = 0;33 private int current_position = 0;
3234
33 public Gee.HashMap<int, string> category_ids = new Gee.HashMap<int, string> ();35 public Gee.HashMap<int, string> category_ids = new Gee.HashMap<int, string> ();
@@ -71,6 +73,9 @@
71 int n = 0;73 int n = 0;
7274
73 foreach (string cat_name in view.apps.keys) {75 foreach (string cat_name in view.apps.keys) {
76 if (cat_name == SWITCHBOARD_CATEGORY)
77 continue;
78
74 category_ids.set (n, cat_name);79 category_ids.set (n, cat_name);
75 category_switcher.add_category (GLib.dgettext ("gnome-menus-3.0", cat_name).dup ());80 category_switcher.add_category (GLib.dgettext ("gnome-menus-3.0", cat_name).dup ());
76 n++;81 n++;

Subscribers

People subscribed via source and target branches