Changeset e6881d679c9940cd32cddd82948f638a97a8df98
- Timestamp:
- 02/28/10 17:13:54 (5 months ago)
- Author:
- Nedko Arnaudov <nedko@…>
- Children:
- 717b3851bef1ce331f4166ecda6a3c1e1a2b0610
- Parents:
- 0d5a0067dd12486d570d26414152cab8f2249746
- git-committer:
- Nedko Arnaudov <nedko@arnaudov.name> / 2010-02-28T17:13:54Z+0200
- Message:
-
gui: accelerator infrastructure; 'c' shortcut for clearing xruns and load
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r0d5a006
|
re6881d6
|
|
| 1202 | 1202 | } |
| 1203 | 1203 | |
| | 1204 | void setup_accelerators(void) |
| | 1205 | { |
| | 1206 | static GtkActionGroup * action_group_ptr; |
| | 1207 | static GtkAccelGroup * accel_group_ptr; |
| | 1208 | struct |
| | 1209 | { |
| | 1210 | GtkAction * action_ptr; |
| | 1211 | const char * shortcut; |
| | 1212 | } * descriptor_ptr, descriptors [] = |
| | 1213 | { |
| | 1214 | {g_clear_xruns_and_max_dsp_action, "c"}, |
| | 1215 | {NULL, NULL} |
| | 1216 | }; |
| | 1217 | |
| | 1218 | action_group_ptr = gtk_action_group_new("main"); |
| | 1219 | accel_group_ptr = gtk_accel_group_new(); |
| | 1220 | |
| | 1221 | for (descriptor_ptr = descriptors; descriptor_ptr->action_ptr != NULL; descriptor_ptr++) |
| | 1222 | { |
| | 1223 | //log_info("action '%s' -> shortcut \"%s\"", gtk_action_get_name(descriptor_ptr->action_ptr), descriptor_ptr->shortcut); |
| | 1224 | gtk_action_group_add_action_with_accel(action_group_ptr, descriptor_ptr->action_ptr, descriptor_ptr->shortcut); |
| | 1225 | gtk_action_set_accel_group(descriptor_ptr->action_ptr, accel_group_ptr); |
| | 1226 | gtk_action_connect_accelerator(descriptor_ptr->action_ptr); |
| | 1227 | } |
| | 1228 | |
| | 1229 | gtk_window_add_accel_group(GTK_WINDOW(g_main_win), accel_group_ptr); |
| | 1230 | } |
| | 1231 | |
| 1204 | 1232 | int main(int argc, char** argv) |
| 1205 | 1233 | { |
| … |
… |
|
| 1288 | 1316 | view_init(); |
| 1289 | 1317 | |
| | 1318 | setup_accelerators(); |
| | 1319 | |
| 1290 | 1320 | dbus_init(); |
| 1291 | 1321 | |