(trunk gtk) don't use the GSEAL'ed variable vbox GtkDialog directly... use gtk_dialog_get_content_area() instead

This commit is contained in:
Charles Kerr 2010-12-22 03:12:47 +00:00
parent 1b7a8cdc68
commit 6627aade08
10 changed files with 37 additions and 28 deletions

View File

@ -381,8 +381,7 @@ gtr_torrent_options_dialog_new( GtkWindow * parent, TrCore * core, tr_ctor * cto
else
sourceChanged( GTK_FILE_CHOOSER_BUTTON( w ), data );
gtk_box_pack_start( GTK_BOX( GTK_DIALOG( d )->vbox ), t, TRUE, TRUE, 0 );
gtr_dialog_set_content( GTK_DIALOG( d ), t );
gtk_widget_grab_focus( grab );
return d;
}
@ -542,7 +541,6 @@ gtr_torrent_add_from_url_dialog_new( GtkWindow * parent, TrCore * core )
g_object_set_data( G_OBJECT( w ), "url-entry", e );
hig_workarea_add_row( t, &row, _( "_URL" ), e, NULL );
gtk_box_pack_start( GTK_BOX( GTK_DIALOG( w )->vbox ), t, TRUE, TRUE, 0 );
gtk_widget_show_all( t );
gtr_dialog_set_content( GTK_DIALOG( w ), t );
return w;
}

View File

@ -2204,8 +2204,8 @@ onEditTrackers( GtkButton * button, gpointer data )
hig_workarea_add_wide_tall_control( t, &row, fr );
hig_workarea_finish( t, &row );
gtk_box_pack_start( GTK_BOX( GTK_DIALOG( d )->vbox ), t, TRUE, TRUE, GUI_PAD_SMALL );
gtk_widget_show_all( d );
gtr_dialog_set_content( GTK_DIALOG( d ), t );
gtk_widget_show( d );
}
static GtkWidget*
@ -2367,11 +2367,9 @@ gtr_torrent_details_dialog_new( GtkWindow * parent, TrCore * core )
l = gtk_label_new( _( "Options" ) );
gtk_notebook_append_page( GTK_NOTEBOOK( n ), w, l );
gtk_box_pack_start( GTK_BOX( GTK_DIALOG( d )->vbox ), n, TRUE, TRUE, 0 );
gtr_dialog_set_content( GTK_DIALOG( d ), n );
di->periodic_refresh_tag = gtr_timeout_add_seconds( SECONDARY_WINDOW_REFRESH_INTERVAL_SECONDS,
periodic_refresh, di );
gtk_widget_show_all( GTK_DIALOG( d )->vbox );
return d;
}

View File

@ -101,16 +101,13 @@ gtr_confirm_quit( GtkWindow * parent,
dontask = gtk_check_button_new_with_mnemonic( _( "_Don't ask me again" ) );
stuff->dontask = dontask;
gtk_box_pack_start( GTK_BOX( GTK_DIALOG(
wind )->vbox ), dontask, FALSE, FALSE,
GUI_PAD );
gtr_dialog_set_content( GTK_DIALOG( wind ), dontask );
g_signal_connect( G_OBJECT( wind ), "response",
G_CALLBACK( quitresp ), stuff );
gtk_widget_grab_focus( w );
gtk_widget_show_all( wind );
gtk_widget_show( wind );
return wind;
}

View File

@ -1189,9 +1189,9 @@ flushAddTorrentErrors( GtkWindow * window,
const char * primary,
GSList ** files )
{
GString * s = g_string_new( NULL );
GSList * l;
GSList * l;
GtkWidget * w;
GString * s = g_string_new( NULL );
if( g_slist_length( *files ) > 1 ) {
for( l=*files; l!=NULL; l=l->next )
@ -1209,7 +1209,7 @@ flushAddTorrentErrors( GtkWindow * window,
"%s", s->str );
g_signal_connect_swapped( w, "response",
G_CALLBACK( gtk_widget_destroy ), w );
gtk_widget_show_all( w );
gtk_widget_show( w );
g_string_free( s, TRUE );
g_slist_foreach( *files, (GFunc)g_free, NULL );
@ -1534,7 +1534,7 @@ about( GtkWindow * parent )
NULL );
gtk_window_set_transient_for( GTK_WINDOW( d ), parent );
g_signal_connect_swapped( d, "response", G_CALLBACK (gtk_widget_destroy), d );
gtk_widget_show_all( d );
gtk_widget_show( d );
}
static void

View File

