~smspillaz/unity/untiy.less-paint-insanity

« back to all changes in this revision

Viewing changes to plugins/unityshell/src/ShortcutHintPrivate.cpp

  • Committer: Daniel van Vugt
  • Date: 2012-03-14 06:24:18 UTC
  • mfrom: (2108 unity)
  • mto: This revision was merged to the branch mainline in revision 2146.
  • Revision ID: daniel.van.vugt@canonical.com-20120314062418-nprucpbr0m7qky5e
MergedĀ latestĀ lp:unity

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 * Authored by: Andrea Azzarone <azzaronea@gmail.com>
17
17
 */
18
18
 
 
19
#include <glib/gi18n-lib.h>
 
20
 
19
21
#include "ShortcutHintPrivate.h"
20
22
 
21
23
#include <boost/algorithm/string/replace.hpp>
27
29
namespace impl
28
30
{
29
31
 
 
32
std::string GetMetaKey(std::string const& scut)
 
33
{
 
34
  size_t index = scut.find_last_of( ">");
 
35
  if (index >= 0)
 
36
    return std::string(scut.begin(), scut.begin() + index + 1);
 
37
  else
 
38
    return "";
 
39
}
 
40
 
30
41
std::string FixShortcutFormat(std::string const& scut)
31
42
{
32
43
  std::string ret(scut.begin(), scut.end() - 1);
44
55
{
45
56
  std::string ret(scut);
46
57
  
47
 
  boost::replace_all(ret, "Button1", "Left Mouse");
48
 
  boost::replace_all(ret, "Button2", "Middle Mouse");
49
 
  boost::replace_all(ret, "Button3", "Right Mouse");
 
58
  boost::replace_all(ret, "Button1", _("Left Mouse"));
 
59
  boost::replace_all(ret, "Button2", _("Middle Mouse"));
 
60
  boost::replace_all(ret, "Button3", _("Right Mouse"));
50
61
      
51
62
  return ret;
52
63
}