Changeset 12963


Ignore:
Timestamp:
Oct 11, 2011, 4:11:08 AM (10 years ago)
Author:
jordan
Message:

(trunk gtk) add portability wrappers for gtk_hbox_new() and gtk_vbox_new(), which are deprecated now in GTK+ 3.2

Location:
trunk/gtk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/details.c

    r12679 r12963  
    515515    hig_workarea_add_section_title( t, &row, _( "Seeding Limits" ) );
    516516
    517     h = gtk_hbox_new( FALSE, GUI_PAD );
     517    h = gtr_hbox_new( FALSE, GUI_PAD );
    518518    w = d->ratio_combo = ratio_combo_new( );
    519519    d->ratio_combo_tag = g_signal_connect( w, "changed", G_CALLBACK( onComboEnumChanged ), d );
     
    525525    hig_workarea_add_row( t, &row, _( "_Ratio:" ), h, NULL );
    526526
    527     h = gtk_hbox_new( FALSE, GUI_PAD );
     527    h = gtr_hbox_new( FALSE, GUI_PAD );
    528528    w = d->idle_combo = idle_combo_new( );
    529529    d->idle_combo_tag = g_signal_connect( w, "changed", G_CALLBACK( onComboEnumChanged ), d );
     
    17321732    gtk_container_add( GTK_CONTAINER( w ), v );
    17331733
    1734     vbox = gtk_vbox_new( FALSE, GUI_PAD );
     1734    vbox = gtr_vbox_new( FALSE, GUI_PAD );
    17351735    gtk_container_set_border_width( GTK_CONTAINER( vbox ), GUI_PAD_BIG );
    17361736
     1737#if GTK_CHECK_VERSION(3,2,0)
     1738    v = gtk_paned_new( GTK_ORIENTATION_VERTICAL );
     1739#else
    17371740    v = gtk_vpaned_new( );
     1741#endif
    17381742    gtk_paned_pack1( GTK_PANED( v ), webtree, FALSE, TRUE );
    17391743    gtk_paned_pack2( GTK_PANED( v ), sw, TRUE, TRUE );
     
    23732377    const int pad = ( GUI_PAD + GUI_PAD_BIG ) / 2;
    23742378
    2375     vbox = gtk_vbox_new( FALSE, GUI_PAD );
     2379    vbox = gtr_vbox_new( FALSE, GUI_PAD );
    23762380    gtk_container_set_border_width( GTK_CONTAINER( vbox ), GUI_PAD_BIG );
    23772381
     
    23912395                                            trackerVisibleFunc, di, NULL );
    23922396
    2393     hbox = gtk_hbox_new( FALSE, GUI_PAD_BIG );
     2397    hbox = gtr_hbox_new( FALSE, GUI_PAD_BIG );
    23942398
    23952399        v = di->tracker_view = gtk_tree_view_new_with_model( GTK_TREE_MODEL( di->trackers_filtered ) );
     
    24262430    gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
    24272431
    2428         v = gtk_vbox_new( FALSE, GUI_PAD );
     2432        v = gtr_vbox_new( FALSE, GUI_PAD );
    24292433
    24302434        w = gtk_button_new_with_mnemonic( _( "_Add" ) );
     
    25512555    gtk_notebook_append_page( GTK_NOTEBOOK( n ), w, l );
    25522556
    2553     v = gtk_vbox_new( FALSE, 0 );
     2557    v = gtr_vbox_new( FALSE, 0 );
    25542558    di->file_list = gtr_file_list_new( core, 0 );
    25552559    di->file_label = gtk_label_new( _( "File listing not available for combined torrent properties" ) );
  • trunk/gtk/filter.c

    r12872 r12963  
    985985
    986986
    987     h = gtk_hbox_new( FALSE, GUI_PAD_SMALL );
     987    h = gtr_hbox_new( FALSE, GUI_PAD_SMALL );
    988988
    989989    /* add the activity combobox */
  • trunk/gtk/hig.c

    r12679 r12963  
    1313#include <gtk/gtk.h>
    1414#include "hig.h"
     15#include "util.h" /* gtr_hbox_new */
    1516
    1617GtkWidget*
     
    5960{
    6061    GtkWidget * a;
    61     GtkWidget * h = gtk_hbox_new( FALSE, 0 );
     62    GtkWidget * h = gtr_hbox_new( FALSE, 0 );
    6263
    6364    /* spacer */
     
    188189{
    189190    GtkWidget * l = gtk_label_new_with_mnemonic( mnemonic_string );
    190     GtkWidget * h = gtk_hbox_new( FALSE, 0 );
    191     GtkWidget * v = gtk_vbox_new( FALSE, 0 );
     191    GtkWidget * h = gtr_hbox_new( FALSE, 0 );
     192    GtkWidget * v = gtr_vbox_new( FALSE, 0 );
    192193    gtk_box_pack_start( GTK_BOX( h ), l, FALSE, FALSE, 0 );
    193194    gtk_box_pack_start( GTK_BOX( v ), h, FALSE, FALSE, GUI_PAD_SMALL );
  • trunk/gtk/makemeta-ui.c

    r12679 r12963  
    178178    gtk_container_set_border_width( GTK_CONTAINER( fr ), GUI_PAD_BIG );
    179179    gtk_frame_set_shadow_type( GTK_FRAME( fr ), GTK_SHADOW_NONE );
    180     v = gtk_vbox_new( TRUE, GUI_PAD );
     180    v = gtr_vbox_new( TRUE, GUI_PAD );
    181181    gtk_container_add( GTK_CONTAINER( fr ), v );
    182182
     
    474474
    475475        str = _( "_Trackers:" );
    476         v = gtk_vbox_new( FALSE, GUI_PAD_SMALL );
     476        v = gtr_vbox_new( FALSE, GUI_PAD_SMALL );
    477477        ui->announce_text_buffer = gtk_text_buffer_new( NULL );
    478478        w = gtk_text_view_new_with_buffer( ui->announce_text_buffer );
  • trunk/gtk/msgwin.c

    r12654 r12963  
    446446    gtk_window_set_default_size( GTK_WINDOW( win ), 560, 350 );
    447447    gtk_window_set_role( GTK_WINDOW( win ), "message-log" );
    448     vbox = gtk_vbox_new( FALSE, 0 );
     448    vbox = gtr_vbox_new( FALSE, 0 );
    449449
    450450    /**
  • trunk/gtk/tr-prefs.c

    r12681 r12963  
    550550    updateBlocklistText( w, TR_CORE( core ) );
    551551    data->label = w;
    552     h = gtk_hbox_new( FALSE, GUI_PAD_BIG );
     552    h = gtr_hbox_new( FALSE, GUI_PAD_BIG );
    553553    gtk_box_pack_start( GTK_BOX( h ), w, TRUE, TRUE, 0 );
    554554    b = data->updateBlocklistButton = gtk_button_new_with_mnemonic( _( "_Update" ) );
     
    812812    page->rpc_tb = GTK_TOGGLE_BUTTON( w );
    813813    g_signal_connect( w, "clicked", G_CALLBACK( onRPCToggled ), page );
    814     h = gtk_hbox_new( FALSE, GUI_PAD_BIG );
     814    h = gtr_hbox_new( FALSE, GUI_PAD_BIG );
    815815    gtk_box_pack_start( GTK_BOX( h ), w, TRUE, TRUE, 0 );
    816816    w = gtk_button_new_with_mnemonic( _( "_Open web client" ) );
     
    903903        page->whitelist_widgets = g_slist_prepend( page->whitelist_widgets, w );
    904904
    905         h = gtk_hbox_new( TRUE, GUI_PAD );
     905        h = gtr_hbox_new( TRUE, GUI_PAD );
    906906        w = gtk_button_new_from_stock( GTK_STOCK_REMOVE );
    907907        g_signal_connect( w, "clicked", G_CALLBACK(
     
    914914        g_signal_connect( w, "clicked", G_CALLBACK( onAddWhitelistClicked ), page );
    915915        gtk_box_pack_start( GTK_BOX( h ), w, TRUE, TRUE, 0 );
    916         w = gtk_hbox_new( FALSE, 0 );
     916        w = gtr_hbox_new( FALSE, 0 );
    917917        gtk_box_pack_start( GTK_BOX( w ), gtk_alignment_new( 0, 0, 0, 0 ),
    918918                            TRUE, TRUE, 0 );
     
    10721072
    10731073    hig_workarea_add_section_divider( t, &row );
    1074     h = gtk_hbox_new( FALSE, GUI_PAD );
     1074    h = gtr_hbox_new( FALSE, GUI_PAD );
    10751075    w = gtk_image_new_from_stock( "alt-speed-on", -1 );
    10761076    gtk_box_pack_start( GTK_BOX( h ), w, FALSE, FALSE, 0 );
     
    10981098
    10991099        s = _( "_Scheduled times:" );
    1100         h = gtk_hbox_new( FALSE, 0 );
     1100        h = gtr_hbox_new( FALSE, 0 );
    11011101        w2 = new_time_combo( core, TR_PREFS_KEY_ALT_SPEED_TIME_BEGIN );
    11021102        page->sched_widgets = g_slist_prepend( page->sched_widgets, w2 );
     
    12121212    hig_workarea_add_row( t, &row, s, w, NULL );
    12131213
    1214     h = gtk_hbox_new( FALSE, GUI_PAD_BIG );
     1214    h = gtr_hbox_new( FALSE, GUI_PAD_BIG );
    12151215    l = data->portLabel = gtk_label_new( _( "Status unknown" ) );
    12161216    gtk_misc_set_alignment( GTK_MISC( l ), 0.0f, 0.5f );
  • trunk/gtk/tr-window.c

    r12856 r12963  
    613613
    614614    /* window's main container */
    615     vbox = gtk_vbox_new ( FALSE, 0 );
     615    vbox = gtr_vbox_new ( FALSE, 0 );
    616616    gtk_container_add ( GTK_CONTAINER( self ), vbox );
    617617
     
    653653
    654654    /* status */
    655     h = status = p->status = gtk_hbox_new( FALSE, GUI_PAD_BIG );
     655    h = status = p->status = gtr_hbox_new( FALSE, GUI_PAD_BIG );
    656656    gtk_container_set_border_width( GTK_CONTAINER( h ), GUI_PAD_SMALL );
    657657
     
    675675        gtk_box_pack_start( GTK_BOX( h ), w, 1, 1, GUI_PAD );
    676676
    677         hbox = gtk_hbox_new( FALSE, GUI_PAD );
     677        hbox = gtr_hbox_new( FALSE, GUI_PAD );
    678678            w = gtk_alignment_new( 0.0f, 0.0f, 0.0f, 0.0f );
    679679            gtk_widget_set_size_request( w, GUI_PAD, 0u );
     
    686686        gtk_box_pack_end( GTK_BOX( h ), hbox, FALSE, FALSE, 0 );
    687687
    688         hbox = gtk_hbox_new( FALSE, GUI_PAD );
     688        hbox = gtr_hbox_new( FALSE, GUI_PAD );
    689689            w = gtk_alignment_new( 0.0f, 0.0f, 0.0f, 0.0f );
    690690            gtk_widget_set_size_request( w, GUI_PAD, 0u );
     
    697697        gtk_box_pack_end( GTK_BOX( h ), hbox, FALSE, FALSE, 0 );
    698698
    699         hbox = gtk_hbox_new( FALSE, GUI_PAD );
     699        hbox = gtr_hbox_new( FALSE, GUI_PAD );
    700700            w = gtk_button_new( );
    701701            gtk_widget_set_tooltip_text( w, _( "Statistics" ) );
  • trunk/gtk/util.c

    r12682 r12963  
    474474***/
    475475
     476GtkWidget*
     477gtr_hbox_new( gboolean homogenous UNUSED, gint spacing )
     478{
     479#if GTK_CHECK_VERSION( 3,2,0 )
     480    return gtk_box_new( GTK_ORIENTATION_HORIZONTAL, spacing );
     481#else
     482    return gtk_hbox_new( homogenous, spacing );
     483#endif
     484}
     485
     486GtkWidget*
     487gtr_vbox_new( gboolean homogenous UNUSED, gint spacing )
     488{
     489#if GTK_CHECK_VERSION( 3,2,0 )
     490    return gtk_box_new( GTK_ORIENTATION_VERTICAL, spacing );
     491#else
     492    return gtk_vbox_new( homogenous, spacing );
     493#endif
     494}
     495
    476496void
    477497gtr_widget_set_visible( GtkWidget * w, gboolean b )
  • trunk/gtk/util.h

    r12656 r12963  
    8989***/
    9090
     91/* backwards-compatible wrapper around gtk_hbox_new() */
     92GtkWidget* gtr_hbox_new( gboolean homogenous, gint spacing );
     93
     94/* backwards-compatible wrapper around gtk_vbox_new() */
     95GtkWidget* gtr_vbox_new( gboolean homogenous, gint spacing );
     96
    9197/* backwards-compatible wrapper around gtk_widget_set_visible() */
    9298void gtr_widget_set_visible( GtkWidget *, gboolean );
Note: See TracChangeset for help on using the changeset viewer.