From b19f5097e2c7c2a433f48064346685cfc89a16ce Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Fri, 27 Feb 2004 14:50:01 +0000 Subject: Fix for gtk+ filechooser API change. 2004-02-27 Christian Persch * embed/mozilla/FilePicker.cpp: * lib/ephy-file-chooser.c: (ephy_file_chooser_init), (ephy_file_chooser_new): * src/prefs-dialog.c: (prefs_download_path_button_clicked_cb): Fix for gtk+ filechooser API change. --- embed/mozilla/FilePicker.cpp | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'embed') diff --git a/embed/mozilla/FilePicker.cpp b/embed/mozilla/FilePicker.cpp index 77e1c436c..2c7150ebd 100644 --- a/embed/mozilla/FilePicker.cpp +++ b/embed/mozilla/FilePicker.cpp @@ -104,9 +104,21 @@ NS_IMETHODIMP GFilePicker::Init(nsIDOMWindowInternal *parent, const PRUnichar *t switch (mode) { - case nsIFilePicker::modeOpen: case nsIFilePicker::modeGetFolder: + gtk_file_chooser_set_action (GTK_FILE_CHOOSER (mDialog), + GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER); + + gtk_dialog_add_buttons (GTK_DIALOG (mDialog), + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, + GTK_STOCK_OPEN, EPHY_RESPONSE_OPEN, + NULL); + gtk_dialog_set_default_response (GTK_DIALOG (mDialog), EPHY_RESPONSE_OPEN); + break; + case nsIFilePicker::modeOpenMultiple: + gtk_file_chooser_set_select_multiple (GTK_FILE_CHOOSER (mDialog), TRUE); + /* fallthrough */ + case nsIFilePicker::modeOpen: gtk_file_chooser_set_action (GTK_FILE_CHOOSER (mDialog), GTK_FILE_CHOOSER_ACTION_OPEN); @@ -117,6 +129,7 @@ NS_IMETHODIMP GFilePicker::Init(nsIDOMWindowInternal *parent, const PRUnichar *t gtk_dialog_set_default_response (GTK_DIALOG (mDialog), EPHY_RESPONSE_OPEN); break; + case nsIFilePicker::modeSave: gtk_file_chooser_set_action (GTK_FILE_CHOOSER (mDialog), GTK_FILE_CHOOSER_ACTION_SAVE); @@ -132,12 +145,6 @@ NS_IMETHODIMP GFilePicker::Init(nsIDOMWindowInternal *parent, const PRUnichar *t break; } - gtk_file_chooser_set_select_multiple (GTK_FILE_CHOOSER (mDialog), - mode == nsIFilePicker::modeOpenMultiple); - - gtk_file_chooser_set_folder_mode (GTK_FILE_CHOOSER (mDialog), - mode == nsIFilePicker::modeGetFolder); - return NS_OK; } -- cgit