Commit 126d58cf174897eb9a37eb8b1d5d4442da90573c
1 parent
a1bc9024
Exists in
master
and in
1 other branch
Adding name on simple action.
Showing
3 changed files
with
14 additions
and
1 deletions
Show diff stats
src/include/v3270/actions.h
... | ... | @@ -149,6 +149,7 @@ |
149 | 149 | GVariant * (*get_state)(GAction *action, GtkWidget *terminal); |
150 | 150 | const gchar * (*translate)(GAction *action, const gchar *text); |
151 | 151 | |
152 | + const gchar * (*get_name)(GAction *action); | |
152 | 153 | const gchar * (*get_icon_name)(GAction *action); |
153 | 154 | const gchar * (*get_label)(GAction *action); |
154 | 155 | const gchar * (*get_tooltip)(GAction *action); |
... | ... | @@ -198,6 +199,7 @@ |
198 | 199 | V3270Action parent; |
199 | 200 | |
200 | 201 | // Fixed data |
202 | + const gchar * name; | |
201 | 203 | const gchar * icon_name; |
202 | 204 | const gchar * label; |
203 | 205 | const gchar * tooltip; | ... | ... |
src/terminal/actions/action.c
... | ... | @@ -46,6 +46,7 @@ |
46 | 46 | static const gchar * get_icon_name(GAction *action); |
47 | 47 | static const gchar * get_label(GAction *action); |
48 | 48 | static const gchar * get_tooltip(GAction *action); |
49 | + static const gchar * get_name(GAction *action); | |
49 | 50 | |
50 | 51 | static void change_widget(GAction *action, GtkWidget *from, GtkWidget *to); |
51 | 52 | static void finalize(GObject *object); |
... | ... | @@ -88,6 +89,7 @@ |
88 | 89 | klass->change_widget = change_widget; |
89 | 90 | klass->get_enabled = get_enabled; |
90 | 91 | klass->get_state = get_state; |
92 | + klass->get_name = get_name; | |
91 | 93 | klass->translate = translate; |
92 | 94 | |
93 | 95 | klass->get_icon_name = get_icon_name; |
... | ... | @@ -396,7 +398,7 @@ |
396 | 398 | } |
397 | 399 | |
398 | 400 | const gchar * iface_get_name(GAction *action) { |
399 | - return V3270_ACTION_GET_DESCRIPTOR(action)->name; | |
401 | + return V3270_ACTION_GET_CLASS(action)->get_name(action); | |
400 | 402 | } |
401 | 403 | |
402 | 404 | GVariant * iface_get_state(GAction *object) { |
... | ... | @@ -497,6 +499,10 @@ |
497 | 499 | |
498 | 500 | } |
499 | 501 | |
502 | + const gchar * get_name(GAction *action) { | |
503 | + return V3270_ACTION_GET_DESCRIPTOR(action)->name; | |
504 | + } | |
505 | + | |
500 | 506 | const gchar * v3270_action_get_icon_name(GAction *action) { |
501 | 507 | return V3270_ACTION_GET_CLASS(action)->get_icon_name(action); |
502 | 508 | } | ... | ... |
src/terminal/actions/simple.c
... | ... | @@ -57,6 +57,10 @@ |
57 | 57 | return V3270_SIMPLE_ACTION(action)->tooltip; |
58 | 58 | } |
59 | 59 | |
60 | + static const gchar * get_name(GAction *action) { | |
61 | + return V3270_SIMPLE_ACTION(action)->name; | |
62 | + } | |
63 | + | |
60 | 64 | static void dispose(GObject *object) { |
61 | 65 | |
62 | 66 | V3270SimpleAction *action = V3270_SIMPLE_ACTION(object); |
... | ... | @@ -71,6 +75,7 @@ |
71 | 75 | |
72 | 76 | static void V3270SimpleAction_class_init(V3270SimpleActionClass *klass) { |
73 | 77 | |
78 | + klass->parent_class.get_name = get_name; | |
74 | 79 | klass->parent_class.get_icon_name = get_icon_name; |
75 | 80 | klass->parent_class.get_label = get_label; |
76 | 81 | klass->parent_class.get_tooltip = get_tooltip; | ... | ... |