~ubuntu-branches/ubuntu/wily/epiphany-browser/wily

« back to all changes in this revision

Viewing changes to src/window-commands.c

  • Committer: Package Import Robot
  • Author(s): Gustavo Noronha Silva, Jeremy Bicha, Emilio Pozuelo Monfort, Gustavo Noronha Silva
  • Date: 2012-12-10 11:40:01 UTC
  • mfrom: (1.8.8) (105.1.4 sid)
  • Revision ID: package-import@ubuntu.com-20121210114001-42jjyg3qw3eyz00a
Tags: 3.6.1-1
[ Jeremy Bicha ]
* New upstream unstable release
* debian/control.in:
  - Bump minimum intltool to 0.50
* debian/epiphany-browser-data.install:
  - The developers no longer provide help files to install since they were
    too outdated
* Dropped upstream patches:
  - 01_email-as-user-for-password-remembering.patch
  - 13_toolbar_size_fixes.patch
* debian/watch: Watch for unstable releases.

[ Emilio Pozuelo Monfort ]
* New upstream release.
  + debian/patches/14_pkglibdir.patch:
    - Removed, applied upstream.
  + debian/control.in:
    - Update (build-)dependencies.

[ Gustavo Noronha Silva ]
* debian/control.in:
- Build-Depend on gnome-common >= 3.6, needed for the code
  coverage feature

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
#include "ephy-notebook.h"
44
44
#include "ephy-prefs.h"
45
45
#include "ephy-private.h"
 
46
#include "ephy-session.h"
46
47
#include "ephy-settings.h"
47
48
#include "ephy-shell.h"
48
49
#include "ephy-state.h"
56
57
#include <glib/gi18n.h>
57
58
#include <gtk/gtk.h>
58
59
#include <libnotify/notify.h>
 
60
#include <libsoup/soup.h>
59
61
#include <string.h>
 
62
#ifdef HAVE_WEBKIT2
 
63
#include <webkit2/webkit2.h>
 
64
#else
60
65
#include <webkit/webkit.h>
 
66
#endif
61
67
 
