Merge lp:~jbicha/activity-log-manager/add-search-tab into lp:activity-log-manager

Proposed by Jeremy Bícha
Status: Merged
Merged at revision: 73
Proposed branch: lp:~jbicha/activity-log-manager/add-search-tab
Merge into: lp:activity-log-manager
Diff against target: 161 lines (+107/-0)
5 files modified
po/POTFILES.in (+1/-0)
po/POTFILES.skip (+1/-0)
src/Makefile.am (+1/-0)
src/activity-log-manager.vala (+5/-0)
src/searchresults-widget.vala (+99/-0)
To merge this branch: bzr merge lp:~jbicha/activity-log-manager/add-search-tab
Reviewer Review Type Date Requested Status
Manish Sinha (मनीष सिन्हा) Approve
Review via email: mp+173393@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Manish Sinha (मनीष सिन्हा) (manishsinha) wrote :

I was thinking if instead of having a separate Search Results tab, why not have it under Security. That tab can contain Scopes enable/disable too.

review: Needs Information
Revision history for this message
Manish Sinha (मनीष सिन्हा) (manishsinha) wrote :

Clarified. Search Results will contain Online Search enable/disable as well as scopes enable/disable

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'po/POTFILES.in'
--- po/POTFILES.in 2013-07-07 19:51:19 +0000
+++ po/POTFILES.in 2013-07-08 01:40:35 +0000
@@ -3,6 +3,7 @@
3src/activity-log-manager.vala3src/activity-log-manager.vala
4src/alm.vala4src/alm.vala
5src/alm-cc.c5src/alm-cc.c
6src/searchresults-widget.vala
6src/security-widget.vala7src/security-widget.vala
7src/unified-privacy-files.vala8src/unified-privacy-files.vala
8src/unified-privacy-applications.vala9src/unified-privacy-applications.vala
910
=== modified file 'po/POTFILES.skip'
--- po/POTFILES.skip 2013-07-07 19:51:19 +0000
+++ po/POTFILES.skip 2013-07-08 01:40:35 +0000
@@ -1,5 +1,6 @@
1src/activity-log-manager.c1src/activity-log-manager.c
2src/alm.c2src/alm.c
3src/searchresults-widget.c
3src/security-widget.c4src/security-widget.c
4src/unified-privacy-applications.c5src/unified-privacy-applications.c
5src/unified-privacy-history.c6src/unified-privacy-history.c
67
=== modified file 'src/Makefile.am'
--- src/Makefile.am 2013-07-07 22:55:28 +0000
+++ src/Makefile.am 2013-07-08 01:40:35 +0000
@@ -24,6 +24,7 @@
24SHARED_SOURCES = \24SHARED_SOURCES = \
25 blacklist-dbus.vala \25 blacklist-dbus.vala \
26 activity-log-manager.vala \26 activity-log-manager.vala \
27 searchresults-widget.vala \
27 security-widget.vala \28 security-widget.vala \
28 unified-privacy-files.vala \29 unified-privacy-files.vala \
29 unified-privacy-applications.vala \30 unified-privacy-applications.vala \
3031
=== modified file 'src/activity-log-manager.vala'
--- src/activity-log-manager.vala 2013-07-07 22:55:28 +0000
+++ src/activity-log-manager.vala 2013-07-08 01:40:35 +0000
@@ -29,6 +29,7 @@
29 public class ActivityLogManager : Gtk.Box {29 public class ActivityLogManager : Gtk.Box {
30 private Gtk.Notebook notebook;30 private Gtk.Notebook notebook;
31 private SecurityWidget security_widget;31 private SecurityWidget security_widget;
32 private SearchResultsWidget searchresults_widget;
32 private PrivacyWidget privacy_widget;33 private PrivacyWidget privacy_widget;
33 private Gtk.Widget whoopsie;34 private Gtk.Widget whoopsie;
3435
@@ -53,6 +54,10 @@
53 security_widget = new SecurityWidget();54 security_widget = new SecurityWidget();
54 var security_label = new Gtk.Label(_("Security"));55 var security_label = new Gtk.Label(_("Security"));
55 notebook.prepend_page(security_widget, security_label);56 notebook.prepend_page(security_widget, security_label);
57
58 searchresults_widget = new SearchResultsWidget();
59 var searchresults_label = new Gtk.Label(_("Search"));
60 notebook.append_page(searchresults_widget, searchresults_label);
56 }61 }
5762
58#if DIAGNOSTIC63#if DIAGNOSTIC
5964
=== added file 'src/searchresults-widget.vala'
--- src/searchresults-widget.vala 1970-01-01 00:00:00 +0000
+++ src/searchresults-widget.vala 2013-07-08 01:40:35 +0000
@@ -0,0 +1,99 @@
1/* -*- Mode: vala; tab-width: 4; intend-tabs-mode: t -*- */
2/* alm
3 *
4 * Copyright (C) 2012 Canonical
5 * Authored by: Didier Roche <didrocks@ubuntu.com>
6 *
7 * alm is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU Lesser General Public License as published
9 * by the Free Software Foundation, either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * alm is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15 * See the GNU Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.";
19 */
20
21using Gtk;
22using Gee;
23
24namespace Alm {
25
26 public class SearchResultsWidget : Gtk.Box {
27
28 private GLib.Settings gp_settings;
29 private const string REMOTE_CONTENT_KEY = "remote-content-search";
30
31 public enum RemoteContent
32 {
33 ALL,
34 NONE,
35 }
36
37 Switch commercial_suggestion;
38
39 public SearchResultsWidget () {
40 Object (orientation: Orientation.VERTICAL);
41 this.spacing = 0;
42 this.set_border_width(12);
43
44 this.gp_settings = new GLib.Settings ("com.canonical.Unity.Lenses");
45 this.gp_settings.bind (REMOTE_CONTENT_KEY, this, "remote-content-search", SettingsBindFlags.DEFAULT);
46
47 this.set_up_ui ();
48 }
49
50 public RemoteContent remote_content_search { get; set; default = RemoteContent.ALL; }
51
52
53 public void set_up_ui () {
54 var top_box = new Box(Orientation.HORIZONTAL, 21);
55 top_box.set_margin_top(9);
56 this.pack_start(top_box, false, false);
57
58 var text_box = new Box(Orientation.VERTICAL, 0);
59 var header = new Label("");
60 header.set_markup("<b>%s</b>".printf(_("When searching in the Dash:")));
61 header.set_alignment(0, (float)0.5);
62 header.set_padding(0, 0);
63
64 text_box.pack_start(header, false, false);
65
66 var label = new Label(null);
67 label.set_markup("%s".printf(_("Include online search results")));
68 label.set_line_wrap(true);
69 label.set_line_wrap_mode(Pango.WrapMode.WORD);
70 label.set_alignment(0, 0.5f);
71 text_box.pack_start(label, false, false, 6);
72 top_box.pack_start(text_box, false, false);
73
74 commercial_suggestion = new Switch();
75 if (this.remote_content_search == RemoteContent.ALL)
76 commercial_suggestion.set_active(true);
77 commercial_suggestion.notify["active"].connect(on_commercial_suggestion_activated);
78
79 var temp_box = new Box(Orientation.VERTICAL, 0);
80 temp_box.pack_start(new Label(""), true, true);
81 temp_box.pack_start(commercial_suggestion, false, false);
82 temp_box.pack_start(new Label(""), true, true);
83 top_box.pack_end(temp_box, false, false);
84
85 }
86
87 public void on_commercial_suggestion_activated() {
88 if (this.commercial_suggestion.get_active())
89 {
90 this.remote_content_search = RemoteContent.ALL;
91 }
92 else
93 {
94 this.remote_content_search = RemoteContent.NONE;
95 }
96 }
97
98 }
99}

Subscribers

People subscribed via source and target branches