//
#include "qe3.h"
+#include "globaldefs.h"
+
+#include <gtk/gtk.h>
#include "debugging/debugging.h"
#include <map>
-#include <gtk/gtktearoffmenuitem.h>
+#include <uilib/uilib.h>
#include "stream/textfilestream.h"
#include "cmdlib.h"
QEGlobals_t g_qeglobals;
-#if defined( WIN32 )
+#if GDEF_OS_WINDOWS
#define PATH_MAX 260
#endif
return true;
}
- EMessageBoxReturn result = gtk_MessageBox( GTK_WIDGET( MainFrame_getWindow() ), "The current map has changed since it was last saved.\nDo you want to save the current map before continuing?", title, eMB_YESNOCANCEL, eMB_ICONQUESTION );
- if ( result == eIDCANCEL ) {
+ auto result = MainFrame_getWindow().alert( "The current map has changed since it was last saved.\nDo you want to save the current map before continuing?", title, ui::alert_type::YESNOCANCEL, ui::alert_icon::Question );
+ if ( result == ui::alert_response::CANCEL ) {
return false;
}
- if ( result == eIDYES ) {
+ if ( result == ui::alert_response::YES ) {
if ( Map_Unnamed( g_map ) ) {
return Map_SaveAs();
}
strcat( junkpath, "junk.txt" );
char batpath[PATH_MAX];
-#if defined( POSIX )
+#if GDEF_OS_POSIX
strcpy( batpath, SettingsPath_get() );
strcat( batpath, "qe3bsp.sh" );
-#elif defined( WIN32 )
+#elif GDEF_OS_WINDOWS
strcpy( batpath, SettingsPath_get() );
strcat( batpath, "qe3bsp.bat" );
#else
{
TextFileOutputStream batchFile( batpath );
if ( !batchFile.failed() ) {
-#if defined ( POSIX )
+#if GDEF_OS_POSIX
batchFile << "#!/bin/sh \n\n";
#endif
BatchCommandListener listener( batchFile, junkpath );
}
}
if ( written ) {
-#if defined ( POSIX )
+#if GDEF_OS_POSIX
chmod( batpath, 0744 );
#endif
globalOutputStream() << "Writing the compile script to '" << batpath << "'\n";
title << " *";
}
- gtk_window_set_title( MainFrame_getWindow(), title.c_str() );
+ gtk_window_set_title(MainFrame_getWindow(), title.c_str() );
}
bool g_bWaitCursor = false;
void Sys_BeginWait( void ){
ScreenUpdates_Disable( "Processing...", "Please Wait" );
GdkCursor *cursor = gdk_cursor_new( GDK_WATCH );
- gdk_window_set_cursor( GTK_WIDGET( MainFrame_getWindow() )->window, cursor );
+ gdk_window_set_cursor( gtk_widget_get_window(MainFrame_getWindow()), cursor );
gdk_cursor_unref( cursor );
g_bWaitCursor = true;
}
void Sys_EndWait( void ){
ScreenUpdates_Enable();
- gdk_window_set_cursor( GTK_WIDGET( MainFrame_getWindow() )->window, 0 );
+ gdk_window_set_cursor(gtk_widget_get_window(MainFrame_getWindow()), 0 );
g_bWaitCursor = false;
}