62
68
void
63
69
window_cmd_file_print (GtkAction *action,
263
269
        dialog = ephy_file_chooser_new (_("Open"),
264
270
                                        GTK_WIDGET (window),
265
271
                                        GTK_FILE_CHOOSER_ACTION_OPEN,
266
 
                                        EPHY_PREFS_STATE_OPEN_DIR,
267
272
                                        EPHY_FILE_FILTER_ALL_SUPPORTED);
268
273
 
269
274
        g_signal_connect (dialog, "response",
275
280
static char *
276
281
get_suggested_filename (EphyWebView *view)
277
282
{
278
 
        char *suggested_filename;
 
283
        char *suggested_filename = NULL;
279
284
        const char *mimetype;
 
285
#ifdef HAVE_WEBKIT2
 
286
        WebKitURIResponse *response;
 
287
#else
280
288
        WebKitWebFrame *frame;
281
289
        WebKitWebDataSource *data_source;
 
290
#endif
282
291
        WebKitWebResource *web_resource;
283
292
 
 
293
#ifdef HAVE_WEBKIT2
 
294
        web_resource = webkit_web_view_get_main_resource (WEBKIT_WEB_VIEW (view));
 
295
        response = webkit_web_resource_get_response (web_resource);
 
296
        mimetype = webkit_uri_response_get_mime_type (response);
 
297
#else
284
298
        frame = webkit_web_view_get_main_frame (WEBKIT_WEB_VIEW (view));
285
299
        data_source = webkit_web_frame_get_data_source (frame);
286
300
        web_resource = webkit_web_data_source_get_main_resource (data_source);
287
301
        mimetype = webkit_web_resource_get_mime_type (web_resource);
 
302
#endif
288
303
 
289
304
        if ((g_ascii_strncasecmp (mimetype, "text/html", 9)) == 0)
290
305
        {
291
 
                /* Web Title will be used as suggested filename*/
 
306
                /* Web Title will be used as suggested filename */
 
307
#ifdef HAVE_WEBKIT2
 
308
                suggested_filename = g_strconcat (ephy_web_view_get_title (view), ".mhtml", NULL);
 
309
#else
292
310
                suggested_filename = g_strconcat (ephy_web_view_get_title (view), ".html", NULL);
 
311
#endif
293
312
        }
294
313
        else
295
314
        {
296
 
                SoupURI *soup_uri = soup_uri_new (webkit_web_resource_get_uri (web_resource));
297
 
                suggested_filename = g_path_get_basename (soup_uri->path);
298
 
                soup_uri_free (soup_uri);
 
315
#ifdef HAVE_WEBKIT2
 
316
                suggested_filename = g_strdup (webkit_uri_response_get_suggested_filename (response));
 
317
#else
 
318
                WebKitNetworkResponse *response;
 
319
 
 
320
                response = webkit_web_frame_get_network_response (frame);
 
321
                suggested_filename = g_strdup (webkit_network_response_get_suggested_filename (response));
 
322
#endif
 
323
 
 
324
                if (!suggested_filename)
 
325
                {
 
326
                        SoupURI *soup_uri = soup_uri_new (webkit_web_resource_get_uri (web_resource));
 
327
                        suggested_filename = g_path_get_basename (soup_uri->path);
 
328
                        soup_uri_free (soup_uri);
 
329
                }
299
330
        }
300
331
 
301
332
        return suggested_filename;
316
347
        dialog = ephy_file_chooser_new (_("Save"),
317
348
                                        GTK_WIDGET (window),
318
349
                                        GTK_FILE_CHOOSER_ACTION_SAVE,
319
 
                                        EPHY_PREFS_STATE_SAVE_DIR,
320
350
                                        EPHY_FILE_FILTER_NONE);
321
351
 
322
352
        gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (dialog), TRUE);
323
353
 
324
354
        view = ephy_embed_get_web_view (embed);
325
 
        suggested_filename = get_suggested_filename (view);
 
355
        suggested_filename = ephy_sanitize_filename (get_suggested_filename (view));
326
356
 
327
357
        gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (dialog), suggested_filename);
328
358
        g_free (suggested_filename);
364
394
        g_object_unref (snapshot);
365
395
}
366
396
 
 
397
#ifdef HAVE_WEBKIT2
 
398
static void
 
399
download_finished_cb (WebKitDownload *download,
 
400
                      EphyApplicationDialogData *data)
 
401
{
 
402
        char *filename;
 
403
 
 
404
        filename = g_filename_from_uri (webkit_download_get_destination (download), NULL, NULL);
 
405
        gtk_image_set_from_file (GTK_IMAGE (data->image), filename);
 
406
        g_free (filename);
 
407
}
 
408
 
 
409
static void
 
410
download_failed_cb (WebKitDownload *download,
 
411
                    GError *error,
 
412
                    EphyApplicationDialogData *data)
 
413
{
 
414
        g_signal_handlers_disconnect_by_func (download, download_finished_cb, data);
 
415
        /* Something happened, default to a page snapshot. */
 
416
        take_page_snapshot_and_set_image (data);
 
417
}
 
418
#else
367
419
static void
368
420
download_status_changed_cb (WebKitDownload *download,
369
421
                            GParamSpec *spec,
370
422
                            EphyApplicationDialogData *data)
