//-----------------------------------------------------------------------------
extern "C" {
-static void gtk_filedialog_ok_callback(GtkWidget *widget, wxDirDialogGTK *dialog)
+static void gtk_dirdialog_ok_callback(GtkWidget *widget, wxDirDialogGTK *dialog)
{
gchar* filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(widget));
//-----------------------------------------------------------------------------
extern "C" {
-static void gtk_filedialog_cancel_callback(GtkWidget *WXUNUSED(w),
+static void gtk_dirdialog_cancel_callback(GtkWidget *WXUNUSED(w),
wxDirDialogGTK *dialog)
{
wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL);
}
extern "C" {
-static void gtk_filedialog_response_callback(GtkWidget *w,
+static void gtk_dirdialog_response_callback(GtkWidget *w,
gint response,
wxDirDialogGTK *dialog)
{
wxapp_install_idle_handler();
if (response == GTK_RESPONSE_ACCEPT)
- gtk_filedialog_ok_callback(w, dialog);
+ gtk_dirdialog_ok_callback(w, dialog);
else if (response == GTK_RESPONSE_CANCEL)
- gtk_filedialog_cancel_callback(w, dialog);
+ gtk_dirdialog_cancel_callback(w, dialog);
else // "delete"
{
- gtk_filedialog_cancel_callback(w, dialog);
+ gtk_dirdialog_cancel_callback(w, dialog);
dialog->m_destroyed_by_delete = true;
}
}
if (!PreCreation(parent, pos, wxDefaultSize) ||
!CreateBase(parent, wxID_ANY, pos, wxDefaultSize, style,
- wxDefaultValidator, wxT("filedialog")))
+ wxDefaultValidator, wxT("dirdialog")))
{
wxFAIL_MSG( wxT("wxDirDialogGTK creation failed") );
return;
GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
NULL);
+ gtk_dialog_set_default_response(GTK_DIALOG(m_widget), GTK_RESPONSE_ACCEPT);
+
// local-only property could be set to false to allow non-local files to be loaded.
// In that case get/set_uri(s) should be used instead of get/set_filename(s) everywhere
// and the GtkFileChooserDialog should probably also be created with a backend,
// Currently local-only is kept as the default - true:
// gtk_file_chooser_set_local_only(GTK_FILE_CHOOSER(m_widget), true);
- g_signal_connect(G_OBJECT(m_widget), "response",
- GTK_SIGNAL_FUNC(gtk_filedialog_response_callback), (gpointer)this);
+ g_signal_connect (m_widget, "response",
+ G_CALLBACK (gtk_dirdialog_response_callback), this);
if ( !defaultPath.empty() )
gtk_file_chooser_set_current_folder( GTK_FILE_CHOOSER(m_widget),