Merge in xonotic/netradiant.git: ingar/texture_layout_defaults
git-manager created issue #1711 on 2013-06-29T14:27:33Z:
Purpose of the branch:
Fix a bug in the patch texture scale dialog, have it remember last used values.
Repository: xonotic/netradiant.git Commit: a2681ec7 Branch: ingar/texture_layout_defaults
Merge commands:
cd netradiant
git checkout master
git reset --hard origin/master
git pull && git diff 'a2681ec7caa19ee4895a4c19b08e35fdb0e263a5'..'origin/ingar/texture_layout_defaults'
# please check that the diff you just saw did not contain anything complex that
# needs a new merge request, and review these changes
git merge --no-ff 'origin/ingar/texture_layout_defaults'
# please make sure this merge worked, and if not, fix merge conflicts and git
# commit BEFORE the next command
#
# also, THIS is the point to do final pre-merge testing
#
# use git reset --hard origin/master to bail out
git push && git push --delete origin 'ingar/texture_layout_defaults'
Diffstat:
radiant/gtkdlgs.cpp | 23 ++++++++++++++++++-----
1 files changed, 18 insertions(+), 5 deletions(-)
Revision log:
commit a2681ec7caa19ee4895a4c19b08e35fdb0e263a5
Author: Stijn Buys
Commit: Stijn Buys
Cleaned up comments.
commit c4901d253275045b7585bc0b36a15fccca173688
Author: Stijn Buys
Commit: Stijn Buys
Makes the texture layout dialog remember last used values, corrects x entry not having its value selected when showing the dialog.
User agreed to the GPLv2*.
Diff:
<pre>diff —git a/radiant/gtkdlgs.cpp b/radiant/gtkdlgs.cpp
index dddbcc9..34fc54c 100644
— a/radiant/gtkdlgs.cpp
**+ b/radiant/gtkdlgs.cpp
@ -590,6 +590,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, floatfy ){
ModalDialog dialog;
ModalDialogButton ok\_button( dialog, eIDOK );
@ -644,8 +648,6
@ EMessageBoxReturn DoTextureLayout( float fx, floatfy ){
(GtkAttachOptions) ( GTK\_EXPAND | GTK\_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
- gtk_widget_grab_focus( GTK_WIDGET( entry ) );
x = entry;
}
{
@ -676,15 +678,26
@ EMessageBoxReturn DoTextureLayout( float fx, floatfy ){
}
}
- // Initialize
- gtk_entry_set_text( x, “4.0” );
- gtk_entry_set_text( y, “4.0” );
-
// 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 );
-
// 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 ) ); **fy = static_cast( 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 ) );