class FindTextureDialog : public Dialog
{
public:
+WindowPositionTracker m_position_tracker;
static void setReplaceStr( const char* name );
static void setFindStr( const char* name );
static bool isOpen();
FindTextureDialog::FindTextureDialog(){
m_bSelectedOnly = FALSE;
+ //m_position_tracker.setPosition( c_default_window_pos );
}
FindTextureDialog::~FindTextureDialog(){
GtkWindow* dlg = create_floating_window( "Find / Replace Texture(s)", m_parent );
+ m_position_tracker.connect( dlg );
+
hbox = gtk_hbox_new( FALSE, 5 );
gtk_widget_show( hbox );
gtk_container_add( GTK_CONTAINER( dlg ), GTK_WIDGET( hbox ) );
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
- label = gtk_label_new( "Replace:" );
+ label = gtk_label_new( "Replace:*" );
+ gtk_widget_set_tooltip_text( label, "Empty = search mode" );
gtk_widget_show( label );
gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 1, 2,
(GtkAttachOptions) ( GTK_FILL ),
GlobalTextureEntryCompletion::instance().connect( GTK_ENTRY( entry ) );
entry = gtk_entry_new();
+ gtk_widget_set_tooltip_text( entry, "Empty = search mode" );
gtk_widget_show( entry );
gtk_table_attach( GTK_TABLE( table ), entry, 1, 2, 1, 2,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
}
void FindTextureDialog::show(){
+ // workaround for strange gtk behaviour - modifying the contents of a window while it is not visible causes the window position to change without sending a configure_event
+ g_FindTextureDialog.m_position_tracker.sync( g_FindTextureDialog.GetWidget() );
g_FindTextureDialog.ShowDlg();
+ gtk_window_present( g_FindTextureDialog.GetWidget() );
}
g_FindTextureDialog.updateTextures( name );
}
+#include "preferencesystem.h"
+
void FindTextureDialog_Construct(){
GlobalCommands_insert( "FindReplaceTextures", FindTextureDialog::ShowCaller() );
+ GlobalPreferenceSystem().registerPreference( "FindReplacehWnd", WindowPositionTrackerImportStringCaller( g_FindTextureDialog.m_position_tracker ), WindowPositionTrackerExportStringCaller( g_FindTextureDialog.m_position_tracker ) );
}
void FindTextureDialog_Destroy(){