371
423
{
372
424
        WebKitDownloadStatus status = webkit_download_get_status (download);
373
 
        const char *destination;
 
425
        char *filename;
374
426
 
375
427
        switch (status)
376
428
        {
377
429
        case WEBKIT_DOWNLOAD_STATUS_FINISHED:
378
 
                destination = g_filename_from_uri (webkit_download_get_destination_uri (download),
 
430
                filename = g_filename_from_uri (webkit_download_get_destination_uri (download),
379
431
                                                   NULL, NULL);
380
 
                gtk_image_set_from_file (GTK_IMAGE (data->image), destination);
 
432
                gtk_image_set_from_file (GTK_IMAGE (data->image), filename);
 
433
                g_free (filename);
381
434
                break;
382
435
        case WEBKIT_DOWNLOAD_STATUS_ERROR:
383
436
        case WEBKIT_DOWNLOAD_STATUS_CANCELLED:
388
441
                break;
389
442
        }
390
443
}
 
444
#endif
391
445
 
392
446
static void
393
447
download_icon_and_set_image (EphyApplicationDialogData *data)
394
448
{
 
449
#ifndef HAVE_WEBKIT2
395
450
        WebKitNetworkRequest *request;
 
451
#endif
396
452
        WebKitDownload *download;
397
453
        char *destination, *destination_uri, *tmp_filename;
398
454
 
 
455
#ifdef HAVE_WEBKIT2
 
456
        download = webkit_web_context_download_uri (webkit_web_context_get_default (),
 
457
                                                    data->icon_href);
 
458
#else
399
459
        request = webkit_network_request_new (data->icon_href);
400
460
        download = webkit_download_new (request);
401
461
        g_object_unref (request);
 
462
#endif
402
463
 
403
464
        tmp_filename = ephy_file_tmp_filename ("ephy-download-XXXXXX", NULL);
404
465
        destination = g_build_filename (ephy_file_tmp_dir (), tmp_filename, NULL);
405
466
        destination_uri = g_filename_to_uri (destination, NULL, NULL);
 
467
#ifdef HAVE_WEBKIT2
 
468
        webkit_download_set_destination (download, destination_uri);
 
469
#else
406
470
        webkit_download_set_destination_uri (download, destination_uri);
 
471
#endif
407
472
        g_free (destination);
408
473
        g_free (destination_uri);
409
474
        g_free (tmp_filename);
410
475
 
 
476
#ifdef HAVE_WEBKIT2
 
477
        g_signal_connect (download, "finished",
 
478
                          G_CALLBACK (download_finished_cb), data);
 
479
        g_signal_connect (download, "failed",
 
480
                          G_CALLBACK (download_failed_cb), data);
 
481
#else
411
482
        g_signal_connect (download, "notify::status",
412
483
                          G_CALLBACK (download_status_changed_cb), data);
413
484
 
414
 
        webkit_download_start (download);       
 
485
        webkit_download_start (download);
 
486
#endif
415
487
}
416
488
 
417
489
static void
418
490
fill_default_application_image (EphyApplicationDialogData *data)
419
491
{
 
492
#ifdef HAVE_WEBKIT2
 
493
        /* TODO: DOM Bindindgs */
 
494
#else
420
495
        WebKitDOMDocument *document;
421
496
        WebKitDOMNodeList *links;
422
497
        gulong length, i;
440
515
                        return;
441
516
                }
442
517
        }
443
 
 
 
518
#endif
444
519
        /* If we make it here, no "apple-touch-icon" link was
445
520
         * found. Take a snapshot of the page. */
446
521
        take_page_snapshot_and_set_image (data);
500
575
                                        gint response,
501
576
                                        EphyApplicationDialogData *data)
