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

« back to all changes in this revision

Viewing changes to UnityCore/AppmenuIndicator.cpp

  • Committer: Marco Trevisan (Treviño)
  • Date: 2012-03-29 12:06:35 UTC
  • mto: (1858.20.3 panel-p-tests)
  • mto: This revision was merged to the branch mainline in revision 2242.
  • Revision ID: mail@3v1n0.net-20120329120635-2prx8dehpcrlc9nk
Removing all the LIM stuff, it will be back soon!

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
namespace indicator
25
25
{
26
26
 
27
 
namespace 
28
 
{
29
 
const std::string SETTING_NAME("com.canonical.indicator.appmenu");
30
 
const std::string SETTING_KEY("menu-mode");
31
 
}
32
 
 
33
27
AppmenuIndicator::AppmenuIndicator(std::string const& name)
34
28
  : Indicator(name)
35
 
  , gsettings_(g_settings_new(SETTING_NAME.c_str()))
36
 
  , integrated_(false)
37
 
{
38
 
  setting_changed_.Connect(gsettings_, "changed::menu-mode", [&] (GSettings*, gchar*) {
39
 
    CheckSettingValue();
40
 
  });
41
 
 
42
 
  CheckSettingValue();
43
 
}
44
 
 
45
 
bool AppmenuIndicator::ShowAppmenu(unsigned int xid, int x, int y, unsigned int timestamp) const
46
 
{
47
 
  if (integrated_)
48
 
  {
49
 
    on_show_appmenu.emit(xid, x, y, timestamp);
50
 
    return true;
51
 
  }
52
 
 
53
 
  return false;
54
 
}
55
 
 
56
 
bool AppmenuIndicator::IsIntegrated() const
57
 
{
58
 
  return integrated_;
59
 
}
60
 
 
61
 
void AppmenuIndicator::CheckSettingValue()
62
 
{
63
 
  glib::String menu_mode(g_settings_get_string(gsettings_, SETTING_KEY.c_str()));
64
 
  bool integrated_menus = false;
65
 
 
66
 
  if (menu_mode.Str() == "locally-integrated")
67
 
  {
68
 
    integrated_menus = true;
69
 
  }
70
 
 
71
 
  if (integrated_menus != integrated_)
72
 
  {
73
 
    integrated_ = integrated_menus;
74
 
    integrated_changed.emit(integrated_);
75
 
  }
 
29
{}
 
30
 
 
31
void AppmenuIndicator::ShowAppmenu(unsigned int xid, int x, int y, unsigned int timestamp) const
 
32
{
 
33
  on_show_appmenu.emit(xid, x, y, timestamp);
76
34
}
77
35
 
78
36
} // namespace indicator