Merge lp:~townsend/unity/fix-lp1168019 into lp:unity

Proposed by Christopher Townsend
Status: Merged
Approved by: Christopher Townsend
Approved revision: no longer in the source branch.
Merged at revision: 3478
Proposed branch: lp:~townsend/unity/fix-lp1168019
Merge into: lp:unity
Diff against target: 101 lines (+36/-1)
4 files modified
dash/DashView.cpp (+9/-0)
tests/CMakeLists.txt (+2/-0)
tests/data/unity/scopes/commands.scope (+8/-0)
tests/test_dashview.cpp (+17/-1)
To merge this branch: bzr merge lp:~townsend/unity/fix-lp1168019
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Brandon Schaefer (community) Approve
Review via email: mp+182189@code.launchpad.net

Commit message

Do not display the scope bar at the bottom when the Command "Lens" is opened as it's not really not a Lens/Scope.

Description of the change

= Issue =
The Command "Lens" is not really a lens and as such, the scope bar at the bottom should not be visible when the Command "Lens" is opened.

= Fix =
Add logic to detect when the command lens is opened and if so, set the scope bar to invisible.

= Test =
Add unit test to ensure that the scope bar is indeed invisible when the command lens is active.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

LGTM

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Christopher Townsend (townsend) wrote :

Finally figured out what was causing the Jenkins failures. I believe the amd64 ci failure last posted by jenkins is not caused by my MP. Globally approving this.

Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'dash/DashView.cpp'
--- dash/DashView.cpp 2013-07-18 20:04:23 +0000
+++ dash/DashView.cpp 2013-08-27 15:51:23 +0000
@@ -1262,6 +1262,15 @@
1262 return;1262 return;
1263 }1263 }
12641264
1265 if (IsCommandLensOpen() && scope_bar_->IsVisible())
1266 {
1267 scope_bar_->SetVisible(false);
1268 }
1269 else if (!scope_bar_->IsVisible())
1270 {
1271 scope_bar_->SetVisible(true);
1272 }
1273
1265 if (active_scope_view_.IsValid())1274 if (active_scope_view_.IsValid())
1266 active_scope_view_->SetVisible(false);1275 active_scope_view_->SetVisible(false);
12671276
12681277
=== modified file 'tests/CMakeLists.txt'
--- tests/CMakeLists.txt 2013-08-01 05:01:01 +0000
+++ tests/CMakeLists.txt 2013-08-27 15:51:23 +0000
@@ -24,6 +24,8 @@
24 ${CMAKE_BINARY_DIR}/tests/data/unity/scopes/testscope3.scope)24 ${CMAKE_BINARY_DIR}/tests/data/unity/scopes/testscope3.scope)
25configure_file (${CMAKE_CURRENT_SOURCE_DIR}/data/unity/scopes/testscope4.scope25configure_file (${CMAKE_CURRENT_SOURCE_DIR}/data/unity/scopes/testscope4.scope
26 ${CMAKE_BINARY_DIR}/tests/data/unity/scopes/testscope4.scope)26 ${CMAKE_BINARY_DIR}/tests/data/unity/scopes/testscope4.scope)
27configure_file (${CMAKE_CURRENT_SOURCE_DIR}/data/unity/scopes/commands.scope
28 ${CMAKE_BINARY_DIR}/tests/data/unity/scopes/commands.scope)
27configure_file (${CMAKE_CURRENT_SOURCE_DIR}/data/unity/sounds/brownnoise.mp329configure_file (${CMAKE_CURRENT_SOURCE_DIR}/data/unity/sounds/brownnoise.mp3
28 ${CMAKE_BINARY_DIR}/tests/data/unity/sounds/brownnoise.mp3 COPYONLY)30 ${CMAKE_BINARY_DIR}/tests/data/unity/sounds/brownnoise.mp3 COPYONLY)
29configure_file (${CMAKE_CURRENT_SOURCE_DIR}/data/unity/sounds/pinknoise.mp331configure_file (${CMAKE_CURRENT_SOURCE_DIR}/data/unity/sounds/pinknoise.mp3
3032
=== added file 'tests/data/unity/scopes/commands.scope'
--- tests/data/unity/scopes/commands.scope 1970-01-01 00:00:00 +0000
+++ tests/data/unity/scopes/commands.scope 2013-08-27 15:51:23 +0000
@@ -0,0 +1,8 @@
1[Scope]
2DBusName=com.canonical.Unity.Test.Scope
3DBusPath=/com/canonical/unity/scope/commands
4Icon=
5Type=commands
6Name=Commands
7Description=This is an Ubuntu search plugin that enables information from local binaries to be searched and displayed in the Dash. If you do not wish to search this content source, you can disable this search plugin.
8SearchHint=Run a command
09
=== modified file 'tests/test_dashview.cpp'
--- tests/test_dashview.cpp 2013-03-21 11:36:49 +0000
+++ tests/test_dashview.cpp 2013-08-27 15:51:23 +0000
@@ -28,6 +28,7 @@
28#include <NuxCore/ObjectPtr.h>28#include <NuxCore/ObjectPtr.h>
2929
30#include "dash/DashView.h"30#include "dash/DashView.h"
31#include "dash/ScopeBar.h"
31#include "dash/ApplicationStarter.h"32#include "dash/ApplicationStarter.h"
32#include "unity-shared/DashStyle.h"33#include "unity-shared/DashStyle.h"
33#include "unity-shared/PanelStyle.h"34#include "unity-shared/PanelStyle.h"
@@ -51,6 +52,7 @@
51 "testscope2.scope",52 "testscope2.scope",
52 "testscope3.scope",53 "testscope3.scope",
53 "testscope4.scope",54 "testscope4.scope",
55 "commands.scope",
54 NULL };56 NULL };
5557
56}58}
@@ -79,6 +81,7 @@
79 }81 }
8082
81 using DashView::scope_views_;83 using DashView::scope_views_;
84 using DashView::scope_bar_;
82 };85 };
8386
84protected:87protected:
@@ -93,7 +96,7 @@
93 Scopes::Ptr scopes(new MockGSettingsScopes(scopes_default));96 Scopes::Ptr scopes(new MockGSettingsScopes(scopes_default));
94 nux::ObjectPtr<MockDashView> view(new MockDashView(scopes, application_starter_));97 nux::ObjectPtr<MockDashView> view(new MockDashView(scopes, application_starter_));
9598
96 EXPECT_EQ(view->scope_views_.size(), 4) << "Error: Incorrect number of scope views (" << view->scope_views_.size() << " != 4)";99 EXPECT_EQ(view->scope_views_.size(), 5) << "Error: Incorrect number of scope views (" << view->scope_views_.size() << " != 5)";
97}100}
98101
99102
@@ -112,5 +115,18 @@
112 scopes->GetScopeAtIndex(0)->activated.emit(result, NOT_HANDLED, glib::HintsMap());115 scopes->GetScopeAtIndex(0)->activated.emit(result, NOT_HANDLED, glib::HintsMap());
113}116}
114117
118TEST_F(TestDashView, TestScopeBarIsInvisibleWithCommandScope)
119{
120 ScopeBar scope_bar;
121 Scopes::Ptr scopes(new MockGSettingsScopes(scopes_default));
122 nux::ObjectPtr<MockDashView> view(new MockDashView(scopes, application_starter_));
123
124 ASSERT_TRUE(view->scope_bar_->IsVisible());
125
126 view->scope_bar_->Activate("commands.scope");
127
128 EXPECT_FALSE(view->scope_bar_->IsVisible());
129}
130
115}131}
116}132}