Merge branch 'master' of github.com:TTimo/GtkRadiant

This commit is contained in:
Timothee TTimo Besset 2012-04-07 18:53:20 -05:00
commit 0280c898c6
3 changed files with 131 additions and 121 deletions

BIN
install/bitmaps/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View file

@ -2497,6 +2497,9 @@ void DoThickenDlg(){
// ============================================================================= // =============================================================================
// About dialog (no program is complete without one) // About dialog (no program is complete without one)
static const int ABT_WIDGET_PADDING = 8;
//! @note kaz 04/01/2012 - not in use
void about_button_changelog( GtkWidget *widget, gpointer data ){ void about_button_changelog( GtkWidget *widget, gpointer data ){
Str log; Str log;
log = g_strAppPath; log = g_strAppPath;
@ -2504,6 +2507,7 @@ void about_button_changelog( GtkWidget *widget, gpointer data ){
OpenURL( log.GetBuffer() ); OpenURL( log.GetBuffer() );
} }
//! @note kaz 04/01/2012 - not in use
void about_button_credits( GtkWidget *widget, gpointer data ){ void about_button_credits( GtkWidget *widget, gpointer data ){
Str cred; Str cred;
cred = g_strAppPath; cred = g_strAppPath;
@ -2512,11 +2516,14 @@ void about_button_credits( GtkWidget *widget, gpointer data ){
} }
void DoAbout(){ void DoAbout(){
GtkWidget *dlg, *vbox, *vbox2, *hbox, *frame, *table, *label, *pixmap, *button, *sc_extensions, *text_extensions; int loop = TRUE, ret = IDCANCEL;
int loop = 1, ret = IDCANCEL;
dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL ); // create dialog window
GtkWidget *dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL );
gtk_window_set_transient_for( GTK_WINDOW( dlg ), GTK_WINDOW( g_pParentWnd->m_pWidget ) );
gtk_window_set_position( GTK_WINDOW( dlg ), GTK_WIN_POS_CENTER_ON_PARENT );
gtk_window_set_title( GTK_WINDOW( dlg ), _( "About GtkRadiant" ) ); gtk_window_set_title( GTK_WINDOW( dlg ), _( "About GtkRadiant" ) );
gtk_window_set_resizable( GTK_WINDOW( dlg ), FALSE );
gtk_signal_connect( GTK_OBJECT( dlg ), "delete_event", gtk_signal_connect( GTK_OBJECT( dlg ), "delete_event",
GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL );
gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", gtk_signal_connect( GTK_OBJECT( dlg ), "destroy",
@ -2524,143 +2531,146 @@ void DoAbout(){
g_object_set_data( G_OBJECT( dlg ), "loop", &loop ); g_object_set_data( G_OBJECT( dlg ), "loop", &loop );
g_object_set_data( G_OBJECT( dlg ), "ret", &ret ); g_object_set_data( G_OBJECT( dlg ), "ret", &ret );
vbox = gtk_vbox_new( FALSE, 10 ); // layout top logo and everything else vertically without border padding
gtk_widget_show( vbox ); GtkWidget *outer_vbox = gtk_vbox_new( FALSE, 0 );
gtk_container_add( GTK_CONTAINER( dlg ), vbox ); gtk_widget_show( outer_vbox );
gtk_container_set_border_width( GTK_CONTAINER( vbox ), 5 ); gtk_container_add( GTK_CONTAINER( dlg ), outer_vbox );
gtk_container_set_border_width( GTK_CONTAINER( outer_vbox ), 0 );
hbox = gtk_hbox_new( FALSE, 5 ); // radiant logo
gtk_widget_show( hbox ); CString s = g_strBitmapsPath;
gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, TRUE, 0 ); s += "logo.png";
GtkWidget *logo_image = gtk_image_new_from_file( s.GetBuffer() );
gtk_widget_show( logo_image );
gtk_box_pack_start( GTK_BOX( outer_vbox ), logo_image, FALSE, FALSE, 0 );
vbox2 = gtk_vbox_new( FALSE, 5 ); // all other widgets layout
gtk_widget_show( vbox2 ); GtkWidget *inner_vbox = gtk_vbox_new( FALSE, ABT_WIDGET_PADDING );
gtk_box_pack_start( GTK_BOX( hbox ), vbox2, TRUE, FALSE, 0 ); gtk_widget_show( inner_vbox );
gtk_box_pack_start( GTK_BOX( outer_vbox ), inner_vbox, FALSE, FALSE, 0 );
gtk_container_set_border_width( GTK_CONTAINER( inner_vbox ), ABT_WIDGET_PADDING );
frame = gtk_frame_new( NULL ); // informative text
gtk_widget_show( frame ); GtkWidget *info_hbox = gtk_hbox_new( FALSE, 0 );
gtk_box_pack_start( GTK_BOX( vbox2 ), frame, FALSE, FALSE, 0 ); gtk_widget_show( info_hbox );
gtk_frame_set_shadow_type( GTK_FRAME( frame ), GTK_SHADOW_IN ); gtk_box_pack_start( GTK_BOX( inner_vbox ), info_hbox, FALSE, FALSE, 0 );
pixmap = new_pixmap( g_pParentWnd->m_pWidget, "logo.bmp" ); GtkWidget *info_label = gtk_label_new(
gtk_widget_show( pixmap ); "GtkRadiant " RADIANT_VERSION " - " __DATE__ "\n"
gtk_container_add( GTK_CONTAINER( frame ), pixmap );
label = gtk_label_new( "GtkRadiant " RADIANT_VERSION "\n"
__DATE__ "\n\n"
RADIANT_ABOUTMSG "\n\n" RADIANT_ABOUTMSG "\n\n"
"By qeradiant.com\n\n" "This product contains software technology from id Software, Inc.\n"
"This product contains software technology\n" "('id Technology'). id Technology 2000 id Software, Inc.\n\n"
"from id Software, Inc. ('id Technology').\n" "Visit http://icculus.org/gtkradiant/ to view a full list of credits,\n"
"id Technology 2000 id Software,Inc.\n\n" "changelogs, and to report problems with this software." );
"GtkRadiant is unsupported, however\n"
"you may report your problems at\n"
"http://zerowing.idsoftware.com/bugzilla"
);
gtk_widget_show( label ); gtk_widget_show( info_label );
gtk_box_pack_start( GTK_BOX( hbox ), label, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( info_hbox ), info_label, FALSE, FALSE, 0 );
gtk_misc_set_alignment( GTK_MISC( label ), 1, 0.5 ); gtk_label_set_justify( GTK_LABEL( info_label ), GTK_JUSTIFY_LEFT );
gtk_label_set_justify( GTK_LABEL( label ), GTK_JUSTIFY_LEFT );
vbox2 = gtk_vbox_new( FALSE, 5 ); // OpenGL properties
gtk_widget_show( vbox2 ); GtkWidget *gl_prop_frame = gtk_frame_new( _( "OpenGL Properties" ) );
gtk_box_pack_start( GTK_BOX( hbox ), vbox2, FALSE, TRUE, 0 ); gtk_widget_show( gl_prop_frame );
gtk_box_pack_start( GTK_BOX( inner_vbox ), gl_prop_frame, FALSE, FALSE, 0 );
button = gtk_button_new_with_label( _( "OK" ) ); GtkWidget *gl_prop_table = gtk_table_new( 3, 2, FALSE );
gtk_widget_show( button ); gtk_widget_show( gl_prop_table );
gtk_box_pack_start( GTK_BOX( vbox2 ), button, FALSE, FALSE, 0 ); gtk_container_add( GTK_CONTAINER( gl_prop_frame ), gl_prop_table );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", gtk_table_set_row_spacings( GTK_TABLE( gl_prop_table ), 4 );
gtk_table_set_col_spacings( GTK_TABLE( gl_prop_table ), 4 );
gtk_container_set_border_width( GTK_CONTAINER( gl_prop_table ), 4 );
GtkWidget *vendor_label = gtk_label_new( _( "Vendor:" ) );
gtk_widget_show( vendor_label );
gtk_table_attach( GTK_TABLE( gl_prop_table ), vendor_label, 0, 1, 0, 1,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_misc_set_alignment( GTK_MISC( vendor_label ), 0, 0.5 );
GtkWidget *version_label = gtk_label_new( _( "Version:" ) );
gtk_widget_show( version_label );
gtk_table_attach( GTK_TABLE( gl_prop_table ), version_label, 0, 1, 1, 2,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_misc_set_alignment( GTK_MISC( version_label ), 0, 0.5 );
GtkWidget *renderer_label = gtk_label_new( _( "Renderer:" ) );
gtk_widget_show( renderer_label );
gtk_table_attach( GTK_TABLE( gl_prop_table ), renderer_label, 0, 1, 2, 3,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_misc_set_alignment( GTK_MISC( renderer_label ), 0, 0.5 );
GtkWidget *gl_vendor_label = gtk_label_new( (char*)qglGetString( GL_VENDOR ) );
gtk_widget_show( gl_vendor_label );
gtk_table_attach( GTK_TABLE( gl_prop_table ), gl_vendor_label, 1, 2, 0, 1,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_misc_set_alignment( GTK_MISC( gl_vendor_label ), 0, 0.5 );
GtkWidget *gl_version_label = gtk_label_new( (char*)qglGetString( GL_VERSION ) );
gtk_widget_show( gl_version_label );
gtk_table_attach( GTK_TABLE( gl_prop_table ), gl_version_label, 1, 2, 1, 2,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_misc_set_alignment( GTK_MISC( gl_version_label ), 0, 0.5 );
GtkWidget *gl_renderer_label = gtk_label_new( (char*)qglGetString( GL_RENDERER ) );
gtk_widget_show( gl_renderer_label );
gtk_table_attach( GTK_TABLE( gl_prop_table ), gl_renderer_label, 1, 2, 2, 3,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_misc_set_alignment( GTK_MISC( gl_renderer_label ), 0, 0.5 );
// OpenGL extensions
GtkWidget *gl_ext_frame = gtk_frame_new( _( "OpenGL Extensions" ) );
gtk_widget_show( gl_ext_frame );
gtk_box_pack_start( GTK_BOX( inner_vbox ), gl_ext_frame, TRUE, TRUE, 0 );
GtkWidget *gl_ext_hbox = gtk_hbox_new( FALSE, ABT_WIDGET_PADDING );
gtk_widget_show( gl_ext_hbox );
gtk_container_add( GTK_CONTAINER( gl_ext_frame ), gl_ext_hbox );
gtk_container_set_border_width( GTK_CONTAINER( gl_ext_hbox ), 4 );
GtkWidget *gl_ext_scroll = gtk_scrolled_window_new( NULL, NULL );
gtk_box_pack_start( GTK_BOX( gl_ext_hbox ), gl_ext_scroll, TRUE, TRUE, 0 );
gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( gl_ext_scroll ), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS );
gtk_scrolled_window_set_shadow_type( GTK_SCROLLED_WINDOW( gl_ext_scroll ), GTK_SHADOW_IN );
gtk_widget_show( gl_ext_scroll );
GtkWidget *gl_ext_textview = gtk_text_view_new();
gtk_text_view_set_editable( GTK_TEXT_VIEW( gl_ext_textview ), FALSE );
gtk_container_add( GTK_CONTAINER( gl_ext_scroll ), gl_ext_textview );
GtkTextBuffer* buffer = gtk_text_view_get_buffer( GTK_TEXT_VIEW( gl_ext_textview ) );
gtk_text_buffer_set_text( buffer, (char *)qglGetString( GL_EXTENSIONS ), -1 );
gtk_text_view_set_wrap_mode( GTK_TEXT_VIEW( gl_ext_textview ), GTK_WRAP_WORD );;
gtk_widget_show( gl_ext_textview );
// buttons
GtkWidget *button_hbox = gtk_hbox_new( FALSE, 4 );
gtk_widget_show( button_hbox );
gtk_box_pack_start( GTK_BOX( inner_vbox ), button_hbox, FALSE, TRUE, 0 );
GtkWidget *ok_button = gtk_button_new_with_label( _( "OK" ) );
gtk_widget_show( ok_button );
gtk_box_pack_end( GTK_BOX( button_hbox ), ok_button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( ok_button ), "clicked",
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
/*
button = gtk_button_new_with_label( _( "Credits" ) ); button = gtk_button_new_with_label( _( "Credits" ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( vbox2 ), button, FALSE, FALSE, 0 ); gtk_box_pack_end( GTK_BOX( button_hbox ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", gtk_signal_connect( GTK_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( about_button_credits ), NULL ); GTK_SIGNAL_FUNC( about_button_credits ), NULL );
button = gtk_button_new_with_label( _( "Changelog" ) ); button = gtk_button_new_with_label( _( "Changelog" ) );
gtk_widget_show( button ); gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( vbox2 ), button, FALSE, FALSE, 0 ); gtk_box_pack_end( GTK_BOX( button_hbox ), button, FALSE, FALSE, 0 );
gtk_signal_connect( GTK_OBJECT( button ), "clicked", gtk_signal_connect( GTK_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( about_button_changelog ), NULL ); GTK_SIGNAL_FUNC( about_button_changelog ), NULL );
*/
frame = gtk_frame_new( _( "OpenGL Properties" ) ); // show it
gtk_widget_show( frame );
gtk_box_pack_start( GTK_BOX( vbox ), frame, FALSE, FALSE, 0 );
table = gtk_table_new( 3, 2, FALSE );
gtk_widget_show( table );
gtk_container_add( GTK_CONTAINER( frame ), table );
gtk_table_set_row_spacings( GTK_TABLE( table ), 5 );
gtk_table_set_col_spacings( GTK_TABLE( table ), 5 );
gtk_container_set_border_width( GTK_CONTAINER( table ), 5 );
label = gtk_label_new( _( "Vendor:" ) );
gtk_widget_show( label );
gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 0, 1,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
label = gtk_label_new( _( "Version:" ) );
gtk_widget_show( label );
gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 1, 2,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
label = gtk_label_new( _( "Renderer:" ) );
gtk_widget_show( label );
gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 2, 3,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
label = gtk_label_new( (char*)qglGetString( GL_VENDOR ) );
gtk_widget_show( label );
gtk_table_attach( GTK_TABLE( table ), label, 1, 2, 0, 1,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
label = gtk_label_new( (char*)qglGetString( GL_VERSION ) );
gtk_widget_show( label );
gtk_table_attach( GTK_TABLE( table ), label, 1, 2, 1, 2,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
label = gtk_label_new( (char*)qglGetString( GL_RENDERER ) );
gtk_widget_show( label );
gtk_table_attach( GTK_TABLE( table ), label, 1, 2, 2, 3,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
frame = gtk_frame_new( _( "OpenGL Extensions" ) );
gtk_widget_show( frame );
gtk_box_pack_start( GTK_BOX( vbox ), frame, TRUE, TRUE, 0 );
hbox = gtk_hbox_new( FALSE, 5 );
gtk_widget_show( hbox );
gtk_container_add( GTK_CONTAINER( frame ), hbox );
gtk_container_set_border_width( GTK_CONTAINER( hbox ), 5 );
sc_extensions = gtk_scrolled_window_new( NULL, NULL );
gtk_box_pack_start( GTK_BOX( hbox ), sc_extensions, TRUE, TRUE, 0 );
gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( sc_extensions ), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS );
gtk_scrolled_window_set_shadow_type( GTK_SCROLLED_WINDOW( sc_extensions ), GTK_SHADOW_IN );
gtk_widget_show( sc_extensions );
text_extensions = gtk_text_view_new();
gtk_text_view_set_editable( GTK_TEXT_VIEW( text_extensions ), FALSE );
gtk_container_add( GTK_CONTAINER( sc_extensions ), text_extensions );
GtkTextBuffer* buffer = gtk_text_view_get_buffer( GTK_TEXT_VIEW( text_extensions ) );
gtk_text_buffer_set_text( buffer, (char *)qglGetString( GL_EXTENSIONS ), -1 );
gtk_text_view_set_wrap_mode( GTK_TEXT_VIEW( text_extensions ), GTK_WRAP_WORD );;
gtk_widget_show( text_extensions );
gtk_grab_add( dlg ); gtk_grab_add( dlg );
gtk_widget_show( dlg ); gtk_widget_show( dlg );

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 167 KiB