mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice-gtk
synced 2026-02-05 23:00:47 +00:00
gtk/controller: add accel menuitem property
This commit is contained in:
parent
3bdd8434d9
commit
abbfb5779e
@ -190,8 +190,10 @@ public class Controller: Object {
|
||||
if (read == 0)
|
||||
break;
|
||||
|
||||
if (warn_if (read != sizeof (SpiceProtocol.Controller.Msg)))
|
||||
if (warn_if (read != sizeof (SpiceProtocol.Controller.Msg))) {
|
||||
warning ("read only: " + read.to_string ());
|
||||
break;
|
||||
}
|
||||
|
||||
var msg = (SpiceProtocol.Controller.Msg*)t;
|
||||
if (warn_if (msg.size < sizeof (SpiceProtocol.Controller.Msg)))
|
||||
|
||||
@ -25,6 +25,7 @@ public class MenuItem: Object {
|
||||
public int parent_id;
|
||||
public int id;
|
||||
public string text;
|
||||
public string accel;
|
||||
public SpiceProtocol.Controller.MenuFlags flags;
|
||||
|
||||
public MenuItem.from_string (string str) throws SpiceCtrl.Error {
|
||||
@ -33,7 +34,10 @@ public class MenuItem: Object {
|
||||
throw new SpiceCtrl.Error.VALUE(""); /* Vala: why is it mandatory to give a string? */
|
||||
parent_id = int.parse (params[0]);
|
||||
id = int.parse (params[1]);
|
||||
text = params[2];
|
||||
var textaccel = params[2].split ("\t");
|
||||
text = textaccel[0];
|
||||
if (textaccel.length > 1)
|
||||
accel = textaccel[1];
|
||||
flags = (SpiceProtocol.Controller.MenuFlags)int.parse (params[3]);
|
||||
|
||||
submenu = new Menu ();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user