502
577
{
503
 
        char *profile_dir;
 
578
        const char *app_name;
504
579
        char *desktop_file;
505
580
        char *message;
506
581
        NotifyNotification *notification;
507
 
        gboolean profile_exists;
508
582
 
509
583
        if (response == GTK_RESPONSE_OK) {
510
 
                profile_dir = ephy_web_application_get_profile_directory (gtk_entry_get_text (GTK_ENTRY (data->entry)));
511
 
                if (!profile_dir)
512
 
                        return;
513
 
                profile_exists = g_file_test (profile_dir, G_FILE_TEST_IS_DIR);
514
 
                g_free (profile_dir);
 
584
                app_name = gtk_entry_get_text (GTK_ENTRY (data->entry));
515
585
 
516
 
                if (profile_exists)
 
586
                if (ephy_web_application_exists (app_name))
517
587
                {
518
 
                        if (confirm_web_application_overwrite (GTK_WINDOW (dialog),
519
 
                                                               gtk_entry_get_text (GTK_ENTRY (data->entry))))
520
 
                                ephy_web_application_delete (gtk_entry_get_text (GTK_ENTRY (data->entry)));
 
588
                        if (confirm_web_application_overwrite (GTK_WINDOW (dialog), app_name))
 
589
                                ephy_web_application_delete (app_name);
521
590
                        else
522
591
                                return;
523
592
                }
524
593
 
525
594
                /* Create Web Application, including a new profile and .desktop file. */
526
 
                desktop_file = ephy_web_application_create (data->view,
527
 
                                                            gtk_entry_get_text (GTK_ENTRY (data->entry)),
 
595
                desktop_file = ephy_web_application_create (webkit_web_view_get_uri (WEBKIT_WEB_VIEW (data->view)),
 
596
                                                            app_name,
528
597
                                                            gtk_image_get_pixbuf (GTK_IMAGE (data->image)));
529
598
                if (desktop_file)
530
599
                        message = g_strdup_printf (_("The application '%s' is ready to be used"),
531
 
                                                   gtk_entry_get_text (GTK_ENTRY (data->entry)));
 
600
                                                   app_name);
532
601
                else
533
602
                        message = g_strdup_printf (_("The application '%s' could not be created"),
534
 
                                                   gtk_entry_get_text (GTK_ENTRY (data->entry)));
 
603
                                                   app_name);
535
604
 
536
605
                notification = notify_notification_new (message,
537
606
                                                        NULL, NULL);
650
719
}
651
720
 
652
721
void
 
722
window_cmd_file_quit (GtkAction *action,
 
723
                      EphyWindow *window)
 
724
{
 
725
        if (ephy_session_close_all_windows (EPHY_SESSION (ephy_shell_get_session (ephy_shell))))
 
726
                g_application_quit (g_application_get_default ());
 
727
}
 
728
 
 
729
void
 
730
window_cmd_file_new_window (GtkAction *action,
 
731
                            EphyWindow *window)
 
732
{
 
733
        ephy_shell_new_tab (ephy_shell, NULL, NULL, NULL,
 
734
                            EPHY_NEW_TAB_IN_NEW_WINDOW | EPHY_NEW_TAB_HOME_PAGE);
 
735
}
 
736
 
 
737
void
653
738
window_cmd_edit_undo (GtkAction *action,
654
739
                      EphyWindow *window)
655
740
{
670
755
 
671
756
                if (embed)
672
757
                {
 
758
#ifdef HAVE_WEBKIT2
 
759
                        webkit_web_view_execute_editing_command (EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED (EPHY_EMBED (embed)), "Undo");
 
760
#else
673
761
                        webkit_web_view_undo (EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED (EPHY_EMBED (embed)));
 
762
#endif
674
763
                }
675
764
        }
676
765
}
695
784
                embed = gtk_widget_get_ancestor (widget, EPHY_TYPE_EMBED);
696
785
                if (embed)
697
786
                {
 
787
#ifdef HAVE_WEBKIT2
 
788
                        webkit_web_view_execute_editing_command (EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED (EPHY_EMBED (embed)), "Redo");
 
789
#else
698
790
                        webkit_web_view_redo (EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED (EPHY_EMBED (embed)));
 
791
#endif
699
792
                }
700
793
        }
701
794
}
715
808
                embed = ephy_embed_container_get_active_child (EPHY_EMBED_CONTAINER (window));
716
809
                g_return_if_fail (embed != NULL);
717
810
 
 
811
#ifdef HAVE_WEBKIT2
 
812
                webkit_web_view_execute_editing_command (EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED (embed), WEBKIT_EDITING_COMMAND_CUT);
 
813
#else
718
814
                webkit_web_view_cut_clipboard (EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED (embed));
 