@ -197,8 +197,8 @@ makeProgressDialog( GtkWidget * parent, MakeMetaUI * ui )
g_object_weak_ref( G_OBJECT( d ), onProgressDialogDestroyed, ui );
onProgressDialogRefresh( ui );
gtk_box_pack_start( GTK_BOX( GTK_DIALOG( d )->vbox ), fr, TRUE, TRUE, 0 );
gtk_widget_show_all( d );
gtr_dialog_set_content( GTK_DIALOG( d ), fr );
gtk_widget_show( d );
}
static void
@ -517,12 +517,11 @@ gtr_torrent_creation_dialog_new( GtkWindow * parent, TrCore * core )
ui->private_check = w;
hig_workarea_finish( t, &row );
gtk_box_pack_start( GTK_BOX( GTK_DIALOG( d )->vbox ), t, TRUE, TRUE, 0 );
gtr_dialog_set_content( GTK_DIALOG( d ), t );
gtk_drag_dest_set( d, GTK_DEST_DEFAULT_ALL, NULL, 0, GDK_ACTION_COPY );
gtk_drag_dest_add_uri_targets( d );
g_signal_connect( d, "drag-data-received", G_CALLBACK( on_drag_data_received ), ui );
gtk_widget_show_all( t );
return d;
}

View File

@ -186,8 +186,7 @@ gtr_relocate_dialog_new( GtkWindow * parent,
w = gtk_radio_button_new_with_mnemonic_from_widget( GTK_RADIO_BUTTON( w ), _( "Local data is _already there" ) );
hig_workarea_add_wide_control( t, &row, w );
hig_workarea_finish( t, &row );
gtk_widget_show_all( t );
gtk_box_pack_start( GTK_BOX( GTK_DIALOG( d )->vbox ), t, TRUE, TRUE, 0 );
gtr_dialog_set_content( GTK_DIALOG( d ), t );
data = g_new0( struct relocate_dialog_data, 1 );
data->core = core;

View File

@ -157,7 +157,6 @@ gtr_stats_dialog_new( GtkWindow * parent, TrCore * core )
TR_RESPONSE_RESET,
-1 );
t = hig_workarea_create( );
gtk_box_pack_start( GTK_BOX( GTK_DIALOG( d )->vbox ), t, TRUE, TRUE, 0 );
ui->core = core;
hig_workarea_add_section_title( t, &row, _( "Current Session" ) );
@ -182,7 +181,7 @@ gtr_stats_dialog_new( GtkWindow * parent, TrCore * core )
l = ui->all_time_lb = gtk_label_new( NULL );
hig_workarea_add_row( t, &row, _( "Duration:" ), l, NULL );
hig_workarea_finish( t, &row );
gtk_widget_show_all( t );
gtr_dialog_set_content( GTK_DIALOG( d ), t );
updateStats( ui );
g_object_set_data_full( G_OBJECT( d ), "data", ui, g_free );

View File

@ -1270,8 +1270,7 @@ gtr_prefs_dialog_new( GtkWindow * parent, GObject * core )
gtk_label_new ( _( "Web" ) ) );
g_signal_connect( d, "response", G_CALLBACK( response_cb ), core );
gtk_box_pack_start( GTK_BOX( GTK_DIALOG( d )->vbox ), n, TRUE, TRUE, 0 );
gtk_widget_show_all( GTK_DIALOG( d )->vbox );
gtr_dialog_set_content( GTK_DIALOG( d ), n );
return d;
}

View File

@ -752,6 +752,24 @@ gtr_widget_set_visible( GtkWidget * w, gboolean b )
#endif
}
static GtkWidget*
gtr_dialog_get_content_area( GtkDialog * dialog )
{
#if GTK_CHECK_VERSION( 2,14,0 )
return gtk_dialog_get_content_area( dialog );
#else
return dialog->vbox;
#endif
}
void
gtr_dialog_set_content( GtkDialog * dialog, GtkWidget * content )
{
GtkWidget * vbox = gtr_dialog_get_content_area( dialog );
gtk_box_pack_start( GTK_BOX( vbox ), content, TRUE, TRUE, 0 );
gtk_widget_show_all( content );
}
/***
****
***/

View File

@ -150,6 +150,8 @@ int gtr_strcmp0( const char * str1, const char * str2 );
/* backwards-compatible wrapper around g_dngettext() */
const gchar* gtr_ngettext( const gchar*, const gchar*, gulong );
void gtr_dialog_set_content( GtkDialog * dialog, GtkWidget * content );
/***
****
***/