~canonical-dx-team/unity/unity.fix-ql-losing-focus

« back to all changes in this revision

Viewing changes to src/PlaceEntryRemote.cpp

This branch add the capability of setting hard coded keybindings to the
workspace
switcher and the Trash.
In addition, each place entry can specify a shortcut in its place file like:
Shortcut=a
in the [Entry:xxx] section

In addition, there are some fixes to be able to navigate by key navigation (or
activate the shortcuts) for the special switchers: ws, places, devices and
trash.

Fixes:
Bug #617356: Super-shortcuts for apps, files, and workspace switcher    Medium
Triaged
Bug #723141: key navigation doesn't activate trash, keys, expo or places    High
In Progress

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
  _name (NULL),
43
43
  _icon (NULL),
44
44
  _description (NULL),
 
45
  _shortcut (10), // impossible shortcut
45
46
  _position (0),
46
47
  _mimetypes (NULL),
47
48
  _sensitive (true),
85
86
  gchar  *domain;
86
87
  gchar  *name;
87
88
  gchar  *description;
 
89
  gchar  *shortcut_entry;
88
90
 
89
91
  _dbus_path = g_key_file_get_string (key_file, group, DBUS_PATH, &error);
90
92
  if (_dbus_path == NULL
126
128
    _name = g_strdup (name);
127
129
    _description = g_strdup (description);
128
130
  }
 
131
  
 
132
  if (g_key_file_has_key (key_file, group, "Shortcut", NULL))
 
133
  {
 
134
    shortcut_entry = g_key_file_get_string(key_file, group, "Shortcut", NULL);
 
135
    if (strlen (shortcut_entry) == 1)
 
136
      _shortcut = shortcut_entry[0];
 
137
    else
 
138
      g_warning ("Place %s has an uncompatible shortcut: %s", name, shortcut_entry);    
 
139
    g_free (shortcut_entry);
 
140
  }
129
141
 
130
142
  /* Finally the two that should default to true */
131
143
  if (g_key_file_has_key (key_file, group, "ShowGlobal", NULL))
169
181
  return _description;
170
182
}
171
183
 
 
184
guint64
 
185
PlaceEntryRemote::GetShortcut ()
 
186
{
 
187
  return _shortcut;
 
188
}
 
189
 
172
190
guint32
173
191
PlaceEntryRemote::GetPosition  ()
174
192
{