815
#endif
719
816
        }
720
817
}
721
818
 
735
832
 
736
833
                embed = ephy_embed_container_get_active_child (EPHY_EMBED_CONTAINER (window));
737
834
                g_return_if_fail (embed != NULL);
738
 
 
 
835
#ifdef HAVE_WEBKIT2
 
836
                webkit_web_view_execute_editing_command (EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED (embed), WEBKIT_EDITING_COMMAND_COPY);
 
837
#else
739
838
                webkit_web_view_copy_clipboard (EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED (embed));
 
839
#endif
740
840
        }
741
841
}
742
842
 
757
857
                embed = ephy_embed_container_get_active_child (EPHY_EMBED_CONTAINER (window));
758
858
                g_return_if_fail (embed != NULL);
759
859
 
 
860
#ifdef HAVE_WEBKIT2
 
861
                webkit_web_view_execute_editing_command (EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED (embed), WEBKIT_EDITING_COMMAND_PASTE);
 
862
#else
760
863
                webkit_web_view_paste_clipboard (EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED (embed));
 
864
#endif
761
865
        }
762
866
}
763
867
 
804
908
                  (EPHY_EMBED_CONTAINER (window));
805
909
                g_return_if_fail (embed != NULL);
806
910
 
 
911
#ifdef HAVE_WEBKIT2
 
912
                webkit_web_view_execute_editing_command (EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED (embed), "SelectAll");
 
913
#else
807
914
                webkit_web_view_select_all (EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED (embed));
 
915
#endif
808
916
        }
809
917
}
810
918
 
839
947
}
840
948
 
841
949
void
 
950
window_cmd_edit_bookmarks (GtkAction *action,
 
951
                           EphyWindow *window)
 
952
{
 
953
        GtkWidget *bwindow;
 
954
        
 
955
        bwindow = ephy_shell_get_bookmarks_editor (ephy_shell);
 
956
        gtk_window_present (GTK_WINDOW (bwindow));
 
957
}
 
958
 
 
959
void
 
960
window_cmd_edit_history (GtkAction *action,
 
961
                         EphyWindow *window)
 
962
{
 
963
        GtkWidget *hwindow;
 
964
        
 
965
        hwindow = ephy_shell_get_history_window (ephy_shell);
 
966
        gtk_window_present (GTK_WINDOW (hwindow));
 
967
}
 
968
 
 
969
void
 
970
window_cmd_edit_preferences (GtkAction *action,
 
971
                             EphyWindow *window)
 
972
{
 
973
        EphyDialog *dialog;
 
974
        
 
975
        dialog = EPHY_DIALOG (ephy_shell_get_prefs_dialog (ephy_shell));
 
976
        
 
977
        ephy_dialog_show (dialog);
 
978
}
 
979
 
 
980
void
 
981
window_cmd_edit_personal_data (GtkAction *action,
 
982
                               EphyWindow *window)
 
983
{
 
984
        PdmDialog *dialog;
 
985
        
 
986
        dialog = EPHY_PDM_DIALOG (ephy_shell_get_pdm_dialog (ephy_shell));
 
987
        /* FIXME?: pdm_dialog_open is supposed to scroll to the host passed
 
988
         * as second parameters in the cookies tab. Honestly I think this
 
989
         * has been broken for a while. In any case it's probably not
 
990
         * relevant here, although we could get the host of the last active
 
991
         * ephy window, I guess. */
 
992
        pdm_dialog_open (dialog, NULL);
 
993
}
 
994
 
 
995
void
842
996
window_cmd_view_fullscreen (GtkAction *action,
843
997
                            EphyWindow *window)
844
998
{
845
999
        if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)))
