]> git.xonotic.org Git - xonotic/netradiant.git/blobdiff - libs/gtkutil/filechooser.cpp
-DGTK_DISABLE_SINGLE_INCLUDES
[xonotic/netradiant.git] / libs / gtkutil / filechooser.cpp
index 55130efdfe65fb141a150a715150a562480ce670..177e752eee7a9fb31d6d0d8ef774d7ae14aebaa6 100644 (file)
 
 #include <list>
 #include <vector>
-#include <gtk/gtkwidget.h>
-#include <gtk/gtkwindow.h>
-#include <gtk/gtkfilechooser.h>
-#include <gtk/gtkfilechooserdialog.h>
-#include <gtk/gtkstock.h>
+#include <gtk/gtk.h>
+#include <uilib/uilib.h>
 
 #include "string/string.h"
 #include "stream/stringstream.h"
@@ -233,7 +230,7 @@ const char* file_dialog_show( GtkWidget* parent, bool open, const char* title, c
        return g_file_dialog_file;
 }
 
-char* dir_dialog( GtkWidget* parent, const char* title, const char* path ){
+char* dir_dialog( ui::Widget parent, const char* title, const char* path ){
        GtkWidget* dialog = gtk_file_chooser_dialog_new( title,
                                                                                                         GTK_WINDOW( parent ),
                                                                                                         GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER,
@@ -258,15 +255,15 @@ char* dir_dialog( GtkWidget* parent, const char* title, const char* path ){
        return filename;
 }
 
-const char* file_dialog( GtkWidget* parent, bool open, const char* title, const char* path, const char* pattern, bool want_load, bool want_import, bool want_save ){
+const char* file_dialog( ui::Widget parent, bool open, const char* title, const char* path, const char* pattern, bool want_load, bool want_import, bool want_save ){
        for (;; )
        {
                const char* file = file_dialog_show( parent, open, title, path, pattern, want_load, want_import, want_save );
 
                if ( open
-                        || file == 0
+                        || file == nullptr
                         || !file_exists( file )
-                        || gtk_MessageBox( parent, "The file specified already exists.\nDo you want to replace it?", title, eMB_NOYES, eMB_ICONQUESTION ) == eIDYES ) {
+                        || parent.alert("The file specified already exists.\nDo you want to replace it?", title, ui::alert_type::NOYES, ui::alert_icon::QUESTION ) == ui::alert_response::YES ) {
                        return file;
                }
        }