// LoadPortalFileDialog.cpp : implementation file
//
-#include "stdafx.h"
+#include "LoadPortalFileDialog.h"
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-//static char THIS_FILE[] = __FILE__;
-#endif
+#include <gtk/gtk.h>
+#include <gtkutil/pointer.h>
+#include "stream/stringstream.h"
+#include "convert.h"
+#include "gtkutil/pointer.h"
+
+#include "qerplugin.h"
+
+#include "prtview.h"
+#include "portals.h"
static void dialog_button_callback( GtkWidget *widget, gpointer data ){
GtkWidget *parent;
ret = (int*)g_object_get_data( G_OBJECT( parent ), "ret" );
*loop = 0;
- *ret = (int)data;
+ *ret = gpointer_to_int( data );
}
static gint dialog_delete_callback( GtkWidget *widget, GdkEvent* event, gpointer data ){
filename = (char**)g_object_get_data( G_OBJECT( parent ), "filename" );
*loop = 0;
- if ( (int)data == IDOK ) {
+ if ( gpointer_to_int( data ) == IDOK ) {
*filename = g_strdup( gtk_file_selection_get_filename( GTK_FILE_SELECTION( parent ) ) );
}
}
GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
gtk_widget_set_usize( button, 60, -2 );
- char *fn = g_FuncTable.m_pfnGetMapName();
- strcpy( portals.fn, fn );
- fn = strrchr( portals.fn, '.' );
+ strcpy( portals.fn, GlobalRadiant().getMapName() );
+ char* fn = strrchr( portals.fn, '.' );
if ( fn != NULL ) {
- *fn = '\0';
- strcat( portals.fn, ".prt" );
+ strcpy( fn, ".prt" );
}
- gtk_entry_set_text( GTK_ENTRY( entry ), portals.fn );
+ StringOutputStream value( 256 );
+ value << portals.fn;
+ gtk_entry_set_text( GTK_ENTRY( entry ), value.c_str() );
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( check2d ), portals.show_2d );
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( check3d ), portals.show_3d );