]> git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/gtkdlgs.cpp
Merge branch 'illwieckz/files'
[xonotic/netradiant.git] / radiant / gtkdlgs.cpp
index dddbcc9238c7623790a868bc55eaf1001069e25e..dbc3abd671b7c8d6ec7a9da034569f6655505d1c 100644 (file)
@@ -434,13 +434,19 @@ void DoSides( int type, int axis ){
 
 void about_button_changelog( GtkWidget *widget, gpointer data ){
        StringOutputStream log( 256 );
-       log << AppPath_get() << "changelog.txt";
+       log << "https://gitlab.com/xonotic/netradiant/commits/master";
        OpenURL( log.c_str() );
 }
 
 void about_button_credits( GtkWidget *widget, gpointer data ){
        StringOutputStream cred( 256 );
-       cred << AppPath_get() << "credits.html";
+       cred << "https://gitlab.com/xonotic/netradiant/graphs/master";
+       OpenURL( cred.c_str() );
+}
+
+void about_button_issues( GtkWidget *widget, gpointer data ){
+       StringOutputStream cred( 256 );
+       cred << "https://gitlab.com/xonotic/netradiant/issues";
        OpenURL( cred.c_str() );
 }
 
@@ -465,7 +471,7 @@ void DoAbout(){
                                        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" );
+                                               GtkImage* image = new_local_image( "logo.png" );
                                                gtk_widget_show( GTK_WIDGET( image ) );
                                                gtk_container_add( GTK_CONTAINER( frame ), GTK_WIDGET( image ) );
                                        }
@@ -476,12 +482,11 @@ void DoAbout(){
                                GtkLabel* label = GTK_LABEL( gtk_label_new( "NetRadiant " RADIANT_VERSION "\n"
                                                                                                                        __DATE__ "\n\n"
                                                                                                                        RADIANT_ABOUTMSG "\n\n"
-                                                                                                                                                        "By alientrap.org\n\n"
+                                                                                                                                                        "By xonotic.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/"
+                                                                                                                                                        "you may report your problems on issue tracker.\n"
                                                                                                                        ) );
 
                                gtk_widget_show( GTK_WIDGET( label ) );
@@ -502,7 +507,11 @@ void DoAbout(){
                                        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 );
+                                       GtkButton* button = create_dialog_button( "Changes", G_CALLBACK( about_button_changelog ), 0 );
+                                       gtk_box_pack_start( GTK_BOX( vbox2 ), GTK_WIDGET( button ), FALSE, FALSE, 0 );
+                               }
+                               {
+                                       GtkButton* button = create_dialog_button( "Issues", G_CALLBACK( about_button_issues ), 0 );
                                        gtk_box_pack_start( GTK_BOX( vbox2 ), GTK_WIDGET( button ), FALSE, FALSE, 0 );
                                }
                        }
@@ -590,6 +599,10 @@ void DoAbout(){
 // =============================================================================
 // TextureLayout dialog
 
+// Last used texture scale values
+static float last_used_texture_layout_scale_x = 4.0;
+static float last_used_texture_layout_scale_y = 4.0;
+
 EMessageBoxReturn DoTextureLayout( float *fx, float *fy ){
        ModalDialog dialog;
        ModalDialogButton ok_button( dialog, eIDOK );
@@ -644,8 +657,6 @@ EMessageBoxReturn DoTextureLayout( float *fx, float *fy ){
                                                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
 
-                                       gtk_widget_grab_focus( GTK_WIDGET( entry ) );
-
                                        x = entry;
                                }
                                {
@@ -675,16 +686,27 @@ EMessageBoxReturn DoTextureLayout( float *fx, float *fy ){
                        }
                }
        }
+       
+       // Initialize with last used values
+       char buf[16];
+       
+       sprintf( buf, "%f", last_used_texture_layout_scale_x );
+       gtk_entry_set_text( x, buf );
+       
+       sprintf( buf, "%f", last_used_texture_layout_scale_y );
+       gtk_entry_set_text( y, buf );
 
-       // Initialize
-       gtk_entry_set_text( x, "4.0" );
-       gtk_entry_set_text( y, "4.0" );
-
+       // Set focus after intializing the values
+       gtk_widget_grab_focus( GTK_WIDGET( x ) );
 
        EMessageBoxReturn ret = modal_dialog_show( window, dialog );
        if ( ret == eIDOK ) {
                *fx = static_cast<float>( atof( gtk_entry_get_text( x ) ) );
                *fy = static_cast<float>( atof( gtk_entry_get_text( y ) ) );
+       
+               // Remember last used values
+               last_used_texture_layout_scale_x = *fx;
+               last_used_texture_layout_scale_y = *fy;
        }
 
        gtk_widget_destroy( GTK_WIDGET( window ) );