aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2004-05-09 04:11:17 +0800
committerChristian Persch <chpe@src.gnome.org>2004-05-09 04:11:17 +0800
commitb3fed7cc16e2f03970776e0f874e94c112f4b240 (patch)
treeb54e3d04e84efa3b1df7b32f42b879c3e03d7609 /src
parent9e4d594ee6ccc51bf5dca17b8f790d7fa1a917c2 (diff)
downloadgsoc2013-epiphany-b3fed7cc16e2f03970776e0f874e94c112f4b240.tar
gsoc2013-epiphany-b3fed7cc16e2f03970776e0f874e94c112f4b240.tar.gz
gsoc2013-epiphany-b3fed7cc16e2f03970776e0f874e94c112f4b240.tar.bz2
gsoc2013-epiphany-b3fed7cc16e2f03970776e0f874e94c112f4b240.tar.lz
gsoc2013-epiphany-b3fed7cc16e2f03970776e0f874e94c112f4b240.tar.xz
gsoc2013-epiphany-b3fed7cc16e2f03970776e0f874e94c112f4b240.tar.zst
gsoc2013-epiphany-b3fed7cc16e2f03970776e0f874e94c112f4b240.zip
Add convenience functions for creating a filter with a bunch of mime types
2004-05-08 Christian Persch <chpe@cvs.gnome.org> * lib/ephy-file-chooser.c: (ephy_file_chooser_add_pattern_filter), (ephy_file_chooser_add_mime_filter), (ephy_file_chooser_new): * lib/ephy-file-chooser.h: Add convenience functions for creating a filter with a bunch of mime types or patterns and add it to a file chooser. Those should really be in gtk+; see bug #142142. * embed/mozilla/ContentHandler.cpp: * embed/mozilla/EphyHeaderSniffer.cpp: * embed/mozilla/FilePicker.cpp: * embed/print-dialog.c: (ephy_print_dialog_browse_button_cb): * src/bookmarks/ephy-bookmarks-editor.c: (import_dialog_response_cb): * src/prefs-dialog.c: (prefs_download_path_button_clicked_cb): * src/window-commands.c: (window_cmd_file_open): Add some filters to the file chooser dialogues.
Diffstat (limited to 'src')
-rw-r--r--src/bookmarks/ephy-bookmarks-editor.c25
-rw-r--r--src/prefs-dialog.c4
-rw-r--r--src/window-commands.c3
3 files changed, 27 insertions, 5 deletions
diff --git a/src/bookmarks/ephy-bookmarks-editor.c b/src/bookmarks/ephy-bookmarks-editor.c
index f789922a2..2bf909e8d 100644
--- a/src/bookmarks/ephy-bookmarks-editor.c
+++ b/src/bookmarks/ephy-bookmarks-editor.c
@@ -554,12 +554,33 @@ import_dialog_response_cb (GtkDialog *dialog, gint response,
if (filename == NULL)
{
EphyFileChooser *dialog;
+ GtkFileFilter *filter;
dialog = ephy_file_chooser_new (_("Import bookmarks from file"),
GTK_WIDGET (editor),
GTK_FILE_CHOOSER_ACTION_OPEN,
- NULL);
- /* FIXME: set up some filters perhaps ? */
+ NULL, EPHY_FILE_FILTER_NONE);
+
+ ephy_file_chooser_add_mime_filter
+ (dialog,
+ _("Firefox/Firebird/Mozilla bookmarks"),
+ "application/x-mozilla-bookmarks", NULL);
+
+ ephy_file_chooser_add_mime_filter
+ (dialog, _("Galeon/Konqueror bookmarks"),
+ "application/x-xbel", NULL);
+
+ ephy_file_chooser_add_mime_filter
+ (dialog, _("Epiphany bookmarks"),
+ "text/rdf", NULL);
+
+ filter = ephy_file_chooser_add_pattern_filter (dialog,
+ _("All Files"),
+ "*", NULL);
+
+ gtk_file_chooser_set_filter (GTK_FILE_CHOOSER (dialog),
+ filter);
+
g_signal_connect (dialog, "response",
G_CALLBACK (import_from_file_response_cb), editor);
diff --git a/src/prefs-dialog.c b/src/prefs-dialog.c
index 087f061d8..161c5663b 100644
--- a/src/prefs-dialog.c
+++ b/src/prefs-dialog.c
@@ -1321,8 +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_SELECT_FOLDER,
- NULL);
-
+ NULL, EPHY_FILE_FILTER_NONE);
+
g_signal_connect (GTK_DIALOG (fc), "response",
G_CALLBACK (download_path_response_cb),
dialog);
diff --git a/src/window-commands.c b/src/window-commands.c
index af9d26ef2..4c4d72372 100644
--- a/src/window-commands.c
+++ b/src/window-commands.c
@@ -396,7 +396,8 @@ window_cmd_file_open (GtkAction *action,
dialog = ephy_file_chooser_new (_("Open"),
GTK_WIDGET (window),
GTK_FILE_CHOOSER_ACTION_OPEN,
- CONF_STATE_OPEN_DIR);
+ CONF_STATE_OPEN_DIR,
+ EPHY_FILE_FILTER_ALL_SUPPORTED);
g_signal_connect (dialog, "response",
G_CALLBACK (open_response_cb), window);