846
 
        {
847
 
                GtkWidget *toolbar_editor;
848
 
                toolbar_editor = GTK_WIDGET (g_object_get_data (G_OBJECT (window),
849
 
                                                                "EphyToolbarEditor"));
850
 
                if (toolbar_editor != NULL)
851
 
                {
852
 
                        /* We don't want the toolbar editor to show
853
 
                         * while in fullscreen.
854
 
                         */
855
 
                        gtk_dialog_response (GTK_DIALOG (toolbar_editor),
856
 
                                             GTK_RESPONSE_DELETE_EVENT);
857
 
                }
858
1000
                gtk_window_fullscreen (GTK_WINDOW (window));
859
 
        }
860
1001
        else
861
 
        {
862
1002
                gtk_window_unfullscreen (GTK_WINDOW (window));
863
 
        }
864
1003
}
865
1004
 
866
1005
void
895
1034
                         embed,
896
1035
                         NULL,
897
1036
                         EPHY_NEW_TAB_JUMP | EPHY_NEW_TAB_IN_EXISTING_WINDOW | EPHY_NEW_TAB_APPEND_AFTER);
898
 
 
 
1037
#ifdef HAVE_WEBKIT2
 
1038
        /* TODO: View Source */
 
1039
#else
899
1040
        webkit_web_view_set_view_source_mode
900
1041
                (EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED (new_embed), TRUE);
901
1042
        webkit_web_view_load_uri
902
1043
                (EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED (new_embed), uri);
 
1044
#endif
903
1045
}
904
1046
 
905
1047
 
980
1122
                                     data);
981
1123
}
982
1124
 
 
1125
#ifdef HAVE_WEBKIT2
 
1126
static void
 
1127
get_main_resource_data_cb (WebKitWebResource *resource, GAsyncResult *result, GOutputStream *ostream)
 
1128
{
 
1129
        guchar *data;
 
1130
        gsize data_length;
 
1131
        GString *data_str;
 
1132
        GError *error = NULL;
 
1133
 
 
1134
        data = webkit_web_resource_get_data_finish (resource, result, &data_length, &error);
 
1135
        if (error) {
 
1136
                g_warning ("Unable to get main resource data: %s", error->message);
 
1137
                g_error_free (error);
 
1138
                return;
 
1139
        }
 
1140
 
 
1141
        /* We create a new GString here because we need to make sure
 
1142
         * we keep writing in case of partial writes */
 
1143
        data_str = g_string_new_len ((gchar *)data, data_length);
 
1144
        g_free (data);
 
1145
 
 
1146
        g_output_stream_write_async (ostream,
 
1147
                                     data_str->str, data_str->len,
 
1148
                                     G_PRIORITY_DEFAULT, NULL,
 
1149
                                     (GAsyncReadyCallback)save_temp_source_write_cb,
 
1150
                                     data_str);
 
1151
}
 
1152
#endif
 
1153
 
983
1154
static void
984
1155
save_temp_source_replace_cb (GFile *file, GAsyncResult *result, EphyEmbed *embed)
985
1156
{
986
1157
        EphyWebView *view;
 
1158
#ifdef HAVE_WEBKIT2
 
1159
        WebKitWebResource *resource;
 
1160
#else
987
1161
        WebKitWebFrame *frame;
988
1162
        WebKitWebDataSource *data_source;
989
1163
        GString *const_data;
990
1164
        GString *data;
 
1165
#endif
991
1166
        GFileOutputStream *ostream;
992
1167
        GError *error = NULL;
993
1168
 
1016
1191
                                g_object_ref (embed),
1017
1192
                                g_object_unref);
1018
1193
 
 
1194
#ifdef HAVE_WEBKIT2
 
1195
        resource = webkit_web_view_get_main_resource (WEBKIT_WEB_VIEW (view));
 
1196
        webkit_web_resource_get_data (resource, NULL,
 
1197
                                      (GAsyncReadyCallback)get_main_resource_data_cb,
 
1198
                                      ostream);
 
1199
#else
1019
1200
        frame = webkit_web_view_get_main_frame (WEBKIT_WEB_VIEW (view));
1020
1201
        data_source = webkit_web_frame_get_data_source (frame);
1021
1202
        const_data = webkit_web_data_source_get_data (data_source);
