-void DoAbout(){
- ModalDialog dialog;
- ModalDialogButton ok_button( dialog, eIDOK );
-
- GtkWindow* window = create_modal_dialog_window( MainFrame_getWindow(), "About NetRadiant", dialog );
-
- {
- GtkVBox* vbox = create_dialog_vbox( 4, 4 );
- gtk_container_add( GTK_CONTAINER( window ), GTK_WIDGET( vbox ) );
-
- {
- GtkHBox* hbox = create_dialog_hbox( 4 );
- gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( hbox ), FALSE, TRUE, 0 );
-
- {
- GtkVBox* vbox2 = create_dialog_vbox( 4 );
- gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( vbox2 ), TRUE, FALSE, 0 );
- {
- GtkFrame* frame = create_dialog_frame( 0, GTK_SHADOW_IN );
- gtk_box_pack_start( GTK_BOX( vbox2 ), GTK_WIDGET( frame ), FALSE, FALSE, 0 );
- {
- GtkImage* image = new_local_image( "logo.bmp" );
- gtk_widget_show( GTK_WIDGET( image ) );
- gtk_container_add( GTK_CONTAINER( frame ), GTK_WIDGET( image ) );
- }
- }
- }
-
- {
- GtkLabel* label = GTK_LABEL( gtk_label_new( "NetRadiant " RADIANT_VERSION "\n"
- __DATE__ "\n\n"
- RADIANT_ABOUTMSG "\n\n"
- "By alientrap.org\n\n"
- "This program is free software\n"
- "licensed under the GNU GPL.\n\n"
- "NetRadiant is unsupported, however\n"
- "you may report your problems at\n"
- "http://www.icculus.org/netradiant/"
- ) );
-
- gtk_widget_show( GTK_WIDGET( label ) );
- gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( label ), FALSE, FALSE, 0 );
- gtk_misc_set_alignment( GTK_MISC( label ), 1, 0.5 );
- gtk_label_set_justify( label, GTK_JUSTIFY_LEFT );
- }
-
- {
- GtkVBox* vbox2 = create_dialog_vbox( 4 );
- gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( vbox2 ), FALSE, TRUE, 0 );
- {
- GtkButton* button = create_modal_dialog_button( "OK", ok_button );
- gtk_box_pack_start( GTK_BOX( vbox2 ), GTK_WIDGET( button ), FALSE, FALSE, 0 );
- }
- {
- GtkButton* button = create_dialog_button( "Credits", G_CALLBACK( about_button_credits ), 0 );
- gtk_box_pack_start( GTK_BOX( vbox2 ), GTK_WIDGET( button ), FALSE, FALSE, 0 );
- }
- {
- GtkButton* button = create_dialog_button( "Changelog", G_CALLBACK( about_button_changelog ), 0 );
- gtk_box_pack_start( GTK_BOX( vbox2 ), GTK_WIDGET( button ), FALSE, FALSE, 0 );
- }
- }
- }
- {
- GtkFrame* frame = create_dialog_frame( "OpenGL Properties" );
- gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( frame ), FALSE, FALSE, 0 );
- {
- GtkTable* table = create_dialog_table( 3, 2, 4, 4, 4 );
- gtk_container_add( GTK_CONTAINER( frame ), GTK_WIDGET( table ) );
- {
- GtkLabel* label = GTK_LABEL( gtk_label_new( "Vendor:" ) );
- gtk_widget_show( GTK_WIDGET( label ) );
- gtk_table_attach( table, GTK_WIDGET( label ), 0, 1, 0, 1,
- (GtkAttachOptions) ( GTK_FILL ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
- gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
- }
- {
- GtkLabel* label = GTK_LABEL( gtk_label_new( "Version:" ) );
- gtk_widget_show( GTK_WIDGET( label ) );
- gtk_table_attach( table, GTK_WIDGET( label ), 0, 1, 1, 2,
- (GtkAttachOptions) ( GTK_FILL ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
- gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
- }
- {
- GtkLabel* label = GTK_LABEL( gtk_label_new( "Renderer:" ) );
- gtk_widget_show( GTK_WIDGET( label ) );
- gtk_table_attach( table, GTK_WIDGET( label ), 0, 1, 2, 3,
- (GtkAttachOptions) ( GTK_FILL ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
- gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
- }
- {
- GtkLabel* label = GTK_LABEL( gtk_label_new( reinterpret_cast<const char*>( glGetString( GL_VENDOR ) ) ) );
- gtk_widget_show( GTK_WIDGET( label ) );
- gtk_table_attach( table, GTK_WIDGET( label ), 1, 2, 0, 1,
- (GtkAttachOptions) ( GTK_FILL ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
- gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
- }
- {
- GtkLabel* label = GTK_LABEL( gtk_label_new( reinterpret_cast<const char*>( glGetString( GL_VERSION ) ) ) );
- gtk_widget_show( GTK_WIDGET( label ) );
- gtk_table_attach( table, GTK_WIDGET( label ), 1, 2, 1, 2,
- (GtkAttachOptions) ( GTK_FILL ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
- gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
- }
- {
- GtkLabel* label = GTK_LABEL( gtk_label_new( reinterpret_cast<const char*>( glGetString( GL_RENDERER ) ) ) );
- gtk_widget_show( GTK_WIDGET( label ) );
- gtk_table_attach( table, GTK_WIDGET( label ), 1, 2, 2, 3,
- (GtkAttachOptions) ( GTK_FILL ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
- gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
- }
- }
- {
- GtkFrame* frame = create_dialog_frame( "OpenGL Extensions" );
- gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( frame ), TRUE, TRUE, 0 );
- {
- GtkScrolledWindow* sc_extensions = create_scrolled_window( GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS, 4 );
- gtk_container_add( GTK_CONTAINER( frame ), GTK_WIDGET( sc_extensions ) );
- {
- GtkWidget* 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, reinterpret_cast<const char*>( glGetString( GL_EXTENSIONS ) ), -1 );
- gtk_text_view_set_wrap_mode( GTK_TEXT_VIEW( text_extensions ), GTK_WRAP_WORD );
- gtk_widget_show( text_extensions );
- }
- }
- }
- }
- }
-
- modal_dialog_show( window, dialog );
-
- gtk_widget_destroy( GTK_WIDGET( window ) );
+void about_button_issues(ui::Widget widget, gpointer data)
+{
+ StringOutputStream cred(256);
+ cred << "https://gitlab.com/xonotic/netradiant/issues";
+ OpenURL(cred.c_str());
+}
+
+void DoAbout()
+{
+ ModalDialog dialog;
+ ModalDialogButton ok_button(dialog, eIDOK);
+
+ auto window = MainFrame_getWindow().create_modal_dialog_window("About NetRadiant", dialog);
+
+ {
+ auto vbox = create_dialog_vbox(4, 4);
+ window.add(vbox);
+
+ {
+ auto hbox = create_dialog_hbox(4);
+ vbox.pack_start(hbox, FALSE, TRUE, 0);
+
+ {
+ auto vbox2 = create_dialog_vbox(4);
+ hbox.pack_start(vbox2, TRUE, FALSE, 0);
+ {
+ auto frame = create_dialog_frame(0, ui::Shadow::IN);
+ vbox2.pack_start(frame, FALSE, FALSE, 0);
+ {
+ auto image = new_local_image("logo.png");
+ image.show();
+ frame.add(image);
+ }
+ }
+ }
+
+ {
+ char const *label_text = "NetRadiant " RADIANT_VERSION "\n"
+ __DATE__ "\n\n"
+ RADIANT_ABOUTMSG "\n\n"
+ "This program is free software\n"
+ "licensed under the GNU GPL.\n\n"
+ "NetRadiant is unsupported, however\n"
+ "you may report your problems at\n"
+ "https://gitlab.com/xonotic/netradiant/issues";
+
+ auto label = ui::Label(label_text);
+
+ label.show();
+ hbox.pack_start(label, FALSE, FALSE, 0);
+ gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);
+ gtk_label_set_justify(label, GTK_JUSTIFY_LEFT);
+ }
+
+ {
+ auto vbox2 = create_dialog_vbox(4);
+ hbox.pack_start(vbox2, FALSE, TRUE, 0);
+ {
+ auto button = create_modal_dialog_button("OK", ok_button);
+ vbox2.pack_start(button, FALSE, FALSE, 0);
+ }
+ {
+ auto button = create_dialog_button("Credits", G_CALLBACK(about_button_credits), 0);
+ vbox2.pack_start(button, FALSE, FALSE, 0);
+ }
+ {
+ auto button = create_dialog_button("Changes", G_CALLBACK(about_button_changelog), 0);
+ vbox2.pack_start(button, FALSE, FALSE, 0);
+ }
+ {
+ auto button = create_dialog_button("Issues", G_CALLBACK(about_button_issues), 0);
+ vbox2.pack_start(button, FALSE, FALSE, 0);
+ }
+ }
+ }
+ {
+ auto frame = create_dialog_frame("OpenGL Properties");
+ vbox.pack_start(frame, FALSE, FALSE, 0);
+ {
+ auto table = create_dialog_table(3, 2, 4, 4, 4);
+ frame.add(table);
+ {
+ auto label = ui::Label("Vendor:");
+ label.show();
+ table.attach(label, {0, 1, 0, 1}, {GTK_FILL, 0});
+ gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
+ }
+ {
+ auto label = ui::Label("Version:");
+ label.show();
+ table.attach(label, {0, 1, 1, 2}, {GTK_FILL, 0});
+ gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
+ }
+ {
+ auto label = ui::Label("Renderer:");
+ label.show();
+ table.attach(label, {0, 1, 2, 3}, {GTK_FILL, 0});
+ gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
+ }
+ {
+ auto label = ui::Label(reinterpret_cast<const char *>( glGetString(GL_VENDOR)));
+ label.show();
+ table.attach(label, {1, 2, 0, 1}, {GTK_FILL, 0});
+ gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
+ }
+ {
+ auto label = ui::Label(reinterpret_cast<const char *>( glGetString(GL_VERSION)));
+ label.show();
+ table.attach(label, {1, 2, 1, 2}, {GTK_FILL, 0});
+ gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
+ }
+ {
+ auto label = ui::Label(reinterpret_cast<const char *>( glGetString(GL_RENDERER)));
+ label.show();
+ table.attach(label, {1, 2, 2, 3}, {GTK_FILL, 0});
+ gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
+ }
+ }
+ {
+ auto frame = create_dialog_frame("OpenGL Extensions");
+ vbox.pack_start(frame, TRUE, TRUE, 0);
+ {
+ auto sc_extensions = create_scrolled_window(ui::Policy::AUTOMATIC, ui::Policy::ALWAYS, 4);
+ frame.add(sc_extensions);
+ {
+ auto text_extensions = ui::TextView(ui::New);
+ gtk_text_view_set_editable(text_extensions, FALSE);
+ sc_extensions.add(text_extensions);
+ text_extensions.text(reinterpret_cast<const char *>(glGetString(GL_EXTENSIONS)));
+ gtk_text_view_set_wrap_mode(text_extensions, GTK_WRAP_WORD);
+ text_extensions.show();
+ }
+ }
+ }
+ }
+ }
+
+ modal_dialog_show(window, dialog);
+
+ window.destroy();