~midori/midori/trunk

« back to all changes in this revision

Viewing changes to midori/midori-browser.c

  • Committer: Christian Dywan
  • Date: 2013-06-20 22:02:17 UTC
  • mto: This revision was merged to the branch mainline in revision 6228.
  • Revision ID: christian.dywan@canonical.com-20130620220217-duorzf73s6clb34a
Drop GTK+ < 2.24 version guards from Midori.Browser and location

Show diffs side-by-side

added added

removed removed

Lines of Context:
997
997
    if (!is_folder)
998
998
    {
999
999
        entry_uri = katze_uri_entry_new (
1000
 
        #if GTK_CHECK_VERSION (2, 20, 0)
1001
1000
            gtk_dialog_get_widget_for_response (GTK_DIALOG (dialog), GTK_RESPONSE_ACCEPT));
1002
 
        #else
1003
 
            NULL);
1004
 
        #endif
1005
1001
        gtk_entry_set_activates_default (GTK_ENTRY (entry_uri), TRUE);
1006
1002
        gtk_entry_set_text (GTK_ENTRY (entry_uri), katze_item_get_uri (bookmark));
1007
1003
        gtk_box_pack_start (GTK_BOX (vbox), entry_uri, FALSE, FALSE, 0);
4689
4685
static const gchar* credits_artists[] =
4690
4686
    { "Nancy Runge <nancy@twotoasts.de>", NULL };
4691
4687
 
4692
 
#if !GTK_CHECK_VERSION (2, 24, 0)
4693
4688
static void
4694
 
_action_about_activate_link (GtkAboutDialog* about,
4695
 
                             const gchar*    uri,
4696
 
                             gpointer        user_data)
 
4689
midori_browser_about_activate_link_cb (GtkAboutDialog* about,
 
4690
                                       const gchar*    uri,
 
4691
                                       gpointer        user_data)
4697
4692
{
 
4693
    /* Some email clients need the 'mailto' to function properly */
 
4694
    if (g_str_has_prefix (uri, "mailto:"))
 
4695
    {
 
4696
        gchar* newuri = NULL;
 
4697
        if (!g_str_has_prefix (uri, "mailto:"))
 
4698
            newuri = g_strconcat ("mailto:", uri, NULL);
 
4699
        sokoke_show_uri (NULL, newuri ? newuri : uri, GDK_CURRENT_TIME, NULL);
 
4700
        g_free (newuri);
 
4701
        return;
 
4702
    }
 
4703
 
4698
4704
    MidoriBrowser* browser = MIDORI_BROWSER (user_data);
4699
4705
    GtkWidget* view = midori_browser_add_uri (browser, uri);
4700
4706
    midori_browser_set_current_tab (browser, view);
4701
4707
}
4702
4708
 
4703
 
static void
4704
 
_action_about_activate_email (GtkAboutDialog* about,
4705
 
                              const gchar*    uri,
4706
 
                              gpointer        user_data)
4707
 
{
4708
 
    /* Some email clients need the 'mailto' to function properly */
4709
 
    gchar* newuri = NULL;
4710
 
    if (!g_str_has_prefix (uri, "mailto:"))
4711
 
        newuri = g_strconcat ("mailto:", uri, NULL);
4712
 
 
4713
 
    sokoke_show_uri (NULL, newuri ? newuri : uri, GDK_CURRENT_TIME, NULL);
4714
 
    g_free (newuri);
4715
 
}
4716
 
#endif
4717
 
 
4718
4709
static gchar*
4719
4710
midori_browser_get_docs (gboolean error)
4720
4711
{
4748
4739
    "License as published by the Free Software Foundation; either "
4749
4740
    "version 2.1 of the License, or (at your option) any later version.");
4750
4741
 
4751
 
#if !GTK_CHECK_VERSION (2, 24, 0)
4752
 
    gtk_about_dialog_set_email_hook (_action_about_activate_email, NULL, NULL);
4753
 
    gtk_about_dialog_set_url_hook (_action_about_activate_link, browser, NULL);
4754
 
#endif
4755
4742
#ifdef HAVE_GRANITE
4756
4743
    gchar* docs = midori_browser_get_docs (FALSE);
4757
4744
    /* Avoid granite_widgets_show_about_dialog for invalid memory and crashes */
4785
4772
    g_free (docs);
4786
4773
    #endif
4787
4774
    gtk_widget_show (dialog);
 
4775
    g_signal_connect (dialog, "activate-link",
 
4776
        G_CALLBACK (midori_browser_about_activate_link_cb), dialog);
4788
4777
    g_signal_connect_swapped (dialog, "response",
4789
4778
                              G_CALLBACK (gtk_widget_destroy), dialog);
4790
4779
}
6358
6347
 
6359
6348
    /* Statusbar */
6360
6349
    browser->statusbar = gtk_statusbar_new ();
6361
 
    #if GTK_CHECK_VERSION (2, 20, 0)
6362
6350
    browser->statusbar_contents =
6363
6351
        gtk_statusbar_get_message_area (GTK_STATUSBAR (browser->statusbar));
6364
 
    #else
6365
 
    /* Rearrange the statusbar packing. This is necessariy to keep
6366
 
        themes happy while there is no support from GtkStatusbar. */
6367
 
    forward = GTK_STATUSBAR (browser->statusbar)->label;
6368
 
    if (GTK_IS_BOX (gtk_widget_get_parent (forward)))
6369
 
        browser->statusbar_contents = gtk_widget_get_parent (forward);
6370
 
    else
6371
 
    {
6372
 
        browser->statusbar_contents = gtk_hbox_new (FALSE, 4);
6373
 
        gtk_widget_show (browser->statusbar_contents);
6374
 
        g_object_ref (GTK_STATUSBAR (browser->statusbar)->label);
6375
 
        gtk_container_remove (
6376
 
            GTK_CONTAINER (GTK_STATUSBAR (browser->statusbar)->frame), forward);
6377
 
        gtk_box_pack_start (GTK_BOX (browser->statusbar_contents),
6378
 
            forward, TRUE, TRUE, 0);
6379
 
        g_object_unref (forward);
6380
 
        gtk_container_add (GTK_CONTAINER (GTK_STATUSBAR (browser->statusbar)->frame),
6381
 
                           browser->statusbar_contents);
6382
 
    }
6383
 
    #endif
6384
6352
    gtk_box_pack_start (GTK_BOX (vbox), browser->statusbar, FALSE, FALSE, 0);
6385
6353
 
6386
6354
    g_signal_connect (browser->statusbar, "button-press-event",