Merge lp:~gordallott/unity/fix-hud-translation into lp:unity

Proposed by Gord Allott
Status: Merged
Approved by: Michal Hruby
Approved revision: no longer in the source branch.
Merged at revision: 2224
Proposed branch: lp:~gordallott/unity/fix-hud-translation
Merge into: lp:unity
Diff against target: 63 lines (+6/-7)
1 file modified
plugins/unityshell/src/HudView.cpp (+6/-7)
To merge this branch: bzr merge lp:~gordallott/unity/fix-hud-translation
Reviewer Review Type Date Requested Status
Michal Hruby (community) Approve
Review via email: mp+100937@code.launchpad.net

Commit message

Fixes a hud translation issue, can't have const std::strings in an anonymous namespace.

Description of the change

Fixes a hud translation issue, can't have const std::strings in an anonymous namespace. no tests - for obvious reasons

To post a comment you must log in.
Revision history for this message
Michal Hruby (mhr3) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'plugins/unityshell/src/HudView.cpp'
--- plugins/unityshell/src/HudView.cpp 2012-04-01 00:45:53 +0000
+++ plugins/unityshell/src/HudView.cpp 2012-04-05 09:15:23 +0000
@@ -40,7 +40,6 @@
40{40{
41nux::logging::Logger logger("unity.hud.view");41nux::logging::Logger logger("unity.hud.view");
42const int icon_size = 46;42const int icon_size = 46;
43const std::string default_text = _("Type your command");
44const int grow_anim_length = 90 * 1000;43const int grow_anim_length = 90 * 1000;
45const int pause_before_grow_length = 32 * 1000;44const int pause_before_grow_length = 32 * 1000;
4645
@@ -176,7 +175,7 @@
176void View::ResetToDefault()175void View::ResetToDefault()
177{176{
178 search_bar_->search_string = "";177 search_bar_->search_string = "";
179 search_bar_->search_hint = default_text;178 search_bar_->search_hint = _("Type your command");
180}179}
181180
182void View::Relayout()181void View::Relayout()
@@ -361,7 +360,7 @@
361 search_bar_ = new unity::SearchBar(true);360 search_bar_ = new unity::SearchBar(true);
362 search_bar_->SetMinimumHeight(style.GetSearchBarHeight());361 search_bar_->SetMinimumHeight(style.GetSearchBarHeight());
363 search_bar_->SetMaximumHeight(style.GetSearchBarHeight());362 search_bar_->SetMaximumHeight(style.GetSearchBarHeight());
364 search_bar_->search_hint = default_text;363 search_bar_->search_hint = _("Type your command");
365 search_bar_->search_changed.connect(sigc::mem_fun(this, &View::OnSearchChanged));364 search_bar_->search_changed.connect(sigc::mem_fun(this, &View::OnSearchChanged));
366 AddChild(search_bar_.GetPointer());365 AddChild(search_bar_.GetPointer());
367 content_layout_->AddView(search_bar_.GetPointer(), 0, nux::MINOR_POSITION_LEFT);366 content_layout_->AddView(search_bar_.GetPointer(), 0, nux::MINOR_POSITION_LEFT);
@@ -385,7 +384,7 @@
385 search_changed.emit(search_string);384 search_changed.emit(search_string);
386 if (search_string.empty())385 if (search_string.empty())
387 {386 {
388 search_bar_->search_hint = default_text;387 search_bar_->search_hint = _("Type your command");
389 }388 }
390 else389 else
391 {390 {
@@ -493,7 +492,7 @@
493 else492 else
494 {493 {
495 search_bar_->search_string = "";494 search_bar_->search_string = "";
496 search_bar_->search_hint = default_text;495 search_bar_->search_hint = _("Type your command");
497 }496 }
498 return true;497 return true;
499 }498 }
@@ -544,13 +543,13 @@
544543
545 if (search_bar_->search_string == "")544 if (search_bar_->search_string == "")
546 {545 {
547 search_bar_->search_hint = default_text;546 search_bar_->search_hint = _("Type your command");
548 ubus.SendMessage(UBUS_HUD_CLOSE_REQUEST);547 ubus.SendMessage(UBUS_HUD_CLOSE_REQUEST);
549 }548 }
550 else549 else
551 {550 {
552 search_bar_->search_string = "";551 search_bar_->search_string = "";
553 search_bar_->search_hint = default_text;552 search_bar_->search_hint = _("Type your command");
554 return search_bar_->text_entry();553 return search_bar_->text_entry();
555 }554 }
556 return NULL;555 return NULL;