]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/gtkdlgs.cpp
radiant/about: make issue tracker url clickable
[xonotic/netradiant.git] / radiant / gtkdlgs.cpp
index d88431bd706030c54913ce5bd3ade05bd65fe57f..f0f3c2749cc4dc87e97edb27079f3f7876af67c5 100644 (file)
@@ -40,7 +40,6 @@
 #include <gtk/gtk.h>
 
 #include "debugging/debugging.h"
-#include "version.h"
 #include "aboutmsg.h"
 
 #include "igl.h"
@@ -353,13 +352,13 @@ void DoProjectSettings(){
 
 void DoSides( int type, int axis ){
        ModalDialog dialog;
-       GtkEntry* sides_entry;
 
        auto window = MainFrame_getWindow().create_dialog_window("Arbitrary sides", G_CALLBACK(dialog_delete_callback ), &dialog );
 
        auto accel = ui::AccelGroup(ui::New);
        window.add_accel_group( accel );
 
+       auto sides_entry = ui::Entry(ui::New);
        {
                auto hbox = create_dialog_hbox( 4, 4 );
                window.add(hbox);
@@ -369,10 +368,9 @@ void DoSides( int type, int axis ){
                        hbox.pack_start( label, FALSE, FALSE, 0 );
                }
                {
-                       auto entry = ui::Entry(ui::New);
+                       auto entry = sides_entry;
                        entry.show();
                        hbox.pack_start( entry, FALSE, FALSE, 0 );
-                       sides_entry = entry;
                        gtk_widget_grab_focus( entry  );
                }
                {
@@ -426,7 +424,7 @@ void DoAbout(){
        ModalDialog dialog;
        ModalDialogButton ok_button( dialog, eIDOK );
 
-       auto window = MainFrame_getWindow().create_modal_dialog_window("About NetRadiant", dialog );
+       auto window = MainFrame_getWindow().create_modal_dialog_window("About " RADIANT_NAME, dialog );
 
        {
                auto vbox = create_dialog_vbox( 4, 4 );
@@ -451,16 +449,19 @@ void DoAbout(){
                        }
 
                        {
-                               char const *label_text = "NetRadiant " RADIANT_VERSION "\n"
+                               char const *label_text = RADIANT_NAME " " RADIANT_VERSION_STRING "\n"
                                                                                __DATE__ "\n\n"
-                                        RADIANT_ABOUTMSG "\n\n"
+                                                                               RADIANT_ABOUTMSG "\n\n"
                                                                                "This program is free software\n"
                                                                                "licensed under the GNU GPL.\n\n"
-                                                                               "NetRadiant is unsupported, however\n"
+                                                                               RADIANT_NAME " is unsupported, however\n"
                                                                                "you may report your problems at\n"
-                                                                               "https://gitlab.com/xonotic/netradiant/issues";
+                                                                               "<a href='https://gitlab.com/xonotic/netradiant/issues'>"
+                                                                                       "gitlab.com/xonotic/netradiant/issues"
+                                                                               "</a>";
 
                                auto label = ui::Label( label_text );
+                               gtk_label_set_use_markup( GTK_LABEL( label ), true );
 
                                label.show();
                                hbox.pack_start( label, FALSE, FALSE, 0 );
@@ -674,7 +675,7 @@ static ui::Window text_editor{ui::null};
 static ui::Widget text_widget{ui::null}; // slave, text widget from the gtk editor
 
 static gint editor_delete( ui::Widget widget, gpointer data ){
-       if ( widget.window().alert( "Close the shader editor ?", "Radiant", ui::alert_type::YESNO, ui::alert_icon::Question ) == ui::alert_response::NO ) {
+       if ( ui::alert( widget.window(), "Close the shader editor ?", "Radiant", ui::alert_type::YESNO, ui::alert_icon::Question ) == ui::alert_response::NO ) {
                return TRUE;
        }
 
@@ -688,7 +689,7 @@ static void editor_save( ui::Widget widget, gpointer data ){
        gpointer text = g_object_get_data( G_OBJECT( data ), "text" );
 
        if ( f == 0 ) {
-               ui::Widget::from(data).window().alert( "Error saving file !" );
+               ui::alert( ui::Widget::from(data).window(), "Error saving file !" );
                return;
        }
 
@@ -698,7 +699,7 @@ static void editor_save( ui::Widget widget, gpointer data ){
 }
 
 static void editor_close( ui::Widget widget, gpointer data ){
-       if ( text_editor.window().alert( "Close the shader editor ?", "Radiant", ui::alert_type::YESNO, ui::alert_icon::Question ) == ui::alert_response::NO ) {
+       if ( ui::alert( text_editor.window(), "Close the shader editor ?", "Radiant", ui::alert_type::YESNO, ui::alert_icon::Question ) == ui::alert_response::NO ) {
                return;
        }
 
@@ -883,7 +884,6 @@ EMessageBoxReturn DoLightIntensityDlg( int *intensity ){
 
 EMessageBoxReturn DoShaderTagDlg( CopiedString* tag, const char* title ){
        ModalDialog dialog;
-       GtkEntry* textentry;
        ModalDialogButton ok_button( dialog, eIDOK );
        ModalDialogButton cancel_button( dialog, eIDCANCEL );
 
@@ -892,6 +892,7 @@ EMessageBoxReturn DoShaderTagDlg( CopiedString* tag, const char* title ){
        auto accel_group = ui::AccelGroup(ui::New);
        window.add_accel_group( accel_group );
 
+       auto textentry = ui::Entry(ui::New);
        {
                auto hbox = create_dialog_hbox( 4, 4 );
                window.add(hbox);
@@ -905,13 +906,11 @@ EMessageBoxReturn DoShaderTagDlg( CopiedString* tag, const char* title ){
                                vbox.pack_start( label, FALSE, FALSE, 0 );
                        }
                        {
-                               auto entry = ui::Entry(ui::New);
+                               auto entry = textentry;
                                entry.show();
                                vbox.pack_start( entry, TRUE, TRUE, 0 );
 
                                gtk_widget_grab_focus( entry  );
-
-                               textentry = entry;
                        }
                }
                {