aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog9
-rw-r--r--embed/mozilla/FilePicker.cpp21
-rw-r--r--lib/ephy-file-chooser.c6
-rw-r--r--src/prefs-dialog.c3
4 files changed, 28 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index 12a093771..9d8b6802d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
2004-02-27 Christian Persch <chpe@cvs.gnome.org>
+ * 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.
+
+2004-02-27 Christian Persch <chpe@cvs.gnome.org>
+
* src/bookmarks/ephy-bookmarks-import.c: (ns_parse_bookmark_item):
Fix potential crash.
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;
}
diff --git a/lib/ephy-file-chooser.c b/lib/ephy-file-chooser.c
index 15e57b7b9..15c764d48 100644
--- a/lib/ephy-file-chooser.c
+++ b/lib/ephy-file-chooser.c
@@ -101,7 +101,7 @@ ephy_file_chooser_init (EphyFileChooser *dialog)
dialog->priv->persist_key = NULL;
ephy_state_add_window (GTK_WIDGET (dialog), "file_chooser",
- 400, 300,
+ -1,-1,
EPHY_STATE_WINDOW_SAVE_SIZE |
EPHY_STATE_WINDOW_SAVE_POSITION);
}
@@ -237,7 +237,9 @@ ephy_file_chooser_new (const char *title,
ephy_file_chooser_set_persist_key (dialog, persist_key);
}
- if (action == GTK_FILE_CHOOSER_ACTION_OPEN)
+ if (action == GTK_FILE_CHOOSER_ACTION_OPEN ||
+ action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER ||
+ action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER)
{
gtk_dialog_add_buttons (GTK_DIALOG (dialog),
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
diff --git a/src/prefs-dialog.c b/src/prefs-dialog.c
index 398b90a89..017151c5f 100644
--- a/src/prefs-dialog.c
+++ b/src/prefs-dialog.c
@@ -1321,9 +1321,8 @@ prefs_download_path_button_clicked_cb (GtkWidget *button,
fc = ephy_file_chooser_new (_("Select a directory"),
GTK_WIDGET (parent),
- GTK_FILE_CHOOSER_ACTION_OPEN,
+ GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER,
NULL);
- gtk_file_chooser_set_folder_mode (GTK_FILE_CHOOSER (fc), TRUE);
g_signal_connect (GTK_DIALOG (fc), "response",
G_CALLBACK (download_path_response_cb),