1032
1213
                                     G_PRIORITY_DEFAULT, NULL,
1033
1214
                                     (GAsyncReadyCallback)save_temp_source_write_cb,
1034
1215
                                     data);
 
1216
#endif
1035
1217
}
1036
1218
 
1037
1219
static void
1081
1263
 
1082
1264
        address = ephy_web_view_get_address (ephy_embed_get_web_view (embed));
1083
1265
 
 
1266
#ifdef HAVE_WEBKIT2
 
1267
        /* TODO: View Source */
 
1268
#else
1084
1269
        if (g_settings_get_boolean (EPHY_SETTINGS_MAIN,
1085
1270
                                    EPHY_PREFS_INTERNAL_VIEW_SOURCE))
1086
1271
        {
1087
1272
                view_source_embedded (address, embed);
1088
1273
                return;
1089
1274
        }
 
1275
#endif
1090
1276
 
1091
1277
        user_time = gtk_get_current_event_time ();
1092
1278
 
1125
1311
                   "51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA")
1126
1312
        };
1127
1313
 
1128
 
        char *licence, *comments;
 
1314
        char *licence = NULL, *comments = NULL;
1129
1315
        GKeyFile *key_file;
1130
1316
        GError *error = NULL;
1131
1317
        char **list, **authors, **contributors, **past_authors, **artists, **documenters;
1202
1388
 
1203
1389
        g_key_file_free (key_file);
1204
1390
 
1205
 
        comments = g_strdup_printf (_("Lets you view web pages and find information on the internet.\n"
 
1391
#ifdef HAVE_WEBKIT2
 
1392
        comments = g_strdup_printf (_("A simple, clean, beautiful view of the web.\n"
 
1393
                                      "Powered by WebKit %d.%d.%d"),
 
1394
                                    webkit_get_major_version (),
 
1395
                                    webkit_get_minor_version (),
 
1396
                                    webkit_get_micro_version ());
 
1397
#else
 
1398
        comments = g_strdup_printf (_("A simple, clean, beautiful view of the web.\n"
1206
1399
                                      "Powered by WebKit %d.%d.%d"),
1207
1400
                                    webkit_major_version (),
1208
1401
                                    webkit_minor_version (),
1209
1402
                                    webkit_micro_version ());
 
1403
#endif
1210
1404
 
1211
1405
        licence = g_strjoin ("\n\n",
1212
1406
                             _(licence_part[0]),
1250
1444
window_cmd_tabs_next (GtkAction *action,
1251
1445
                      EphyWindow *window)
1252
1446
{
1253
 
        GtkNotebook *nb;
1254
 
        gboolean handled;
 
1447
        GtkWidget *nb;
1255
1448
 
1256
 
        nb = GTK_NOTEBOOK (ephy_window_get_notebook (window));
 
1449
        nb = ephy_window_get_notebook (window);
1257
1450
        g_return_if_fail (nb != NULL);
1258
1451
 
1259
 
        g_signal_emit_by_name (nb, "change-current-page", 1, &handled);
 
1452
        ephy_notebook_next_page (EPHY_NOTEBOOK (nb));
1260
1453
}
1261
1454
 
1262
1455
void
1263
1456
window_cmd_tabs_previous (GtkAction *action,
1264
1457
                          EphyWindow *window)
1265
1458
{
1266
 
        GtkNotebook *nb;
1267
 
        gboolean handled;
 
1459
        GtkWidget *nb;
1268
1460
 
1269
 
        nb = GTK_NOTEBOOK (ephy_window_get_notebook (window));
 
1461
        nb = ephy_window_get_notebook (window);
1270
1462
        g_return_if_fail (nb != NULL);
1271
1463
 
1272
 
        g_signal_emit_by_name (nb, "change-current-page", -1, &handled);
 
1464
        ephy_notebook_prev_page (EPHY_NOTEBOOK (nb));
1273
1465
}
1274
1466
 
1275
1467
void