diff options
Diffstat (limited to 'UIManager.cpp')
-rw-r--r-- | UIManager.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/UIManager.cpp b/UIManager.cpp index c1b1e45..2b4fefd 100644 --- a/UIManager.cpp +++ b/UIManager.cpp @@ -26,12 +26,14 @@ const gchar* const UIManager::uiData = (const gchar*) void UIManager::handleAction(GtkAction *action, UIManager *uiManager) { const gchar* name = gtk_action_get_name(action); - if(!strcmp(name, "zoomIn")) + if(!strcmp(name, "save")) + uiManager->window->handleAction(SAVE); + else if(!strcmp(name, "saveAs")) + uiManager->window->handleAction(SAVE_AS); + else if(!strcmp(name, "zoomIn")) uiManager->window->handleAction(ZOOM_IN); - //zoomInCentered(1.2f); else if(!strcmp(name, "zoomOut")) uiManager->window->handleAction(ZOOM_OUT); - //zoomOutCentered(1.2f); } GtkActionGroup* UIManager::createActions() { @@ -47,18 +49,22 @@ GtkActionGroup* UIManager::createActions() { g_object_unref(G_OBJECT(action)); action = gtk_action_new("new", "_New", NULL, GTK_STOCK_NEW); + g_signal_connect(G_OBJECT(action), "activate", G_CALLBACK(handleAction), this); gtk_action_group_add_action_with_accel(actionGroup, action, NULL); g_object_unref(G_OBJECT(action)); action = gtk_action_new("open", "_Open", NULL, GTK_STOCK_OPEN); + g_signal_connect(G_OBJECT(action), "activate", G_CALLBACK(handleAction), this); gtk_action_group_add_action_with_accel(actionGroup, action, NULL); g_object_unref(G_OBJECT(action)); action = gtk_action_new("save", "_Save", NULL, GTK_STOCK_SAVE); + g_signal_connect(G_OBJECT(action), "activate", G_CALLBACK(handleAction), this); gtk_action_group_add_action_with_accel(actionGroup, action, NULL); g_object_unref(G_OBJECT(action)); action = gtk_action_new("saveAs", "Save _As", NULL, NULL); + g_signal_connect(G_OBJECT(action), "activate", G_CALLBACK(handleAction), this); gtk_action_group_add_action(actionGroup, action); g_object_unref(G_OBJECT(action)); |