allow different file type selections for open/import/save
This commit is contained in:
@@ -31,12 +31,15 @@ public:
|
||||
: name(""), pattern("")
|
||||
{
|
||||
}
|
||||
filetype_t(const char* _name, const char* _pattern)
|
||||
: name(_name), pattern(_pattern)
|
||||
filetype_t(const char* _name, const char* _pattern, bool _can_load = true, bool _can_import = true, bool _can_save = true)
|
||||
: name(_name), pattern(_pattern), can_load(_can_load), can_import(_can_import), can_save(_can_save)
|
||||
{
|
||||
}
|
||||
const char* name;
|
||||
const char* pattern;
|
||||
bool can_load;
|
||||
bool can_import;
|
||||
bool can_save;
|
||||
};
|
||||
|
||||
|
||||
@@ -53,7 +56,7 @@ public:
|
||||
STRING_CONSTANT(Name, "filetypes");
|
||||
|
||||
virtual void addType(const char* moduleType, const char* moduleName, filetype_t type) = 0;
|
||||
virtual void getTypeList(const char* moduleType, IFileTypeList* typelist) = 0;
|
||||
virtual void getTypeList(const char* moduleType, IFileTypeList* typelist, bool want_load = false, bool want_import = false, bool want_save = false) = 0;
|
||||
};
|
||||
|
||||
#include "modulesystem.h"
|
||||
|
||||
@@ -71,7 +71,7 @@ typedef EMessageBoxReturn (* PFN_QERAPP_MESSAGEBOX) (GtkWidget *parent, const ch
|
||||
// - 'title' is the dialog title (can be null)
|
||||
// - 'path' is used to set the initial directory (can be null)
|
||||
// - 'pattern': the first pattern is for the win32 mode, then comes the Gtk pattern list, see Radiant source for samples
|
||||
typedef const char* (* PFN_QERAPP_FILEDIALOG) (GtkWidget *parent, bool open, const char* title, const char* path/* = 0*/, const char* pattern/* = 0*/);
|
||||
typedef const char* (* PFN_QERAPP_FILEDIALOG) (GtkWidget *parent, bool open, const char* title, const char* path/* = 0*/, const char* pattern/* = 0*/, bool want_load/* = false*/, bool want_import/* = false*/, bool want_save/* = false*/);
|
||||
|
||||
// returns a gchar* string that must be g_free'd by the user
|
||||
typedef char* (* PFN_QERAPP_DIRDIALOG) (GtkWidget *parent, const char* title/* = "Choose Directory"*/, const char* path/* = 0*/);
|
||||
|
||||
Reference in New Issue
Block a user